mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-19 12:55:08 +02:00
Add get_account_id for ldap.php to use the accounts class
This commit is contained in:
@@ -50,6 +50,39 @@
|
|||||||
}
|
}
|
||||||
define('SEP',filesystem_separator());
|
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
|
// Include to check user authorization against the
|
||||||
// password in ../header.inc.php to protect all of the setup
|
// password in ../header.inc.php to protect all of the setup
|
||||||
// pages from unauthorized use.
|
// pages from unauthorized use.
|
||||||
|
Reference in New Issue
Block a user