From 867666b9492b2edcbd69d71ea53666ee33120bf3 Mon Sep 17 00:00:00 2001 From: Giulio Cesare Solaroli Date: Wed, 11 Mar 2015 18:19:29 +0100 Subject: [PATCH] =?UTF-8?q?Disabled=20=E2=80=99sign=20in=E2=80=99=20link?= =?UTF-8?q?=20when=20the=20proxy=20does=20not=20support=20creating=20new?= =?UTF-8?q?=20accounts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Clipperz/PM/UI/Components/Pages/LoginPage.js | 14 ++++++++++---- frontend/delta/js/Clipperz/PM/UI/MainController.js | 9 +++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/frontend/delta/js/Clipperz/PM/UI/Components/Pages/LoginPage.js b/frontend/delta/js/Clipperz/PM/UI/Components/Pages/LoginPage.js index 56e912f..429cbd5 100644 --- a/frontend/delta/js/Clipperz/PM/UI/Components/Pages/LoginPage.js +++ b/frontend/delta/js/Clipperz/PM/UI/Components/Pages/LoginPage.js @@ -141,16 +141,22 @@ Clipperz.PM.UI.Components.Pages.LoginPage = React.createClass({ }, render: function() { - var registrationLink = React.DOM.footer({'key':'registrationLink', 'className':'registrationLink'}, [ - React.DOM.a({'key':'signup', 'onClick':this.handleRegistrationLinkClick}, "Sign up") - ]); +//console.log("LOGIN PAGE", this.props); +// var registrationLink = React.DOM.footer({'key':'registrationLink', 'className':'registrationLink'}, [ +// React.DOM.a({'key':'signup', 'onClick':this.handleRegistrationLinkClick}, "Sign up") +// ]); + + var registrationLink = React.DOM.a({'key':'signup', 'onClick':this.handleRegistrationLinkClick}, "Sign up"); return React.DOM.div({'className':'loginForm ' + this.props['style']}, [ React.DOM.header({'key':'header'}, 'clipperz'), React.DOM.div({'key':'form-wrapper', 'className':'form'}, [ this.props.mode == 'PIN' ? this.pinForm() : this.loginForm(), ]), - this.props.isNewUserRegistrationAvailable ? registrationLink : null + React.DOM.footer({'key':'registrationLink', 'className':'registrationLink'}, [ + this.props['isNewUserRegistrationAvailable'] ? registrationLink : null + ]) +// this.props['isNewUserRegistrationAvailable'] ? registrationLink : null ]); } }); diff --git a/frontend/delta/js/Clipperz/PM/UI/MainController.js b/frontend/delta/js/Clipperz/PM/UI/MainController.js index e4eb4e9..7fa5dc9 100644 --- a/frontend/delta/js/Clipperz/PM/UI/MainController.js +++ b/frontend/delta/js/Clipperz/PM/UI/MainController.js @@ -237,10 +237,10 @@ console.log("THE BROWSER IS OFFLINE"); var canRegisterNewUsers; canRegisterNewUsers = Clipperz.PM.Proxy.defaultProxy.canRegisterNewUsers(); - +//console.log("CAN REGISTER NEW USERS", canRegisterNewUsers); this.selectInitialProxy(); shouldShowRegistrationForm = parameters['shouldShowRegistrationForm'] && canRegisterNewUsers; - this.pages()['loginPage'].setProps({'mode':this.loginMode(), 'isNewUserRegistrationAvailable':canRegisterNewUsers}); +// this.pages()['loginPage'].setProps({'mode':this.loginMode(), 'isNewUserRegistrationAvailable':canRegisterNewUsers}); this.showLoginForm(); if (shouldShowRegistrationForm) { @@ -257,7 +257,8 @@ console.log("THE BROWSER IS OFFLINE"); var loginFormPage; loginFormPage = this.pages()['loginPage']; - loginFormPage.setProps({'mode':this.loginMode(), 'isNewUserRegistrationAvailable':Clipperz.PM.Proxy.defaultProxy.canRegisterNewUsers()}); +// loginFormPage.setProps({'mode':this.loginMode(), 'isNewUserRegistrationAvailable':Clipperz.PM.Proxy.defaultProxy.canRegisterNewUsers()}); + loginFormPage.setProps({'mode':this.loginMode()}); this.moveInPage(this.currentPage(), 'loginPage'); MochiKit.Async.callLater(0.5, MochiKit.Base.method(loginFormPage, 'setInitialFocus')); }, @@ -979,7 +980,7 @@ console.log("THE BROWSER IS OFFLINE"); if (aPageName == 'loginPage') { extraProperties = { 'mode': 'CREDENTIALS', - 'isNewUserRegistrationAvailable': true, + 'isNewUserRegistrationAvailable': Clipperz.PM.Proxy.defaultProxy.canRegisterNewUsers(), 'disabled': false, }; } else if (aPageName == 'registrationPage') {