[gnome-shell/wip/smartcard: 13/16] gdmUtil: support disabling password authentication



commit 05dcd8575cbef5f567f3ba7a459a521b28230eb2
Author: Ray Strode <rstrode redhat com>
Date:   Mon Jul 29 14:18:30 2013 -0400

    gdmUtil: support disabling password authentication
    
    This commit skips trying password authentication if it's
    disallowed, favoring fingerprint login instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683437

 js/gdm/util.js |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/js/gdm/util.js b/js/gdm/util.js
index 24f3d18..cc58308 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -21,6 +21,7 @@ const FADE_ANIMATION_TIME = 0.16;
 const CLONE_FADE_ANIMATION_TIME = 0.25;
 
 const LOGIN_SCREEN_SCHEMA = 'org.gnome.login-screen';
+const PASSWORD_AUTHENTICATION_KEY = 'enable-password-authentication';
 const FINGERPRINT_AUTHENTICATION_KEY = 'enable-fingerprint-authentication';
 const BANNER_MESSAGE_KEY = 'banner-message-enable';
 const BANNER_MESSAGE_TEXT_KEY = 'banner-message-text';
@@ -116,6 +117,10 @@ const ShellUserVerifier = new Lang.Class({
         this._client = client;
 
         this._settings = new Gio.Settings({ schema: LOGIN_SCREEN_SCHEMA });
+        this._settings.connect('changed',
+                               Lang.bind(this, function() {
+                                   this._updateDefaultService();
+                               }));
         this._updateDefaultService();
 
         this._fprintManager = new Fprint.FprintManager();
@@ -312,7 +317,10 @@ const ShellUserVerifier = new Lang.Class({
     },
 
     _updateDefaultService: function() {
-        this._defaultService = PASSWORD_SERVICE_NAME;
+        if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
+            this._defaultService = PASSWORD_SERVICE_NAME;
+        else if (this._settings.get_boolean(FINGERPRINT_AUTHENTICATION_KEY))
+            this._defaultService = FINGERPRINT_SERVICE_NAME;
     },
 
     _beginVerification: function() {
@@ -335,7 +343,7 @@ const ShellUserVerifier = new Lang.Class({
                 this._hold.release();
             }));
 
-            if (this._haveFingerprintReader) {
+            if (this._haveFingerprintReader && !this.serviceIsForeground(FINGERPRINT_SERVICE_NAME)) {
                 this._hold.acquire();
 
                 this._userVerifier.call_begin_verification_for_user(FINGERPRINT_SERVICE_NAME,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]