[gnome-shell] ScreenShield: don't lock if the user has no password



commit aefdf15a45f21030f98dec3c2185d710836a5309
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat Jun 8 17:22:43 2013 +0200

    ScreenShield: don't lock if the user has no password
    
    If the user has no configured password (like the default user in
    a live cd), the behavior should be as if the session was not locked
    at all.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=701495

 js/ui/screenShield.js |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 89601c0..4776333 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -1,5 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
+const AccountsService = imports.gi.AccountsService;
 const Cairo = imports.cairo;
 const Clutter = imports.gi.Clutter;
 const Gio = imports.gi.Gio;
@@ -1245,7 +1246,14 @@ const ScreenShield = new Lang.Class({
         St.Clipboard.get_default().set_text(St.ClipboardType.CLIPBOARD, '');
         St.Clipboard.get_default().set_text(St.ClipboardType.PRIMARY, '');
 
-        this._isLocked = true;
+        let userManager = AccountsService.UserManager.get_default();
+        let user = userManager.get_user(GLib.get_user_name());
+
+        if (this._isGreeter)
+            this._isLocked = true;
+        else
+            this._isLocked = user.password_mode != AccountsService.UserPasswordMode.NONE;
+
         this.activate(animate);
 
         this.emit('locked-changed');


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