fixed display_fullname for missing parts of the name

merged kneckes ldap-change too
This commit is contained in:
Ralf Becker 2003-05-17 20:34:55 +00:00
parent e51acc6ad8
commit 02c9cec298

View File

@ -426,20 +426,27 @@
$a[] = $firstname; $a[] = $firstname;
} }
$name = '';
switch($display) switch($display)
{ {
case 'all': case 'all':
$name = '['.$lid.'] '; if ($lid)
{
$name = '['.$lid.'] ';
}
// fall-through // fall-through
case 'lastname': case 'lastname':
$name .= implode(', ',$a); $name .= implode(', ',$a);
break; break;
case 'firstall': case 'firstall':
$name = $firstname . ' ' . $lastname . ' ['.$lid.']'; if ($lid)
break; {
$name = ' ['.$lid.']';
}
// fall-through
case 'firstname': case 'firstname':
default: default:
$name = $firstname . ' ' . $lastname; $name = $firstname . ' ' . $lastname . $name;
break; break;
} }
return $name; return $name;
@ -1785,17 +1792,17 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
*/ */
function encrypt_password($password) function encrypt_password($password)
{ {
if($GLOBALS['phpgw_info']['server']['ldap_encryption_type'] == 'DES') if (strtolower($GLOBALS['phpgw_info']['server']['ldap_encryption_type']) == 'des')
{ {
$salt = $this->randomstring(2); $salt = $this->randomstring(2);
$e_password = $this->des_cryptpasswd($password, $salt); $e_password = $this->des_cryptpasswd($password, $salt);
} }
if($GLOBALS['phpgw_info']['server']['ldap_encryption_type'] == 'MD5') elseif (strtolower($GLOBALS['phpgw_info']['server']['ldap_encryption_type']) == 'md5')
{ {
$salt = $this->randomstring(8); $salt = $this->randomstring(8);
$e_password = $this->md5_cryptpasswd($password, $salt); $e_password = $this->md5_cryptpasswd($password, $salt);
} }
if($GLOBALS['phpgw_info']['server']['ldap_encryption_type'] == 'SHA') elseif(strtolower($GLOBALS['phpgw_info']['server']['ldap_encryption_type']) == 'sha')
{ {
if(@function_exists('mhash')) if(@function_exists('mhash'))
{ {