use a prefix for user accounts

can be set in setup
This commit is contained in:
Lars Kneschke 2004-01-12 06:22:20 +00:00
parent 69e0eea014
commit d96c9afac2
2 changed files with 24 additions and 3 deletions

View File

@ -305,11 +305,17 @@
return False;
}
$accountPrefix = '';
if(isset($GLOBALS['phpgw_info']['server']['account_prefix']))
{
$accountPrefix = $GLOBALS['phpgw_info']['server']['account_prefix'];
}
if ($_POST['submit'])
{
$userData = array(
'account_type' => 'u',
'account_lid' => $_POST['account_lid'],
'account_lid' => $accountPrefix.$_POST['account_lid'],
'account_firstname' => $_POST['account_firstname'],
'account_lastname' => $_POST['account_lastname'],
'account_passwd' => $_POST['account_passwd'],
@ -569,10 +575,16 @@
return False;
}
$accountPrefix = '';
if(isset($GLOBALS['phpgw_info']['server']['account_prefix']))
{
$accountPrefix = $GLOBALS['phpgw_info']['server']['account_prefix'];
}
if ($_POST['submit'])
{
$userData = array(
'account_lid' => $_POST['account_lid'],
'account_lid' => $accountPrefix.$_POST['account_lid'],
'firstname' => $_POST['account_firstname'],
'lastname' => $_POST['account_lastname'],
'account_passwd' => $_POST['account_passwd'],

View File

@ -1068,10 +1068,19 @@
);
$t->set_var($var);
*/
$accountPrefix = '';
if(isset($GLOBALS['phpgw_info']['server']['account_prefix']))
{
$accountPrefix = $GLOBALS['phpgw_info']['server']['account_prefix'];
if (preg_match ("/^$accountPrefix(.*)/i", $userData['account_lid'], $matches))
{
$userData['account_lid'] = $matches[1];
}
}
$var = Array(
'input_expires' => $jscal->input('expires',$userData['expires']<0?'':($userData['expires']?$userData['expires']:time()+(60*60*24*7))),
'lang_never' => lang('Never'),
'account_lid' => '<input name="account_lid" value="' . $userData['account_lid'] . '">',
'account_lid' => $accountPrefix.'<input name="account_lid" value="' . $userData['account_lid'] . '">',
'lang_homedir' => $lang_homedir,
'lang_shell' => $lang_shell,
'homedirectory' => $homedirectory,