From 9720301d01430eb76b4f131c388cc83bc870cabd Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 21 Aug 2013 18:05:55 -0400 Subject: [PATCH] gdmUtil: make _startService support no username commit fd11ad95f61b904d6f7014f8d56c1c27d88af65c factored out duplicated code, but unintentionally dropped support for beginning verification without a username. This commit brings it back. https://bugzilla.gnome.org/show_bug.cgi?id=706542 --- js/gdm/util.js | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/js/gdm/util.js b/js/gdm/util.js index bfbd1b37d..f42190220 100644 --- a/js/gdm/util.js +++ b/js/gdm/util.js @@ -381,21 +381,38 @@ const ShellUserVerifier = new Lang.Class({ _startService: function(serviceName) { this._hold.acquire(); - this._userVerifier.call_begin_verification_for_user(serviceName, - this._userName, - this._cancellable, - Lang.bind(this, function(obj, result) { - try { - obj.call_begin_verification_for_user_finish(result); - } catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) { - return; - } catch(e) { - this._reportInitError('Failed to start verification for user', e); - return; - } + if (this._userName) { + this._userVerifier.call_begin_verification_for_user(serviceName, + this._userName, + this._cancellable, + Lang.bind(this, function(obj, result) { + try { + obj.call_begin_verification_for_user_finish(result); + } catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) { + return; + } catch(e) { + this._reportInitError('Failed to start verification for user', e); + return; + } - this._hold.release(); - })); + this._hold.release(); + })); + } else { + this._userVerifier.call_begin_verification(serviceName, + this._cancellable, + Lang.bind(this, function(obj, result) { + try { + obj.call_begin_verification_finish(result); + } catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) { + return; + } catch(e) { + this._reportInitError('Failed to start verification', e); + return; + } + + this._hold.release(); + })); + } }, _beginVerification: function() {