Fix user details expansion (lp 1310634)
This commit is contained in:
parent
ed852b91a5
commit
1eea1e49d3
|
@ -243,8 +243,13 @@ class MugshotWindow(Window):
|
||||||
for line in open('/etc/passwd', 'r'):
|
for line in open('/etc/passwd', 'r'):
|
||||||
if line.startswith(username + ':'):
|
if line.startswith(username + ':'):
|
||||||
logger.debug('Found details: %s' % line.strip())
|
logger.debug('Found details: %s' % line.strip())
|
||||||
details = line.split(':')[4]
|
details = line.split(':')[4].split(',', 3)
|
||||||
name, office, office_phone, home_phone = details.split(',', 3)
|
|
||||||
|
while len(details) < 4:
|
||||||
|
details.append("")
|
||||||
|
|
||||||
|
# Extract the user details
|
||||||
|
name, office, office_phone, home_phone = details
|
||||||
break
|
break
|
||||||
|
|
||||||
# Expand the user's fullname into first and last.
|
# Expand the user's fullname into first and last.
|
||||||
|
|
|
@ -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: 2014-04-04 21:20-0400\n"
|
"POT-Creation-Date: 2014-04-22 06:13-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"
|
||||||
|
|
Loading…
Reference in New Issue