mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 00:58:55 +01:00
Add get_account_id for ldap.php to use the accounts class
This commit is contained in:
parent
dab3d59f04
commit
32d5dec027
@ -50,6 +50,39 @@
|
||||
}
|
||||
define('SEP',filesystem_separator());
|
||||
|
||||
function get_account_id($account_id = '',$default_id = '')
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
|
||||
if (gettype($account_id) == 'integer')
|
||||
{
|
||||
return $account_id;
|
||||
}
|
||||
elseif ($account_id == '')
|
||||
{
|
||||
if ($default_id == '')
|
||||
{
|
||||
return $phpgw_info['user']['account_id'];
|
||||
}
|
||||
elseif (gettype($default_id) == 'string')
|
||||
{
|
||||
return $phpgw->accounts->name2id($default_id);
|
||||
}
|
||||
return intval($default_id);
|
||||
}
|
||||
elseif (gettype($account_id) == 'string')
|
||||
{
|
||||
if($phpgw->accounts->exists(intval($account_id)) == True)
|
||||
{
|
||||
return intval($account_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $phpgw->accounts->name2id($account_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Include to check user authorization against the
|
||||
// password in ../header.inc.php to protect all of the setup
|
||||
// pages from unauthorized use.
|
||||
|
Loading…
Reference in New Issue
Block a user