" . $entries[$i]['cn'][0] . " | " . $entries[$i]['mail'][0] . " | |
";
$trs[$tr] = $entries[$i]['cn'][0];
}
}
$trs_string = '';
if (count($trs))
{
natcasesort($trs);
foreach ($trs as $tr=>$cn)
{
$trs_string .= $tr;
}
}
$return['status'] = 'true';
$return['trs'] = $trs_string;
return $return;
}
function get_institutional_account_data($params)
{
if (!$this->functions->check_acl($_SESSION['phpgw_info']['expresso']['user']['account_lid'], 'edit_institutional_accounts'))
{
$return['status'] = false;
$return['msg'] = $this->functions->lang('You do not have right to list institutional accounts') . ".";
return $return;
}
$uid = $params['uid'];
//$justthese = array("accountStatus", "phpgwAccountVisible", "cn", "mail", "mailForwardingAddress", "description");
$institutional_accounts = ldap_search($this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], ("(&(phpgwAccountType=i)(uid=$uid))"));
$entrie = ldap_get_entries($this->ldap, $institutional_accounts);
if ($entrie['count'] != 1)
{
$return['status'] = 'false';
$result['msg'] = $this->functions->lang('Problems loading datas') . '.';
}
else
{
$tmp_user_context = split(",", $entrie[0]['dn']);
$tmp_reverse_user_context = array_reverse($tmp_user_context);
array_pop($tmp_reverse_user_context);
$return['user_context'] = implode(",", array_reverse($tmp_reverse_user_context));
$return['status'] = 'true';
$return['accountStatus'] = $entrie[0]['accountstatus'][0];
$return['phpgwAccountVisible'] = $entrie[0]['phpgwaccountvisible'][0];
$return['cn'] = $entrie[0]['cn'][0];
$return['mail'] = $entrie[0]['mail'][0];
$return['description'] = utf8_decode($entrie[0]['description'][0]);
if ($entrie[0]['mailforwardingaddress']['count'] > 0)
{
$a_cn = array();
for ($i=0; $i<$entrie[0]['mailforwardingaddress']['count']; $i++)
{
$tmp = $this->mailforwardingaddress2uidnumber($entrie[0]['mailforwardingaddress'][$i]);
if (!$tmp) {}
else
$a_cn[$tmp['uidnumber']] = $tmp['cn'];
}
natcasesort($a_cn);
foreach($a_cn as $uidnumber => $cn)
{
$return['owners'] .= '