diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-30 21:29:58 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-30 21:29:58 +0200 |
commit | 02d69762631edda67e56ff652c67dd12fef098fd (patch) | |
tree | c1bfbe928de9f50f67b88bbd42f23f0fb228f635 | |
parent | 8e0060405dd585a33f58d6a5520532726b3af5d6 (diff) | |
parent | b58a464b864e70076aa0bde6d70c727b2aa32397 (diff) | |
download | nextcloud-server-02d69762631edda67e56ff652c67dd12fef098fd.tar.gz nextcloud-server-02d69762631edda67e56ff652c67dd12fef098fd.zip |
Merge branch 'master' into lib-private-master-2
-rw-r--r-- | apps/files_encryption/appinfo/info.xml | 1 | ||||
-rw-r--r-- | core/templates/login.php | 3 | ||||
-rw-r--r-- | lib/base.php | 1 | ||||
-rwxr-xr-x | lib/private/util.php | 22 |
4 files changed, 26 insertions, 1 deletions
diff --git a/apps/files_encryption/appinfo/info.xml b/apps/files_encryption/appinfo/info.xml index 46f1375c987..9d495916d26 100644 --- a/apps/files_encryption/appinfo/info.xml +++ b/apps/files_encryption/appinfo/info.xml @@ -7,6 +7,7 @@ <author>Sam Tuke, Bjoern Schiessle, Florin Peter</author> <require>4</require> <shipped>true</shipped> + <rememberlogin>false</rememberlogin> <types> <filesystem/> </types> diff --git a/core/templates/login.php b/core/templates/login.php index ee761f0aa52..06f64d41e39 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -32,9 +32,10 @@ <?php p($l->t('Lost your password?')); ?> </a> <?php endif; ?> - + <?php if ($_['rememberLoginAllowed'] === true) : ?> <input type="checkbox" name="remember_login" value="1" id="remember_login" checked /> <label for="remember_login"><?php p($l->t('remember')); ?></label> + <?php endif; ?> <input type="hidden" name="timezone-offset" id="timezone-offset"/> <input type="submit" id="submit" class="login primary" value="<?php p($l->t('Log in')); ?>"/> </fieldset> 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 */ |