Merge branch 'master' into lib-private-master-2

remotes/origin/stable6
Thomas Müller 11 years ago
commit 02d6976263
  1. 1
      apps/files_encryption/appinfo/info.xml
  2. 3
      core/templates/login.php
  3. 1
      lib/base.php
  4. 22
      lib/private/util.php

@ -7,6 +7,7 @@
<author>Sam Tuke, Bjoern Schiessle, Florin Peter</author>
<require>4</require>
<shipped>true</shipped>
<rememberlogin>false</rememberlogin>
<types>
<filesystem/>
</types>

@ -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>

@ -770,6 +770,7 @@ class OC {
|| !isset($_COOKIE["oc_token"])
|| !isset($_COOKIE["oc_username"])
|| !$_COOKIE["oc_remember_login"]
|| !OC_Util::rememberLoginAllowed()
) {
return false;
}

@ -471,6 +471,7 @@ class OC_Util {
}
$parameters['alt_login'] = OC_App::getAlternativeLogIns();
$parameters['rememberLoginAllowed'] = self::rememberLoginAllowed();
OC_Template::printGuestPage("", "login", $parameters);
}
@ -512,6 +513,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

Loading…
Cancel
Save