diff options
author | Florin Peter <github@florin-peter.de> | 2013-05-31 20:34:43 +0200 |
---|---|---|
committer | Florin Peter <github@florin-peter.de> | 2013-05-31 20:34:43 +0200 |
commit | 8761242f5240319e234c9fa3020141e9791cdcfb (patch) | |
tree | a0f2e6b080f276826cb54963e484449288587fb8 /apps | |
parent | 1bfe975938e96f462afe5ef5e5ebc75735767711 (diff) | |
parent | eafb241068c9d2ca591e37580722101ea548ef88 (diff) | |
download | nextcloud-server-8761242f5240319e234c9fa3020141e9791cdcfb.tar.gz nextcloud-server-8761242f5240319e234c9fa3020141e9791cdcfb.zip |
Merge branch 'master' into files_encryption_upgrade_fix
Conflicts:
apps/files_encryption/appinfo/app.php
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_encryption/appinfo/app.php | 8 | ||||
-rw-r--r-- | apps/files_encryption/hooks/hooks.php | 5 | ||||
-rw-r--r-- | apps/user_ldap/lib/connection.php | 12 |
3 files changed, 21 insertions, 4 deletions
diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php index d2bac218a9f..f69e04b5bbf 100644 --- a/apps/files_encryption/appinfo/app.php +++ b/apps/files_encryption/appinfo/app.php @@ -10,7 +10,7 @@ OC::$CLASSPATH['OCA\Encryption\Session'] = 'files_encryption/lib/session.php'; OC::$CLASSPATH['OCA\Encryption\Capabilities'] = 'files_encryption/lib/capabilities.php'; OC::$CLASSPATH['OCA\Encryption\Helper'] = 'files_encryption/lib/helper.php'; -if(!OC_Config::getValue('maintenance', false)) { +if (!OC_Config::getValue('maintenance', false)) { OC_FileProxy::register(new OCA\Encryption\Proxy()); // User related hooks @@ -26,6 +26,12 @@ if(!OC_Config::getValue('maintenance', false)) { // 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 02602989087..f823999dcb0 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; } |