Merge pull request #8592 from owncloud/login-timezone

Disable login button until the timezone is set
This commit is contained in:
Morris Jobke 2014-05-19 01:14:03 +02:00
commit db9cfaa56d
2 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,10 @@
$(document).ready(function () { $(document).ready(function () {
var visitortimezone = (-new Date().getTimezoneOffset() / 60); var visitortimezone = (-new Date().getTimezoneOffset() / 60);
$('#timezone-offset').val(visitortimezone); $('#timezone-offset').val(visitortimezone);
// only enable the submit button once we are sure that the timezone is set
var $loginForm = $('form[name="login"]');
if ($loginForm.length) {
$loginForm.find('input#submit').prop('disabled', false);
}
}); });

View File

@ -51,7 +51,7 @@
<label for="remember_login"><?php p($l->t('remember')); ?></label> <label for="remember_login"><?php p($l->t('remember')); ?></label>
<?php endif; ?> <?php endif; ?>
<input type="hidden" name="timezone-offset" id="timezone-offset"/> <input type="hidden" name="timezone-offset" id="timezone-offset"/>
<input type="submit" id="submit" class="login primary" value="<?php p($l->t('Log in')); ?>"/> <input type="submit" id="submit" class="login primary" value="<?php p($l->t('Log in')); ?>" disabled="disabled"/>
</fieldset> </fieldset>
</form> </form>
<?php if (!empty($_['alt_login'])) { ?> <?php if (!empty($_['alt_login'])) { ?>