Opened 7 years ago

Closed 4 years ago

#1484003 closed Feature Requests (fixed)

Allow display name import with email when creating user by virtuser

Reported by: tomsparrow Owned by:
Priority: 1 - Highest Milestone: 0.3-stable
Component: Core functionality Version: 0.1-beta
Severity: trivial Keywords: display name virtuser
Cc:

Description

I wanted to pull in the email address and a display name when auto creating a user. I added a second column to this effect in the SQL for $rcmail_configvirtuser_query? (main.inc.php) and them modified program\include\main.inc as follows (the two lines with $user_DispName are what has changed:

try to resolve the e-mail address from the virtuser table

if (!empty($CONFIGvirtuser_query?))

{

$sql_result = $DB->query(preg_replace('/%u/', $user, $CONFIGvirtuser_query?));
if ($sql_arr = $DB->fetch_array($sql_result))

$user_email = $sql_arr[0];

$user_DispName = Count($sql_arr) > 1 ? $sql_arr[1] : $user_name;

}

also create new identity records
$DB->query("INSERT INTO .get_table_name('identities').

(user_id, del, standard, name, email)
VALUES (?, 0, 1, ?, ?)",
$user_id,
$user_DispName,
$user_email);

Seems to work fine from my limited test. Small change, but I thought I'd share.

Change History (3)

comment:1 Changed 7 years ago by tomsparrow

  • Type changed from Bugs to Feature Requests

comment:2 Changed 5 years ago by seansan

  • Milestone set to later
  • Summary changed from Change to allow display name to be pulled in with email addr when creating a user to Allow display name import with email when creating user by virtuser

comment:3 Changed 4 years ago by alec

  • Milestone changed from later to 0.3-stable
  • Resolution set to fixed
  • Status changed from new to closed

Implemented in [1301e981].

Note: See TracTickets for help on using tickets.