summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2015-03-31 13:42:23 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2015-04-10 09:12:37 +0200
commit488405d1ec41faefaa3cbbc60a0c1b23745b6a31 (patch)
tree863c571ca79815cf9c19acb068f581f69f2d4ba1 /apps/user_ldap/lib
parent43b503641c9f3cc705f4a5c318c4122d00f8940a (diff)
downloadnextcloud-server-488405d1ec41faefaa3cbbc60a0c1b23745b6a31.tar.gz
nextcloud-server-488405d1ec41faefaa3cbbc60a0c1b23745b6a31.zip
do not hide exception when ldap server has a hiccup
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/connection.php3
-rw-r--r--apps/user_ldap/lib/user/manager.php8
2 files changed, 4 insertions, 7 deletions
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index 1577d9facb8..3869f5da9c9 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -167,7 +167,8 @@ class Connection extends LDAPUtility {
$this->establishConnection();
}
if(is_null($this->ldapConnectionRes)) {
- \OCP\Util::writeLog('user_ldap', 'Connection could not be established', \OCP\Util::ERROR);
+ \OCP\Util::writeLog('user_ldap', 'No LDAP Connection to server ' . $this->connection->ldapHost, \OCP\Util::ERROR);
+ throw new \Exception('Connection to LDAP server could not be established');
}
return $this->ldapConnectionRes;
}
diff --git a/apps/user_ldap/lib/user/manager.php b/apps/user_ldap/lib/user/manager.php
index c0bc8ea6230..b99c9715e58 100644
--- a/apps/user_ldap/lib/user/manager.php
+++ b/apps/user_ldap/lib/user/manager.php
@@ -165,6 +165,7 @@ class Manager {
* @brief returns a User object by it's DN or ownCloud username
* @param string the DN or username of the user
* @return \OCA\user_ldap\lib\user\User|\OCA\user_ldap\lib\user\OfflineUser|null
+ * @throws \Exception when connection could not be established
*/
public function get($id) {
$this->checkAccess();
@@ -181,12 +182,7 @@ class Manager {
}
}
- try {
- $user = $this->createInstancyByUserName($id);
- return $user;
- } catch (\Exception $e) {
- return null;
- }
+ return $this->createInstancyByUserName($id);
}
}