changing discouraged operators
Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
This commit is contained in:
10
lib/imap.php
10
lib/imap.php
@@ -65,12 +65,12 @@ class OC_User_IMAP extends \OCA\user_external\Base {
|
|||||||
if(count($users) === 1) {
|
if(count($users) === 1) {
|
||||||
$username = $uid;
|
$username = $uid;
|
||||||
$uid = $users[0];
|
$uid = $users[0];
|
||||||
// Check if we only want logins from ONE domain and strip the domain part from UID
|
// Check if we only want logins from ONE domain and strip the domain part from UID
|
||||||
}elseif($this->domain != '') {
|
}elseif($this->domain !== '') {
|
||||||
$pieces = explode('@', $uid);
|
$pieces = explode('@', $uid);
|
||||||
if(count($pieces) == 1) {
|
if(count($pieces) === 1) {
|
||||||
$username = $uid . "@" . $this->domain;
|
$username = $uid . "@" . $this->domain;
|
||||||
}elseif((count($pieces) == 2) and ($pieces[1] == $this->domain)) {
|
}elseif((count($pieces) === 2) and ($pieces[1] === $this->domain)) {
|
||||||
$username = $uid;
|
$username = $uid;
|
||||||
$uid = $pieces[0];
|
$uid = $pieces[0];
|
||||||
}else{
|
}else{
|
||||||
@@ -79,7 +79,7 @@ class OC_User_IMAP extends \OCA\user_external\Base {
|
|||||||
}else{
|
}else{
|
||||||
$username = $uid;
|
$username = $uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mbox = @imap_open($this->mailbox, $username, $password, OP_HALFOPEN, 1);
|
$mbox = @imap_open($this->mailbox, $username, $password, OP_HALFOPEN, 1);
|
||||||
imap_errors();
|
imap_errors();
|
||||||
imap_alerts();
|
imap_alerts();
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class OC_User_SMB extends \OCA\user_external\Base{
|
|||||||
} else if (strpos($lastline, 'NT_STATUS_BAD_NETWORK_NAME') !== false) {
|
} else if (strpos($lastline, 'NT_STATUS_BAD_NETWORK_NAME') !== false) {
|
||||||
//login on minor error
|
//login on minor error
|
||||||
goto login;
|
goto login;
|
||||||
} else if ($retval != 0) {
|
} else if ($retval !== 0) {
|
||||||
//some other error
|
//some other error
|
||||||
OCP\Util::writeLog(
|
OCP\Util::writeLog(
|
||||||
'user_external', 'ERROR: smbclient error: ' . trim($lastline),
|
'user_external', 'ERROR: smbclient error: ' . trim($lastline),
|
||||||
@@ -91,4 +91,3 @@ class OC_User_SMB extends \OCA\user_external\Base{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class WebDavAuth extends Base {
|
|||||||
list($protocol, $path) = $arr;
|
list($protocol, $path) = $arr;
|
||||||
$url= $protocol.'://'.urlencode($uid).':'.urlencode($password).'@'.$path;
|
$url= $protocol.'://'.urlencode($uid).':'.urlencode($password).'@'.$path;
|
||||||
$headers = get_headers($url);
|
$headers = get_headers($url);
|
||||||
if($headers==false) {
|
if($headers === false) {
|
||||||
\OCP\Util::writeLog('OC_USER_WEBDAVAUTH', 'Not possible to connect to WebDAV Url: "'.$protocol.'://'.$path.'" ', 3);
|
\OCP\Util::writeLog('OC_USER_WEBDAVAUTH', 'Not possible to connect to WebDAV Url: "'.$protocol.'://'.$path.'" ', 3);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user