Skip to content
Snippets Groups Projects
Commit 35b5d27b authored by Jared Hancock's avatar Jared Hancock
Browse files

Fallback to client email display on user directory

parent afc31fcb
No related branches found
No related tags found
No related merge requests found
...@@ -215,7 +215,11 @@ class User extends UserModel { ...@@ -215,7 +215,11 @@ class User extends UserModel {
} }
function getName() { function getName() {
return new PersonsName($this->name); if (!$this->name)
list($name) = explode('@', $this->getDefaultEmailAddress(), 2);
else
$name = $this->name;
return new PersonsName($name);
} }
function getUpdateDate() { function getUpdateDate() {
......
...@@ -115,7 +115,12 @@ else ...@@ -115,7 +115,12 @@ else
if($res && db_num_rows($res)): if($res && db_num_rows($res)):
$ids=($errors && is_array($_POST['ids']))?$_POST['ids']:null; $ids=($errors && is_array($_POST['ids']))?$_POST['ids']:null;
while ($row = db_fetch_array($res)) { while ($row = db_fetch_array($res)) {
$name = new PersonsName($row['name']); // Default to email address mailbox if no name specified
if (!$row['name'])
list($name) = explode('@', $row['email']);
else
$name = new PersonsName($row['name']);
// Account status // Account status
if ($row['account_id']) if ($row['account_id'])
$status = new UserAccountStatus($row['status']); $status = new UserAccountStatus($row['status']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment