Merge branch 'master' into files_encryption_upgrade_fix
Conflicts: apps/files_encryption/appinfo/app.php
This commit is contained in:
commit
8761242f52
|
@ -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\Capabilities'] = 'files_encryption/lib/capabilities.php';
|
||||||
OC::$CLASSPATH['OCA\Encryption\Helper'] = 'files_encryption/lib/helper.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());
|
OC_FileProxy::register(new OCA\Encryption\Proxy());
|
||||||
|
|
||||||
// User related hooks
|
// User related hooks
|
||||||
|
@ -26,6 +26,12 @@ if(!OC_Config::getValue('maintenance', false)) {
|
||||||
|
|
||||||
// check if we are logged in
|
// check if we are logged in
|
||||||
if (OCP\User::isLoggedIn()) {
|
if (OCP\User::isLoggedIn()) {
|
||||||
|
|
||||||
|
// ensure filesystem is loaded
|
||||||
|
if (!\OC\Files\Filesystem::$loaded) {
|
||||||
|
\OC_Util::setupFS();
|
||||||
|
}
|
||||||
|
|
||||||
$view = new OC_FilesystemView('/');
|
$view = new OC_FilesystemView('/');
|
||||||
$session = new \OCA\Encryption\Session($view);
|
$session = new \OCA\Encryption\Session($view);
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,11 @@ class Hooks {
|
||||||
|
|
||||||
$view = new \OC_FilesystemView('/');
|
$view = new \OC_FilesystemView('/');
|
||||||
|
|
||||||
|
// ensure filesystem is loaded
|
||||||
|
if(!\OC\Files\Filesystem::$loaded) {
|
||||||
|
\OC_Util::setupFS($params['uid']);
|
||||||
|
}
|
||||||
|
|
||||||
$util = new Util($view, $params['uid']);
|
$util = new Util($view, $params['uid']);
|
||||||
|
|
||||||
// setup user, if user not ready force relogin
|
// setup user, if user not ready force relogin
|
||||||
|
|
|
@ -601,14 +601,13 @@ class Connection {
|
||||||
$error = null;
|
$error = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$error = null;
|
|
||||||
//if LDAP server is not reachable, try the Backup (Replica!) Server
|
//if LDAP server is not reachable, try the Backup (Replica!) Server
|
||||||
if((!$bindStatus && ($error === -1))
|
if((!$bindStatus && ($error !== 0))
|
||||||
|| $this->config['ldapOverrideMainServer']
|
|| $this->config['ldapOverrideMainServer']
|
||||||
|| $this->getFromCache('overrideMainServer')) {
|
|| $this->getFromCache('overrideMainServer')) {
|
||||||
$this->doConnect($this->config['ldapBackupHost'], $this->config['ldapBackupPort']);
|
$this->doConnect($this->config['ldapBackupHost'], $this->config['ldapBackupPort']);
|
||||||
$bindStatus = $this->bind();
|
$bindStatus = $this->bind();
|
||||||
if($bindStatus && $error === -1) {
|
if(!$bindStatus && $error === -1) {
|
||||||
//when bind to backup server succeeded and failed to main server,
|
//when bind to backup server succeeded and failed to main server,
|
||||||
//skip contacting him until next cache refresh
|
//skip contacting him until next cache refresh
|
||||||
$this->writeToCache('overrideMainServer', true);
|
$this->writeToCache('overrideMainServer', true);
|
||||||
|
@ -636,10 +635,17 @@ class Connection {
|
||||||
* Binds to LDAP
|
* Binds to LDAP
|
||||||
*/
|
*/
|
||||||
public function bind() {
|
public function bind() {
|
||||||
|
static $getConnectionResourceAttempt = false;
|
||||||
if(!$this->config['ldapConfigurationActive']) {
|
if(!$this->config['ldapConfigurationActive']) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if($getConnectionResourceAttempt) {
|
||||||
|
$getConnectionResourceAttempt = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$getConnectionResourceAttempt = true;
|
||||||
$cr = $this->getConnectionResource();
|
$cr = $this->getConnectionResource();
|
||||||
|
$getConnectionResourceAttempt = false;
|
||||||
if(!is_resource($cr)) {
|
if(!is_resource($cr)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue