Changeset 3351 for branches/2.2/expressoAdmin1_2/inc
- Timestamp:
- 10/14/10 11:10:26 (13 years ago)
- Location:
- branches/2.2/expressoAdmin1_2/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/expressoAdmin1_2/inc/class.ldap_functions.inc.php
r3171 r3351 764 764 765 765 if ($recursive == 'true') 766 {767 $lists_search = ldap_search($ldap_conn_following_ref, $context, $lists_filter, $justthese);768 766 $users_search = ldap_search($ldap_conn_following_ref, $context, $users_filter, $justthese); 769 } 770 else 771 { 772 $lists_search = ldap_list($ldap_conn_following_ref, $context, $lists_filter, $justthese); 767 else 773 768 $users_search = ldap_list($ldap_conn_following_ref, $context, $users_filter, $justthese); 774 } 775 769 776 770 /* email lists */ 777 $lists_entries = ldap_get_entries($ldap_conn_following_ref, $lists_search); 778 779 for ($i=0; $i<$lists_entries["count"]; $i++) 780 { 781 $l_tmp[$lists_entries[$i]["mail"][0]] = $lists_entries[$i]["cn"][0]; 782 } 783 784 if (count($l_tmp)) 785 natcasesort($l_tmp); 786 787 $i = 0; 788 $lists = array(); 789 790 $options .= '<option value="-1" disabled>------------------------------ '.$this->functions->lang('email lists').' ------------------------------ </option>'."\n"; 791 if (count($l_tmp)) 792 { 793 foreach ($l_tmp as $mail => $cn) 794 { 795 $options .= "<option value=$mail>$cn</option>"; 796 } 797 unset($l_tmp); 771 if($params['listSearch'] == 'true'){ 772 if ($recursive == 'true') 773 $lists_search = ldap_search($ldap_conn_following_ref, $context, $lists_filter, $justthese); 774 else 775 $lists_search = ldap_list($ldap_conn_following_ref, $context, $lists_filter, $justthese); 776 777 $lists_entries = ldap_get_entries($ldap_conn_following_ref, $lists_search); 778 779 for ($i=0; $i<$lists_entries["count"]; $i++) 780 { 781 $l_tmp[$lists_entries[$i]["mail"][0]] = $lists_entries[$i]["cn"][0]; 782 } 783 784 if (count($l_tmp)) 785 natcasesort($l_tmp); 786 787 $i = 0; 788 $lists = array(); 789 790 $options .= '<option value="-1" disabled>------------------------------ '.$this->functions->lang('email lists').' ------------------------------ </option>'."\n"; 791 if (count($l_tmp)) 792 { 793 foreach ($l_tmp as $mail => $cn) 794 { 795 $options .= "<option value=$mail>$cn</option>"; 796 } 797 unset($l_tmp); 798 } 798 799 } 799 800 … … 2626 2627 return $return; 2627 2628 } 2629 2630 function search_available_users_and_maillist($params) 2631 { 2632 $context = $params['context']; 2633 $recursive = $params['recursive']; 2634 $filtro =utf8_encode($params['filter']); 2635 //Usado para retirar a própria lista das possibilidades de inclusão. 2636 $denied_uidnumber = $params['denied_uidnumber']; 2637 2638 $justthese = array("cn", "uidNumber", "mail"); 2639 2640 $users_filter="(&(phpgwaccounttype=u)(!(phpgwaccountvisible=-1))(phpgwaccountstatus=A)(|(cn=*$filtro*)(mail=$filtro*)))"; 2641 $lists_filter = $denied_uidnumber == '' ? "(&(phpgwAccountType=l)(cn=*$filtro*))" : "(&(phpgwAccountType=l)(!(uidnumber=$denied_uidnumber))(|(cn=*$filtro*)(mail=$filtro*)))"; 2642 2643 $users = Array(); 2644 $lists = Array(); 2645 2646 /* folling referral connection */ 2647 $ldap_conn_following_ref = ldap_connect($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['host']); 2648 if ($ldap_conn_following_ref) 2649 { 2650 ldap_set_option($ldap_conn_following_ref, LDAP_OPT_PROTOCOL_VERSION, 3); 2651 ldap_set_option($ldap_conn_following_ref, LDAP_OPT_REFERRALS, 1); 2652 2653 if ( ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'] != '') && ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw'] != '') ) 2654 ldap_bind($ldap_conn_following_ref, $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'], $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw']); 2655 } 2656 else 2657 return false; 2658 2659 if ($recursive == 'true') 2660 $users_search = ldap_search($ldap_conn_following_ref, $context, $users_filter, $justthese); 2661 else 2662 $users_search = ldap_list($ldap_conn_following_ref, $context, $users_filter, $justthese); 2663 2664 /* email lists */ 2665 if($params['listSearch'] == 'true'){ 2666 if ($recursive == 'true') 2667 $lists_search = ldap_search($ldap_conn_following_ref, $context, $lists_filter, $justthese); 2668 else 2669 $lists_search = ldap_list($ldap_conn_following_ref, $context, $lists_filter, $justthese); 2670 2671 $lists_entries = ldap_get_entries($ldap_conn_following_ref, $lists_search); 2672 2673 for ($i=0; $i<$lists_entries["count"]; $i++) 2674 { 2675 $l_tmp[$lists_entries[$i]["mail"][0]] = $lists_entries[$i]["cn"][0]; 2676 } 2677 2678 if (count($l_tmp)) 2679 natcasesort($l_tmp); 2680 2681 $i = 0; 2682 $lists = array(); 2683 2684 $options .= '<option value="-1" disabled>------------------------------ '.$this->functions->lang('email lists').' ------------------------------ </option>'."\n"; 2685 if (count($l_tmp)) 2686 { 2687 foreach ($l_tmp as $mail => $cn) 2688 { 2689 $options .= "<option value=$mail>$cn</option>"; 2690 } 2691 unset($l_tmp); 2692 } 2693 } 2694 2695 /* users */ 2696 $users_entries = ldap_get_entries($ldap_conn_following_ref, $users_search); 2697 for ($i=0; $i<$users_entries["count"]; $i++) 2698 { 2699 $u_tmp[$users_entries[$i]["mail"][0]] = $users_entries[$i]["cn"][0]; 2700 } 2701 2702 if (count($u_tmp)) 2703 natcasesort($u_tmp); 2704 2705 $i = 0; 2706 $users = array(); 2707 2708 $options .= '<option value="-1" disabled>----------------------------- '.$this->functions->lang('users').' ---------------------------- </option>'."\n"; 2709 2710 if (count($u_tmp)) 2711 { 2712 foreach ($u_tmp as $mail => $cn) 2713 { 2714 $options .= "<option value=$mail class='line-above'>$cn</option>"; 2715 } 2716 unset($u_tmp); 2717 } 2718 2719 ldap_close($ldap_conn_following_ref); 2720 return $options; 2721 } 2722 2628 2723 } 2629 2724 ?> -
branches/2.2/expressoAdmin1_2/inc/class.uimaillists.inc.php
r493 r3351 166 166 function add_maillists() 167 167 { 168 $GLOBALS['phpgw']->js->set_onload('get_available_users(document.forms[0].org_context.value, document.forms[0].ea_check_allUsers.checked);'); 169 168 if($this->current_config['users_auto_search'] == "true"){ 169 $GLOBALS['phpgw']->js->set_onload('get_available_users(document.forms[0].org_context.value, document.forms[0].ea_check_allUsers.checked);'); 170 } 170 171 $manager_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 171 172 $manager_acl = $this->functions->read_acl($manager_lid); … … 205 206 'combo_manager_org' => $combo_manager_org, 206 207 'combo_all_orgs' => $combo_all_orgs, 207 'defaultDomain' => $this->current_config['expressoAdmin_defaultDomain'] 208 'defaultDomain' => $this->current_config['expressoAdmin_defaultDomain'], 209 'autosearch' => $this->current_config['users_auto_search'], 210 'minNum' => ($this->current_config['min_num_characters'] == "") ? 0:$this->current_config['min_num_characters'] 208 211 ); 209 212 $p->set_var($var); … … 304 307 'phpgwAccountVisible_checked' => $maillist_info['phpgwAccountVisible'] == '-1' ? 'CHECKED' : '', 305 308 'ea_select_usersInMaillist' => $ea_select_usersInMaillist, 306 'defaultDomain' => $this->current_config['expressoAdmin_defaultDomain'] 309 'defaultDomain' => $this->current_config['expressoAdmin_defaultDomain'], 310 'autosearch' => $this->current_config['users_auto_search'], 311 'minNum' => ($this->current_config['min_num_characters'] == "") ? 0:$this->current_config['min_num_characters'] 307 312 ); 308 313 $p->set_var($var); … … 373 378 'accountRestrictive_checked' => $maillist_info['accountRestrictive'] == 'mailListRestriction' ? 'CHECKED' : '', 374 379 'participantCanSendMail_checked'=> $maillist_info['participantCanSendMail'] == 'TRUE' ? 'CHECKED' : '', 375 'ea_select_users_SCL_Maillist' => $ea_select_users_SCL_Maillist 380 'ea_select_users_SCL_Maillist' => $ea_select_users_SCL_Maillist, 381 'autosearch' => $this->current_config['users_auto_search'], 382 'minNum' => ($this->current_config['min_num_characters'] == "") ? 0:$this->current_config['min_num_characters'] 376 383 ); 377 384 $p->set_var($var);
Note: See TracChangeset
for help on using the changeset viewer.