Hello,
I made a little mod for virtuser_query and virtuser_file !
in program/include/main.inc line 513 remove
// try to resolve email address from virtuser table
if (!empty($CONFIG['virtuser_file']) && strstr($user, '@'))
$user = rcmail_email2user($user);
in program/include/main.inc line 497 add
/*
** devil1591
*/
// try to resolve email address from virtuser table
if (!empty($CONFIG['virtuser_file']) && strstr($user, '@'))
$user = rcmail_email2user($user);
// try to resolve the e-mail address from the virtuser table
if (!empty($CONFIG['virtuser_query']) && !strstr($user, '@'))
{
$sql_result = $DB->query(preg_replace('/%u/', $user, $CONFIG['virtuser_query']));
if ($DB->num_rows()>0) {
while ($sql_arr = $DB->fetch_array($sql_result)) {
$user = $sql_arr[0];
}
}
}
in fact, this improvement will check if an email can be found in the query or file from config.
In this case, the webmail will try to login to the IMAP.
If a user already exist in our DB, it'll use it, if not, it will create a new one...
I made this mod in order to login with Wordpress login with the email associated to this login
ex : admin is associated to
[email protected]my virtuser_query config :
$rcmail_config['virtuser_query'] = "SELECT meta_value FROM wordpresstable.wp_users WHERE user_login = '%u'";
I hope this will be incorporated in latest svn :P