Thanks for the solution, I have the solution modified for RoundCube 0.2 stable that the Squirrelmail Address Book with the first login users after to put on automatically adapted is imported.
Importantly the Squirrelmail and RoundCube tables must lie in the same data base on the same MySQL server.
serach in /program/include/rcube_user.php in the static function create
and insert behind itPHP Code:if ($user_id = $dbh->insert_id(get_sequence_name('users')))
{
so it should look thenPHP Code://Import Users Squirrelmail Address Book on first login start
$dbh->query(
"INSERT INTO ".get_table_name('contacts')."
(name, firstname, surname, email, user_id)
SELECT nickname, firstname, lastname, email, '".$user_id."'
FROM address
WHERE owner = '".strip_newlines($user)."'
ORDER BY lastname ASC");
//Import Users Squirrelmail Address Book on first login end
Additionally one can arrange also over the configurable over main.inc.phpPHP Code:if ($user_id = $dbh->insert_id(get_sequence_name('users')))
{
//Import Users Squirrelmail Address Book on first login start
$dbh->query(
"INSERT INTO ".get_table_name('contacts')."
(name, firstname, surname, email, user_id)
SELECT nickname, firstname, lastname, email, '".$user_id."'
FROM address
WHERE owner = '".strip_newlines($user)."'
ORDER BY lastname ASC");
//Import Users Squirrelmail Address Book on first login end
inserts for this into /config/main.inc.php
and modifie the /program/include/rcube_user.php in the static function createPHP Code:// Import SquirrelMail Address Book after Auto Create User
// The Squirrelmail and RoundCube Tables must on the same DB
$rcmail_config['import_squirrel_addresses'] = TRUE; //or FALSE
so it should look then
PHP Code:if ($user_id = $dbh->insert_id(get_sequence_name('users')))
{
//Import Users Squirrelmail Address Book on first login start
if($rcmail->config->get('import_squirrel_addresses')) {
$dbh->query(
"INSERT INTO ".get_table_name('contacts')."
(name, firstname, surname, email, user_id)
SELECT nickname, firstname, lastname, email, '".$user_id."'
FROM address
WHERE owner = '".strip_newlines($user)."'
ORDER BY lastname ASC");
}
//Import Users Squirrelmail Address Book on first login end


LinkBack URL
About LinkBacks



Reply With Quote

