forked from extern/egroupware
Fix for grab_owner_name() in comon. now calls account storage specific functions.
This commit is contained in:
parent
7861ad6363
commit
56ef840422
@ -399,7 +399,7 @@
|
||||
}
|
||||
elseif ($_type == 'both' || $_type == 'groups')
|
||||
{
|
||||
$sri = ldap_search($ds, $this->group_context, '(|(gidnumber=*)(phpgwaccounttype=g))');
|
||||
$sri = ldap_search($ds, $this->group_context, '(&(gidnumber=*)(phpgwaccounttype=g))');
|
||||
$allValues = ldap_get_entries($ds, $sri);
|
||||
while (list($null,$allVals) = @each($allValues))
|
||||
{
|
||||
@ -773,6 +773,52 @@
|
||||
return $accountid;
|
||||
}
|
||||
|
||||
function get_account_name($accountid,&$lid,&$fname,&$lname)
|
||||
{
|
||||
static $account_name;
|
||||
|
||||
$account_id = get_account_id($accountid);
|
||||
if(isset($account_name[$account_id]))
|
||||
{
|
||||
$lid = $account_name[$account_id]['lid'];
|
||||
$fname = $account_name[$account_id]['fname'];
|
||||
$lname = $account_name[$account_id]['lname'];
|
||||
return;
|
||||
}
|
||||
/* get an ldap connection handle */
|
||||
$ds = $GLOBALS['phpgw']->common->ldapConnect();
|
||||
$acct_type = $this->get_type($account_id);
|
||||
|
||||
/* search the dn for the given uid */
|
||||
if ( ($acct_type == 'g') && $this->group_context )
|
||||
{
|
||||
$sri = ldap_search($ds, $this->group_context, 'gidnumber='.$account_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sri = ldap_search($ds, $this->user_context, 'uidnumber='.$account_id);
|
||||
}
|
||||
$allValues = ldap_get_entries($ds, $sri);
|
||||
|
||||
if($acct_type =='g')
|
||||
{
|
||||
$account_name[$account_id]['lid'] = $allValues[0]['cn'][0];
|
||||
$account_name[$account_id]['fname'] = $allValues[0]['cn'][0];
|
||||
$account_name[$account_id]['lname'] = 'Group';
|
||||
}
|
||||
else
|
||||
{
|
||||
$account_name[$account_id]['lid'] = $allValues[0]['uid'][0];
|
||||
$account_name[$account_id]['fname'] = $allValues[0]['givenname'][0];
|
||||
$account_name[$account_id]['lname'] = $allValues[0]['sn'][0];
|
||||
}
|
||||
$lid = $account_name[$account_id]['lid'];
|
||||
$fname = $account_name[$account_id]['fname'];
|
||||
$lname = $account_name[$account_id]['lname'];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
function getDNforID($_accountid = '')
|
||||
{
|
||||
$_account_id = get_account_id($_accountid);
|
||||
|
@ -351,5 +351,29 @@
|
||||
$this->db->transaction_commit();
|
||||
return $accountid;
|
||||
}
|
||||
|
||||
function get_account_name($accountid,&$lid,&$fname,&$lname)
|
||||
{
|
||||
static $account_name;
|
||||
|
||||
$account_id = get_account_id($accountid);
|
||||
if(isset($account_name[$account_id]))
|
||||
{
|
||||
$lid = $account_name[$account_id]['lid'];
|
||||
$fname = $account_name[$account_id]['fname'];
|
||||
$lname = $account_name[$account_id]['lname'];
|
||||
return;
|
||||
}
|
||||
$db = $GLOBALS['phpgw']->db;
|
||||
$db->query('select account_lid,account_firstname,account_lastname from phpgw_accounts where account_id='.$account_id,__LINE__,__FILE__);
|
||||
$db->next_record();
|
||||
$$account_name[$account_id]['lid'] = $$db->f('account_lid');
|
||||
$$account_name[$account_id]['fname'] = $$db->f('account_firstname');
|
||||
$$account_name[$account_id]['lname'] = $$db->f('account_lastname');
|
||||
$lid = $account_name[$account_id]['lid'];
|
||||
$fname = $account_name[$account_id]['fname'];
|
||||
$lname = $account_name[$account_id]['lname'];
|
||||
return;
|
||||
}
|
||||
} //end of class
|
||||
?>
|
||||
|
@ -379,12 +379,8 @@
|
||||
*/
|
||||
function grab_owner_name($accountid = '')
|
||||
{
|
||||
$account_id = get_account_id($accountid);
|
||||
$db = $GLOBALS['phpgw']->db;
|
||||
$db->query('select account_lid,account_firstname,account_lastname from phpgw_accounts where account_id='.$account_id,__LINE__,__FILE__);
|
||||
$db->next_record();
|
||||
|
||||
return $this->display_fullname($db->f('account_lid'),$db->f('account_firstname'),$db->f('account_lastname'));
|
||||
$GLOBALS['phpgw']->accounts->get_account_name($accountid,$lid,$fname,$lname);
|
||||
return $this->display_fullname($lid,$fname,$lname);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user