From bbbcdb7745a507acaeb2b51d4c9e5677e2a9944f Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 17 Dec 2013 12:48:08 -0500 Subject: [PATCH] web staff: FF autofil login form support Signed-off-by: Bill Erickson --- Open-ILS/src/templates/staff/t_login.tt2 | 2 +- Open-ILS/web/js/ui/default/staff/app.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/staff/t_login.tt2 b/Open-ILS/src/templates/staff/t_login.tt2 index a363dfee02..a29b7bcda4 100644 --- a/Open-ILS/src/templates/staff/t_login.tt2 +++ b/Open-ILS/src/templates/staff/t_login.tt2 @@ -11,7 +11,7 @@ The input IDs are there to match the labels. They are not referenced in the Login controller. --> -
+
diff --git a/Open-ILS/web/js/ui/default/staff/app.js b/Open-ILS/web/js/ui/default/staff/app.js index 2b4fba5150..c5acf5f714 100644 --- a/Open-ILS/web/js/ui/default/staff/app.js +++ b/Open-ILS/web/js/ui/default/staff/app.js @@ -56,7 +56,22 @@ angular.module('egHome', ['ngRoute', 'ui.bootstrap', 'egCoreMod', 'egUiMod']) args.type = 'staff'; $scope.loginFailed = false; + if (!args.username) { + /* + Issues with form autofill / auto-complete + https://github.com/angular/angular.js/issues/1460 + http://timothy.userapp.io/post/63412334209/form-autocomplete-and-remember-password-with-angularjs + For now, since FF will save the values, we should + honor them, even if it's hacky. */ + args.username = document.getElementById("login-username").value; + args.password = document.getElementById("login-password").value; + args.workstation = document.getElementById("login-workstation").value; + } + + if (! (args.username && args.password) ) return; + egAuth.login(args).then( + function() { // after login, send the user back to the originally // requested page or, if none, the home page. -- 2.11.0