Changeset 11
- Timestamp:
- 03/30/07 18:29:24 (17 years ago)
- Location:
- trunk/expressoAdmin1_2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/docs/change_log.txt
r2 r11 34 34 21/03/2007 35 35 - Permitido criação de grupos inciados por "smb-" para grupos samba. 36 37 29/03/2007 38 - Corrigido bug que retirava aplicações de usuário e grupos se o gerente não tivesse 39 acessa a esta aplicação. -
trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
r9 r11 637 637 } 638 638 639 function group_exist($gidnumber) 640 { 641 $justthese = array("cn"); 642 $filter="(&(phpgwAccountType=g)(gidNumber=".$gidnumber."))"; 643 $search = ldap_search($this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 644 645 $entry = ldap_get_entries($this->ldap, $search); 646 if ($entry['count'] == 0) 647 return false; 648 else 649 return true; 650 } 651 639 652 function gidnumbers2cn($gidnumbers, $context) 640 653 { … … 649 662 650 663 $entry = ldap_get_entries($this->ldap, $search); 651 $result['groups_info'][$i]['cn'] = $entry[0]['cn'][0]; 664 if ($entry['count'] == 0) 665 $result['groups_info'][$i]['cn'] = '_Grupo existe no BD mas não no LDAP'; 666 else 667 $result['groups_info'][$i]['cn'] = $entry[0]['cn'][0]; 652 668 $result['groups_info'][$i]['gidnumber'] = $gidnumber; 653 669 -
trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php
r9 r11 27 27 var $current_config; 28 28 var $ldap_functions; 29 var $db_functions; 29 30 30 31 function uiaccounts() … … 34 35 $this->functions = CreateObject('expressoAdmin1_2.functions'); 35 36 $this->ldap_functions = CreateObject('expressoAdmin1_2.ldap_functions'); 37 $this->db_functions = CreateObject('expressoAdmin1_2.db_functions'); 36 38 37 39 $c = CreateObject('phpgwapi.config','expressoAdmin1_2'); … … 370 372 foreach ($array_groups as $gidnumber=>$cn) 371 373 { 374 // Grupo existe no Banco mas não no Ldap, excluimos grupo do Banco. 375 /* 376 if (!$this->ldap_functions->group_exist($gidnumber)) 377 { 378 $this->db_functions->delete_group($gidnumber); 379 $this->db_functions->write_log("expressoAdmin deletou o grupo $gidnumber do banco, pois não existia no ldap.",'','','',''); 380 continue; 381 } 382 */ 372 383 373 384 // O memberUid do usuário está somente no Banco, então adicionamos o memberUid no Ldap. … … 376 387 $this->ldap_functions->add_user2group($gidnumber, $user_info['uid']); 377 388 $ea_select_user_groups_options .= "<option value=" . $gidnumber . ">" . $cn . " [Incluido memberUid no Ldap]</option>"; 378 389 379 390 if ($alert_warning == '') 380 391 $alert_warning = "O expressoAdmin corrigiu as seguintes inconsistências:\\n"; 381 $alert_warning .= "Incluido atributo memberUid do usuário no grupo $cn .\\n";392 $alert_warning .= "Incluido atributo memberUid do usuário no grupo $cn - $gidnumber.\\n"; 382 393 } 383 394 else 384 $ea_select_user_groups_options .= "<option value=" . $gidnumber . ">" . $cn . " 3</option>";395 $ea_select_user_groups_options .= "<option value=" . $gidnumber . ">" . $cn . "</option>"; 385 396 386 397 if ($gidnumber == $user_info['gidnumber']) … … 394 405 } 395 406 396 // O memberUid do usuário está somente no Ldap , então removemos ele.407 // O memberUid do usuário está somente no Ldap. 397 408 $groups_db = array_flip($user_info['groups']); 398 409 foreach ($user_info['groups_ldap'] as $gidnumber=>$cn) … … 400 411 if (is_null($groups_db[$gidnumber])) 401 412 { 413 /* 402 414 $this->ldap_functions->remove_user2group($gidnumber, $user_info['uid']); 403 415 if ($alert_warning == '') 404 416 $alert_warning = "O expressoAdmin corrigiu as seguintes inconsistências:\\n"; 405 417 $alert_warning .= "Removido atributo memberUid do usuário do grupo $cn.\\n"; 418 */ 419 $ea_select_user_groups_options .= "<option value=" . $gidnumber . ">" . $cn . " [Somente no LDAP]</option>"; 406 420 } 407 } 421 } 408 422 } 409 423
Note: See TracChangeset
for help on using the changeset viewer.