Warning! Breaking change!

Removed "additional Login field" on login page (Security reason) (Closes #206)
Added "custom-login-mapping" plugin
This commit is contained in:
RainLoop Team 2014-06-25 20:36:46 +04:00
parent 9643c621f1
commit 81e25b4235
24 changed files with 246 additions and 303 deletions

View file

@ -9,32 +9,23 @@ function PopupsAddAccountViewModel()
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAddAccount');
this.email = ko.observable('');
this.login = ko.observable('');
this.password = ko.observable('');
this.emailError = ko.observable(false);
this.loginError = ko.observable(false);
this.passwordError = ko.observable(false);
this.email.subscribe(function () {
this.emailError(false);
}, this);
this.login.subscribe(function () {
this.loginError(false);
}, this);
this.password.subscribe(function () {
this.passwordError(false);
}, this);
this.allowCustomLogin = RL.data().allowCustomLogin;
this.submitRequest = ko.observable(false);
this.submitError = ko.observable('');
this.emailFocus = ko.observable(false);
this.loginFocus = ko.observable(false);
this.addAccountCommand = Utils.createCommand(this, function () {
@ -68,7 +59,7 @@ function PopupsAddAccountViewModel()
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
}
}, this), this.email(), this.allowCustomLogin() ? this.login() : '', this.password());
}, this), this.email(), '', this.password());
return true;
@ -76,13 +67,6 @@ function PopupsAddAccountViewModel()
return !this.submitRequest();
});
this.loginFocus.subscribe(function (bValue) {
if (bValue && '' === this.login() && '' !== this.email())
{
this.login(this.email());
}
}, this);
Knoin.constructorEnd(this);
}
@ -91,11 +75,9 @@ Utils.extendAsViewModel('PopupsAddAccountViewModel', PopupsAddAccountViewModel);
PopupsAddAccountViewModel.prototype.clearPopup = function ()
{
this.email('');
this.login('');
this.password('');
this.emailError(false);
this.loginError(false);
this.passwordError(false);
this.submitRequest(false);