Commit Graph

18 Commits

Author SHA1 Message Date
Stef Walter
602da771f6 Rename CSS selectors for password prompts
* Use .prompt-xxx selectors instead of .polkit-xxx,
   as the selectors are now used by various non-polkit
   dialogs as well

https://bugzilla.gnome.org/show_bug.cgi?id=669776
2012-02-10 09:16:09 +01:00
Adel Gadllah
3f328463a8 Fix timeout callback leaks
Make sure that we don't leak oneshot timeout handlers in main.js and
polkitAuthenticationAgent.js by making the callback return false.

https://bugzilla.gnome.org/show_bug.cgi?id=668087
2012-01-17 12:39:03 +01:00
Giovanni Campagna
17c46c2452 Port everything to class framework
The last patch in the sequence. Every place that was previously
setting prototype has been ported to Lang.Class, to make code more
concise and allow for better toString().

https://bugzilla.gnome.org/show_bug.cgi?id=664436
2011-11-24 09:50:04 +01:00
Giovanni Campagna
987099ea55 Port ModalDialog to the class framework
Similar to the previous commits, time to port shell modal dialogs
to the class framework.

https://bugzilla.gnome.org/show_bug.cgi?id=664436
2011-11-24 09:50:04 +01:00
Matthias Clasen
55d6c5ea8f polkit: Find the best user to authenticate as
We prefer to ask the user for his own password. If PolicyKit
is not configured to accept that, try the root password. If
PolicyKit does not accept that either, ask for password of
the first user that PolicyKit _will_ accept. The last case
is a bit broken, but should rarely occur in real-life
configurations.

https://bugzilla.gnome.org/show_bug.cgi?id=651547
2011-11-18 17:28:58 -05:00
Florian Müllner
9439da81c4 Add context menus to some entries
Use ShellEntry.addContextMenu() to add context menus to most
existing entries, with the exception of:

 - the login dialog - it may act be used to enter either the
                      username (e.g. no password entry) or the
                      password, and copy/paste does not make sense
                      (nowhere to copy from, nowhere to paste to)
 - notifications    - while adding a context menu is useful here as
                      well, it will require changes to the tray's
                      focus grab handling, so leave those entries
                      out for now

https://bugzilla.gnome.org/show_bug.cgi?id=659275
2011-10-17 15:29:32 +02:00
Dan Winship
75b824d032 *.js: Make emacs modelines consistent
js2-mode is no longer developed and we recommend js-mode these days,
so switch the modelines to specify that, and make them consistent
across all files.

https://bugzilla.gnome.org/show_bug.cgi?id=660358
2011-10-11 08:05:12 -04:00
Florian Müllner
bc0c490ec3 polkit-agent: Remove hack to focus password entry
As dialog buttons used to "steal" the initial key focus, the polkit
dialog delayed focusing the password entry. With buttons no longer
overwriting the manually set focus, this is no longer necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=659133
2011-09-19 21:26:32 +02:00
Florian Müllner
fa786fd3ef Replace GdmUser with AccountsService
The GdmUser copy+paste code has been superseded by AccountsService,
so kill the former and use the latter.

https://bugzilla.gnome.org/show_bug.cgi?id=650893
2011-08-29 22:53:41 +02:00
Dan Winship
898b2b903d environment: put gettext stuff into global environment
Rather than defining _() as a local function in every module, put it
into the global environment (along with C_() and ngettext()).

https://bugzilla.gnome.org/show_bug.cgi?id=649203
2011-05-16 14:57:21 -04:00
Vincent Untz
641d7a4ea4 polkit: Add translator comment
Add a translator comment for the "Sorry, that didn't work. Please try
again." string, as suggested by several people; this should help
translators what "that" refers to.
2011-03-27 10:41:54 +05:30
Kjartan Maraas
ee6693e6e3 Don't translate empty string 2011-03-24 09:03:19 +01:00
Kjartan Maraas
bfba97647e Mark strings for translation in the right way 2011-03-24 09:03:19 +01:00
Ray Strode
1314559833 polkit: drop gdmuser naming workaround
The polkit authentication dialog contains logic for
falling back to dispalying a user's username if that
user has no real name.

This logic is no longer needed because gdmuser does it
internally now.

https://bugzilla.gnome.org/show_bug.cgi?id=644765
2011-03-15 15:50:26 -04:00
David Zeuthen
9b55de1c6b polkit: Make dialogs look more like the mockups
The mockups are here

 https://live.gnome.org/GnomeShell/Design/Whiteboards/AuthorizationDialog

Detailed changes

 - Don't use an icon for root
 - For root, show Administrator in red
 - Nuke icons for info and error messages
 - Make error messages yellow
 - Use 10pt size for error and message labels, not 12px
 - Don't make the dialog change size when (single-line) error/info
   messages appear
 - Spacing fixes
 - Show "Sorry, that didn't work. Please try again" if authentication fails
 - Don't cancel the PolkitAgentSession if the session has already completed

https://bugzilla.gnome.org/show_bug.cgi?id=644737

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-14 15:18:03 -03:00
David Zeuthen
adb04eb010 polkit: don't show authentication dialog until needed
See https://bugs.freedesktop.org/show_bug.cgi?id=27788#c1 for details
about the problem this patch is solving

In particular, we should never bring up the dialog if there is no
password on the account. While this sounds like a weird corner case,
it's not.. the Live CD, for example, does not have a root password.

This also avoids the initial dialog resize.. before the patch the
authentication dialog appears and a split-second later an StEntry
widget is added.

Also print out more diagnostic information if showing the modal dialog
fails. Also add a comment about how to easily make this happen.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23 14:49:09 -05:00
David Zeuthen
697139043f polkit: return error when authentication dialog is dismissed
This allows PolicyKit applications to disambiguate between when the
authentication dialog is dismissed versus when authentication fails
(e.g. the wrong password has been entered).

See https://bugs.freedesktop.org/show_bug.cgi?id=30653 for more
information.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-23 11:02:46 -05:00
David Zeuthen
86b925a294 Add a PolicyKit authentication agent
A PolicyKit Authentication Agent is a construct used to authenticate
one or more identities. See the PolicyKit documentation for more
details on authentication agents and how PolicyKit works:

    http://hal.freedesktop.org/docs/polkit/

Since gjs does not support subclassing a GObject class from Javascript
code, we bring in a native class to bridge the VFuncs to GObject
signals. Additionally, this native class also queues up authentication
requests so the user of the native class only has to deal with a
single outstanding request at any one time.

The file js/ui/polkitAuthenticationAgent.js introduces a singleton
that listens for authentication requests via the native class. This
singleton uses the PolkitAgent machinery to do the actual heavy-weight
lifting required for authentication (essentially a PAM conversation).

We currently don't allow the user to pick the identity to be
authenticated.

https://bugzilla.gnome.org/show_bug.cgi?id=642886

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-02-22 15:13:56 -05:00