provide a register button on login
also direct users from file to login
This commit is contained in:
@@ -301,7 +301,12 @@ define([
|
||||
}
|
||||
|
||||
if (!Cryptpad.isLoggedIn()) {
|
||||
return Cryptpad.alert("You must be logged in to upload files");
|
||||
return Cryptpad.alert(Messages.upload_mustLogin, function () {
|
||||
if (sessionStorage) {
|
||||
sessionStorage.redirectTo = window.location.href;
|
||||
}
|
||||
window.location.href = '/login/';
|
||||
});
|
||||
}
|
||||
|
||||
$form.css({
|
||||
|
||||
@@ -62,6 +62,10 @@
|
||||
<input type="text" id="name" name="name" class="form-control" data-localization-placeholder="login_username" autofocus>
|
||||
<input type="password" id="password" name="password" class="form-control" data-localization-placeholder="login_password">
|
||||
<button class="btn btn-primary login first" data-localization="login_login"></button>
|
||||
<div class="extra">
|
||||
<p data-localization="login_notRegistered"></p>
|
||||
<button id="register" class="btn btn-success register first" data-localization="login_register"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -128,5 +128,16 @@ define([
|
||||
}, 0);
|
||||
}, 100);
|
||||
});
|
||||
$('#register').on('click', function () {
|
||||
if (sessionStorage) {
|
||||
if ($uname.val()) {
|
||||
sessionStorage.login_user = $uname.val();
|
||||
}
|
||||
if ($passwd.val()) {
|
||||
sessionStorage.login_pass = $passwd.val();
|
||||
}
|
||||
}
|
||||
window.location.href = '/register/';
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user