phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] admin/inc/class.boaccounts.inc.php, 1.22.2.7.2.19


From: nomail
Subject: [Phpgroupware-cvs] admin/inc/class.boaccounts.inc.php, 1.22.2.7.2.19
Date: Tue, 15 Jun 2004 15:20:49 +0200

Update of /admin/inc
Modified Files:
        Branch: Version-0_9_16-branch
          class.boaccounts.inc.php

date: 2004/06/15 13:20:49;  author: fipsfuchs;  state: Exp;  lines: +20 -17

Log Message:
patch 2916
=====================================================================
Index: admin/inc/class.boaccounts.inc.php
diff -u admin/inc/class.boaccounts.inc.php:1.22.2.7.2.18 
admin/inc/class.boaccounts.inc.php:1.22.2.7.2.19
--- admin/inc/class.boaccounts.inc.php:1.22.2.7.2.18    Tue Apr 13 07:42:11 2004
+++ admin/inc/class.boaccounts.inc.php  Tue Jun 15 13:20:49 2004
@@ -337,7 +337,6 @@
                                        //jarg-SOG S
                                        'domain'                                
=> $_POST['domain'],
                                        'add_addbook'                   => 
$_POST['add_addbook'],
-                                       'person_id'                             
=> $_POST['person_id'],
                                        'quota'                                 
=> $_POST['quota']
                                        //End
                                        /* 'file_space' => 
$_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */
@@ -345,7 +344,7 @@
                                if (!$errors = $this->validate_user($userData))
                                {
                                        $account_id = 
$this->_add_user($userData);
-                                       $userData['person_id'] = 
$GLOBALS['phpgw']->accounts->account_contact_id;
+                                       $userData['person_id'] = 
$GLOBALS['phpgw']->accounts->save_contact_for_account($userData);
                                        $ui = createobject('admin.uiaccounts');
                                        
$ui->create_edit_user($account_id,$userData);
                                        return False;
@@ -488,25 +487,24 @@
 
                        // Set group acl
                        $acl = 
CreateObject('phpgwapi.acl',$group_info['account_id']);
-//                     $acl->read_repository();
                        $old_group_list = 
$acl->get_ids_for_location($group_info['account_id'],1,'phpgw_group');
-                       @reset($old_group_list);
-                       while($old_group_list && list($key,$user_id) = 
each($old_group_list))
+                       if ($old_group_list)
                        {
-                               
$acl->delete_repository('phpgw_group',$group_info['account_id'],$user_id);
-                               if(!$group_info['account_user'][$user_id])
+                               @reset($old_group_list);
+                               while(list($key,$user_id) = 
each($old_group_list))
                                {
-                                       // If the user is logged in, it will 
force a refresh of the session_info
-                                       $GLOBALS['phpgw']->db->query("update 
phpgw_sessions set session_action='' "
-                                               ."where session_lid='" . 
$GLOBALS['phpgw']->accounts->id2name($user_id)
-                                               . '@' . 
$GLOBALS['phpgw_info']['user']['domain'] . "'",__LINE__,__FILE__);
-                                       
$GLOBALS['phpgw']->session->delete_cache($user_id);
+                                       
$acl->delete_repository('phpgw_group',$group_info['account_id'],$user_id);
+                                       
if(!$group_info['account_user'][$user_id])
+                                       {
+                                               // If the user is logged in, it 
will force a refresh of the session_info
+                                               
$GLOBALS['phpgw']->db->query("update phpgw_sessions set session_action='' "
+                                                       ."where session_lid='" 
. $GLOBALS['phpgw']->accounts->id2name($user_id)
+                                                       . '@' . 
$GLOBALS['phpgw_info']['user']['domain'] . "'",__LINE__,__FILE__);
+                                               
$GLOBALS['phpgw']->session->delete_cache($user_id);
+                                       }
                                }
                        }
 
-//                     $acl->save_repository();
-//                     $acl->read_repository();
-
                        @reset($group_info['account_user']);
                        while(list($user_id,$dummy) = 
each($group_info['account_user']))
                        {
@@ -605,6 +603,7 @@
                                        $GLOBALS['hook_values']['account_lid'] 
= $userData['account_lid'];
                                        
$GLOBALS['hook_values']['account_firstname'] = $userData['account_firstname'];
                                        
$GLOBALS['hook_values']['account_lastname'] = $userData['account_lastname'];
+                                       $GLOBALS['hook_values']['person_id'] = 
$userData['person_id'];
                                        
$GLOBALS['phpgw']->hooks->process('editaccount');
 
                                        // check if would create a menu
@@ -798,9 +797,13 @@
                function save_user($_userData)
                {
                        $account = 
CreateObject('phpgwapi.accounts',$_userData['account_id'],'u');
+                       //This is a temporary patch for the case of corrupted 
LDAP tree :) (Caeies)
+                       if ( empty($_userData['person_id']) )
+                       {
+                               $_userData['person_id'] = 
$account->data['person_id'] ? $account->data['person_id'] : 
$GLOBALS['phpgw']->accounts->save_contact_for_account($_userData);
+                       }
                        $account->update_data($_userData);
                        $account->save_repository();
-                       $_userData['person_id'] = $account->account_contact_id;
                        if ($_userData['account_passwd'])
                        {
                                $auth = CreateObject('phpgwapi.auth');




reply via email to

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