Don't ask for a password on shutdown

Show a warning and the list of active users instead when
multiple sessions are present.

https://bugzilla.gnome.org/show_bug.cgi?id=693385
This commit is contained in:
Adel Gadllah
2013-02-11 17:39:29 +01:00
parent 4ab1e893f0
commit b2fb84e361
2 changed files with 128 additions and 1 deletions

View File

@ -33,6 +33,9 @@ const SystemdLoginManagerIface = <interface name='org.freedesktop.login1.Manager
<arg type='s' direction='in'/>
<arg type='h' direction='out'/>
</method>
<method name='ListSessions'>
<arg name='sessions' type='a(susso)' direction='out'/>
</method>
<signal name='PrepareForSleep'>
<arg type='b' direction='out'/>
</signal>
@ -142,6 +145,15 @@ const LoginManagerSystemd = new Lang.Class({
});
},
listSessions: function(asyncCallback) {
this._proxy.ListSessionsRemote(function(result, error) {
if (error)
asyncCallback([]);
else
asyncCallback(result[0]);
});
},
powerOff: function() {
this._proxy.PowerOffRemote(true);
},
@ -225,6 +237,10 @@ const LoginManagerConsoleKit = new Lang.Class({
asyncCallback(false);
},
listSessions: function(asyncCallback) {
asyncCallback([]);
},
powerOff: function() {
this._proxy.StopRemote();
},