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) {
|
||||
if (false === array_search($this->protocol, stream_get_wrappers())) {
|
||||
OCP\Util::writeLog(
|
||||
'user_external',
|
||||
'ERROR: Stream wrapper not available: ' . $this->protocol, OCP\Util::ERROR
|
||||
OC::$server->getLogger()->error(
|
||||
'ERROR: Stream wrapper not available: ' . $this->protocol,
|
||||
['app' => 'user_external']
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class OC_User_IMAP extends \OCA\user_external\Base {
|
||||
*/
|
||||
public function checkPassword($uid, $password) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
$lastline = exec($command, $output, $retval);
|
||||
if ($retval === 127) {
|
||||
OCP\Util::writeLog(
|
||||
'user_external', 'ERROR: smbclient executable missing',
|
||||
OCP\Util::ERROR
|
||||
OC::$server->getLogger()->error(
|
||||
'ERROR: smbclient executable missing',
|
||||
['app' => 'user_external']
|
||||
);
|
||||
return false;
|
||||
} else if (strpos($lastline, self::LOGINERROR) !== false) {
|
||||
@@ -55,9 +55,9 @@ class OC_User_SMB extends \OCA\user_external\Base{
|
||||
goto login;
|
||||
} else if ($retval !== 0) {
|
||||
//some other error
|
||||
OCP\Util::writeLog(
|
||||
'user_external', 'ERROR: smbclient error: ' . trim($lastline),
|
||||
OCP\Util::ERROR
|
||||
OC::$server->getLogger()->error(
|
||||
'ERROR: smbclient error: ' . trim($lastline),
|
||||
['app' => 'user_external']
|
||||
);
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -28,14 +28,14 @@ class WebDavAuth extends Base {
|
||||
public function checkPassword($uid, $password) {
|
||||
$arr = explode('://', $this->webDavAuthUrl, 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;
|
||||
}
|
||||
list($protocol, $path) = $arr;
|
||||
$url= $protocol.'://'.urlencode($uid).':'.urlencode($password).'@'.$path;
|
||||
$headers = get_headers($url);
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user