summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/files_encryption/appinfo/app.php6
-rw-r--r--apps/files_encryption/hooks/hooks.php5
-rw-r--r--apps/user_ldap/lib/connection.php12
3 files changed, 20 insertions, 3 deletions
diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php
index d9bb4d5e74e..99bdc2c2470 100644
--- a/apps/files_encryption/appinfo/app.php
+++ b/apps/files_encryption/appinfo/app.php
@@ -25,6 +25,12 @@ stream_wrapper_register('crypt', 'OCA\Encryption\Stream');
// check if we are logged in
if (OCP\User::isLoggedIn()) {
+
+ // ensure filesystem is loaded
+ if(!\OC\Files\Filesystem::$loaded) {
+ \OC_Util::setupFS();
+ }
+
$view = new OC_FilesystemView('/');
$session = new \OCA\Encryption\Session($view);
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index eb9a2600d70..d1b08a0b978 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -46,6 +46,11 @@ class Hooks {
$view = new \OC_FilesystemView('/');
+ // ensure filesystem is loaded
+ if(!\OC\Files\Filesystem::$loaded) {
+ \OC_Util::setupFS($params['uid']);
+ }
+
$util = new Util($view, $params['uid']);
// setup user, if user not ready force relogin
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index ba4de135341..409f3758792 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -601,14 +601,13 @@ class Connection {
$error = null;
}
- $error = null;
//if LDAP server is not reachable, try the Backup (Replica!) Server
- if((!$bindStatus && ($error === -1))
+ if((!$bindStatus && ($error !== 0))
|| $this->config['ldapOverrideMainServer']
|| $this->getFromCache('overrideMainServer')) {
$this->doConnect($this->config['ldapBackupHost'], $this->config['ldapBackupPort']);
$bindStatus = $this->bind();
- if($bindStatus && $error === -1) {
+ if(!$bindStatus && $error === -1) {
//when bind to backup server succeeded and failed to main server,
//skip contacting him until next cache refresh
$this->writeToCache('overrideMainServer', true);
@@ -636,10 +635,17 @@ class Connection {
* Binds to LDAP
*/
public function bind() {
+ static $getConnectionResourceAttempt = false;
if(!$this->config['ldapConfigurationActive']) {
return false;
}
+ if($getConnectionResourceAttempt) {
+ $getConnectionResourceAttempt = false;
+ return false;
+ }
+ $getConnectionResourceAttempt = true;
$cr = $this->getConnectionResource();
+ $getConnectionResourceAttempt = false;
if(!is_resource($cr)) {
return false;
}