summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2014-06-04 16:23:46 +0200
committerPetr Vobornik <pvoborni@redhat.com>2014-06-30 12:27:04 +0200
commit72a107c9d73d1576f3adf7928deef4b5e5f35a83 (patch)
tree56f010c9dd1e8d03251a1200f6a7c6b55256ca7e /install
parent30b1256b6231610812b394e3363394690a297201 (diff)
downloadfreeipa-72a107c9d73d1576f3adf7928deef4b5e5f35a83.tar.gz
freeipa-72a107c9d73d1576f3adf7928deef4b5e5f35a83.tar.xz
freeipa-72a107c9d73d1576f3adf7928deef4b5e5f35a83.zip
webui: add link pointing to OTP sync page to login
https://fedorahosted.org/freeipa/ticket/4218 Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
Diffstat (limited to 'install')
-rw-r--r--install/ui/src/freeipa/plugins/login.js4
-rw-r--r--install/ui/src/freeipa/widgets/LoginScreen.js13
-rw-r--r--install/ui/test/data/ipa_init.json1
3 files changed, 18 insertions, 0 deletions
diff --git a/install/ui/src/freeipa/plugins/login.js b/install/ui/src/freeipa/plugins/login.js
index cf9e5bea8..c555ed2d9 100644
--- a/install/ui/src/freeipa/plugins/login.js
+++ b/install/ui/src/freeipa/plugins/login.js
@@ -75,6 +75,10 @@ define(['dojo/_base/declare',
on(this, 'show', function(args) {
login_screen.refresh();
});
+
+ on(login_screen, 'require-otp-sync', function(args) {
+ self.emit('require-otp-sync', args);
+ });
}
});
diff --git a/install/ui/src/freeipa/widgets/LoginScreen.js b/install/ui/src/freeipa/widgets/LoginScreen.js
index 6c448ff99..3e0986435 100644
--- a/install/ui/src/freeipa/widgets/LoginScreen.js
+++ b/install/ui/src/freeipa/widgets/LoginScreen.js
@@ -82,6 +82,13 @@ define(['dojo/_base/declare',
render_buttons: function(container) {
+ this.sync_btn_node = IPA.button({
+ label: text.get('@i18n:login.sync_otp_token', "Sync OTP Token"),
+ button_class: 'btn btn-link',
+ click: lang.hitch(this, this.on_sync)
+ })[0];
+ construct.place(this.sync_btn_node, container);
+
this.login_btn_node = IPA.button({
label: text.get('@i18n:login.login', "Login"),
'class': 'btn-primary btn-lg',
@@ -115,6 +122,11 @@ define(['dojo/_base/declare',
p_f.set_required(required);
},
+ on_sync: function() {
+ var user = this.get_field('username').get_value()[0];
+ this.emit('require-otp-sync', { source: this, user: user });
+ },
+
on_confirm: function() {
if (this.view == 'login') {
this.login();
@@ -231,6 +243,7 @@ define(['dojo/_base/declare',
show_login_view: function() {
this.set_login_aside_text();
if (this.buttons_node) {
+ construct.place(this.sync_btn_node, this.buttons_node);
construct.place(this.login_btn_node, this.buttons_node);
}
if (this.password_enabled()) {
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
index 3da2b4f4a..83ed670d0 100644
--- a/install/ui/test/data/ipa_init.json
+++ b/install/ui/test/data/ipa_init.json
@@ -148,6 +148,7 @@
"logout": "Logout",
"logout_error": "Logout error",
"password": "Password",
+ "sync_otp_token": "Sync OTP Token",
"username": "Username"
},
"measurement_units": {