Changeset 208 for trunk/expressoAdmin1_2
- Timestamp:
- 03/10/08 09:20:40 (16 years ago)
- Location:
- trunk/expressoAdmin1_2
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.functions.inc.php
r107 r208 494 494 } 495 495 496 function get_organizations($context, $selected='', $referral=false, $show_invisible_ou=true )496 function get_organizations($context, $selected='', $referral=false, $show_invisible_ou=true, $master=false) 497 497 { 498 498 $s = CreateObject('phpgwapi.sector_search_ldap'); 499 $sectors_info = $s->get_organizations($context, $selected, $referral, $show_invisible_ou );499 $sectors_info = $s->get_organizations($context, $selected, $referral, $show_invisible_ou, $master); 500 500 return $sectors_info; 501 501 } 502 502 503 503 function get_sectors($selected='', $referral=false, $show_invisible_ou=true) 504 504 { -
trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
r180 r208 4 4 include_once(PHPGW_API_INC.'/class.common.inc.php'); 5 5 include_once('class.functions.inc.php'); 6 7 function ldapRebind($ldap_connection, $ldap_url) 8 { 9 if ( ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'] != '') && ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw'] != '') ) 10 { 11 ldap_bind($ldap_connection, $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'], $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw']); 12 } 13 } 6 14 7 15 class ldap_functions … … 23 31 } 24 32 33 /* ldap connection following referals and using Contac Center config*/ 34 function ldapMasterConnect() 35 { 36 if ( (is_array($_SESSION['phpgw_info']['expresso']['cc_ldap_server'])) && ($ldap_connection = ldap_connect($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['host'])) ) 37 { 38 ldap_set_option($ldap_connection, LDAP_OPT_PROTOCOL_VERSION, 3); 39 ldap_set_option($ldap_connection, LDAP_OPT_REFERRALS, true); 40 ldap_set_rebind_proc($ldap_connection, ldapRebind); 41 if ( ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'] != '') && ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw'] != '') ) 42 { 43 if ( ! ldap_bind($ldap_connection, $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'], $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw']) ) 44 { 45 echo 'retornou false1'; 46 return false; 47 } 48 } 49 return $ldap_connection; 50 } 51 else 52 { 53 $ldap_connection = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 54 if ($ldap_connection) 55 { 56 ldap_set_option($ldap_connection,LDAP_OPT_PROTOCOL_VERSION,3); 57 ldap_set_option($ldap_connection, LDAP_OPT_REFERRALS, true); 58 if ( ldap_bind($ldap_connection, $GLOBALS['phpgw_info']['server']['ldap_root_dn'], $GLOBALS['phpgw_info']['server']['ldap_root_pw']) ) 59 return $ldap_connection; 60 } 61 } 62 63 return false; 64 } 65 25 66 function validate_fields($params) 26 67 { … … 71 112 if (($type == 'create_user') || ($type == 'rename_user')) 72 113 { 73 //UID 74 if (($type == 'rename_user') && ($this->current_config['expressoAdmin_prefix_org'] == 'true')) 114 if ($this->current_config['expressoAdmin_prefix_org'] == 'true') 75 115 { 76 116 //Obtenho UID sem a organização. Na criação o uid já vem sem a organização … … 85 125 $filter = "(&(|(phpgwAccountType=u)(phpgwAccountType=l))(uid=$uid))"; 86 126 } 127 /* 128 //UID 129 if (($type == 'rename_user') && ($this->current_config['expressoAdmin_prefix_org'] == 'true')) 130 { 131 //Obtenho UID sem a organização. Na criação o uid já vem sem a organização 132 $tmp_uid_without_org = split("-", $params['uid']); 133 $tmp_reverse_uid_without_org = array_reverse($tmp_uid_without_org); 134 array_pop($tmp_reverse_uid_without_org); 135 $uid_without_org = implode("-", $tmp_reverse_uid_without_org); 136 $filter = "(&(|(phpgwAccountType=u)(phpgwAccountType=l))(|(uid=$uid)(uid=$uid_without_org)))"; 137 } 138 else 139 { 140 $filter = "(&(|(phpgwAccountType=u)(phpgwAccountType=l))(uid=$uid))"; 141 } 142 */ 143 87 144 $justthese = array("uid", "mail", "cn"); 88 145 $search = ldap_search($ldap_connection, $context, $filter, $justthese); … … 333 390 334 391 // MAIL 335 /*336 392 $filter = "(&(|(phpgwAccountType=u)(phpgwAccountType=l))(|(mail=$mail)(mailalternateaddress=$mail)))"; 337 393 $justthese = array("mail"); … … 343 399 $result['msg'] = 'E-MAIL da lista já está sendo usado.'; 344 400 return $result; 345 } */401 } 346 402 347 403 return $result; … … 536 592 function get_available_maillists($params) 537 593 { 594 if ( !$ldapMasterConnect = $this->ldapMasterConnect() ) 595 return false; 596 538 597 $context = $params['context']; 539 598 $justthese = array("uid","mail","uidNumber"); 540 $maillists=ldap_list($ this->ldap, $context, ("(phpgwAccountType=l)"), $justthese);541 ldap_sort($ this->ldap, $maillists, "uid");599 $maillists=ldap_list($ldapMasterConnect, $context, ("(phpgwAccountType=l)"), $justthese); 600 ldap_sort($ldapMasterConnect, $maillists, "uid"); 542 601 543 $entries = ldap_get_entries($ this->ldap, $maillists);602 $entries = ldap_get_entries($ldapMasterConnect, $maillists); 544 603 545 604 $options = ''; 546 605 for ($i=0; $i<$entries['count']; $i++) 547 606 { 548 $options .= "<option value=" . $entries[$i]['uidnumber'][0] . ">" . $entries[$i]['uid'][0] . " (" . $entries[$i]['mail'][0] . ")" . "</option>"; 549 } 550 return $options; 607 $options .= "<option value=" . $entries[$i]['uid'][0] . ">" . $entries[$i]['uid'][0] . " (" . $entries[$i]['mail'][0] . ")" . "</option>"; 608 } 609 610 ldap_close($ldapMasterConnect); 611 return $options; 551 612 } 552 613 … … 659 720 } 660 721 661 function add_user2maillist($uidNumber, $mail) 662 { 663 $filter = "(&(phpgwAccountType=l)(uidNumber=$uidNumber))"; 722 function add_user2maillist($uid, $mail) 723 { 724 if ( !$ldapMasterConnect = $this->ldapMasterConnect() ) 725 { 726 $result['status'] = false; 727 $result['msg'] = "Falha de conexão com o openLDAP.\n\nRetorno do servidor:" . ldap_error($ldapMasterConnect); 728 return $result; 729 } 730 731 $filter = "(&(phpgwAccountType=l)(uid=$uid))"; 664 732 $justthese = array("dn"); 665 $search = ldap_search($ this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);666 $entry = ldap_get_entries($ this->ldap, $search);733 $search = ldap_search($ldapMasterConnect, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 734 $entry = ldap_get_entries($ldapMasterConnect, $search); 667 735 $group_dn = $entry[0]['dn']; 668 736 $attrs['mailForwardingAddress'] = $mail; 669 $res = @ldap_mod_add($ this->ldap, $group_dn, $attrs);737 $res = @ldap_mod_add($ldapMasterConnect, $group_dn, $attrs); 670 738 671 739 if ($res) … … 678 746 $result['msg'] = "Erro na funcao ldap_functions->add_user2maillist ($mail).\nRetorno do servidor:" . ldap_error($this->ldap); 679 747 } 748 749 ldap_close($ldapMasterConnect); 680 750 return $result; 681 751 } … … 684 754 { 685 755 $attrs['mailSenderAddress'] = $array_emails; 756 757 print_r($attrs); 758 686 759 $res = @ldap_mod_add($this->ldap, $dn, $attrs); 687 760 … … 698 771 } 699 772 700 function remove_user2maillist($uidNumber, $mail) 701 { 702 $filter = "(&(phpgwAccountType=l)(uidNumber=$uidNumber))"; 773 function remove_user2maillist($uid, $mail) 774 { 775 if ( !$ldapMasterConnect = $this->ldapMasterConnect() ) 776 { 777 $result['status'] = false; 778 $result['msg'] = "Falha de conexão com o openLDAP.\n\nRetorno do servidor:" . ldap_error($ldapMasterConnect); 779 return $result; 780 } 781 782 $filter = "(&(phpgwAccountType=l)(uid=$uid))"; 703 783 $justthese = array("dn"); 704 $search = ldap_search($ this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);705 $entry = ldap_get_entries($ this->ldap, $search);784 $search = ldap_search($ldapMasterConnect, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 785 $entry = ldap_get_entries($ldapMasterConnect, $search); 706 786 $group_dn = $entry[0]['dn']; 707 787 $attrs['mailForwardingAddress'] = $mail; 708 $res = @ldap_mod_del($ this->ldap, $group_dn, $attrs);788 $res = @ldap_mod_del($ldapMasterConnect, $group_dn, $attrs); 709 789 710 790 if ($res) … … 717 797 $result['msg'] = "Erro na funcao ldap_functions->remove_user2maillist ($mail).\n\nRetorno do servidor:" . ldap_error($this->ldap); 718 798 } 799 ldap_close($ldapMasterConnect); 719 800 return $result; 720 801 } … … 829 910 $result['maillists_info'] = $this->get_user_maillists($result['mail']); 830 911 if($result['maillists_info']) 912 { 831 913 foreach ($result['maillists_info'] as $maillist) 832 914 { 833 $result['maillists'][] = $maillist['uid number'];915 $result['maillists'][] = $maillist['uid']; 834 916 } 917 } 835 918 836 919 // Groups … … 851 934 function get_user_maillists($mail) 852 935 { 936 if ( !$ldapMasterConnect = $this->ldapMasterConnect() ) 937 return false; 938 853 939 $result = array(); 854 940 … … 859 945 foreach ($this->manager_contexts as $index=>$context) 860 946 { 861 $search = ldap_search($this->ldap, $context, $filter, $justthese); 862 //ldap_sort($this->ldap, $search, "uid"); 863 $entries = ldap_get_entries($this->ldap, $search); 947 $search = ldap_search($ldapMasterConnect, $context, $filter, $justthese); 948 $entries = ldap_get_entries($ldapMasterConnect, $search); 864 949 865 950 for ($i=0; $i<$entries['count']; $i++) 866 951 { 867 $result[ $entries[$i]['uid'][0] ]['uidnumber'] = $entries[$i]['uidnumber'][0];868 952 $result[ $entries[$i]['uid'][0] ]['uid'] = $entries[$i]['uid'][0]; 869 953 $result[ $entries[$i]['uid'][0] ]['mail'] = $entries[$i]['mail'][0]; … … 878 962 foreach ($a_tmp as $uid) 879 963 { 880 $return[$uid]['uidnumber'] = $result[$uid]['uidnumber'];881 964 $return[$uid]['uid'] = $result[$uid]['uid']; 882 965 $return[$uid]['mail'] = $result[$uid]['mail']; 883 966 } 884 967 } 968 ldap_close($ldapMasterConnect); 885 969 return $return; 886 970 } … … 1093 1177 $user_entry = ldap_get_entries($this->ldap, $search); 1094 1178 1095 $result['senders_info'][$user_entry[0]['uidnumber'][0]]['uid'] = $user_entry[0]['uid'][0]; 1096 $result['senders_info'][$user_entry[0]['uidnumber'][0]]['cn'] = $user_entry[0]['cn'][0]; 1097 $result['senders_info'][$user_entry[0]['uidnumber'][0]]['mail'] = $user_entry[0]['mail'][0]; 1098 $result['members'][] = $user_entry[0]['uidnumber'][0]; 1179 $result['senders_info'][$user_entry[0]['mail'][0]]['uid'] = $user_entry[0]['uid'][0]; 1180 $result['senders_info'][$user_entry[0]['mail'][0]]['cn'] = $user_entry[0]['cn'][0]; 1181 $result['members'][] = $user_entry[0]['mail'][0]; 1099 1182 } 1100 1183 return $result; … … 1282 1365 $attrs = array(); 1283 1366 $attrs['mailForwardingAddress'] = $user_info['mail']; 1367 1284 1368 if (count($user_info['maillists_info'])) 1285 1369 { 1370 1371 if ( !$ldapMasterConnect = $this->ldapMasterConnect() ) 1372 { 1373 $return['status'] = false; 1374 $return['msg'] .= 'Erro ao conectar ao ldap_master: ' . ldap_error($this->ldap); 1375 return $return; 1376 } 1377 1286 1378 foreach ($user_info['maillists_info'] as $maillists_info) 1287 1379 { 1288 $uid number = $maillists_info['uidnumber'];1380 $uid = $maillists_info['uid']; 1289 1381 $justthese = array("dn"); 1290 $filter="(&(phpgwAccountType=l)(uid number=".$uidnumber."))";1291 $search = ldap_search($ this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);1292 $entry = ldap_get_entries($ this->ldap, $search);1382 $filter="(&(phpgwAccountType=l)(uid=".$uid."))"; 1383 $search = ldap_search($ldapMasterConnect, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 1384 $entry = ldap_get_entries($ldapMasterConnect, $search); 1293 1385 $dn = $entry[0]['dn']; 1294 1386 1295 if (!@ldap_mod_del($ this->ldap, $dn, $attrs))1387 if (!@ldap_mod_del($ldapMasterConnect, $dn, $attrs)) 1296 1388 { 1297 1389 $return['status'] = false; … … 1299 1391 } 1300 1392 } 1393 ldap_close($ldapMasterConnect); 1301 1394 } 1302 1395 -
trunk/expressoAdmin1_2/inc/class.maillist.inc.php
r180 r208 100 100 if ($params['phpgwAccountVisible'] == 'on') 101 101 $maillist_info['phpgwAccountVisible'] = '-1'; 102 103 /* 104 foreach($params['members'] as $index=>$uidnumber) 105 { 106 $mail = $this->ldap_functions->uidnumber2mail($uidnumber); 107 $maillist_info['mailForwardingAddress'][] = $mail; 108 $this->db_functions->write_log("Adicionado usuario $mail a lista ".$params['cn']." no momento da criação",$dn,$uidnumber,'',''); 109 } 110 */ 111 102 112 103 $maillist_info['mailForwardingAddress'] = $params['mailForwardingAddress']; 113 104 … … 234 225 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 235 226 // USERS 227 /* 228 echo '<pre>'; 229 print_r($new_values['mailForwardingAddress']); 230 */ 236 231 if (!$new_values['mailForwardingAddress']) 237 232 $new_values['mailForwardingAddress'] = array(); … … 242 237 $remove_users = array_diff($old_values['mailForwardingAddress'], $new_values['mailForwardingAddress']); 243 238 244 /* echo '<pre>';245 print_r($new_values);*/246 247 239 if (count($add_users)>0) 248 240 { 249 241 sort($add_users); 250 $result = $this->ldap_functions->add_user2maillist($new_values['uid number'], $add_users);242 $result = $this->ldap_functions->add_user2maillist($new_values['uid'], $add_users); 251 243 252 244 /* log */ … … 258 250 else 259 251 { 260 foreach($add_users ['mailForwardingAddress']as $index=>$mail)252 foreach($add_users as $index=>$mail) 261 253 { 262 254 $this->db_functions->write_log("Adicionado usuario $mail a lista de email $dn",$dn,'','',''); … … 268 260 { 269 261 sort($remove_users); 270 $result = $this->ldap_functions->remove_user2maillist($new_values['uid number'], $remove_users);262 $result = $this->ldap_functions->remove_user2maillist($new_values['uid'], $remove_users); 271 263 272 264 /* log */ … … 302 294 //Retira os uids duplicados se existir 303 295 $array_tmp = array(); 304 $array_tmp = array_unique($new_values['members']);296 $array_tmp = @array_unique($new_values['members']); 305 297 $new_values['members'] = $array_tmp; 306 298 307 299 $old_values = $this->get_scl_info($new_values['uidnumber'], $new_values['manager_context']); 300 308 301 $diff = array_diff($new_values, $old_values); 309 302 $dn = $old_values['dn']; … … 372 365 if (count($add_users)>0) 373 366 { 374 $array_emails_add = array(); 375 foreach($add_users as $uidnumber) 376 { 377 if ($uidnumber != -1) 367 sort($add_users); 368 $result = $this->ldap_functions->add_user2maillist_scl($dn, $add_users); 369 370 /* log */ 371 if (!$result['status']) 372 { 373 $return['status'] = false; 374 $return['msg'] .= $result['msg']; 375 } 376 else 377 { 378 foreach($add_users as $index=>$mail) 378 379 { 379 $mail = $this->ldap_functions->uidnumber2mail($uidnumber); 380 $array_emails_add[] = $mail; 381 $this->db_functions->write_log("Adicionado usuario $mail a SCL da lista $dn",'',$uidnumber,'',''); 380 $this->db_functions->write_log("Adicionado usuario $mail da SCP da lista de email $dn",$dn,'','',''); 382 381 } 383 382 } 384 $result = $this->ldap_functions->add_user2maillist_scl($dn, $array_emails_add);385 if (!$result['status'])386 {387 $return['status'] = false;388 $return['msg'] .= $result['msg'];389 }383 } 384 385 if (count($remove_users)>0) 386 { 387 sort($remove_users); 388 $result = $this->ldap_functions->remove_user2maillist_scl($dn, $remove_users); 390 389 391 } 392 393 if (count($remove_users)>0) 394 { 395 $array_emails_remove = array(); 396 foreach($remove_users as $uidnumber) 397 { 398 if ($uidnumber != -1) 390 /* log */ 391 if (!$result['status']) 392 { 393 $return['status'] = false; 394 $return['msg'] .= $result['msg']; 395 } 396 else 397 { 398 foreach($add_users as $index=>$mail) 399 399 { 400 $mail = $this->ldap_functions->uidnumber2mail($uidnumber); 401 $array_emails_remove[] = $mail; 402 $this->db_functions->write_log("Removido usuario $mail da SCP da lista $dn",'',$uidnumber,'',''); 400 $this->db_functions->write_log("Removido usuario $mail da SCP da lista de email $dn",$dn,'','',''); 403 401 } 404 }405 $result = $this->ldap_functions->remove_user2maillist_scl($dn, $array_emails_remove);406 if (!$result['status'])407 {408 $return['status'] = false;409 $return['msg'] .= $result['msg'];410 402 } 411 403 } -
trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php
r180 r208 216 216 // Pega combo das organizações e seleciona, caso seja um post, o setor que o usuario selecionou. 217 217 foreach ($manager_contexts as $index=>$context) 218 $sectors .= $this->functions->get_organizations($context); 218 $combo_manager_org .= $this->functions->get_organizations($context); 219 $combo_all_orgs = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context'], '', true, true, true); 219 220 220 221 // Chama funcao para criar lista de aplicativos disponiveis. … … 273 274 'lang_back' => lang('Back'), 274 275 'lang_save' => lang('Save'), 275 276 ' sectors' => $sectors,277 'combo_ organizations' => $sectors,276 'sectors' => $combo_manager_org, 277 'combo_organizations' => $combo_manager_org, 278 'combo_all_orgs' => $combo_all_orgs, 278 279 'passwd_expired_checked' => 'CHECKED', 279 280 'changepassword_checked' => 'CHECKED', … … 430 431 431 432 // ORGANIZATIONS 433 /* 432 434 foreach ($contexts as $index=>$context) 433 435 $orgs .= $this->functions->get_organizations($context, $user_info['context']); 436 */ 437 438 foreach ($contexts as $index=>$context) 439 $combo_manager_org .= $this->functions->get_organizations($context, $user_info['context']); 440 $combo_all_orgs = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context'], $user_info['context'], true, true, true); 441 434 442 435 443 // GROUPS. … … 498 506 foreach ($user_info['maillists_info'] as $maillist) 499 507 { 500 $array_maillist[$maillist['uid number']] = $maillist['uid'] . " (" . $maillist['mail'] . ") ";508 $array_maillist[$maillist['uid']] = $maillist['uid'] . " (" . $maillist['mail'] . ") "; 501 509 } 502 510 natcasesort($array_maillist); 503 foreach ($array_maillist as $uid number=>$option)504 { 505 $ea_select_user_maillists_options .= "<option value=" . $uid number. ">" . $option . "</option>";511 foreach ($array_maillist as $uid=>$option) 512 { 513 $ea_select_user_maillists_options .= "<option value=" . $uid . ">" . $option . "</option>"; 506 514 } 507 515 } … … 622 630 'lang_save' => lang('Save'), 623 631 624 'sectors' => $orgs, 625 'combo_organizations' => $orgs, 632 'sectors' => $combo_manager_org, 633 'combo_organizations' => $combo_manager_org, 634 'combo_all_orgs' => $combo_all_orgs, 626 635 627 636 'uid' => $user_info['uid'], -
trunk/expressoAdmin1_2/inc/class.uimaillists.inc.php
r180 r208 189 189 foreach ($manager_contexts as $index=>$context) 190 190 $combo_manager_org .= $this->functions->get_organizations($context); 191 $combo_all_orgs = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context'], '', true, true );191 $combo_all_orgs = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context'], '', true, true, true); 192 192 193 193 // Seta variaveis utilizadas pelo tpl. … … 252 252 foreach ($manager_contexts as $index=>$context) 253 253 $combo_manager_org .= $this->functions->get_organizations($context, trim(strtolower($maillist_info['context']))); 254 $combo_all_orgs = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context'], trim(strtolower($maillist_info['context'])), true, true );254 $combo_all_orgs = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context'], trim(strtolower($maillist_info['context'])), true, true, true); 255 255 256 256 // Usuarios da lista. … … 367 367 if (count($maillist_info['senders_info']) > 0) 368 368 { 369 foreach ($maillist_info['senders_info'] as $ uidnumber=>$senderinfo)370 { 371 $array_senders[$ uidnumber] = $senderinfo['cn'];369 foreach ($maillist_info['senders_info'] as $mail=>$senderinfo) 370 { 371 $array_senders[$mail] = $senderinfo['cn']; 372 372 } 373 373 natcasesort($array_senders); 374 foreach ($array_senders as $ uidnumber=>$cn)375 { 376 $ea_select_users_SCL_Maillist .= "<option value=" . $ uidnumber . ">" . $cn . " [" . $maillist_info['senders_info'][$uidnumber]['mail']. "]</option>";374 foreach ($array_senders as $mail=>$cn) 375 { 376 $ea_select_users_SCL_Maillist .= "<option value=" . $mail . ">" . $cn . " [" . $mail . "]</option>"; 377 377 } 378 378 } -
trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php
r180 r208 162 162 */ 163 163 164 $options_context = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context'], '', false, true );164 $options_context = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context'], '', false, true, false); 165 165 166 166 // Seta variaveis que estao no TPL … … 292 292 foreach ($a_context as $context) 293 293 $input_context_fields .= '<div><input disabled type="text" value="'.$context.'" size=60></input><span onclick="this.parentNode.parentNode.removeChild(this.parentNode);" style="cursor:pointer"> -</span></div>'; 294 $options_context = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context'], '', false, true );294 $options_context = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context'], '', false, true, false); 295 295 296 296 $var = Array( -
trunk/expressoAdmin1_2/inc/class.user.inc.php
r180 r208 23 23 var $current_config; 24 24 25 26 25 function user() 27 26 { … … 224 223 if ($params['maillists']) 225 224 { 226 foreach($params['maillists'] as $uid number)225 foreach($params['maillists'] as $uid) 227 226 { 228 $result = $this->ldap_functions->add_user2maillist($uid number, $user_info['mail']);227 $result = $this->ldap_functions->add_user2maillist($uid, $user_info['mail']); 229 228 if (!$result['status']) 230 229 { … … 756 755 foreach($remove_groups as $gidnumber) 757 756 { 758 echo $gidnumber;759 760 757 foreach($old_values['groups_info'] as $group) 761 758 { … … 836 833 if (count($add_maillists)>0) 837 834 { 838 foreach($add_maillists as $uidnumber) 839 { 840 $this->ldap_functions->add_user2maillist($uidnumber, $new_values['mail']); 841 $this->db_functions->write_log("adicionado usuario a maillist $uidnumber.",'',$dn,'',''); 842 } 843 } 835 foreach($add_maillists as $uid) 836 { 837 $this->ldap_functions->add_user2maillist($uid, $new_values['mail']); 838 $this->db_functions->write_log("adicionado usuario a maillist $uid.",'',$dn,'',''); 839 } 840 } 841 /* 842 echo '<pre>'; 843 print_r($old_values['maillists']); 844 print_r($new_values['maillists']); 845 */ 844 846 845 847 if (count($remove_maillists)>0) 846 848 { 847 foreach($remove_maillists as $uid number)848 { 849 $this->ldap_functions->remove_user2maillist($uid number, $new_values['mail']);850 $this->db_functions->write_log("removido usuario da maillist $uid number.",'',$dn,'','');849 foreach($remove_maillists as $uid) 850 { 851 $this->ldap_functions->remove_user2maillist($uid, $new_values['mail']); 852 $this->db_functions->write_log("removido usuario da maillist $uid.",'',$dn,'',''); 851 853 } 852 854 } -
trunk/expressoAdmin1_2/js/jscode/maillists.js
r180 r208 66 66 // Needed select all options from select 67 67 for(var i=0; i<select_userInMaillist.options.length; i++) 68 select_userInMaillist.options[i].selected = true; 69 68 { 69 // No IE, não seleciona o separador do select 70 if (select_userInMaillist.options[i].value != -1) 71 select_userInMaillist.options[i].selected = true; 72 else 73 select_userInMaillist.options[i].selected = false; 74 } 75 70 76 // O UID da lista foi alterado ou é uma nova lista. 71 77 if ((document.forms[0].old_uid.value != document.forms[0].uid.value) || (type == 'create_maillist')){ 72 cExecute ('$this.maillist.validate_fields&uid='+document.forms[0].uid.value , handler_validate_fields);78 cExecute ('$this.maillist.validate_fields&uid='+document.forms[0].uid.value+'&mail='+document.forms[0].mail.value, handler_validate_fields); 73 79 } 74 80 else if (type == 'edit_maillist') -
trunk/expressoAdmin1_2/js/jscode/users.js
r81 r208 682 682 } 683 683 684 /* 684 685 function search_organization(key) 685 686 { 686 687 var organizations = document.getElementById('ea_combo_org_info'); 688 var RegExp_org = new RegExp("\\b"+key, "i"); 689 690 for(i = 0; i < organizations.length; i++) 691 { 692 if (RegExp_org.test(organizations[i].text)) 693 { 694 organizations[i].selected = true; 695 return; 696 } 697 } 698 }*/ 699 700 function search_organization(key, element) 701 { 702 var organizations = document.getElementById(element); 687 703 var RegExp_org = new RegExp("\\b"+key, "i"); 688 704
Note: See TracChangeset
for help on using the changeset viewer.