@@ -29,18 +29,18 @@ discard block |
||
| 29 | 29 | * @param string $passwd_type ='text' 'text' for cleartext passwords (default) |
| 30 | 30 | * @return boolean true if successful authenticated, false otherwise |
| 31 | 31 | */ |
| 32 | - function authenticate($username, $passwd, $passwd_type='text') |
|
| 32 | + function authenticate($username, $passwd, $passwd_type = 'text') |
|
| 33 | 33 | { |
| 34 | 34 | /* if program goes here, authenticate is, normaly, already verified by CAS */ |
| 35 | 35 | if ($GLOBALS['egw_info']['server']['account_repository'] != 'ldap' && |
| 36 | 36 | $GLOBALS['egw_info']['server']['account_repository'] != 'ldsq') /* For anonymous LDAP connection */ |
| 37 | 37 | { |
| 38 | - if (!($id = $GLOBALS['egw']->accounts->name2id($username,'account_lid','u')) && |
|
| 38 | + if (!($id = $GLOBALS['egw']->accounts->name2id($username, 'account_lid', 'u')) && |
|
| 39 | 39 | $GLOBALS['egw_info']['server']['auto_create_acct']) |
| 40 | 40 | { |
| 41 | 41 | // create a global array with all availible info about that account |
| 42 | 42 | $GLOBALS['auto_create_acct'] = array(); |
| 43 | - foreach(array( |
|
| 43 | + foreach (array( |
|
| 44 | 44 | 'givenname' => 'firstname', |
| 45 | 45 | 'sn' => 'lastname', |
| 46 | 46 | 'uidnumber' => 'id', |
@@ -48,11 +48,11 @@ discard block |
||
| 48 | 48 | 'gidnumber' => 'primary_group', |
| 49 | 49 | ) as $ldap_name => $acct_name) |
| 50 | 50 | { |
| 51 | - $GLOBALS['auto_create_acct'][$acct_name] = Api\Translation::convert($allValues[0][$ldap_name][0],'utf-8'); |
|
| 51 | + $GLOBALS['auto_create_acct'][$acct_name] = Api\Translation::convert($allValues[0][$ldap_name][0], 'utf-8'); |
|
| 52 | 52 | } |
| 53 | 53 | return True; |
| 54 | 54 | } |
| 55 | - return $id && $GLOBALS['egw']->accounts->id2name($id,'account_status') == 'A' && phpCAS::checkAuthentication(); |
|
| 55 | + return $id && $GLOBALS['egw']->accounts->id2name($id, 'account_status') == 'A' && phpCAS::checkAuthentication(); |
|
| 56 | 56 | } |
| 57 | 57 | return phpCAS::checkAuthentication(); |
| 58 | 58 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | * @param int $account_id =0 account id of user whose passwd should be changed |
| 66 | 66 | * @return boolean true if password successful changed, false otherwise |
| 67 | 67 | */ |
| 68 | - function change_password($old_passwd, $new_passwd, $account_id=0) |
|
| 68 | + function change_password($old_passwd, $new_passwd, $account_id = 0) |
|
| 69 | 69 | { |
| 70 | 70 | /* Not allowed */ |
| 71 | 71 | return false; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @param mixed $_purpose =true if given it need to be used in validate too! (It must NOT be NULL) |
| 33 | 33 | * @return string CSRF token |
| 34 | 34 | */ |
| 35 | - public static function token($_purpose=true) |
|
| 35 | + public static function token($_purpose = true) |
|
| 36 | 36 | { |
| 37 | 37 | if (is_null($_purpose)) |
| 38 | 38 | { |
@@ -40,8 +40,7 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | // generate random token (using oppenssl if available otherwise mt_rand based Auth::randomstring) |
| 42 | 42 | $token = function_exists('openssl_random_pseudo_bytes') ? |
| 43 | - base64_encode(openssl_random_pseudo_bytes(64)) : |
|
| 44 | - Auth::randomstring(64); |
|
| 43 | + base64_encode(openssl_random_pseudo_bytes(64)) : Auth::randomstring(64); |
|
| 45 | 44 | |
| 46 | 45 | // store it in session for later validation |
| 47 | 46 | Cache::setSession(__CLASS__, $token, $_purpose); |
@@ -56,7 +55,7 @@ discard block |
||
| 56 | 55 | * @param string $_purpose =true optional purpose string passed to token method |
| 57 | 56 | * @param boolean $_delete_token =true true if token should be deleted after validation, it will validate no second time |
| 58 | 57 | */ |
| 59 | - public static function validate($_token, $_purpose=true, $_delete_token=true) |
|
| 58 | + public static function validate($_token, $_purpose = true, $_delete_token = true) |
|
| 60 | 59 | { |
| 61 | 60 | $stored_purpose = Cache::getSession(__CLASS__, $_token); |
| 62 | 61 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @param string $defaultDomain =null |
| 81 | 81 | */ |
| 82 | - function __construct($defaultDomain=null) |
|
| 82 | + function __construct($defaultDomain = null) |
|
| 83 | 83 | { |
| 84 | 84 | $this->defaultDomain = $defaultDomain ? $defaultDomain : $GLOBALS['egw_info']['server']['mail_suffix']; |
| 85 | 85 | |
@@ -104,12 +104,10 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | function addAccount($_hookValues) |
| 106 | 106 | { |
| 107 | - $mailLocalAddress = $_hookValues['account_email'] ? $_hookValues['account_email'] : |
|
| 108 | - Api\Accounts::email($_hookValues['account_firstname'], |
|
| 109 | - $_hookValues['account_lastname'],$_hookValues['account_lid'],$this->defaultDomain); |
|
| 107 | + $mailLocalAddress = $_hookValues['account_email'] ? $_hookValues['account_email'] : Api\Accounts::email($_hookValues['account_firstname'], |
|
| 108 | + $_hookValues['account_lastname'], $_hookValues['account_lid'], $this->defaultDomain); |
|
| 110 | 109 | |
| 111 | - $account_id = !empty($_hookValues['account_id']) ? $_hookValues['account_id'] : |
|
| 112 | - $this->accounts->name2id($_hookValues['account_lid'], 'account_lid', 'u'); |
|
| 110 | + $account_id = !empty($_hookValues['account_id']) ? $_hookValues['account_id'] : $this->accounts->name2id($_hookValues['account_lid'], 'account_lid', 'u'); |
|
| 113 | 111 | |
| 114 | 112 | if ($this->accounts->exists($account_id) != 1) |
| 115 | 113 | { |
@@ -126,7 +124,7 @@ discard block |
||
| 126 | 124 | */ |
| 127 | 125 | function deleteAccount($_hookValues) |
| 128 | 126 | { |
| 129 | - unset($_hookValues); // not used, but required by function signature |
|
| 127 | + unset($_hookValues); // not used, but required by function signature |
|
| 130 | 128 | |
| 131 | 129 | return true; |
| 132 | 130 | } |
@@ -139,12 +137,12 @@ discard block |
||
| 139 | 137 | */ |
| 140 | 138 | function getAccountEmailAddress($_accountName) |
| 141 | 139 | { |
| 142 | - $emailAddresses = array(); |
|
| 140 | + $emailAddresses = array(); |
|
| 143 | 141 | |
| 144 | 142 | if (($account_id = $this->accounts->name2id($_accountName, 'account_lid', 'u'))) |
| 145 | 143 | { |
| 146 | - $realName = trim($GLOBALS['egw_info']['user']['account_firstname'] . (!empty($GLOBALS['egw_info']['user']['account_firstname']) ? ' ' : '') . $GLOBALS['egw_info']['user']['account_lastname']); |
|
| 147 | - $emailAddresses[] = array ( |
|
| 144 | + $realName = trim($GLOBALS['egw_info']['user']['account_firstname'].(!empty($GLOBALS['egw_info']['user']['account_firstname']) ? ' ' : '').$GLOBALS['egw_info']['user']['account_lastname']); |
|
| 145 | + $emailAddresses[] = array( |
|
| 148 | 146 | 'name' => $realName, |
| 149 | 147 | 'address' => $this->accounts->id2name($account_id, 'account_email'), |
| 150 | 148 | 'type' => 'default', |
@@ -161,9 +159,9 @@ discard block |
||
| 161 | 159 | * @return array with values for keys 'mailLocalAddress', 'mailAlternateAddress' (array), 'mailForwardingAddress' (array), |
| 162 | 160 | * 'accountStatus' ("active"), 'quotaLimit' and 'deliveryMode' ("forwardOnly") |
| 163 | 161 | */ |
| 164 | - function getUserData($user, $match_uid_at_domain=false) |
|
| 162 | + function getUserData($user, $match_uid_at_domain = false) |
|
| 165 | 163 | { |
| 166 | - unset($user, $match_uid_at_domain); // not used, but required by function signature |
|
| 164 | + unset($user, $match_uid_at_domain); // not used, but required by function signature |
|
| 167 | 165 | |
| 168 | 166 | $userData = array(); |
| 169 | 167 | |
@@ -201,9 +199,9 @@ discard block |
||
| 201 | 199 | * @return boolean true on success, false on error writing to ldap |
| 202 | 200 | */ |
| 203 | 201 | function setUserData($_uidnumber, array $_mailAlternateAddress, array $_mailForwardingAddress, $_deliveryMode, |
| 204 | - $_accountStatus, $_mailLocalAddress, $_quota, $_forwarding_only=false, $_setMailbox=null) |
|
| 202 | + $_accountStatus, $_mailLocalAddress, $_quota, $_forwarding_only = false, $_setMailbox = null) |
|
| 205 | 203 | { |
| 206 | - unset($_uidnumber, $_mailAlternateAddress, $_mailForwardingAddress, // not used, but require by function signature |
|
| 204 | + unset($_uidnumber, $_mailAlternateAddress, $_mailForwardingAddress, // not used, but require by function signature |
|
| 207 | 205 | $_deliveryMode, $_accountStatus, $_mailLocalAddress, $_quota, $_forwarding_only, $_setMailbox); |
| 208 | 206 | |
| 209 | 207 | return true; |
@@ -217,7 +215,7 @@ discard block |
||
| 217 | 215 | */ |
| 218 | 216 | function updateAccount($_hookValues) |
| 219 | 217 | { |
| 220 | - unset($_hookValues); // not used, but required by function signature |
|
| 218 | + unset($_hookValues); // not used, but required by function signature |
|
| 221 | 219 | |
| 222 | 220 | return true; |
| 223 | 221 | } |
@@ -233,15 +231,15 @@ discard block |
||
| 233 | 231 | * default use $this->loginType |
| 234 | 232 | * @return string |
| 235 | 233 | */ |
| 236 | - /*static*/ public function mailbox_addr($account,$domain=null,$mail_login_type=null) |
|
| 234 | + /*static*/ public function mailbox_addr($account, $domain = null, $mail_login_type = null) |
|
| 237 | 235 | { |
| 238 | 236 | if (is_null($domain)) $domain = $this->defaultDomain; |
| 239 | 237 | if (is_null($mail_login_type)) $mail_login_type = $this->loginType; |
| 240 | 238 | |
| 241 | - switch($mail_login_type) |
|
| 239 | + switch ($mail_login_type) |
|
| 242 | 240 | { |
| 243 | 241 | case 'email': |
| 244 | - $mbox = is_array($account) ? $account['account_email'] : $GLOBALS['egw']->accounts->id2name($account,'account_email'); |
|
| 242 | + $mbox = is_array($account) ? $account['account_email'] : $GLOBALS['egw']->accounts->id2name($account, 'account_email'); |
|
| 245 | 243 | break; |
| 246 | 244 | |
| 247 | 245 | case 'uidNumber': |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | function deleteAccount($_hookValues) |
| 63 | 63 | { |
| 64 | 64 | // some precausion to really delete just _one_ account |
| 65 | - if (strpos($_hookValues['account_lid'],'%') !== false || |
|
| 66 | - strpos($_hookValues['account_lid'],'*') !== false) |
|
| 65 | + if (strpos($_hookValues['account_lid'], '%') !== false || |
|
| 66 | + strpos($_hookValues['account_lid'], '*') !== false) |
|
| 67 | 67 | { |
| 68 | 68 | return false; |
| 69 | 69 | } |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | * @return string $username='%' username containing wildcards, default '%' for all users of a domain |
| 79 | 79 | * @return int|boolean number of deleted mailboxes on success or false on error |
| 80 | 80 | */ |
| 81 | - function deleteUsers($username='%') |
|
| 81 | + function deleteUsers($username = '%') |
|
| 82 | 82 | { |
| 83 | - if(!$this->acc_imap_administration || empty($username)) |
|
| 83 | + if (!$this->acc_imap_administration || empty($username)) |
|
| 84 | 84 | { |
| 85 | 85 | return false; |
| 86 | 86 | } |
@@ -94,14 +94,14 @@ discard block |
||
| 94 | 94 | $mboxes = (array)$this->getMailboxes($mailboxName, 1); |
| 95 | 95 | //error_log(__METHOD__."('$username') getMailboxes('$reference','$username$restriction') = ".array2string($mboxes)); |
| 96 | 96 | |
| 97 | - foreach(array_keys($mboxes) as $mbox) |
|
| 97 | + foreach (array_keys($mboxes) as $mbox) |
|
| 98 | 98 | { |
| 99 | 99 | // give the admin account the rights to delete this mailbox |
| 100 | 100 | $this->setACL($mbox, $this->acc_imap_admin_username, array('rights' => 'aeiklprstwx')); |
| 101 | 101 | $this->deleteMailbox($mbox); |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | - catch(Horde_Imap_Client_Exception $e) { |
|
| 104 | + catch (Horde_Imap_Client_Exception $e) { |
|
| 105 | 105 | _egw_log_exception($e); |
| 106 | 106 | $this->disconnect(); |
| 107 | 107 | return false; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | if ($_username !== $GLOBALS['egw_info']['user']['account_lid']) $this->adminConnection(); |
| 125 | 125 | $userData = array(); |
| 126 | 126 | |
| 127 | - if(($quota = $this->getQuotaByUser($_username,'ALL'))) |
|
| 127 | + if (($quota = $this->getQuotaByUser($_username, 'ALL'))) |
|
| 128 | 128 | { |
| 129 | 129 | $userData['quotaLimit'] = (int)($quota['limit'] / 1024); |
| 130 | 130 | $userData['quotaUsed'] = (int)($quota['usage'] / 1024); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | function setUserData($_username, $_quota) |
| 147 | 147 | { |
| 148 | - if(!$this->acc_imap_administration) |
|
| 148 | + if (!$this->acc_imap_administration) |
|
| 149 | 149 | { |
| 150 | 150 | return false; |
| 151 | 151 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | $mailboxName = $this->getUserMailboxString($_username); |
| 157 | 157 | |
| 158 | - $this->setQuota($mailboxName, array('STORAGE' => (int)$_quota > 0 ? (int)$_quota*1024 : -1)); |
|
| 158 | + $this->setQuota($mailboxName, array('STORAGE' => (int)$_quota > 0 ? (int)$_quota * 1024 : -1)); |
|
| 159 | 159 | |
| 160 | 160 | $this->disconnect(); |
| 161 | 161 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | function updateAccount($_hookValues) |
| 171 | 171 | { |
| 172 | - if(!$this->acc_imap_administration) |
|
| 172 | + if (!$this->acc_imap_administration) |
|
| 173 | 173 | { |
| 174 | 174 | return false; |
| 175 | 175 | } |
@@ -182,14 +182,14 @@ discard block |
||
| 182 | 182 | // make sure we use the correct username here. |
| 183 | 183 | $username = $this->getMailBoxUserName($_hookValues['account_lid']); |
| 184 | 184 | $folderInfo = $this->getMailboxes('', $mailboxName, true); |
| 185 | - if(empty($folderInfo)) |
|
| 185 | + if (empty($folderInfo)) |
|
| 186 | 186 | { |
| 187 | 187 | try { |
| 188 | 188 | $this->createMailbox($mailboxName); |
| 189 | 189 | $this->setACL($mailboxName, $username, array('rights' => 'aeiklprstwx')); |
| 190 | 190 | // create defined folders and subscribe them (have to use user-credentials to subscribe!) |
| 191 | 191 | $userimap = null; |
| 192 | - foreach($this->params as $name => $value) |
|
| 192 | + foreach ($this->params as $name => $value) |
|
| 193 | 193 | { |
| 194 | 194 | if (substr($name, 0, 11) == 'acc_folder_' && !empty($value)) |
| 195 | 195 | { |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | if (isset($userimap)) $userimap->logout(); |
| 208 | 208 | } |
| 209 | - catch(Horde_Imap_Client_Exception $e) { |
|
| 209 | + catch (Horde_Imap_Client_Exception $e) { |
|
| 210 | 210 | _egw_log_exception($e); |
| 211 | 211 | } |
| 212 | 212 | } |
@@ -220,9 +220,9 @@ discard block |
||
| 220 | 220 | * @param array $params |
| 221 | 221 | * @throws Exception |
| 222 | 222 | */ |
| 223 | - public function __call($name,array $params=null) |
|
| 223 | + public function __call($name, array $params = null) |
|
| 224 | 224 | { |
| 225 | - switch($name) |
|
| 225 | + switch ($name) |
|
| 226 | 226 | { |
| 227 | 227 | case 'setRules': // call setRules with 3. param of true, to enable utf7imap fileinto for Cyrus |
| 228 | 228 | $params += array(null, null, true); |
@@ -47,16 +47,16 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $ds = Ldap::factory(); |
| 49 | 49 | |
| 50 | - if(!is_resource($ds)) { |
|
| 50 | + if (!is_resource($ds)) { |
|
| 51 | 51 | return false; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $filter = '(&(objectclass=posixaccount)(uid='. $_username .')(dbmailGID='. sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])) .'))'; |
|
| 54 | + $filter = '(&(objectclass=posixaccount)(uid='.$_username.')(dbmailGID='.sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])).'))'; |
|
| 55 | 55 | $justthese = array('dn', 'objectclass', 'mailQuota'); |
| 56 | - if(($sri = ldap_search($ds, $GLOBALS['egw_info']['server']['ldap_context'], $filter, $justthese))) { |
|
| 56 | + if (($sri = ldap_search($ds, $GLOBALS['egw_info']['server']['ldap_context'], $filter, $justthese))) { |
|
| 57 | 57 | |
| 58 | - if(($info = ldap_get_entries($ds, $sri))) { |
|
| 59 | - if(isset($info[0]['mailquota'][0])) { |
|
| 58 | + if (($info = ldap_get_entries($ds, $sri))) { |
|
| 59 | + if (isset($info[0]['mailquota'][0])) { |
|
| 60 | 60 | $userData['quotaLimit'] = $info[0]['mailquota'][0] / 1048576; |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -66,40 +66,40 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | function updateAccount($_hookValues) |
| 68 | 68 | { |
| 69 | - if(!$uidnumber = (int)$_hookValues['account_id']) { |
|
| 69 | + if (!$uidnumber = (int)$_hookValues['account_id']) { |
|
| 70 | 70 | return false; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $ds = Ldap::factory(); |
| 74 | 74 | |
| 75 | - if(!is_resource($ds)) { |
|
| 75 | + if (!is_resource($ds)) { |
|
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - $filter = '(&(objectclass=posixaccount)(uidnumber='. $uidnumber .'))'; |
|
| 80 | - $justthese = array('dn', 'objectclass', 'dbmailUID', 'dbmailGID', 'mail'); |
|
| 79 | + $filter = '(&(objectclass=posixaccount)(uidnumber='.$uidnumber.'))'; |
|
| 80 | + $justthese = array('dn', 'objectclass', 'dbmailUID', 'dbmailGID', 'mail'); |
|
| 81 | 81 | $sri = ldap_search($ds, $GLOBALS['egw_info']['server']['ldap_context'], $filter, $justthese); |
| 82 | 82 | |
| 83 | - if(($info = ldap_get_entries($ds, $sri))) { |
|
| 84 | - if((!in_array('dbmailuser',$info[0]['objectclass']) && !in_array('dbmailUser',$info[0]['objectclass'])) && $info[0]['mail']) { |
|
| 83 | + if (($info = ldap_get_entries($ds, $sri))) { |
|
| 84 | + if ((!in_array('dbmailuser', $info[0]['objectclass']) && !in_array('dbmailUser', $info[0]['objectclass'])) && $info[0]['mail']) { |
|
| 85 | 85 | $newData['objectclass'] = $info[0]['objectclass']; |
| 86 | 86 | unset($newData['objectclass']['count']); |
| 87 | 87 | $newData['objectclass'][] = 'dbmailuser'; |
| 88 | 88 | sort($newData['objectclass']); |
| 89 | 89 | $newData['dbmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
| 90 | - $newData['dbmailUID'] = (!empty($this->domainName)) ? $_hookValues['account_lid'] .'@'. $this->domainName : $_hookValues['account_lid']; |
|
| 90 | + $newData['dbmailUID'] = (!empty($this->domainName)) ? $_hookValues['account_lid'].'@'.$this->domainName : $_hookValues['account_lid']; |
|
| 91 | 91 | |
| 92 | - if(!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 92 | + if (!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 93 | 93 | #print ldap_error($ds); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | return true; |
| 97 | 97 | } else { |
| 98 | 98 | $newData = array(); |
| 99 | - $newData['dbmailUID'] = (!empty($this->domainName)) ? $_hookValues['account_lid'] .'@'. $this->domainName : $_hookValues['account_lid']; |
|
| 99 | + $newData['dbmailUID'] = (!empty($this->domainName)) ? $_hookValues['account_lid'].'@'.$this->domainName : $_hookValues['account_lid']; |
|
| 100 | 100 | $newData['dbmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
| 101 | 101 | |
| 102 | - if(!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 102 | + if (!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 103 | 103 | print ldap_error($ds); |
| 104 | 104 | _debug_array($newData); |
| 105 | 105 | exit; |
@@ -115,63 +115,63 @@ discard block |
||
| 115 | 115 | { |
| 116 | 116 | $ds = Ldap::factory(); |
| 117 | 117 | |
| 118 | - if(!is_resource($ds)) { |
|
| 118 | + if (!is_resource($ds)) { |
|
| 119 | 119 | return false; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - $filter = '(&(objectclass=posixaccount)(uid='. $_username .'))'; |
|
| 123 | - $justthese = array('dn', 'objectclass', 'dbmailGID', 'dbmailUID', 'mail'); |
|
| 122 | + $filter = '(&(objectclass=posixaccount)(uid='.$_username.'))'; |
|
| 123 | + $justthese = array('dn', 'objectclass', 'dbmailGID', 'dbmailUID', 'mail'); |
|
| 124 | 124 | $sri = ldap_search($ds, $GLOBALS['egw_info']['server']['ldap_context'], $filter, $justthese); |
| 125 | 125 | |
| 126 | - if(($info = ldap_get_entries($ds, $sri))) { |
|
| 126 | + if (($info = ldap_get_entries($ds, $sri))) { |
|
| 127 | 127 | $validLDAPConfig = false; |
| 128 | - if(in_array('dbmailuser',$info[0]['objectclass']) || in_array('dbmailUser',$info[0]['objectclass'])) { |
|
| 128 | + if (in_array('dbmailuser', $info[0]['objectclass']) || in_array('dbmailUser', $info[0]['objectclass'])) { |
|
| 129 | 129 | $validLDAPConfig = true; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - if(!in_array('dbmailuser',$info[0]['objectclass']) && !in_array('dbmailUser',$info[0]['objectclass']) && $info[0]['mail']) { |
|
| 132 | + if (!in_array('dbmailuser', $info[0]['objectclass']) && !in_array('dbmailUser', $info[0]['objectclass']) && $info[0]['mail']) { |
|
| 133 | 133 | $newData['objectclass'] = $info[0]['objectclass']; |
| 134 | 134 | unset($newData['objectclass']['count']); |
| 135 | 135 | $newData['objectclass'][] = 'dbmailUser'; |
| 136 | 136 | sort($newData['objectclass']); |
| 137 | 137 | $newData['dbmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
| 138 | - $newData['dbmailUID'] = (!empty($this->domainName)) ? $_username .'@'. $this->domainName : $_username; |
|
| 138 | + $newData['dbmailUID'] = (!empty($this->domainName)) ? $_username.'@'.$this->domainName : $_username; |
|
| 139 | 139 | |
| 140 | - if(ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 140 | + if (ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 141 | 141 | $validLDAPConfig = true; |
| 142 | 142 | } |
| 143 | 143 | } else { |
| 144 | - if ((in_array('dbmailuser',$info[0]['objectclass']) || in_array('dbmailUser',$info[0]['objectclass'])) && !$info[0]['dbmailuid']) { |
|
| 144 | + if ((in_array('dbmailuser', $info[0]['objectclass']) || in_array('dbmailUser', $info[0]['objectclass'])) && !$info[0]['dbmailuid']) { |
|
| 145 | 145 | $newData = array(); |
| 146 | - $newData['dbmailUID'] = (!empty($this->domainName)) ? $_username .'@'. $this->domainName : $_username; |
|
| 146 | + $newData['dbmailUID'] = (!empty($this->domainName)) ? $_username.'@'.$this->domainName : $_username; |
|
| 147 | 147 | |
| 148 | - if(!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 148 | + if (!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 149 | 149 | #print ldap_error($ds); |
| 150 | 150 | #return false; |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - if ((in_array('dbmailuser',$info[0]['objectclass']) || in_array('dbmailUser',$info[0]['objectclass'])) && !$info[0]['dbmailgid']) { |
|
| 154 | + if ((in_array('dbmailuser', $info[0]['objectclass']) || in_array('dbmailUser', $info[0]['objectclass'])) && !$info[0]['dbmailgid']) { |
|
| 155 | 155 | $newData = array(); |
| 156 | - $newData['dbmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
|
| 156 | + $newData['dbmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
|
| 157 | 157 | |
| 158 | - if(!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 158 | + if (!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 159 | 159 | #print ldap_error($ds); |
| 160 | 160 | #return false; |
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if($validLDAPConfig) { |
|
| 165 | + if ($validLDAPConfig) { |
|
| 166 | 166 | $newData = array(); |
| 167 | 167 | |
| 168 | - if((int)$_quota >= 0) { |
|
| 168 | + if ((int)$_quota >= 0) { |
|
| 169 | 169 | $newData['mailQuota'] = (int)$_quota * 1048576; |
| 170 | 170 | } else { |
| 171 | 171 | $newData['mailQuota'] = array(); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - if(!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 174 | + if (!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 175 | 175 | #print ldap_error($ds); |
| 176 | 176 | return false; |
| 177 | 177 | } |
@@ -47,16 +47,16 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $ds = Ldap::factory(); |
| 49 | 49 | |
| 50 | - if(!is_resource($ds)) { |
|
| 50 | + if (!is_resource($ds)) { |
|
| 51 | 51 | return false; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $filter = '(&(objectclass=posixaccount)(uid='. $_username .')(qmailGID='. sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])) .'))'; |
|
| 54 | + $filter = '(&(objectclass=posixaccount)(uid='.$_username.')(qmailGID='.sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])).'))'; |
|
| 55 | 55 | $justthese = array('dn', 'objectclass', 'mailQuota'); |
| 56 | - if(($sri = ldap_search($ds, $GLOBALS['egw_info']['server']['ldap_context'], $filter, $justthese))) { |
|
| 56 | + if (($sri = ldap_search($ds, $GLOBALS['egw_info']['server']['ldap_context'], $filter, $justthese))) { |
|
| 57 | 57 | |
| 58 | - if(($info = ldap_get_entries($ds, $sri))) { |
|
| 59 | - if(isset($info[0]['mailquota'][0])) { |
|
| 58 | + if (($info = ldap_get_entries($ds, $sri))) { |
|
| 59 | + if (isset($info[0]['mailquota'][0])) { |
|
| 60 | 60 | $userData['quotaLimit'] = $info[0]['mailquota'][0] / 1048576; |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -65,27 +65,27 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | function updateAccount($_hookValues) { |
| 68 | - if(!$uidnumber = (int)$_hookValues['account_id']) { |
|
| 68 | + if (!$uidnumber = (int)$_hookValues['account_id']) { |
|
| 69 | 69 | return false; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | $ds = Ldap::factory(); |
| 73 | 73 | |
| 74 | - if(!is_resource($ds)) { |
|
| 74 | + if (!is_resource($ds)) { |
|
| 75 | 75 | return false; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - $filter = '(&(objectclass=posixaccount)(uidnumber='. $uidnumber .'))'; |
|
| 79 | - $justthese = array('dn', 'objectclass', 'qmailUID', 'qmailGID', 'mail'); |
|
| 78 | + $filter = '(&(objectclass=posixaccount)(uidnumber='.$uidnumber.'))'; |
|
| 79 | + $justthese = array('dn', 'objectclass', 'qmailUID', 'qmailGID', 'mail'); |
|
| 80 | 80 | $sri = ldap_search($ds, $GLOBALS['egw_info']['server']['ldap_context'], $filter, $justthese); |
| 81 | 81 | |
| 82 | - if(($info = ldap_get_entries($ds, $sri))) { |
|
| 83 | - if(!in_array('qmailuser',$info[0]['objectclass']) && $info[0]['email']) { |
|
| 82 | + if (($info = ldap_get_entries($ds, $sri))) { |
|
| 83 | + if (!in_array('qmailuser', $info[0]['objectclass']) && $info[0]['email']) { |
|
| 84 | 84 | $newData['objectclass'] = $info[0]['objectclass']; |
| 85 | 85 | unset($newData['objectclass']['count']); |
| 86 | 86 | $newData['objectclass'][] = 'qmailuser'; |
| 87 | 87 | sort($newData['objectclass']); |
| 88 | - $newData['qmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
|
| 88 | + $newData['qmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
|
| 89 | 89 | #$newData['qmailUID'] = (!empty($this->domainName)) ? $_username .'@'. $this->domainName : $_username; |
| 90 | 90 | |
| 91 | 91 | ldap_modify($ds, $info[0]['dn'], $newData); |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | return true; |
| 94 | 94 | } else { |
| 95 | 95 | $newData = array(); |
| 96 | - $newData['qmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
|
| 96 | + $newData['qmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
|
| 97 | 97 | #$newData['qmailUID'] = (!empty($this->domainName)) ? $_username .'@'. $this->domainName : $_username; |
| 98 | 98 | |
| 99 | - if(!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 99 | + if (!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 100 | 100 | #print ldap_error($ds); |
| 101 | 101 | #return false; |
| 102 | 102 | } |
@@ -109,30 +109,30 @@ discard block |
||
| 109 | 109 | function setUserData($_username, $_quota) { |
| 110 | 110 | $ds = Ldap::factory(); |
| 111 | 111 | |
| 112 | - if(!is_resource($ds)) { |
|
| 112 | + if (!is_resource($ds)) { |
|
| 113 | 113 | return false; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - $filter = '(&(objectclass=posixaccount)(uid='. $_username .'))'; |
|
| 117 | - $justthese = array('dn', 'objectclass', 'qmailGID', 'mail'); |
|
| 116 | + $filter = '(&(objectclass=posixaccount)(uid='.$_username.'))'; |
|
| 117 | + $justthese = array('dn', 'objectclass', 'qmailGID', 'mail'); |
|
| 118 | 118 | $sri = ldap_search($ds, $GLOBALS['egw_info']['server']['ldap_context'], $filter, $justthese); |
| 119 | 119 | |
| 120 | - if(($info = ldap_get_entries($ds, $sri))) { |
|
| 120 | + if (($info = ldap_get_entries($ds, $sri))) { |
|
| 121 | 121 | #_debug_array($info); |
| 122 | - if(!in_array('qmailuser',$info[0]['objectclass']) && $info[0]['email']) { |
|
| 122 | + if (!in_array('qmailuser', $info[0]['objectclass']) && $info[0]['email']) { |
|
| 123 | 123 | $newData['objectclass'] = $info[0]['objectclass']; |
| 124 | 124 | unset($newData['objectclass']['count']); |
| 125 | 125 | $newData['objectclass'][] = 'qmailuser'; |
| 126 | 126 | sort($newData['objectclass']); |
| 127 | - $newData['qmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
|
| 127 | + $newData['qmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
|
| 128 | 128 | |
| 129 | 129 | ldap_modify($ds, $info[0]['dn'], $newData); |
| 130 | 130 | } else { |
| 131 | - if (in_array('qmailuser',$info[0]['objectclass']) && !$info[0]['qmailgid']) { |
|
| 131 | + if (in_array('qmailuser', $info[0]['objectclass']) && !$info[0]['qmailgid']) { |
|
| 132 | 132 | $newData = array(); |
| 133 | - $newData['qmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
|
| 133 | + $newData['qmailGID'] = sprintf("%u", crc32($GLOBALS['egw_info']['server']['install_id'])); |
|
| 134 | 134 | |
| 135 | - if(!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 135 | + if (!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 136 | 136 | #print ldap_error($ds); |
| 137 | 137 | #return false; |
| 138 | 138 | } |
@@ -141,13 +141,13 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | $newData = array(); |
| 143 | 143 | |
| 144 | - if((int)$_quota >= 0) { |
|
| 144 | + if ((int)$_quota >= 0) { |
|
| 145 | 145 | $newData['mailQuota'] = (int)$_quota * 1048576; |
| 146 | 146 | } else { |
| 147 | 147 | $newData['mailQuota'] = array(); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - if(!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 150 | + if (!ldap_modify($ds, $info[0]['dn'], $newData)) { |
|
| 151 | 151 | #print ldap_error($ds); |
| 152 | 152 | return false; |
| 153 | 153 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * |
| 57 | 57 | * @var string |
| 58 | 58 | */ |
| 59 | - var $user_home; // = '/var/dovecot/imap/%d/%u'; |
|
| 59 | + var $user_home; // = '/var/dovecot/imap/%d/%u'; |
|
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * Ensure we use an admin connection |
@@ -65,12 +65,12 @@ discard block |
||
| 65 | 65 | * |
| 66 | 66 | * @param string $_username =true create an admin connection for given user or $this->acc_imap_username |
| 67 | 67 | */ |
| 68 | - function adminConnection($_username=true) |
|
| 68 | + function adminConnection($_username = true) |
|
| 69 | 69 | { |
| 70 | 70 | // generate admin user name of $username |
| 71 | 71 | if (($pos = strpos($this->acc_imap_admin_username, '*')) !== false) // remove evtl. set username |
| 72 | 72 | { |
| 73 | - $this->params['acc_imap_admin_username'] = substr($this->acc_imap_admin_username, $pos+1); |
|
| 73 | + $this->params['acc_imap_admin_username'] = substr($this->acc_imap_admin_username, $pos + 1); |
|
| 74 | 74 | } |
| 75 | 75 | $this->params['acc_imap_admin_username'] = (is_string($_username) ? $_username : $this->acc_imap_username). |
| 76 | 76 | '*'.$this->acc_imap_admin_username; |
@@ -87,16 +87,16 @@ discard block |
||
| 87 | 87 | * @param string $_folderName ='' |
| 88 | 88 | * @return string utf-7 encoded (done in getMailboxName) |
| 89 | 89 | */ |
| 90 | - function getUserMailboxString($_username, $_folderName='') |
|
| 90 | + function getUserMailboxString($_username, $_folderName = '') |
|
| 91 | 91 | { |
| 92 | - unset($_username); // not used, but required by function signature |
|
| 92 | + unset($_username); // not used, but required by function signature |
|
| 93 | 93 | |
| 94 | 94 | $mailboxString = 'INBOX'; |
| 95 | 95 | |
| 96 | 96 | if (!empty($_folderName)) |
| 97 | 97 | { |
| 98 | 98 | $nameSpaces = $this->getNameSpaceArray(); |
| 99 | - $mailboxString .= $nameSpaces['others'][0]['delimiter'] . $_folderName; |
|
| 99 | + $mailboxString .= $nameSpaces['others'][0]['delimiter'].$_folderName; |
|
| 100 | 100 | } |
| 101 | 101 | return $mailboxString; |
| 102 | 102 | } |
@@ -119,8 +119,8 @@ discard block |
||
| 119 | 119 | function deleteAccount($_hookValues) |
| 120 | 120 | { |
| 121 | 121 | // some precausion to really delete just _one_ account |
| 122 | - if (strpos($_hookValues['account_lid'],'%') !== false || |
|
| 123 | - strpos($_hookValues['account_lid'],'*') !== false) |
|
| 122 | + if (strpos($_hookValues['account_lid'], '%') !== false || |
|
| 123 | + strpos($_hookValues['account_lid'], '*') !== false) |
|
| 124 | 124 | { |
| 125 | 125 | return false; |
| 126 | 126 | } |
@@ -135,9 +135,9 @@ discard block |
||
| 135 | 135 | * @return string $username='%' username containing wildcards, default '%' for all users of a domain |
| 136 | 136 | * @return int|boolean number of deleted mailboxes on success or false on error |
| 137 | 137 | */ |
| 138 | - function deleteUsers($username='%') |
|
| 138 | + function deleteUsers($username = '%') |
|
| 139 | 139 | { |
| 140 | - if(!$this->acc_imap_administration || empty($username)) |
|
| 140 | + if (!$this->acc_imap_administration || empty($username)) |
|
| 141 | 141 | { |
| 142 | 142 | return false; |
| 143 | 143 | } |
@@ -155,9 +155,9 @@ discard block |
||
| 155 | 155 | { |
| 156 | 156 | throw new Api\Exception\AssertionFailed("user_home='$this->user_home' contains no domain-part '%d'!"); |
| 157 | 157 | } |
| 158 | - $home = strtr(substr($this->user_home, 0, $pos+2), $replace); |
|
| 158 | + $home = strtr(substr($this->user_home, 0, $pos + 2), $replace); |
|
| 159 | 159 | |
| 160 | - $ret = count(scandir($home))-2; |
|
| 160 | + $ret = count(scandir($home)) - 2; |
|
| 161 | 161 | } |
| 162 | 162 | else |
| 163 | 163 | { |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | { |
| 184 | 184 | if (is_dir($path)) |
| 185 | 185 | { |
| 186 | - foreach(scandir($path) as $file) |
|
| 186 | + foreach (scandir($path) as $file) |
|
| 187 | 187 | { |
| 188 | 188 | if ($file == '.' || $file == '..') continue; |
| 189 | 189 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | return false; |
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | - elseif(!unlink($path)) |
|
| 204 | + elseif (!unlink($path)) |
|
| 205 | 205 | { |
| 206 | 206 | return false; |
| 207 | 207 | } |
@@ -235,10 +235,10 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | $userData = array(); |
| 237 | 237 | // we are authenticated with master but for current user |
| 238 | - if(($quota = $this->getStorageQuotaRoot('INBOX'))) |
|
| 238 | + if (($quota = $this->getStorageQuotaRoot('INBOX'))) |
|
| 239 | 239 | { |
| 240 | - $userData['quotaLimit'] = (int) ($quota['QMAX'] / 1024); |
|
| 241 | - $userData['quotaUsed'] = (int) ($quota['USED'] / 1024); |
|
| 240 | + $userData['quotaLimit'] = (int)($quota['QMAX'] / 1024); |
|
| 241 | + $userData['quotaUsed'] = (int)($quota['USED'] / 1024); |
|
| 242 | 242 | } |
| 243 | 243 | $this->username = $bufferUsername; |
| 244 | 244 | $this->loginName = $bufferLoginName; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | function setUserData($_username, $_quota) |
| 262 | 262 | { |
| 263 | - unset($_username); unset($_quota); // not used, but required by function signature |
|
| 263 | + unset($_username); unset($_quota); // not used, but required by function signature |
|
| 264 | 264 | |
| 265 | 265 | return true; |
| 266 | 266 | } |
@@ -272,9 +272,9 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | function updateAccount($_hookValues) |
| 274 | 274 | { |
| 275 | - unset($_hookValues); // not used, but required by function signature |
|
| 275 | + unset($_hookValues); // not used, but required by function signature |
|
| 276 | 276 | |
| 277 | - if(!$this->acc_imap_administration) |
|
| 277 | + if (!$this->acc_imap_administration) |
|
| 278 | 278 | { |
| 279 | 279 | return false; |
| 280 | 280 | } |
@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | namespace EGroupware\Api\Mail\Imap; |
| 15 | 15 | |
| 16 | 16 | define('IMAP_NAMESPACE_PERSONAL', 'personal'); |
| 17 | -define('IMAP_NAMESPACE_OTHERS' , 'others'); |
|
| 18 | -define('IMAP_NAMESPACE_SHARED' , 'shared'); |
|
| 19 | -define('IMAP_NAMESPACE_ALL' , 'all'); |
|
| 17 | +define('IMAP_NAMESPACE_OTHERS', 'others'); |
|
| 18 | +define('IMAP_NAMESPACE_SHARED', 'shared'); |
|
| 19 | +define('IMAP_NAMESPACE_ALL', 'all'); |
|
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * This class holds all information about the imap connection. |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | * @param string $_folderName='' |
| 88 | 88 | * @return string utf-7 encoded (done in getMailboxName) |
| 89 | 89 | */ |
| 90 | - function getUserMailboxString($_username, $_folderName=''); |
|
| 90 | + function getUserMailboxString($_username, $_folderName = ''); |
|
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | 93 | * get list of namespaces |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * @param string $_what - what to retrieve either QMAX, USED or ALL is supported |
| 104 | 104 | * @return mixed the quota for specified user (by what) or array with all available Quota Information, or false |
| 105 | 105 | */ |
| 106 | - function getQuotaByUser($_username, $_what='QMAX'); |
|
| 106 | + function getQuotaByUser($_username, $_what = 'QMAX'); |
|
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | 109 | * returns information about a user |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @param int $_timeout =null timeout in secs, if none given fmail pref or default of 20 is used |
| 123 | 123 | * @throws Exception on error |
| 124 | 124 | */ |
| 125 | - function openConnection($_adminConnection=false, $_timeout=null); |
|
| 125 | + function openConnection($_adminConnection = false, $_timeout = null); |
|
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * set userdata |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * @param string $_scriptName =null |
| 150 | 150 | * @return boolean |
| 151 | 151 | */ |
| 152 | - public function setVacationUser($_euser, array $_vacation, $_scriptName=null); |
|
| 152 | + public function setVacationUser($_euser, array $_vacation, $_scriptName = null); |
|
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | 155 | * Get vacation message for given user |
@@ -159,5 +159,5 @@ discard block |
||
| 159 | 159 | * @throws Exception on connection error or authentication failure |
| 160 | 160 | * @return array |
| 161 | 161 | */ |
| 162 | - public function getVacationUser($_euser, $_scriptName=null); |
|
| 162 | + public function getVacationUser($_euser, $_scriptName = null); |
|
| 163 | 163 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function get($key, $lifetime = 0) |
| 41 | 41 | { |
| 42 | - unset($lifetime); // not (yet) used, but required by function signature |
|
| 42 | + unset($lifetime); // not (yet) used, but required by function signature |
|
| 43 | 43 | |
| 44 | 44 | $ret = Api\Cache::getCache(self::LEVEL, 'mail', $key); |
| 45 | 45 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function exists($key, $lifetime = 0) |
| 73 | 73 | { |
| 74 | - unset($lifetime); // not (yet) used, but required by function signature |
|
| 74 | + unset($lifetime); // not (yet) used, but required by function signature |
|
| 75 | 75 | |
| 76 | 76 | return !is_null(Api\Cache::getCache(self::LEVEL, 'mail', $key)); |
| 77 | 77 | } |