refactoring code
This commit is contained in:
parent
e7859f705c
commit
06b2f11e57
3 changed files with 4 additions and 9 deletions
|
@ -21,9 +21,4 @@ OC.Login = _.extend(OC.Login || {}, {
|
|||
});
|
||||
$(document).ready(function() {
|
||||
$('form[name=login]').submit(OC.Login.onLogin);
|
||||
|
||||
//set previous state of remember login checkbox
|
||||
if($('label[for="remember_login"]').attr('previously') === 'checked'){
|
||||
$('#remember_login').prop('checked', true);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -67,13 +67,12 @@ script('core', [
|
|||
<?php } ?>
|
||||
<?php if ($_['rememberLoginAllowed'] === true) : ?>
|
||||
<div class="remember-login-container">
|
||||
<?php if ($_['rememberLoginState'] === 0) { ?>
|
||||
<input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white">
|
||||
<?php if ($_POST['remember_login'] !== '1') { ?>
|
||||
<label for="remember_login">
|
||||
<?php } else { ?>
|
||||
<label previously="checked" for="remember_login">
|
||||
<input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white" checked="checked">
|
||||
<?php } ?>
|
||||
<?php p($l->t('Stay logged in')); ?></label>
|
||||
<label for="remember_login"><?php p($l->t('Stay logged in')); ?></label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="timezone-offset" id="timezone-offset"/>
|
||||
|
|
|
@ -969,6 +969,7 @@ class OC_Util {
|
|||
|
||||
$parameters['alt_login'] = OC_App::getAlternativeLogIns();
|
||||
$parameters['rememberLoginAllowed'] = self::rememberLoginAllowed();
|
||||
$parameters['rememberLoginState'] = isset($_POST['remember_login']) ? $_POST['remember_login'] : 0;
|
||||
\OC_Hook::emit('OC_Util', 'pre_displayLoginPage', array('parameters' => $parameters));
|
||||
OC_Template::printGuestPage("", "login", $parameters);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue