From b6163183276470039f3a2a2094d1a6224c272f28 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 12 May 2016 16:55:58 +0200 Subject: [PATCH] Fix several minor issues --- apps/user_ldap/lib/Access.php | 4 ++-- apps/user_ldap/lib/User/User.php | 9 +++------ apps/user_ldap/lib/User_LDAP.php | 2 +- apps/user_ldap/lib/Wizard.php | 5 +++-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 8137deb023..6ec90cfff8 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -316,7 +316,7 @@ class Access extends LDAPUtility implements IUserTools { * @return string|false LDAP DN on success, otherwise false */ public function groupname2dn($name) { - return $this->groupMapper->getDNbyName($name); + return $this->groupMapper->getDNByName($name); } /** @@ -325,7 +325,7 @@ class Access extends LDAPUtility implements IUserTools { * @return string|false with the LDAP DN on success, otherwise false */ public function username2dn($name) { - $fdn = $this->userMapper->getDNbyName($name); + $fdn = $this->userMapper->getDNByName($name); //Check whether the DN belongs to the Base, to avoid issues on multi- //server setups diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php index 828648906f..8f7666790c 100644 --- a/apps/user_ldap/lib/User/User.php +++ b/apps/user_ldap/lib/User/User.php @@ -464,7 +464,7 @@ class User { } } if(!is_null($quota)) { - $user = $this->userManager->get($this->uid)->setQuota($quota); + $this->userManager->get($this->uid)->setQuota($quota); } } @@ -502,16 +502,13 @@ class User { */ private function setOwnCloudAvatar() { if(!$this->image->valid()) { - $this->log->log('user_ldap', 'jpegPhoto data invalid for '.$this->dn, - \OCP\Util::ERROR); + $this->log->log('jpegPhoto data invalid for '.$this->dn, \OCP\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('user_ldap', - 'croping image for avatar failed for '.$this->dn, - \OCP\Util::ERROR); + $this->log->log('croping image for avatar failed for '.$this->dn, \OCP\Util::ERROR); return; } diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php index 1000f3ba53..87c603fc75 100644 --- a/apps/user_ldap/lib/User_LDAP.php +++ b/apps/user_ldap/lib/User_LDAP.php @@ -98,7 +98,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn public function getLDAPUserByLoginName($loginName) { //find out dn of the user name $attrs = $this->access->userManager->getAttributes(); - $users = $this->access->fetchUsersByLoginName($loginName, $attrs, 1); + $users = $this->access->fetchUsersByLoginName($loginName, $attrs); if(count($users) < 1) { throw new \Exception('No user available for the given login name on ' . $this->access->connection->ldapHost . ':' . $this->access->connection->ldapPort); diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php index f8c82a2970..f71d5af2c4 100644 --- a/apps/user_ldap/lib/Wizard.php +++ b/apps/user_ldap/lib/Wizard.php @@ -34,6 +34,7 @@ namespace OCA\User_LDAP; use OC\ServerNotAvailableException; class Wizard extends LDAPUtility { + /** @var \OCP\IL10N */ static protected $l; protected $access; protected $cr; @@ -1033,12 +1034,12 @@ class Wizard extends LDAPUtility { $host = $this->configuration->ldapHost; $hostInfo = parse_url($host); if(!$hostInfo) { - throw new \Exception($this->l->t('Invalid Host')); + throw new \Exception(self::$l->t('Invalid Host')); } \OCP\Util::writeLog('user_ldap', 'Wiz: Attempting to connect ', \OCP\Util::DEBUG); $cr = $this->ldap->connect($host, $port); if(!is_resource($cr)) { - throw new \Exception($this->l->t('Invalid Host')); + throw new \Exception(self::$l->t('Invalid Host')); } \OCP\Util::writeLog('user_ldap', 'Wiz: Setting LDAP Options ', \OCP\Util::DEBUG);