| | |
| | | |
| | | |
| | | // prepare DB connection |
| | | if (strtolower($CONFIG['db_type'])=='mysql') |
| | | $DB = new rcube_mysql($CONFIG['db_name'], $CONFIG['db_user'], $CONFIG['db_pass'], $CONFIG['db_host']); |
| | | |
| | | // database not supported |
| | | else |
| | | { |
| | | raise_error(array('code' => 500, |
| | | 'type' => 'php', |
| | | 'line' => __LINE__, |
| | | 'file' => __FILE__, |
| | | 'message' => "Database not supported"), TRUE, TRUE); |
| | | return; |
| | | } |
| | | |
| | | $DB = new rcube_db($CONFIG['db_dsnw'], $CONFIG['db_dsnr']); |
| | | |
| | | // we can use the database for storing session data |
| | | if (is_object($DB) && $DB->connect()) |
| | | if (is_object($DB)) |
| | | include_once('include/session.inc'); |
| | | |
| | | |
| | |
| | | |
| | | if ($user_id = $DB->insert_id()) |
| | | { |
| | | $user_email = strstr($user, '@') ? $user : sprintf('%s@%s', $user, $host); |
| | | $user_name = $user!=$user_email ? $user : ''; |
| | | |
| | | // also create a new identity record |
| | | $DB->query(sprintf("INSERT INTO %s |
| | | (user_id, `default`, name, email) |
| | | VALUES (%d, '1', '%s', '%s@%s')", |
| | | VALUES (%d, '1', '%s', '%s')", |
| | | get_table_name('identities'), |
| | | $user_id, |
| | | $user, |
| | | $user, |
| | | $host)); |
| | | $user_name, |
| | | $user_email)); |
| | | |
| | | // get existing mailboxes |
| | | $a_mailboxes = $IMAP->list_mailboxes(); |