phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpgwapi/inc class.accounts_ldap.inc.php [Version-0_9


From: Caeies
Subject: [Phpgroupware-cvs] phpgwapi/inc class.accounts_ldap.inc.php [Version-0_9_16-branch]
Date: Sun, 18 Dec 2005 08:43:55 +0000

CVSROOT:        /cvsroot/phpgwapi
Module name:    phpgwapi
Branch:         Version-0_9_16-branch
Changes by:     Caeies <address@hidden> 05/12/18 08:43:55

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

Log message:
        fix for bug #14827, Hope people will be happy ! :)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/phpgwapi/inc/class.accounts_ldap.inc.php.diff?only_with_tag=Version-0_9_16-branch&tr1=1.101.2.13.2.40&tr2=1.101.2.13.2.41&r1=text&r2=text

Patches:
Index: phpgwapi/inc/class.accounts_ldap.inc.php
diff -u phpgwapi/inc/class.accounts_ldap.inc.php:1.101.2.13.2.40 
phpgwapi/inc/class.accounts_ldap.inc.php:1.101.2.13.2.41
--- phpgwapi/inc/class.accounts_ldap.inc.php:1.101.2.13.2.40    Tue Dec  6 
09:29:30 2005
+++ phpgwapi/inc/class.accounts_ldap.inc.php    Sun Dec 18 08:43:55 2005
@@ -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.101.2.13.2.40 
2005/12/06 09:29:30 skwashd Exp $
+       * @version $Id: class.accounts_ldap.inc.php,v 1.101.2.13.2.41 
2005/12/18 08:43:55 Caeies Exp $
        */
 
        /**
@@ -52,6 +52,11 @@
 
                function accounts($account_id = '', $account_type = '')
                {
+                       //XXX Caeies this should be modified in setup !!! 
(that's next step)
+                       
if(!isset($GLOBALS['phpgw_info']['server']['ldap_structural_objectclass']))
+                       {
+                               
$GLOBALS['phpgw_info']['server']['ldap_structural_objectclass'] = 'account';
+                       }
                        
if($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap')
                        {
                                $this->ds = 
$GLOBALS['phpgw']->common->ldapConnect();
@@ -764,7 +769,7 @@
                        
                        // additional attributes from the phpgw for groups
                        $entry['objectclass'][]       = 'posixAccount';
-                       $entry['objectclass'][]       = 'account';
+                       $entry['objectclass'][]       = 
$GLOBALS['phpgw_info']['server']['ldap_structural_objectclass']; //'account';
                        $entry['cn']                  = 
utf8_encode($this->get_fullname($account_info['account_firstname'], 
$account_info['account_lastname']));
                        $entry['uidnumber']           = 
$account_info['account_id'];
                        $entry['uid']                 = 
$account_info['account_lid'];
@@ -792,16 +797,6 @@
                        //$entry['loginshell']          = 
$this->get_loginshell($account_info['loginshell']);
 
                                
-                       // special gidnumber handling
-                       if ($GLOBALS['phpgw_info']['server']['ldap_group_id'])
-                       {
-                               $enty['gidnumber'] = 
$GLOBALS['phpgw_info']['server']['ldap_group_id'];
-                       }
-                       else
-                       {
-                               $entry['gidnumber']           = 
$account_info['account_id'];
-                       }
-
                        $oldEntry = 
$this->account_exists($account_info['account_id'], $dn);
                        
                        if ($oldEntry) // found an existing entry in LDAP
@@ -862,14 +857,15 @@
                                                                                
$entry[$key] = $oldEntry[$key];
                                                                                
array_push($entry[$key], 'phpgwAccount');
                                                                        }
-                                                                       
elseif((in_array('phpgwContact',$entry[$key]) && ! 
in_array('phpgwContact',$oldEntry[$key])))
+                                                                       
/*elseif((in_array('phpgwContact',$entry[$key]) && ! 
in_array('phpgwContact',$oldEntry[$key])))
                                                                        {
                                                                                
$structural_modification = true;
-                                                                       } 
+                                                                       }*/ 
                                                                        else
                                                                        {
-                                                                               
$entry[$key] = $oldEntry[$key];
+                                                                               
$entry[$key] = array_unique(array_merge($entry[$key],$oldEntry[$key]));
                                                                        }
+                                                                       
sort($entry[$key]);//ensure array keys are sequential
                                                                        break;
                                                                                
                                                                default:
@@ -909,6 +905,15 @@
                        }
                        else // entry not yet in LDAP
                        {
+                               //XXX Caies : we add the gidnumber ONLY if we 
create the account, else don't touch it ! 
+                               if 
($GLOBALS['phpgw_info']['server']['ldap_group_id'])
+                               {
+                                       $enty['gidnumber'] = 
$GLOBALS['phpgw_info']['server']['ldap_group_id'];
+                               }
+                               else
+                               {
+                                       $entry['gidnumber']           = 
$account_info['account_id'];
+                               }
                                $this->add_LDAP_Entry($dn, $entry);
                        }                               
                }




reply via email to

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