Changeset 9
- Timestamp:
- 03/29/07 14:23:18 (17 years ago)
- Location:
- trunk/expressoAdmin1_2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.db_functions.inc.php
r2 r9 503 503 return $serverList; 504 504 } 505 506 function get_apps($account_lid) 507 { 508 $this->db->query("SELECT * FROM phpgw_expressoadmin_apps WHERE manager_lid = '".$account_lid."'"); 509 510 while($this->db->next_record()) 511 { 512 $tmp = $this->db->row(); 513 $availableApps[$tmp['app']] = 'run'; 514 } 515 516 return $availableApps; 517 } 505 518 } 506 519 ?> -
trunk/expressoAdmin1_2/inc/class.group.inc.php
r2 r9 282 282 } 283 283 } 284 $add_apps = array_diff($new_values2, $old_values2); 285 $remove_apps = array_diff($old_values2, $new_values2); 284 285 $add_apps = array_flip(array_diff($new_values2, $old_values2)); 286 $remove_apps = array_flip(array_diff($old_values2, $new_values2)); 286 287 287 288 if (count($add_apps)>0) 288 289 { 289 $this->db_functions->add_id2apps($new_values['gidnumber'], array_flip($add_apps)); 290 } 290 $this->db_functions->add_id2apps($new_values['gidnumber'], $add_apps); 291 292 foreach ($add_apps as $app => $index) 293 $this->db_functions->write_log("Adicionado aplicativo $app ao grupo $dn",'',$dn,'',''); 294 } 295 291 296 if (count($remove_apps)>0) 292 297 { 293 $this->db_functions->remove_id2apps($new_values['gidnumber'], array_flip($remove_apps)); 298 //Verifica se o gerente tem acesso a aplicação antes de remove-la do usuario. 299 $manager_apps = $this->db_functions->get_apps($_SESSION['phpgw_session']['session_lid']); 300 301 foreach ($remove_apps as $app => $app_index) 302 { 303 if ($manager_apps[$app] == 'run') 304 $remove_apps2[$app] = $app_index; 305 } 306 $this->db_functions->remove_id2apps($new_values['gidnumber'], $remove_apps2); 307 308 foreach ($remove_apps2 as $app => $access) 309 $this->db_functions->write_log("Removido aplicativo $app do grupo $dn",'',$dn,'',''); 294 310 } 295 311 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -
trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
r2 r9 355 355 $group_dn = $entry[0]['dn']; 356 356 $attrs['memberUid'] = $memberUid; 357 358 /*echo 'usuarios recebidos para adicao no ldap';359 echo '<pre>';360 print_r($memberUid);*/361 357 362 358 $res = @ldap_mod_add($this->ldap, $group_dn, $attrs); … … 527 523 } 528 524 525 // Groups 526 $justthese = array("gidnumber","cn"); 527 $filter="(&(phpgwAccountType=g)(memberuid=".$result['uid']."))"; 528 $search = ldap_search($this->ldap, $context, $filter, $justthese); 529 ldap_sort($this->ldap, $search, "cn"); 530 $entries = ldap_get_entries($this->ldap, $search); 531 for ($i=0; $i<$entries['count']; $i++) 532 { 533 $result['groups_ldap'][ $entries[$i]['gidnumber'][0] ] = $entries[$i]['cn'][0]; 534 } 535 529 536 return $result; 530 537 } -
trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php
r2 r9 26 26 var $functions; 27 27 var $current_config; 28 var $ldap_functions; 28 29 29 30 function uiaccounts() … … 32 33 $this->nextmatchs = CreateObject('phpgwapi.nextmatchs'); 33 34 $this->functions = CreateObject('expressoAdmin1_2.functions'); 35 $this->ldap_functions = CreateObject('expressoAdmin1_2.ldap_functions'); 34 36 35 37 $c = CreateObject('phpgwapi.config','expressoAdmin1_2'); … … 299 301 $tmp = $this->functions->read_acl($manager_account_lid); 300 302 $manager_context = $tmp[0]['context']; 303 $alert_warning = ''; 301 304 302 305 // Verifica se tem acesso a este modulo … … 339 342 $GLOBALS['phpgw']->js->validate_file("jscode","users","expressoAdmin1_2"); 340 343 $GLOBALS['phpgw']->js->set_onload("get_available_groups(document.forms[0].context.value);"); 341 //$GLOBALS['phpgw']->js->set_onload("get_sectors(document.forms[0].context.value, '".$user_info['context']."','".$user_info['departmentnumber']."');");342 344 $GLOBALS['phpgw']->js->set_onload("get_available_maillists(document.forms[0].context.value);"); 343 345 $GLOBALS['phpgw']->js->set_onload("use_samba_attrs('".$user_info['sambaUser']."');"); … … 368 370 foreach ($array_groups as $gidnumber=>$cn) 369 371 { 370 $ea_select_user_groups_options .= "<option value=" . $gidnumber . ">" . $cn . "</option>"; 372 373 // O memberUid do usuário está somente no Banco, então adicionamos o memberUid no Ldap. 374 if (is_null($user_info['groups_ldap'][$gidnumber])) 375 { 376 $this->ldap_functions->add_user2group($gidnumber, $user_info['uid']); 377 $ea_select_user_groups_options .= "<option value=" . $gidnumber . ">" . $cn . " [Incluido memberUid no Ldap]</option>"; 378 379 if ($alert_warning == '') 380 $alert_warning = "O expressoAdmin corrigiu as seguintes inconsistências:\\n"; 381 $alert_warning .= "Incluido atributo memberUid do usuário no grupo $cn.\\n"; 382 } 383 else 384 $ea_select_user_groups_options .= "<option value=" . $gidnumber . ">" . $cn . "3</option>"; 385 371 386 if ($gidnumber == $user_info['gidnumber']) 372 387 { … … 378 393 } 379 394 } 395 396 // O memberUid do usuário está somente no Ldap, então removemos ele. 397 $groups_db = array_flip($user_info['groups']); 398 foreach ($user_info['groups_ldap'] as $gidnumber=>$cn) 399 { 400 if (is_null($groups_db[$gidnumber])) 401 { 402 $this->ldap_functions->remove_user2group($gidnumber, $user_info['uid']); 403 if ($alert_warning == '') 404 $alert_warning = "O expressoAdmin corrigiu as seguintes inconsistências:\\n"; 405 $alert_warning .= "Removido atributo memberUid do usuário do grupo $cn.\\n"; 406 } 407 } 380 408 } 381 409 … … 412 440 } 413 441 414 /* 415 echo '<pre>'; 416 _debug_array($user_info); 417 echo '</pre>'; 418 */ 419 442 if ($alert_warning != '') 443 $alert_warning = "alert('". $alert_warning ."')"; 444 420 445 $var = Array( 421 446 'uidnumber' => $_GET['account_id'], … … 438 463 439 464 // First ABA 465 'alert_warning' => "$alert_warning", 440 466 'display_input_account_lid' => 'display:none', 441 467 'lang_general_information' => lang('General Information'), -
trunk/expressoAdmin1_2/inc/class.user.inc.php
r2 r9 655 655 { 656 656 $this->db_functions->add_id2apps($new_values['uidnumber'], $add_apps); 657 $this->db_functions->write_log("adicionado app ao usuario",'',$dn,'',''); 657 658 foreach ($add_apps as $app => $index) 659 $this->db_functions->write_log("Adicionado aplicativo $app ao usuário $dn",'',$dn,'',''); 658 660 } 659 661 if (count($remove_apps)>0) 660 662 { 661 $this->db_functions->remove_id2apps($new_values['uidnumber'], $remove_apps); 662 $this->db_functions->write_log("removido app do usuario",'',$dn,'',''); 663 //Verifica se o gerente tem acesso a aplicação antes de remove-la do usuario. 664 $manager_apps = $this->db_functions->get_apps($_SESSION['phpgw_session']['session_lid']); 665 666 foreach ($remove_apps as $app => $app_index) 667 { 668 if ($manager_apps[$app] == 'run') 669 $remove_apps2[$app] = $app_index; 670 } 671 $this->db_functions->remove_id2apps($new_values['uidnumber'], $remove_apps2); 672 673 foreach ($remove_apps2 as $app => $access) 674 $this->db_functions->write_log("Removido aplicativo $app do usuário $dn",'',$dn,'',''); 663 675 } 664 676 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -
trunk/expressoAdmin1_2/js/jscode/connector.js
r2 r9 522 522 523 523 form._action.value = url; 524 debug_controller = false;524 //debug_controller = false; 525 525 divUpload.innerHTML= "<iframe onload=\"cExecute('$this.functions.getReturnExecuteForm',"+handler+");\" style='display:"+(debug_controller ? "" : "none")+";width:"+(debug_controller ? 800 : 0)+";height:"+(debug_controller ? 800 : 0)+";' name='uploadFile'></iframe>"; 526 526 -
trunk/expressoAdmin1_2/templates/default/accounts_form.tpl
r2 r9 5 5 function initAll() 6 6 { 7 tab.init(); 7 tab.init(); 8 8 } 9 {alert_warning}; 9 10 </script> 10 11
Note: See TracChangeset
for help on using the changeset viewer.