[gnome-shell/wip/rancell/guest] Show a guest login prompt
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/rancell/guest] Show a guest login prompt
- Date: Wed, 13 Dec 2017 03:16:04 +0000 (UTC)
commit 1798aa038d0ca4995782a1daaa455c2d04ff60a8
Author: Robert Ancell <robert ancell canonical com>
Date: Wed Dec 13 15:27:47 2017 +1300
Show a guest login prompt
js/gdm/loginDialog.js | 27 +++++++++++++++++++++++++++
js/gdm/util.js | 16 +++++++++++++++-
2 files changed, 42 insertions(+), 1 deletions(-)
---
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 1cae3db..e8bf109 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -402,6 +402,31 @@ var SessionMenuButton = new Lang.Class({
});
Signals.addSignalMethods(SessionMenuButton.prototype);
+var GuestUser = new Lang.Class({
+ Name: 'GuestUser',
+
+ _init: function() {
+ this.is_loaded = true;
+ this.locked = false;
+ },
+
+ is_system_account: function() {
+ return false;
+ },
+
+ get_icon_file: function() {
+ return null; // FIXME
+ },
+
+ get_real_name: function() {
+ return 'Guest';
+ },
+
+ get_user_name: function() {
+ return '*guest';
+ }
+});
+
var LoginDialog = new Lang.Class({
Name: 'LoginDialog',
@@ -1204,6 +1229,8 @@ var LoginDialog = new Lang.Class({
for (let i = 0; i < users.length; i++) {
this._userList.addUser(users[i]);
}
+ let guestUser = new GuestUser();
+ this._userList.addUser(guestUser);
this._updateDisableUserList();
diff --git a/js/gdm/util.js b/js/gdm/util.js
index b594da4..e144fce 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -423,7 +423,21 @@ var ShellUserVerifier = new Lang.Class({
_startService: function(serviceName) {
this._hold.acquire();
- if (this._userName) {
+ if (this._userName == "*guest") {
+ this._userVerifier.call_begin_verification_for_guest(this._cancellable,
+ Lang.bind(this, function(obj, result) {
+ try {
+ obj.call_begin_verification_for_guest_finish(result);
+ } catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
+ return;
+ } catch(e) {
+ this._reportInitError('Failed to start verification for guest', e);
+ return;
+ }
+
+ this._hold.release();
+ }));
+ } else if (this._userName) {
this._userVerifier.call_begin_verification_for_user(serviceName,
this._userName,
this._cancellable,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]