- Timestamp:
- 06/30/11 19:00:36 (13 years ago)
- Location:
- sandbox/expressoMail1_2/MailArchiver/2.2/expressoAdmin1_2/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/expressoMail1_2/MailArchiver/2.2/expressoAdmin1_2/inc/class.ldap_functions.inc.php
r3530 r4644 974 974 function add_user2maillist($uid, $mail) 975 975 { 976 if ( !$ldapMasterConnect = $this->ldapMasterConnect() )977 {978 $result['status'] = false;979 $result['msg'] = $this->functions->lang('Ldap connection fail') . ".\n" . $this->functions->lang('Server returns') . ': ' . ldap_error($ldapMasterConnect);980 return $result;981 }982 983 976 $filter = "(&(phpgwAccountType=l)(uid=$uid))"; 984 977 $justthese = array("dn"); 985 $search = ldap_search($ ldapMasterConnect, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);986 $entry = ldap_get_entries($ ldapMasterConnect, $search);978 $search = ldap_search($this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 979 $entry = ldap_get_entries($this->ldap, $search); 987 980 $group_dn = $entry[0]['dn']; 988 981 $attrs['mailForwardingAddress'] = $mail; 989 $res = @ldap_mod_add($ ldapMasterConnect, $group_dn, $attrs);982 $res = @ldap_mod_add($this->ldap, $group_dn, $attrs); 990 983 991 984 if ($res) … … 996 989 { 997 990 $result['status'] = false; 998 if (ldap_errno($ ldapMasterConnect) == '50')991 if (ldap_errno($this->ldap) == '50') 999 992 { 1000 993 $result['msg'] = $this->functions->lang('Error on the function') . ' ldap_functions->add_user2maillist' . ".\n" . 1001 $this->functions->lang('The user used for record on L PDA, must have write access') . ".\n";994 $this->functions->lang('The user used for record on LDAP, must have write access') . ".\n"; 1002 995 $this->functions->lang('The user') . ' ' . $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'] . ' ' . $this->functions->lang('does not have this access') . ".\n"; 1003 996 $this->functions->lang('Edit Global Catalog Config, in the admin module, and add an user with write access') . ".\n"; 1004 997 } 1005 998 else 1006 $result['msg'] = $this->functions->lang('Error on function') . " ldap_functions->add_user2maillist ($dn)" . ".\n" . $this->functions->lang('Server returns') . ': ' . ldap_error($ ldapMasterConnect);1007 } 1008 1009 ldap_close($ ldapMasterConnect);999 $result['msg'] = $this->functions->lang('Error on function') . " ldap_functions->add_user2maillist ($dn)" . ".\n" . $this->functions->lang('Server returns') . ': ' . ldap_error($this->ldap); 1000 } 1001 1002 ldap_close($this->ldap); 1010 1003 return $result; 1011 1004 } … … 1031 1024 function remove_user2maillist($uid, $mail) 1032 1025 { 1033 if ( !$ldapMasterConnect = $this->ldapMasterConnect() )1034 {1035 $result['status'] = false;1036 $result['msg'] = $this->functions->lang('Ldap connection fail') . ".\n" . $this->functions->lang('Server returns') . ': ' . ldap_error($ldapMasterConnect);1037 return $result;1038 }1039 1040 1026 $filter = "(&(phpgwAccountType=l)(uid=$uid))"; 1041 1027 $justthese = array("dn"); 1042 $search = ldap_search($ ldapMasterConnect, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);1043 $entry = ldap_get_entries($ ldapMasterConnect, $search);1028 $search = ldap_search($this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 1029 $entry = ldap_get_entries($this->ldap, $search); 1044 1030 $group_dn = $entry[0]['dn']; 1045 1031 $attrs['mailForwardingAddress'] = $mail; 1046 $res = @ldap_mod_del($ ldapMasterConnect, $group_dn, $attrs);1032 $res = @ldap_mod_del($this->ldap, $group_dn, $attrs); 1047 1033 1048 1034 if ($res) … … 1053 1039 { 1054 1040 $result['status'] = false; 1055 if (ldap_errno($ ldapMasterConnect) == '50')1041 if (ldap_errno($this->ldap) == '50') 1056 1042 { 1057 1043 $result['msg'] = $this->functions->lang('Error on the function') . ' ldap_functions->remove_user2maillist' . ".\n" . 1058 $this->functions->lang('The user used for record on L PDA, must have write access') . ".\n";1044 $this->functions->lang('The user used for record on LDAP, must have write access') . ".\n"; 1059 1045 $this->functions->lang('The user') . ' ' . $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'] . ' ' . $this->functions->lang('does not have this access') . ".\n"; 1060 1046 $this->functions->lang('Edit Global Catalog Config, in the admin module, and add an user with write access') . ".\n"; 1061 1047 } 1062 1048 else 1063 $result['msg'] = $this->functions->lang('Error on function') . " ldap_functions->remove_user2maillist ($dn)" . ".\n" . $this->functions->lang('Server returns') . ': ' . ldap_error($ ldapMasterConnect);1064 } 1065 ldap_close($ ldapMasterConnect);1049 $result['msg'] = $this->functions->lang('Error on function') . " ldap_functions->remove_user2maillist ($dn)" . ".\n" . $this->functions->lang('Server returns') . ': ' . ldap_error($this->ldap); 1050 } 1051 ldap_close($this->ldap); 1066 1052 return $result; 1067 1053 } -
sandbox/expressoMail1_2/MailArchiver/2.2/expressoAdmin1_2/inc/class.totalsessions.inc.php
r414 r4644 75 75 76 76 $fd = fopen ($path . '/' . $file,'r'); 77 $session = @fread ($fd, filesize ($path . '/' . $file));77 $session = @fread ($fd, 50); 78 78 fclose ($fd); 79 79 80 if (s ubstr($session,0,14) != 'phpgw_session|')80 if (strstr($session,'phpgw_session|') === FALSE) 81 81 { 82 82 continue;
Note: See TracChangeset
for help on using the changeset viewer.