r28253 - /trunk/phpgwapi/inc/class.accounts_ldap.inc.php

View: New views
1 Messages — Rating Filter:   Alert me  

r28253 - /trunk/phpgwapi/inc/class.accounts_ldap.inc.php

by leithoff :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Author: leithoff
Date: Wed Nov  4 12:17:06 2009
New Revision: 28253

URL: http://www.egroupware.org/viewvc/egroupware?rev=28253&view=rev
Log:
bugfix groupmembers of groups got lost, while renaming accounts

Modified:
    trunk/phpgwapi/inc/class.accounts_ldap.inc.php

Modified: trunk/phpgwapi/inc/class.accounts_ldap.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/trunk/phpgwapi/inc/class.accounts_ldap.inc.php?rev=28253&r1=28252&r2=28253&view=diff
==============================================================================
--- trunk/phpgwapi/inc/class.accounts_ldap.inc.php (original)
+++ trunk/phpgwapi/inc/class.accounts_ldap.inc.php Wed Nov  4 12:17:06 2009
@@ -697,7 +697,7 @@
  $order = $propertyMap[$param['order']] ? $propertyMap[$param['order']] : 'uid';
  $sri = ldap_search($this->ds, $this->user_context, $filter,array('uid', $order));
  $fullSet = array();
- foreach (ldap_get_entries($this->ds, $sri) as $key => $entry)
+ foreach ((array)ldap_get_entries($this->ds, $sri) as $key => $entry)
  {
  if ($key !== 'count') $fullSet[$entry['uid'][0]] = $entry[$order][0];
  }
@@ -933,7 +933,7 @@
 
  $sri = ldap_search($this->ds,$this->group_context,'(&(objectClass=posixGroup)(memberuid='.ldap::quote($account_lid).'))',array('cn','gidnumber'));
  $memberships = array();
- foreach(ldap_get_entries($this->ds, $sri) as $key => $data)
+ foreach((array)ldap_get_entries($this->ds, $sri) as $key => $data)
  {
  if ($key === 'count') continue;
 
@@ -951,7 +951,12 @@
  */
  function members($gid)
  {
- if (!is_numeric($gid)) return false;
+ if (!is_numeric($gid))
+ {
+ // try to recover
+ $gid = $this->name2id($gid,'account_lid','g');
+ if (!is_numeric($gid)) return false;
+ }
 
  $gid = abs($gid); // our gid is negative!
 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
eGroupWare-cvs mailing list
eGroupWare-cvs@...
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs