Merge branch 'master' into lib-private-master-2
This commit is contained in:
commit
02d6976263
|
@ -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…
Reference in New Issue