Changeset 1391
- Timestamp:
- 09/08/09 09:43:51 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.bosectors.inc.php
r1120 r1391 27 27 $this->functions = $this->so->functions; 28 28 $this->db_functions = $this->so->db_functions; 29 $this-> soaccounts = createobject('expressoAdmin1_2.soaccounts');30 $this->sogroups = createobject('expressoAdmin1_2.sogroups');29 $this->group = createobject('expressoAdmin1_2.group'); 30 $this->user = createobject('expressoAdmin1_2.user'); 31 31 } 32 32 … … 109 109 function delete_sector() 110 110 { 111 111 112 // Verifica o acesso do gerente 112 113 if (!$this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'delete_sectors')) … … 120 121 $manager_context = $_POST['manager_context']; 121 122 123 124 122 125 $sector_users = $this->so->get_sector_users($sector_dn); 123 124 126 for ($i=0; $i<count($sector_users)-1; $i++) 125 127 { … … 129 131 $account_id = $sector_users[$i]['uidnumber'][0]; 130 132 $dn = $sector_users[$i]['dn']; 131 132 $memberships = $this->soaccounts->get_user_memberships($account_id, $manager_context); 133 $memberships = explode("|", $memberships); 134 135 // Deleta os memberUid dos grupos que o usuario pertence. 136 foreach ($memberships as $group_dn) 137 $this->soaccounts->delete_memberuid($group_dn, $uid); 138 139 // Deleta o cn do usuarios no ldap. 140 $this->soaccounts->delete_user_ldap($dn); 141 142 // Deleta user dos grupos no BD 143 $this->soaccounts->delete_group_user_pgsql($account_id); 144 145 // Deleta apps do user 146 $this->soaccounts->delete_apps_pgsql($account_id); 147 148 // Deleta permissao para alterar senha no pgsql 149 $this->soaccounts->delete_changepassword_pgsql($account_id); 150 151 // Deleta conta imap-cyrus do usuarios. 152 $this->soaccounts->delete_account_imap($uid); 133 $this->user->delete(Array('uid' => $uid , 'uidnumber' => $account_id)); 153 134 } 154 135 … … 160 141 $gidnumber = $sector_groups[$i]['gidnumber'][0]; 161 142 162 //Delete cn of the group from ldap. 163 if (!$this->sogroups->delete_group_ldap($dn)) 164 { 165 $_POST['error_messages'] = lang('Error delete Group in OpenLDAP.'); 166 ExecMethod('expressoAdmin1_2.uisectors.list_sectors'); 167 return false; 168 } 169 170 //Delete all users of the group from BD. 171 $this->sogroups->delete_all_users_pgsql($gidnumber); 172 173 //Delete all apps of the group from BD. 174 $this->sogroups->delete_all_apps_pgsql($gidnumber); 143 //Delete group 144 $this->group->delete(Array('gidnumber' => $gidnumber, 'cn' => $dn)); 175 145 } 176 146
Note: See TracChangeset
for help on using the changeset viewer.