summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-30 21:29:58 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-30 21:29:58 +0200
commit02d69762631edda67e56ff652c67dd12fef098fd (patch)
treec1bfbe928de9f50f67b88bbd42f23f0fb228f635 /lib
parent8e0060405dd585a33f58d6a5520532726b3af5d6 (diff)
parentb58a464b864e70076aa0bde6d70c727b2aa32397 (diff)
downloadnextcloud-server-02d69762631edda67e56ff652c67dd12fef098fd.tar.gz
nextcloud-server-02d69762631edda67e56ff652c67dd12fef098fd.zip
Merge branch 'master' into lib-private-master-2
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php1
-rwxr-xr-xlib/private/util.php22
2 files changed, 23 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php
index 7e237c35d27..42182c21fb0 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -770,6 +770,7 @@ class OC {
|| !isset($_COOKIE["oc_token"])
|| !isset($_COOKIE["oc_username"])
|| !$_COOKIE["oc_remember_login"]
+ || !OC_Util::rememberLoginAllowed()
) {
return false;
}
diff --git a/lib/private/util.php b/lib/private/util.php
index 6be56d07c9a..1fb867d3ac8 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -471,6 +471,7 @@ class OC_Util {
}
$parameters['alt_login'] = OC_App::getAlternativeLogIns();
+ $parameters['rememberLoginAllowed'] = self::rememberLoginAllowed();
OC_Template::printGuestPage("", "login", $parameters);
}
@@ -513,6 +514,27 @@ class OC_Util {
}
/**
+ * Check if it is allowed to remember login.
+ *
+ * @note Every app can set 'rememberlogin' to 'false' to disable the remember login feature
+ *
+ * @return bool
+ */
+ public static function rememberLoginAllowed() {
+
+ $apps = OC_App::getEnabledApps();
+
+ foreach ($apps as $app) {
+ $appInfo = OC_App::getAppInfo($app);
+ if (isset($appInfo['rememberlogin']) && $appInfo['rememberlogin'] === 'false') {
+ return false;
+ }
+
+ }
+ return true;
+ }
+
+ /**
* @brief Check if the user is a subadmin, redirects to home if not
* @return array $groups where the current user is subadmin
*/