Need sudo rights to update phone numbers

This commit is contained in:
Sean Davis 2016-03-30 21:17:13 -04:00
parent 48b0adea1a
commit 19d5a23f87
2 changed files with 18 additions and 13 deletions

View File

@ -222,6 +222,7 @@ class MugshotWindow(Window):
# Users without sudo rights cannot change their name. # Users without sudo rights cannot change their name.
if not self.accounts_service.available(): if not self.accounts_service.available():
self.set_name_editable(SudoDialog.check_dependencies(['chfn'])) self.set_name_editable(SudoDialog.check_dependencies(['chfn']))
self.set_phone_editable(SudoDialog.check_dependencies(['chfn']))
# Populate all of the widgets. # Populate all of the widgets.
self.init_user_details() self.init_user_details()
@ -232,6 +233,10 @@ class MugshotWindow(Window):
self.last_name_entry.set_sensitive(editable) self.last_name_entry.set_sensitive(editable)
self.initials_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): def init_user_details(self):
"""Initialize the user details entries and variables.""" """Initialize the user details entries and variables."""
# Check for .face and set profile image. # Check for .face and set profile image.
@ -727,7 +732,7 @@ class MugshotWindow(Window):
details.append("") details.append("")
# Extract the user details # Extract the user details
name, office, office_phone, home_phone = details name, office, office_phone, home_phone = details[:4]
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
logger.warning("User %s not found in /etc/passwd. " logger.warning("User %s not found in /etc/passwd. "
"Mugshot may not function correctly." % username) "Mugshot may not function correctly." % username)

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -61,7 +61,7 @@ msgstr ""
msgid "Browse…" msgid "Browse…"
msgstr "" msgstr ""
#: ../data/ui/MugshotWindow.ui.h:9 ../mugshot/MugshotWindow.py:558 #: ../data/ui/MugshotWindow.ui.h:9 ../mugshot/MugshotWindow.py:563
msgid "Mugshot" msgid "Mugshot"
msgstr "" msgstr ""
@ -107,45 +107,45 @@ msgstr ""
msgid "Retry" msgid "Retry"
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:336 #: ../mugshot/MugshotWindow.py:341
msgid "Authentication cancelled." msgid "Authentication cancelled."
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:339 #: ../mugshot/MugshotWindow.py:344
msgid "Authentication failed." msgid "Authentication failed."
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:342 #: ../mugshot/MugshotWindow.py:347
msgid "An error occurred when saving changes." msgid "An error occurred when saving changes."
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:344 #: ../mugshot/MugshotWindow.py:349
msgid "User details were not updated." msgid "User details were not updated."
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:445 #: ../mugshot/MugshotWindow.py:450
msgid "Update Pidgin buddy icon?" msgid "Update Pidgin buddy icon?"
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:446 #: ../mugshot/MugshotWindow.py:451
msgid "Would you also like to update your Pidgin buddy icon?" msgid "Would you also like to update your Pidgin buddy icon?"
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:559 #: ../mugshot/MugshotWindow.py:564
msgid "Enter your password to change user details." msgid "Enter your password to change user details."
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:561 #: ../mugshot/MugshotWindow.py:566
msgid "" msgid ""
"This is a security measure to prevent unwanted updates\n" "This is a security measure to prevent unwanted updates\n"
"to your personal information." "to your personal information."
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:812 #: ../mugshot/MugshotWindow.py:817
msgid "Update LibreOffice user details?" msgid "Update LibreOffice user details?"
msgstr "" msgstr ""
#: ../mugshot/MugshotWindow.py:813 #: ../mugshot/MugshotWindow.py:818
msgid "Would you also like to update your user details in LibreOffice?" msgid "Would you also like to update your user details in LibreOffice?"
msgstr "" msgstr ""