]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make LDAP more robust to exceptions and log them properly
authorMorris Jobke <hey@morrisjobke.de>
Tue, 5 Jan 2016 10:41:06 +0000 (11:41 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Wed, 6 Jan 2016 12:46:55 +0000 (13:46 +0100)
apps/user_ldap/lib/user/user.php
apps/user_ldap/user_ldap.php

index 0dc3c8c0c26465ca8d450e96c5ad76506e870106..7a121920a35a8371e545e7071fb2b16a4464a817 100644 (file)
@@ -474,8 +474,8 @@ class User {
                        $this->fs->setup($this->uid);
                }
 
-               $avatar = $this->avatarManager->getAvatar($this->uid);
                try {
+                       $avatar = $this->avatarManager->getAvatar($this->uid);
                        $avatar->set($this->image);
                } catch (\Exception $e) {
                        \OC::$server->getLogger()->notice(
index a266be7b7f786cb69d0ed4969ded9cfae0590b6d..c568905f3d98f8db651a89ddf9ca8b473bf5112f 100644 (file)
@@ -118,6 +118,7 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
                try {
                        $ldapRecord = $this->getLDAPUserByLoginName($uid);
                } catch(\Exception $e) {
+                       \OC::$server->getLogger()->logException($e, ['app' => 'user_ldap']);
                        return false;
                }
                $dn = $ldapRecord['dn'][0];