Permalink
Browse files

Several bugfixes and feature improvements

  • Loading branch information...
1 parent 597170f commit 42b11351497ce67e96a0465c76694632cdfb3ecb @thomascube thomascube committed Oct 7, 2005
View
@@ -26,14 +26,18 @@ CHANGELOG RoundCube Webmail
- Make list of special mailboxes configurable
-2005/10/04
+2005/10/09
----------
-- Added French, Italian, Spanish, Danish translation
+- Added French, Italian, Spanish, Danish, Dutch translation
+- Clearified license (Bug #1305966)
- Fixed PHP warnings (Bug #1299403)
- Fixed english translation bug #1295406
- Fixed bug #1290833: Last character of email not seen
+- Fixed bug #1292199 when creating new user
+- Allow more borwsers (Bug #1285101)
- Added setting for showing pretty dates
- Added support for SQLite database
- Make use of message caching configurable
- Also add attachments when forwarding a message
- Show nested mailboxes hieracically
+- Enable IMAPS by host
View
18 INSTALL
@@ -6,11 +6,17 @@ INSTALLATION
2. Make shure that the following directories are writable by the webserver
- /temp
- /logs
-3. Rename the files config/*.inc.php.dist to config/*.inc.php
-4. Modify the files in config/* to suit your local environment
-5. Create database tables using the queries in file 'SQL/*.initial.sql'
- Rename tables if you like, but make shure the names are also changed in config/db.inc.php
-6. Done!
+3. Create a new database and a database user for RoundCube
+4. Create database tables using the queries in file 'SQL/*.initial.sql'
+5. Rename the files config/*.inc.php.dist to config/*.inc.php
+6. Modify the files in config/* to suit your local environment
+7. Done!
+
+
+UPGRADING
+=========
+If you already have a previous version of RoundCube installed,
+please refer to the instructions in UPGRADING guide.
REQUIREMENTS
@@ -22,7 +28,7 @@ REQUIREMENTS
* php.ini options:
- error_reporting E_ALL & ~E_NOTICE (or lower)
- file_uploads on (for attachment upload features)
-* A MySQL or Postgres database engine
+* A MySQL or PostgreSQL database engine or the SQLite extension for PHP
* A database with permission to create tables
View
@@ -71,6 +71,7 @@ CREATE TABLE `session` (
`sess_id` varchar(32) NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`changed` datetime NOT NULL default '0000-00-00 00:00:00',
+ `ip` VARCHAR(15) NOT NULL default '',
`vars` text NOT NULL,
PRIMARY KEY (`sess_id`)
) TYPE=MyISAM;
@@ -84,7 +85,8 @@ CREATE TABLE `session` (
CREATE TABLE `users` (
`user_id` int(10) unsigned NOT NULL auto_increment,
`username` varchar(128) NOT NULL default '',
- `mail_host` varchar(255) NOT NULL default '',
+ `mail_host` varchar(128) NOT NULL default '',
+ `alias` varchar(128) NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`last_login` datetime NOT NULL default '0000-00-00 00:00:00',
`language` varchar(5) NOT NULL default 'en',
View
@@ -147,6 +147,7 @@ CREATE TABLE users (
user_id integer DEFAULT nextval('user_ids'::text) NOT NULL,
username character varying(128) DEFAULT ''::character varying NOT NULL,
mail_host character varying(128) DEFAULT ''::character varying NOT NULL,
+ alias character varying(128) DEFAULT ''::character varying NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
last_login timestamp with time zone DEFAULT now() NOT NULL,
"language" character varying(5) DEFAULT 'en'::character varying NOT NULL,
View
@@ -9,17 +9,28 @@ of RoundCube Webmail.
from versions 0.1-alpha and 0.1-20050811
----------------------------------------
- replace all files in folder /program/
+- rund SQL queries in order to update the database
- add these line to /config/main.inc.php
$rcmail_config['trash_mbox'] = 'Trash';
$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
$rcmail_config['prefer_html'] = TRUE;
$rcmail_config['prettydate'] = TRUE;
$rcmail_config['smtp_port'] = 25;
+ $rcmail_config['default_port'] = 143;
+- replace database properties (db_type, db_host, db_user, db_pass, $d_name)
+ in /config/db.inc.php with the following line:
+ $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
from version 0.1-20050820
----------------------------------------
- replace all files in folder /program/
+- rund SQL queries in order to update the database
- add these line to /config/main.inc.php
$rcmail_config['prettydate'] = TRUE;
$rcmail_config['smtp_port'] = 25;
+ $rcmail_config['default_port'] = 143;
+- replace database properties (db_type, db_host, db_user, db_pass, $d_name)
+ in /config/db.inc.php with the following line:
+ $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
+
View
@@ -15,13 +15,14 @@
$rcmail_config = array();
// PEAR database DSN for read/write operations
-//format is db_provider://user:password@host/databse
+// format is db_provider://user:password@host/databse
+// currentyl suported db_providers: mysql, sqlite, pgsql
$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
+// sqlite example: 'sqlite://./sqlite.db?mode=0646';
// PEAR database DSN for read only operations (if empty write database will be used)
// userful for database replication
-
$rcmail_config['db_dsnr'] = '';
// you can define specific table names used to store webmail data
View
@@ -28,9 +28,13 @@ $rcmail_config['auto_create_user'] = TRUE;
// the mail host chosen to perform the log-in
// leave blank to show a textbox at login, give a list of hosts
-// to display a pulldown menu or set one host as string
+// to display a pulldown menu or set one host as string.
+// To use SSL connection, enter ssl://hostname:993
$rcmail_config['default_host'] = '';
+// TCP port used for IMAP connections
+$rcmail_config['default_port'] = 143;
+
// use this host for sending mails.
// if left blank, the PHP mail() function is used
$rcmail_config['smtp_server'] = '';
View
@@ -48,9 +48,10 @@
// set environment first
-ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.'program'.PATH_SEPARATOR.'program/lib');
+ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.$INSTALL_PATH.PATH_SEPARATOR.'program'.PATH_SEPARATOR.'program/lib');
ini_set('session.name', 'sessid');
ini_set('session.use_cookies', 1);
+ini_set('error_reporting', E_ALL&~E_NOTICE);
//ini_set('session.save_path', $INSTALL_PATH.'session');
@@ -73,6 +74,10 @@
$_action = !empty($_POST['_action']) ? $_POST['_action'] : (!empty($_GET['_action']) ? $_GET['_action'] : '');
$_framed = (!empty($_GET['_framed']) || !empty($_POST['_framed']));
+if (!empty($_GET['_remote']))
+ $REMOTE_REQUEST = TRUE;
+
+
// start session with requested task
rcmail_startup($_task);
@@ -136,7 +141,7 @@
{
if ($_auth !== $sess_auth || $_auth != rcmail_auth_hash($_SESSION['client_id'], $_SESSION['auth_time']))
{
- show_message('sessionerror', 'error');
+ $message = show_message('sessionerror', 'error');
rcmail_kill_session();
}
}
@@ -156,7 +161,15 @@
// not logged in -> set task to 'login
if (empty($_SESSION['user_id']))
+ {
+ if ($REMOTE_REQUEST)
+ {
+ $message .= "setTimeout(\"location.href='\"+this.env.comm_path+\"'\", 2000);";
+ rcube_remote_response($message);
+ }
+
$_task = 'login';
+ }
View
@@ -55,9 +55,10 @@ function rcmail_startup($task='mail')
// prepare DB connection
$DB = new rcube_db($CONFIG['db_dsnw'], $CONFIG['db_dsnr']);
+ $DB->sqlite_initials = $INSTALL_PATH.'SQL/sqlite.initial.sql';
// we can use the database for storing session data
- if (is_object($DB))
+ if (is_object($DB) && $DB->db_provider!='sqlite')
include_once('include/session.inc');
@@ -232,26 +233,43 @@ function load_gui()
function rcmail_login($user, $pass, $host=NULL)
{
global $CONFIG, $IMAP, $DB, $sess_user_lang;
+ $user_id = NULL;
if (!$host)
$host = $CONFIG['default_host'];
- // exit if IMAP login failed
- if (!($imap_login = $IMAP->connect($host, $user, $pass)))
- return FALSE;
-
// query if user already registered
- $sql_result = $DB->query(sprintf("SELECT user_id, language, preferences
- FROM %s
- WHERE username='%s' AND mail_host='%s'",
+ $sql_result = $DB->query(sprintf("SELECT user_id, username, language, preferences
+ FROM %s
+ WHERE mail_host='%s' AND (username='%s' OR alias='%s')",
get_table_name('users'),
- $user, $host));
+ addslashes($host),
+ addslashes($user),
+ addslashes($user)));
- // user already registered
+ // user already registered -> overwrite username
if ($sql_arr = $DB->fetch_assoc($sql_result))
{
$user_id = $sql_arr['user_id'];
-
+ $user = $sql_arr['username'];
+ }
+
+ // parse $host URL
+ $a_host = parse_url($host);
+ if ($a_host['host'])
+ {
+ $host = $a_host['host'];
+ $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? TRUE : FALSE;
+ $imap_port = isset($a_host['post']) ? $a_host['post'] : ($imap_ssl ? 993 : $CONFIG['default_port']);
+ }
+
+ // exit if IMAP login failed
+ if (!($imap_login = $IMAP->connect($host, $user, $pass, $imap_port, $imap_ssl)))
+ return FALSE;
+
+ // user already registered
+ if ($user_id && !empty($sql_arr))
+ {
// get user prefs
if (strlen($sql_arr['preferences']))
{
@@ -303,7 +321,8 @@ function rcmail_create_user($user, $host)
(created, last_login, username, mail_host)
VALUES (NOW(), NOW(), '%s', '%s')",
get_table_name('users'),
- $user, $host));
+ addslashes($user),
+ addslashes($host)));
if ($user_id = $DB->insert_id())
{
@@ -316,8 +335,8 @@ function rcmail_create_user($user, $host)
VALUES (%d, '1', '%s', '%s')",
get_table_name('identities'),
$user_id,
- $user_name,
- $user_email));
+ addslashes($user_name),
+ addslashes($user_email)));
// get existing mailboxes
$a_mailboxes = $IMAP->list_mailboxes();
@@ -330,6 +349,14 @@ function rcmail_create_user($user, $host)
if ($CONFIG['trash_mbox'] && !in_array_nocase($CONFIG['trash_mbox'], $a_mailboxes))
$IMAP->create_mailbox($CONFIG['trash_mbox'], TRUE);
}
+ else
+ {
+ raise_error(array('code' => 500,
+ 'type' => 'php',
+ 'line' => __LINE__,
+ 'file' => __FILE__,
+ 'message' => "Failed to create new user"), TRUE, FALSE);
+ }
return $user_id;
}
@@ -963,7 +990,10 @@ function rcmail_login_form($attrib)
if (is_array($CONFIG['default_host']))
{
$select_host = new select(array('name' => '_host'));
- $select_host->add($CONFIG['default_host']);
+
+ foreach ($CONFIG['default_host'] as $key => $value)
+ $select_host->add($value, (is_numeric($key) ? $value : $key));
+
$fields['host'] = $select_host->show($_POST['_host']);
}
else if (!strlen($CONFIG['default_host']))
Oops, something went wrong.

0 comments on commit 42b1135

Please sign in to comment.