Changeset 2537 in subversion
- Timestamp:
- May 26, 2009 3:01:55 AM (4 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 3 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/rcube_user.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r2523 r2537 2 2 =========================== 3 3 4 - Support initial identity name from virtuser_query (#1484003) 4 5 - Added message menu, removed Print and Source buttons 5 6 - Added possibility to save message as .eml file (#1485861) -
trunk/roundcubemail/config/main.inc.php.dist
r2530 r2537 88 88 // Query to resolve user names and e-mail addresses from the database 89 89 // %u will be replaced with the current username for login. 90 // The query should select the user's e-mail address as first col 90 // The query should select the user's e-mail address as first column 91 // and optional identity name as second column 91 92 $rcmail_config['virtuser_query'] = ''; 92 93 -
trunk/roundcubemail/program/include/rcube_user.php
r2508 r2537 367 367 // try to resolve user in virtuser table and file 368 368 if ($user_email != '' && !strpos($user, '@')) { 369 if ($email_list = self::user2email($user, false ))370 $user_email = $email_list[0];369 if ($email_list = self::user2email($user, false, true)) 370 $user_email = is_array($email_list[0]) ? $email_list[0][0] : $email_list[0]; 371 371 } 372 372 … … 400 400 // create new identities records 401 401 $standard = 1; 402 foreach ($email_list as $email) { 402 foreach ($email_list as $row) { 403 404 if (is_array($row)) { 405 $email = $row[0]; 406 $name = $row[1] ? $row[1] : $user_name; 407 } else { 408 $email = $row; 409 $name = $user_name; 410 } 411 403 412 $plugin = $rcmail->plugins->exec_hook('create_identity', array('record' => array( 404 413 'login' => true, 405 414 'user_id' => $user_id, 406 'name' => strip_newlines($ user_name),415 'name' => strip_newlines($name), 407 416 'email' => $email, 408 417 'standard' => $standard))); … … 462 471 * @param string User name 463 472 * @param boolean If true returns first found entry 473 * @param boolean If true returns email as array (email and name for identity) 464 474 * @return mixed Resolved e-mail address string or array of strings 465 475 */ 466 static function user2email($user, $first=true )476 static function user2email($user, $first=true, $extended=false) 467 477 { 468 478 $result = array(); … … 475 485 while ($sql_arr = $dbh->fetch_array($sql_result)) 476 486 if (strpos($sql_arr[0], '@')) { 477 $result[] = $sql_arr[0];487 $result[] = ($extended && count($sql_arr) > 1) ? $sql_arr : $sql_arr[0]; 478 488 if ($first) 479 489 return $result[0];
Note: See TracChangeset
for help on using the changeset viewer.
