Skip to content

Commit

Permalink
Need sudo rights to update phone numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
bluesabre committed Mar 31, 2016
1 parent 48b0ade commit 19d5a23
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
7 changes: 6 additions & 1 deletion mugshot/MugshotWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def finish_initializing(self, builder): # pylint: disable=E1002
# Users without sudo rights cannot change their name.
if not self.accounts_service.available():
self.set_name_editable(SudoDialog.check_dependencies(['chfn']))
self.set_phone_editable(SudoDialog.check_dependencies(['chfn']))

# Populate all of the widgets.
self.init_user_details()
Expand All @@ -232,6 +233,10 @@ def set_name_editable(self, editable):
self.last_name_entry.set_sensitive(editable)
self.initials_entry.set_sensitive(editable)

def set_phone_editable(self, editable):
self.home_phone_entry.set_sensitive(editable)
self.office_phone_entry.set_sensitive(editable)

def init_user_details(self):
"""Initialize the user details entries and variables."""
# Check for .face and set profile image.
Expand Down Expand Up @@ -727,7 +732,7 @@ def get_passwd_data(self):
details.append("")

# Extract the user details
name, office, office_phone, home_phone = details
name, office, office_phone, home_phone = details[:4]
except subprocess.CalledProcessError:
logger.warning("User %s not found in /etc/passwd. "
"Mugshot may not function correctly." % username)
Expand Down
24 changes: 12 additions & 12 deletions po/mugshot.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-30 07:08-0400\n"
"POT-Creation-Date: 2016-03-30 21:15-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -61,7 +61,7 @@ msgstr ""
msgid "Browse…"
msgstr ""

#: ../data/ui/MugshotWindow.ui.h:9 ../mugshot/MugshotWindow.py:558
#: ../data/ui/MugshotWindow.ui.h:9 ../mugshot/MugshotWindow.py:563
msgid "Mugshot"
msgstr ""

Expand Down Expand Up @@ -107,45 +107,45 @@ msgstr ""
msgid "Retry"
msgstr ""

#: ../mugshot/MugshotWindow.py:336
#: ../mugshot/MugshotWindow.py:341
msgid "Authentication cancelled."
msgstr ""

#: ../mugshot/MugshotWindow.py:339
#: ../mugshot/MugshotWindow.py:344
msgid "Authentication failed."
msgstr ""

#: ../mugshot/MugshotWindow.py:342
#: ../mugshot/MugshotWindow.py:347
msgid "An error occurred when saving changes."
msgstr ""

#: ../mugshot/MugshotWindow.py:344
#: ../mugshot/MugshotWindow.py:349
msgid "User details were not updated."
msgstr ""

#: ../mugshot/MugshotWindow.py:445
#: ../mugshot/MugshotWindow.py:450
msgid "Update Pidgin buddy icon?"
msgstr ""

#: ../mugshot/MugshotWindow.py:446
#: ../mugshot/MugshotWindow.py:451
msgid "Would you also like to update your Pidgin buddy icon?"
msgstr ""

#: ../mugshot/MugshotWindow.py:559
#: ../mugshot/MugshotWindow.py:564
msgid "Enter your password to change user details."
msgstr ""

#: ../mugshot/MugshotWindow.py:561
#: ../mugshot/MugshotWindow.py:566
msgid ""
"This is a security measure to prevent unwanted updates\n"
"to your personal information."
msgstr ""

#: ../mugshot/MugshotWindow.py:812
#: ../mugshot/MugshotWindow.py:817
msgid "Update LibreOffice user details?"
msgstr ""

#: ../mugshot/MugshotWindow.py:813
#: ../mugshot/MugshotWindow.py:818
msgid "Would you also like to update your user details in LibreOffice?"
msgstr ""

Expand Down

0 comments on commit 19d5a23

Please sign in to comment.