Changeset 1912 for trunk/expressoMail1_2/inc/class.ldap_functions.inc.php
- Timestamp:
- 01/04/10 11:25:23 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.ldap_functions.inc.php
r1740 r1912 689 689 function getSharedUsersFrom($params){ 690 690 $filter = ''; 691 $i = 0; 691 $i = 0; 692 //Added to save if must save sent messages in shared folder 693 $acl_save_sent_in_shared = array(); 694 692 695 if($params['uids']) { 693 696 $uids = explode(";",$params['uids']); 694 $this->imap = new imap_functions(); 697 $this->imap = new imap_functions(); 695 698 foreach($uids as $index => $uid){ 696 699 $params = array(); 700 //Added to save if user has create permission 701 $acl_create_message = array(); 697 702 $acl = $this->imap->getacltouser($uid); 698 if(preg_match("/a/",$acl)) 699 $filter .= "(uid=$uid)"; 700 } 701 } 702 703 if ( preg_match("/a/",$acl )){ 704 $filter .= "(uid=$uid)"; 705 if ( preg_match("/p/",$acl )){ 706 $acl_save_sent_in_shared[ $i ] =$uid; 707 $i++; 708 } 709 } 710 } 711 } 712 703 713 $this->ldapRootConnect(false); 704 714 if ($this->ds) { 705 $justthese = array("cn","mail" );715 $justthese = array("cn","mail","uid"); 706 716 if($filter) { 707 $filter="(&( phpgwAccountType=u)(|$filter))";717 $filter="(&(|(phpgwAccountType=u)(phpgwAccountType=s))(|$filter))"; 708 718 $sr = ldap_search($this->ds, $this->ldap_context, $filter, $justthese); 709 719 ldap_sort($this->ds,$sr,"cn"); 710 720 $info = ldap_get_entries($this->ds, $sr); 711 for ($i = 0;$i < $info["count"]; $i++) 721 $var = print_r($acl_save_sent_in_shared, true); 722 for ($i = 0;$i < $info["count"]; $i++){ 712 723 $info[$i]['cn'][0] = utf8_decode($info[$i]['cn'][0]); 713 } 724 //verify if user has permission to save sent messages in a shared folder 725 if ( in_array( $info[$i]['uid'][0],$acl_save_sent_in_shared) ){ 726 $info[$i]['save_shared'][0] = 'y'; 727 } else $info[$i]['save_shared'][0] = 'n'; 728 } 729 } 730 714 731 $info['myname'] = $_SESSION['phpgw_info']['expressomail']['user']['fullname']; 715 732 … … 728 745 for ($j = 0;$j < $result["count"]; $j++){ 729 746 $info[$i]['cn'][0] = utf8_decode($result[$j]['cn'][0]); 730 $info[$i++]['mail'][0] = $result[$j]['mail'][0]; 747 $info[$i]['mail'][0] = $result[$j]['mail'][0]; 748 $info[$i]['save_shared'][0] = 'n'; 749 $info[$i++]['uid'][0] = $result[$j]['uid'][0]; 731 750 } 732 751 } 733 752 734 753 $_SESSION['phpgw_info']['expressomail']['user']['shared_mailboxes'] = $info; 735 754 736 755 return $info; 737 756 }
Note: See TracChangeset
for help on using the changeset viewer.