change deprecated logging method

Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
This commit is contained in:
Jonas Sulzer
2018-12-27 13:02:49 +01:00
parent a67e3e08e0
commit db5ab31ee4
4 changed files with 12 additions and 12 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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 {

View File

@@ -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;
}