]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix several minor issues
authorJoas Schilling <nickvergessen@owncloud.com>
Thu, 12 May 2016 14:55:58 +0000 (16:55 +0200)
committerJoas Schilling <nickvergessen@owncloud.com>
Wed, 25 May 2016 14:06:08 +0000 (16:06 +0200)
apps/user_ldap/lib/Access.php
apps/user_ldap/lib/User/User.php
apps/user_ldap/lib/User_LDAP.php
apps/user_ldap/lib/Wizard.php

index 8137deb023d429b44a5222d726057b6916dbde47..6ec90cfff8f957d4c4c9db60db60a65e80a0bd48 100644 (file)
@@ -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
index 828648906fbed508e8d3c3dd072d00c93e2d19c8..8f7666790c1a11bd49111472fe2d4f6527ba650f 100644 (file)
@@ -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;
                }
 
index 1000f3ba530cc77c6c8b0e431e1fa630b5dc1a32..87c603fc753a93d997e8ec620e474f6f8237ba69 100644 (file)
@@ -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);
index f8c82a297016c860bfc3bd1c120ae6de6ac3a1e6..f71d5af2c4980c03b55056f1dc45134736138134 100644 (file)
@@ -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);