diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-12-22 09:31:35 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-12-22 11:03:42 +0100 |
commit | b32e252fb04a49833975304abebac2cec60a3156 (patch) | |
tree | d3cefee6357fb75e960caa43832bc523ac8e3f47 /lib | |
parent | 1588dd0ee037e2f1e92e689b717815eb0d37cb20 (diff) | |
download | nextcloud-server-b32e252fb04a49833975304abebac2cec60a3156.tar.gz nextcloud-server-b32e252fb04a49833975304abebac2cec60a3156.zip |
Testing md5home (#26854)
* Allow clearing default user backends in config.php
When specifying "user_backends" in config.php, a new option "default"
when set to false will prevent the default user backend to be
registered. The default one is the database backend.
This makes it possible to select exclusive user backends from apps.
* Testing app provides test user backend for alternative homes
The backend provide md5 result to getHome()
* Only md5 the user home when it's not the admin
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/legacy/user.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/private/legacy/user.php b/lib/private/legacy/user.php index ed0d14a1ab9..0a52be7565d 100644 --- a/lib/private/legacy/user.php +++ b/lib/private/legacy/user.php @@ -125,9 +125,16 @@ class OC_User { * setup the configured backends in config.php */ public static function setupBackends() { - OC_App::loadApps(array('prelogin')); - $backends = \OC::$server->getSystemConfig()->getValue('user_backends', array()); + OC_App::loadApps(['prelogin']); + $backends = \OC::$server->getSystemConfig()->getValue('user_backends', []); + if (isset($backends['default']) && !$backends['default']) { + // clear default backends + self::clearBackends(); + } foreach ($backends as $i => $config) { + if (!is_array($config)) { + continue; + } $class = $config['class']; $arguments = $config['arguments']; if (class_exists($class)) { |