constants belong to Util in 13

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2018-07-02 12:51:51 +02:00
parent 56aaa40dde
commit ea62d7a9f5
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
1 changed files with 9 additions and 8 deletions

View File

@ -39,6 +39,7 @@ use OCP\Image;
use OCP\IUser;
use OCP\IUserManager;
use OCP\Notification\IManager as INotificationManager;
use OCP\Util;
/**
* User
@ -144,7 +145,7 @@ class User {
$this->userManager = $userManager;
$this->notificationManager = $notificationManager;
\OCP\Util::connectHook('OC_User', 'post_login', $this, 'handlePasswordExpiry');
Util::connectHook('OC_User', 'post_login', $this, 'handlePasswordExpiry');
}
/**
@ -252,7 +253,7 @@ class User {
// system must be postponed after the login. It is to ensure
// external mounts are mounted properly (e.g. with login
// credentials from the session).
\OCP\Util::connectHook('OC_User', 'post_login', $this, 'updateAvatarPostLogin');
Util::connectHook('OC_User', 'post_login', $this, 'updateAvatarPostLogin');
break;
}
}
@ -510,19 +511,19 @@ class User {
if($aQuota && (count($aQuota) > 0) && $this->verifyQuotaValue($aQuota[0])) {
$quota = $aQuota[0];
} else if(is_array($aQuota) && isset($aQuota[0])) {
$this->log->log('no suitable LDAP quota found for user ' . $this->uid . ': [' . $aQuota[0] . ']', \OCP\Util::DEBUG);
$this->log->log('no suitable LDAP quota found for user ' . $this->uid . ': [' . $aQuota[0] . ']', Util::DEBUG);
}
} else if ($this->verifyQuotaValue($valueFromLDAP)) {
$quota = $valueFromLDAP;
} else {
$this->log->log('no suitable LDAP quota found for user ' . $this->uid . ': [' . $valueFromLDAP . ']', \OCP\Util::DEBUG);
$this->log->log('no suitable LDAP quota found for user ' . $this->uid . ': [' . $valueFromLDAP . ']', Util::DEBUG);
}
if ($quota === false && $this->verifyQuotaValue($defaultQuota)) {
// quota not found using the LDAP attribute (or not parseable). Try the default quota
$quota = $defaultQuota;
} else if($quota === false) {
$this->log->log('no suitable default quota found for user ' . $this->uid . ': [' . $defaultQuota . ']', ILogger::DEBUG);
$this->log->log('no suitable default quota found for user ' . $this->uid . ': [' . $defaultQuota . ']', Util::DEBUG);
return;
}
@ -530,7 +531,7 @@ class User {
if ($targetUser instanceof IUser) {
$targetUser->setQuota($quota);
} else {
$this->log->log('trying to set a quota for user ' . $this->uid . ' but the user is missing', \OCP\Util::INFO);
$this->log->log('trying to set a quota for user ' . $this->uid . ' but the user is missing', Util::INFO);
}
}
@ -572,13 +573,13 @@ class User {
*/
private function setOwnCloudAvatar() {
if(!$this->image->valid()) {
$this->log->log('jpegPhoto data invalid for '.$this->dn, \OCP\Util::ERROR);
$this->log->log('jpegPhoto data invalid for '.$this->dn, Util::ERROR);
return;
}
//make sure it is a square and not bigger than 128x128
$size = min(array($this->image->width(), $this->image->height(), 128));
if(!$this->image->centerCrop($size)) {
$this->log->log('croping image for avatar failed for '.$this->dn, \OCP\Util::ERROR);
$this->log->log('croping image for avatar failed for '.$this->dn, Util::ERROR);
return;
}