change deprecated logging method
Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
This commit is contained in:
@@ -46,9 +46,9 @@ class OC_User_FTP extends \OCA\user_external\Base{
|
|||||||
*/
|
*/
|
||||||
public function checkPassword($uid, $password) {
|
public function checkPassword($uid, $password) {
|
||||||
if (false === array_search($this->protocol, stream_get_wrappers())) {
|
if (false === array_search($this->protocol, stream_get_wrappers())) {
|
||||||
OCP\Util::writeLog(
|
OC::$server->getLogger()->error(
|
||||||
'user_external',
|
'ERROR: Stream wrapper not available: ' . $this->protocol,
|
||||||
'ERROR: Stream wrapper not available: ' . $this->protocol, OCP\Util::ERROR
|
['app' => 'user_external']
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class OC_User_IMAP extends \OCA\user_external\Base {
|
|||||||
*/
|
*/
|
||||||
public function checkPassword($uid, $password) {
|
public function checkPassword($uid, $password) {
|
||||||
if (!function_exists('imap_open')) {
|
if (!function_exists('imap_open')) {
|
||||||
OCP\Util::writeLog('user_external', 'ERROR: PHP imap extension is not installed', OCP\Util::ERROR);
|
OC::$server->getLogger()->error('ERROR: PHP imap extension is not installed', ['app' => 'user_external']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
lib/smb.php
12
lib/smb.php
@@ -42,9 +42,9 @@ class OC_User_SMB extends \OCA\user_external\Base{
|
|||||||
$command = self::SMBCLIENT.' '.escapeshellarg('//' . $this->host . '/dummy').' -U'.$uidEscaped.'%'.$password;
|
$command = self::SMBCLIENT.' '.escapeshellarg('//' . $this->host . '/dummy').' -U'.$uidEscaped.'%'.$password;
|
||||||
$lastline = exec($command, $output, $retval);
|
$lastline = exec($command, $output, $retval);
|
||||||
if ($retval === 127) {
|
if ($retval === 127) {
|
||||||
OCP\Util::writeLog(
|
OC::$server->getLogger()->error(
|
||||||
'user_external', 'ERROR: smbclient executable missing',
|
'ERROR: smbclient executable missing',
|
||||||
OCP\Util::ERROR
|
['app' => 'user_external']
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
} else if (strpos($lastline, self::LOGINERROR) !== false) {
|
} else if (strpos($lastline, self::LOGINERROR) !== false) {
|
||||||
@@ -55,9 +55,9 @@ class OC_User_SMB extends \OCA\user_external\Base{
|
|||||||
goto login;
|
goto login;
|
||||||
} else if ($retval !== 0) {
|
} else if ($retval !== 0) {
|
||||||
//some other error
|
//some other error
|
||||||
OCP\Util::writeLog(
|
OC::$server->getLogger()->error(
|
||||||
'user_external', 'ERROR: smbclient error: ' . trim($lastline),
|
'ERROR: smbclient error: ' . trim($lastline),
|
||||||
OCP\Util::ERROR
|
['app' => 'user_external']
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -28,14 +28,14 @@ class WebDavAuth extends Base {
|
|||||||
public function checkPassword($uid, $password) {
|
public function checkPassword($uid, $password) {
|
||||||
$arr = explode('://', $this->webDavAuthUrl, 2);
|
$arr = explode('://', $this->webDavAuthUrl, 2);
|
||||||
if( ! isset($arr) OR count($arr) !== 2) {
|
if( ! isset($arr) OR count($arr) !== 2) {
|
||||||
\OCP\Util::writeLog('OC_USER_WEBDAVAUTH', 'Invalid Url: "'.$this->webDavAuthUrl.'" ', 3);
|
OC::$server->getLogger()->error('ERROR: Invalid WebdavUrl: "'.$this->webDavAuthUrl.'" ', ['app' => 'user_external']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
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);
|
OC::$server->getLogger()->error('ERROR: Not possible to connect to WebDAV Url: "'.$protocol.'://'.$path.'" ', ['app' => 'user_external']);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user