LP#1402797 Protect against chrome autofill as best we can in Verfiy Credentials
authorMike Rylander <mrylander@gmail.com>
Fri, 30 Jan 2015 22:16:09 +0000 (17:16 -0500)
committerBill Erickson <berickxx@gmail.com>
Wed, 25 Feb 2015 16:16:06 +0000 (11:16 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/staff/circ/patron/t_credentials.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/app.js

index 524cb7f..6355722 100644 (file)
@@ -11,7 +11,7 @@
               for="verify-username">[% l('Username') %]</label>
             <div class="col-md-8">
               <input type="text" id="verify-username" class="form-control" 
-                focus-me="focusMe" ng-disabled="prepop"
+                focus-me="focusMe" ng-disabled="prepop" autocomplete="off"
                 placeholder="[% l('Username') %]" ng-model="username"/>
             </div>
           </div>
@@ -21,7 +21,7 @@
               for="verify-barcode">[% l('Barcode') %]</label>
             <div class="col-md-8">
               <input type="text" id="verify-barcode" class="form-control" 
-                ng-disabled="prepop"
+                ng-disabled="prepop" autocomplete="off"
                 placeholder="[% l('Barcode') %]" ng-model="barcode"/>
             </div>
           </div>
@@ -30,7 +30,7 @@
             <label class="col-md-4 control-label" 
               for="verify-password">[% l('Password') %]</label>
             <div class="col-md-8">
-              <input type="password" id="verify-password" class="form-control" 
+              <input autocomplete="off" type="password" id="verify-password" class="form-control" 
                 placeholder="[% l('Password') %]" ng-model="password"/>
             </div>
           </div>
index f2f21a3..cca86d0 100644 (file)
@@ -1167,10 +1167,14 @@ function($scope,  $routeParams , $location , egCore) {
     // called with a patron, pre-populate the form args
     $scope.initTab('other', $routeParams.id).then(
         function() {
-            if ($scope.patron()) {
+            if ($routeParams.id && $scope.patron()) {
                 $scope.prepop = true;
                 $scope.username = $scope.patron().usrname();
                 $scope.barcode = $scope.patron().card().barcode();
+            } else {
+                $scope.username = '';
+                $scope.barcode = '';
+                $scope.password = '';
             }
         }
     );