phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpgwapi/inc/accounts class.accounts_ldap.inc.php


From: Dave Hall
Subject: [Phpgroupware-cvs] phpgwapi/inc/accounts class.accounts_ldap.inc.php
Date: Fri, 11 Aug 2006 07:36:30 +0000

CVSROOT:        /sources/phpgwapi
Module name:    phpgwapi
Changes by:     Dave Hall <skwashd>     06/08/11 07:36:30

Modified files:
        inc/accounts   : class.accounts_ldap.inc.php 

Log message:
        this time fix accounts in accounts_ldap, groups is working fine

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/accounts/class.accounts_ldap.inc.php?cvsroot=phpgwapi&r1=1.8&r2=1.9

Patches:
Index: class.accounts_ldap.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/accounts/class.accounts_ldap.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- class.accounts_ldap.inc.php 6 Aug 2006 04:51:26 -0000       1.8
+++ class.accounts_ldap.inc.php 11 Aug 2006 07:36:30 -0000      1.9
@@ -11,7 +11,7 @@
        * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package phpgwapi
        * @subpackage accounts
-       * @version $Id: class.accounts_ldap.inc.php,v 1.8 2006/08/06 04:51:26 
skwashd Exp $
+       * @version $Id: class.accounts_ldap.inc.php,v 1.9 2006/08/11 07:36:30 
skwashd Exp $
        */
 
        /**
@@ -556,17 +556,17 @@
                        $result = ldap_search($this->ds, $this->user_context, 
$filter, array('uidnumber'));
                        $entries = ldap_get_entries($this->ds, $result);
 
-                       if ( !is_array($entries) && !count($entries) )//this 
shouldn't happen
+                       if ( !is_array($entries) || !count($entries) )//this 
shouldn't happen
                        {
-                               return 
$GLOBALS['phpgw_info']['server']['account_min_id'];
+                               return (int) 
$GLOBALS['phpgw_info']['server']['account_min_id'];
                        }
 
                        // parse all LDAP uidnumbers in a single array '$IDs'
                        foreach ( $entries as $entry )
                        {
-                               if ( is_int($key) )
+                               if ( isset($entry['uidnumber'][0]) && 
is_numeric($entry['uidnumber'][0]) )
                                {
-                                       $ids[$entries[$key]['uidnumber'][0]] = 
true;
+                                       $ids[$entry['uidnumber'][0]] = true;
                                }
                        }
                        return $this->id_tester($ids, 
$GLOBALS['phpgw_info']['server']['account_min_id'], 
$GLOBALS['phpgw_info']['server']['account_max_id'] );
@@ -746,10 +746,10 @@
                */
                function create($account_info, $default_prefs = true)
                {
-                       //echo 'create called!';
+                       //echo 'accounts_ldap::create called!';
                        if ( !isset($account_info['account_id']) || 
empty($account_info['account_id']) || !$account_info['account_id'] == 0 )
                        {
-                               //echo 'need new acct id for new group';
+                               //echo 'need new acct id for new entry';
                                $account_info['account_id'] = 
$this->get_nextid($account_info['account_type']);
                                //echo "- got given 
{$account_info['account_id']}<br>";
                        }
@@ -783,8 +783,8 @@
                              ',' .
                              $this->user_context;
 
-                       //This is here to stop object class violations! - 
skwashd Jul-2006
-                       $entry['objectclass'][]       = 'inetOrgPerson';
+                       $entry = array();
+                       $entry['objectclass'] = array();
 
                        // phpgw attributes
                        $entry['objectclass'][]       = 'phpgwAccount';




reply via email to

[Prev in Thread] Current Thread [Next in Thread]