diff options
-rw-r--r-- | install/ui/reset_password.html | 10 | ||||
-rw-r--r-- | install/ui/reset_password.js | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/install/ui/reset_password.html b/install/ui/reset_password.html index 2b7589226..598fe8f1e 100644 --- a/install/ui/reset_password.html +++ b/install/ui/reset_password.html @@ -75,6 +75,16 @@ </div> <div class="form-group"> <div class="col-sm-4 control-label"> + <label for="otp">OTP</label> + </div> + <div class="col-sm-8 controls"> + <div class="widget text-widget"> + <input type="password" class="form-control" name="otp" id="otp" accesskey="o"> + </div> + </div> + </div> + <div class="form-group"> + <div class="col-sm-4 control-label"> <label for="new_password">New Password</label> </div> <div class="col-sm-8 controls"> diff --git a/install/ui/reset_password.js b/install/ui/reset_password.js index 5555a17bc..bc0834987 100644 --- a/install/ui/reset_password.js +++ b/install/ui/reset_password.js @@ -20,7 +20,7 @@ var RP = {}; //Reset Password Page -RP.reset_password = function(username, old_password, new_password) { +RP.reset_password = function(username, old_password, new_password, otp) { //possible results: 'ok', 'invalid-password', 'policy-error' @@ -55,6 +55,10 @@ RP.reset_password = function(username, old_password, new_password) { new_password: new_password }; + if (otp) { + data.otp = otp; + } + request = { url: '/ipa/session/change_password', data: data, @@ -89,6 +93,7 @@ RP.on_submit = function() { var username = $('#user').val(); var current_password = $('#old_password').val(); + var otp = $('#otp').val(); var new_password = $('#new_password').val(); var verify_password = $('#verify_password').val(); @@ -102,7 +107,7 @@ RP.on_submit = function() { return; } - var result = RP.reset_password(username, current_password, new_password); + var result = RP.reset_password(username, current_password, new_password, otp); if (result.status !== 'ok') { RP.show_error(result.message); @@ -116,6 +121,7 @@ RP.reset_form = function() { $('.alert-danger').css('display', 'none'); $('.alert-success').css('display', 'none'); $('#old_password').val(''); + $('#otp').val(''); $('#new_password').val(''); $('#verify_password').val(''); }; |