Changeset 21 in subversion
- Timestamp:
- Oct 7, 2005 10:17:08 AM (8 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 3 added
- 16 edited
-
CHANGELOG (modified) (2 diffs)
-
INSTALL (modified) (2 diffs)
-
SQL/mysql.initial.sql (modified) (2 diffs)
-
SQL/postgres.initial.sql (modified) (1 diff)
-
UPGRADING (modified) (3 diffs)
-
config/db.inc.php.dist (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
index.php (modified) (4 diffs)
-
program/include/main.inc (modified) (6 diffs)
-
program/include/rcube_db.inc (modified) (11 diffs)
-
program/include/rcube_imap.inc (modified) (2 diffs)
-
program/include/session.inc (modified) (2 diffs)
-
program/js/app.js (modified) (1 diff)
-
program/js/common.js (modified) (2 diffs)
-
program/lib/imap.inc (modified) (2 diffs)
-
program/localization/nl (added)
-
program/localization/nl/labels.inc (added)
-
program/localization/nl/messages.inc (added)
-
program/steps/settings/func.inc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r20 r21 27 27 28 28 29 2005/10/0 429 2005/10/09 30 30 ---------- 31 - Added French, Italian, Spanish, Danish translation 31 - Added French, Italian, Spanish, Danish, Dutch translation 32 - Clearified license (Bug #1305966) 32 33 - Fixed PHP warnings (Bug #1299403) 33 34 - Fixed english translation bug #1295406 34 35 - Fixed bug #1290833: Last character of email not seen 36 - Fixed bug #1292199 when creating new user 37 - Allow more borwsers (Bug #1285101) 35 38 - Added setting for showing pretty dates 36 39 - Added support for SQLite database … … 38 41 - Also add attachments when forwarding a message 39 42 - Show nested mailboxes hieracically 43 - Enable IMAPS by host -
trunk/roundcubemail/INSTALL
r16 r21 7 7 - /temp 8 8 - /logs 9 3. Rename the files config/*.inc.php.dist to config/*.inc.php 10 4. Modify the files in config/* to suit your local environment 11 5. Create database tables using the queries in file 'SQL/*.initial.sql' 12 Rename tables if you like, but make shure the names are also changed in config/db.inc.php 13 6. Done! 9 3. Create a new database and a database user for RoundCube 10 4. Create database tables using the queries in file 'SQL/*.initial.sql' 11 5. Rename the files config/*.inc.php.dist to config/*.inc.php 12 6. Modify the files in config/* to suit your local environment 13 7. Done! 14 15 16 UPGRADING 17 ========= 18 If you already have a previous version of RoundCube installed, 19 please refer to the instructions in UPGRADING guide. 14 20 15 21 … … 23 29 - error_reporting E_ALL & ~E_NOTICE (or lower) 24 30 - file_uploads on (for attachment upload features) 25 * A MySQL or Postgre s database engine31 * A MySQL or PostgreSQL database engine or the SQLite extension for PHP 26 32 * A database with permission to create tables 27 33 -
trunk/roundcubemail/SQL/mysql.initial.sql
r13 r21 72 72 `created` datetime NOT NULL default '0000-00-00 00:00:00', 73 73 `changed` datetime NOT NULL default '0000-00-00 00:00:00', 74 `ip` VARCHAR(15) NOT NULL default '', 74 75 `vars` text NOT NULL, 75 76 PRIMARY KEY (`sess_id`) … … 85 86 `user_id` int(10) unsigned NOT NULL auto_increment, 86 87 `username` varchar(128) NOT NULL default '', 87 `mail_host` varchar(255) NOT NULL default '', 88 `mail_host` varchar(128) NOT NULL default '', 89 `alias` varchar(128) NOT NULL default '', 88 90 `created` datetime NOT NULL default '0000-00-00 00:00:00', 89 91 `last_login` datetime NOT NULL default '0000-00-00 00:00:00', -
trunk/roundcubemail/SQL/postgres.initial.sql
r13 r21 148 148 username character varying(128) DEFAULT ''::character varying NOT NULL, 149 149 mail_host character varying(128) DEFAULT ''::character varying NOT NULL, 150 alias character varying(128) DEFAULT ''::character varying NOT NULL, 150 151 created timestamp with time zone DEFAULT now() NOT NULL, 151 152 last_login timestamp with time zone DEFAULT now() NOT NULL, -
trunk/roundcubemail/UPGRADING
r11 r21 10 10 ---------------------------------------- 11 11 - replace all files in folder /program/ 12 - rund SQL queries in order to update the database 12 13 - add these line to /config/main.inc.php 13 14 $rcmail_config['trash_mbox'] = 'Trash'; … … 16 17 $rcmail_config['prettydate'] = TRUE; 17 18 $rcmail_config['smtp_port'] = 25; 19 $rcmail_config['default_port'] = 143; 20 - replace database properties (db_type, db_host, db_user, db_pass, $d_name) 21 in /config/db.inc.php with the following line: 22 $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail'; 18 23 19 24 … … 21 26 ---------------------------------------- 22 27 - replace all files in folder /program/ 28 - rund SQL queries in order to update the database 23 29 - add these line to /config/main.inc.php 24 30 $rcmail_config['prettydate'] = TRUE; 25 31 $rcmail_config['smtp_port'] = 25; 32 $rcmail_config['default_port'] = 143; 33 - replace database properties (db_type, db_host, db_user, db_pass, $d_name) 34 in /config/db.inc.php with the following line: 35 $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail'; 36 -
trunk/roundcubemail/config/db.inc.php.dist
r16 r21 16 16 17 17 // PEAR database DSN for read/write operations 18 //format is db_provider://user:password@host/databse 18 // format is db_provider://user:password@host/databse 19 // currentyl suported db_providers: mysql, sqlite, pgsql 19 20 20 21 $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail'; 22 // sqlite example: 'sqlite://./sqlite.db?mode=0646'; 21 23 22 24 // PEAR database DSN for read only operations (if empty write database will be used) 23 25 // userful for database replication 24 25 26 $rcmail_config['db_dsnr'] = ''; 26 27 -
trunk/roundcubemail/config/main.inc.php.dist
r19 r21 29 29 // the mail host chosen to perform the log-in 30 30 // leave blank to show a textbox at login, give a list of hosts 31 // to display a pulldown menu or set one host as string 31 // to display a pulldown menu or set one host as string. 32 // To use SSL connection, enter ssl://hostname:993 32 33 $rcmail_config['default_host'] = ''; 34 35 // TCP port used for IMAP connections 36 $rcmail_config['default_port'] = 143; 33 37 34 38 // use this host for sending mails. -
trunk/roundcubemail/index.php
r20 r21 49 49 50 50 // set environment first 51 ini_set('include_path', ini_get('include_path').PATH_SEPARATOR. 'program'.PATH_SEPARATOR.'program/lib');51 ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.$INSTALL_PATH.PATH_SEPARATOR.'program'.PATH_SEPARATOR.'program/lib'); 52 52 ini_set('session.name', 'sessid'); 53 53 ini_set('session.use_cookies', 1); 54 ini_set('error_reporting', E_ALL&~E_NOTICE); 54 55 //ini_set('session.save_path', $INSTALL_PATH.'session'); 55 56 … … 74 75 $_framed = (!empty($_GET['_framed']) || !empty($_POST['_framed'])); 75 76 77 if (!empty($_GET['_remote'])) 78 $REMOTE_REQUEST = TRUE; 79 80 76 81 // start session with requested task 77 82 rcmail_startup($_task); … … 137 142 if ($_auth !== $sess_auth || $_auth != rcmail_auth_hash($_SESSION['client_id'], $_SESSION['auth_time'])) 138 143 { 139 show_message('sessionerror', 'error');144 $message = show_message('sessionerror', 'error'); 140 145 rcmail_kill_session(); 141 146 } … … 157 162 // not logged in -> set task to 'login 158 163 if (empty($_SESSION['user_id'])) 164 { 165 if ($REMOTE_REQUEST) 166 { 167 $message .= "setTimeout(\"location.href='\"+this.env.comm_path+\"'\", 2000);"; 168 rcube_remote_response($message); 169 } 170 159 171 $_task = 'login'; 172 } 160 173 161 174 -
trunk/roundcubemail/program/include/main.inc
r20 r21 56 56 // prepare DB connection 57 57 $DB = new rcube_db($CONFIG['db_dsnw'], $CONFIG['db_dsnr']); 58 $DB->sqlite_initials = $INSTALL_PATH.'SQL/sqlite.initial.sql'; 58 59 59 60 // we can use the database for storing session data 60 if (is_object($DB) )61 if (is_object($DB) && $DB->db_provider!='sqlite') 61 62 include_once('include/session.inc'); 62 63 … … 233 234 { 234 235 global $CONFIG, $IMAP, $DB, $sess_user_lang; 236 $user_id = NULL; 235 237 236 238 if (!$host) 237 239 $host = $CONFIG['default_host']; 238 240 241 // query if user already registered 242 $sql_result = $DB->query(sprintf("SELECT user_id, username, language, preferences 243 FROM %s 244 WHERE mail_host='%s' AND (username='%s' OR alias='%s')", 245 get_table_name('users'), 246 addslashes($host), 247 addslashes($user), 248 addslashes($user))); 249 250 // user already registered -> overwrite username 251 if ($sql_arr = $DB->fetch_assoc($sql_result)) 252 { 253 $user_id = $sql_arr['user_id']; 254 $user = $sql_arr['username']; 255 } 256 257 // parse $host URL 258 $a_host = parse_url($host); 259 if ($a_host['host']) 260 { 261 $host = $a_host['host']; 262 $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? TRUE : FALSE; 263 $imap_port = isset($a_host['post']) ? $a_host['post'] : ($imap_ssl ? 993 : $CONFIG['default_port']); 264 } 265 239 266 // exit if IMAP login failed 240 if (!($imap_login = $IMAP->connect($host, $user, $pass )))267 if (!($imap_login = $IMAP->connect($host, $user, $pass, $imap_port, $imap_ssl))) 241 268 return FALSE; 242 269 243 // query if user already registered244 $sql_result = $DB->query(sprintf("SELECT user_id, language, preferences245 FROM %s246 WHERE username='%s' AND mail_host='%s'",247 get_table_name('users'),248 $user, $host));249 250 270 // user already registered 251 if ($sql_arr = $DB->fetch_assoc($sql_result)) 252 { 253 $user_id = $sql_arr['user_id']; 254 271 if ($user_id && !empty($sql_arr)) 272 { 255 273 // get user prefs 256 274 if (strlen($sql_arr['preferences'])) … … 304 322 VALUES (NOW(), NOW(), '%s', '%s')", 305 323 get_table_name('users'), 306 $user, $host)); 324 addslashes($user), 325 addslashes($host))); 307 326 308 327 if ($user_id = $DB->insert_id()) … … 317 336 get_table_name('identities'), 318 337 $user_id, 319 $user_name,320 $user_email));338 addslashes($user_name), 339 addslashes($user_email))); 321 340 322 341 // get existing mailboxes … … 330 349 if ($CONFIG['trash_mbox'] && !in_array_nocase($CONFIG['trash_mbox'], $a_mailboxes)) 331 350 $IMAP->create_mailbox($CONFIG['trash_mbox'], TRUE); 351 } 352 else 353 { 354 raise_error(array('code' => 500, 355 'type' => 'php', 356 'line' => __LINE__, 357 'file' => __FILE__, 358 'message' => "Failed to create new user"), TRUE, FALSE); 332 359 } 333 360 … … 964 991 { 965 992 $select_host = new select(array('name' => '_host')); 966 $select_host->add($CONFIG['default_host']); 993 994 foreach ($CONFIG['default_host'] as $key => $value) 995 $select_host->add($value, (is_numeric($key) ? $value : $key)); 996 967 997 $fields['host'] = $select_host->show($_POST['_host']); 968 998 } -
trunk/roundcubemail/program/include/rcube_db.inc
r20 r21 41 41 $this->db_dsnw = $db_dsnw; 42 42 $this->db_dsnr = $db_dsnr; 43 44 $dsn_array = DB::parseDSN($db_dsnw); 45 $this->db_provider = $dsn_array['phptype']; 43 46 } 44 47 … … 52 55 function dsn_connect($dsn) 53 56 { 54 $dsn_array = DB::parseDSN($dsn);55 $this->db_provider = $dsn_array['phptype'];56 57 57 // Use persistent connections if available 58 58 $dbh = DB::connect($dsn, array('persistent' => $true)); 59 59 60 60 if (DB::isError($dbh)) 61 61 raise_error(array('code' => 500, … … 64 64 'file' => __FILE__, 65 65 'message' => $dbh->getMessage()), TRUE, FALSE); 66 66 67 else if ($this->db_provider=='sqlite') 67 68 { 68 if (!is_file($dsn_array['database']) || !filesize($dsn_array['database'])) 69 $this->_sqlite_create_database($dbh, 'SQL/sqlite.initial.sql'); 69 $dsn_array = DB::parseDSN($dsn); 70 if (!filesize($dsn_array['database']) && !empty($this->sqlite_initials)) 71 $this->_sqlite_create_database($dbh, $this->sqlite_initials); 70 72 } 71 73 … … 76 78 function db_connect ($mode) 77 79 { 80 $this->db_mode = $mode; 81 78 82 // Already connected 79 80 83 if ($this->db_connected) 81 84 { … … 97 100 $this->db_handle = $this->dsn_connect($dsn); 98 101 $this->db_connected = true; 99 $this->db_mode = $mode;100 102 } 101 103 … … 118 120 119 121 if (DB::isError($result)) 120 raise_error(array('code' => 500, 'type' => 'db', 122 raise_error(array('code' => 500, 123 'type' => 'db', 121 124 'line' => __LINE__, 122 125 'file' => __FILE__, … … 128 131 function db_execute ($query) 129 132 { 130 db_connect('w');133 $this->db_connect('w'); 131 134 132 135 if ($this->db_provider == 'sqlite') … … 160 163 function insert_id($sequence = '') 161 164 { 162 if (!$this->db_ link|| $this->db_mode=='r')165 if (!$this->db_handle || $this->db_mode=='r') 163 166 return FALSE; 164 167 … … 168 171 // PostgreSQL uses sequences 169 172 $result =& $this->db_handle->getOne("SELECT CURRVAL('$sequence')"); 170 if (DB::isError($result)) 173 if (DB::isError($result)) { 171 174 raise_error( array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__, 172 175 'message' => $result->getMessage()), TRUE, TRUE); 176 } 173 177 return $result; 174 178 175 179 case 'mysql': // This is unfortuneate 176 return mysql_insert_id( $this->db_handle);180 return mysql_insert_id(); 177 181 178 182 case 'sqlite': … … 190 194 191 195 if (DB::isError($result)) 196 { 192 197 raise_error( array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__, 193 'message' => $this->db_link->getMessage()), TRUE, TRUE); 198 'message' => $this->db_link->getMessage()), TRUE, FALSE); 199 return FALSE; 200 } 194 201 195 202 return $result->fetchRow(DB_FETCHMODE_ASSOC); … … 232 239 return ; 233 240 234 $fd = fopen($fileName, 'r');235 if (!$fd)236 return ;237 238 241 $data = ''; 239 while ($line = fgets($fd, 4096)) 240 $data .= $line; 241 242 fclose($fd); 243 sqlite_exec($dbh->connection, $data); 242 if ($fd = fopen($fileName, 'r')) 243 { 244 $data = fread($fd, filesize($fileName)); 245 fclose($fd); 246 } 247 248 if (strlen($data)) 249 sqlite_exec($dbh->connection, $data); 244 250 } 245 251 -
trunk/roundcubemail/program/include/rcube_imap.inc
r20 r21 25 25 require_once('lib/mime.inc'); 26 26 27 // check for Open-SSL support in PHP build28 //$ICL_SSL = TRUE;29 //$ICL_PORT = 993;30 27 31 28 class rcube_imap … … 76 73 77 74 78 function connect($host, $user, $pass, $port=143) 79 { 80 global $ICL_PORT; 75 function connect($host, $user, $pass, $port=143, $use_ssl=FALSE) 76 { 77 global $ICL_PORT, $CONFIG; 78 79 // check for Open-SSL support in PHP build 80 if ($use_ssl && in_array('openssl', get_loaded_extensions())) 81 $ICL_SSL = TRUE; 81 82 82 83 $ICL_PORT = $port; 83 $this->conn = iil_Connect($host, $user, $pass );84 $this->conn = iil_Connect($host, $user, $pass, array('imap' => 'check')); 84 85 $this->host = $host; 85 86 $this->user = $user; 86 87 $this->pass = $pass; 88 89 if ($this->conn && ($CONFIG['debug_level'] & 8)) 90 print $this->conn->message; 91 92 else if (!$this->conn && $GLOBALS['iil_error']) 93 { 94 raise_error(array('code' => 403, 95 'type' => 'imap', 96 'message' => $GLOBALS['iil_error']), TRUE, FALSE); 97 } 87 98 88 99 return $this->conn ? TRUE : FALSE; -
trunk/roundcubemail/program/include/session.inc
r8 r21 39 39 global $DB, $SESS_CHANGED; 40 40 41 $sql_result = $DB->query(sprintf("SELECT vars, UNIX_TIMESTAMP(changed) AS changed41 $sql_result = $DB->query(sprintf("SELECT vars, ip, UNIX_TIMESTAMP(changed) AS changed 42 42 FROM %s 43 43 WHERE sess_id='%s'", … … 82 82 { 83 83 $DB->query(sprintf("INSERT INTO %s 84 (sess_id, vars, created, changed)85 VALUES ('%s', '%s', NOW(), NOW())",84 (sess_id, vars, ip, created, changed) 85 VALUES ('%s', '%s', '%s', NOW(), NOW())", 86 86 get_table_name('session'), 87 87 $key, 88 $vars)); 88 $vars, 89 $_SERVER['REMOTE_ADDR'])); 89 90 } 90 91 -
trunk/roundcubemail/program/js/app.js
r20 r21 77 77 78 78 // check browser 79 if (!(bw.dom && ((bw.ie && bw.vendver>=5.5 && !bw.opera) || (bw.mz && bw.vendver>=1) || (bw.safari && bw.vendver>=125) || (bw.opera && bw.vendver>=8)))) 79 if (!(bw.dom && ((bw.ie && bw.vendver>=5.5 && !bw.opera) || (bw.mz && bw.vendver>=1) || (bw.safari && bw.vendver>=125) || 80 (bw.opera && bw.vendver>=8) || (bw.konq && bw.vendver>=3.4)))) 80 81 { 81 82 location.href = this.env.comm_path+'&_action=error&_code=0x199'; -
trunk/roundcubemail/program/js/common.js
r8 r21 48 48 this.ns6 = (this.ns && parseInt(this.vendver)==6); // (this.mz && this.ns) ? true : false; 49 49 this.ns7 = (this.ns && parseInt(this.vendver)==7); // this.agent.indexOf('Netscape/7')>0); 50 this.safari = this.agent.toLowerCase().indexOf('safari')>0;51 this.konq = (this.agent.toLowerCase().indexOf('konqueror')>0); 50 this.safari = (this.agent.toLowerCase().indexOf('safari')>0 || this.agent.toLowerCase().indexOf('applewebkit')>0); 51 this.konq = (this.agent.toLowerCase().indexOf('konqueror')>0); 52 52 53 53 this.opera = (window.opera) ? true : false; … … 59 59 this.vendver = (/opera(\s|\/)([0-9\.]+)/i.test(navigator.userAgent)) ? parseFloat(RegExp.$2) : -1; 60 60 else if(!this.vendver && this.safari) 61 this.vendver = (/ safari\/([0-9]+)/i.test(this.agent)) ? parseInt(RegExp.$1) : 0;61 this.vendver = (/(safari|applewebkit)\/([0-9]+)/i.test(this.agent)) ? parseInt(RegExp.$2) : 0; 62 62 else if((!this.vendver && this.mz) || this.agent.indexOf('Camino')>0) 63 63 this.vendver = (/rv:([0-9\.]+)/.test(this.agent)) ? parseFloat(RegExp.$1) : 0; 64 64 else if(this.ie && window.RegExp) 65 65 this.vendver = (/msie\s+([0-9\.]+)/i.test(this.agent)) ? parseFloat(RegExp.$1) : 0; 66 else if(this.konq && window.RegExp) 67 this.vendver = (/khtml\/([0-9\.]+)/i.test(this.agent)) ? parseFloat(RegExp.$1) : 0; 68 66 69 67 70 // get real language out of safari's user agent -
trunk/roundcubemail/program/lib/imap.inc
r8 r21 346 346 do{ 347 347 $line = trim(chop(iil_ReadLine($conn->fp, 100))); 348 $conn->message.="$line\n"; 348 349 $a = explode(" ", $line); 349 350 if ($line[0]=="*"){ … … 363 364 fputs($conn->fp, "a000 AUTHENTICATE CRAM-MD5\r\n"); 364 365 $line = trim(chop(iil_ReadLine($conn->fp, 1024))); 366 $conn->message.="$line\n"; 365 367 if ($line[0]=="+"){ 366 368 $conn->message.='Got challenge: '.htmlspecialchars($line)."\n"; -
trunk/roundcubemail/program/steps/settings/func.inc
r8 r21 58 58 $select_lang->add('English', 'en'); 59 59 $select_lang->add('Espanol', 'es'); 60 $select_lang->add('Fran ais', 'fr');60 $select_lang->add('Français', 'fr'); 61 61 $select_lang->add('Italiano', 'it'); 62 63 $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 64 $field_id, 65 rcube_label('language'), 62 $select_lang->add('Nederlands', 'nl'); 63 64 $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 65 $field_id, 66 rep_specialchars_output(rcube_label('language')), 66 67 $select_lang->show($sess_user_lang)); 67 68 … … 100 101 $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 101 102 $field_id, 102 r cube_label('timezone'),103 rep_specialchars_output(rcube_label('timezone')), 103 104 $select_timezone->show($CONFIG['timezone'])); 104 105 … … 110 111 $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 111 112 $field_id, 112 r cube_label('pagesize'),113 rep_specialchars_output(rcube_label('pagesize')), 113 114 $input_pagesize->show($CONFIG['pagesize'])); 114 115 … … 119 120 $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 120 121 $field_id, 121 r cube_label('preferhtml'),122 rep_specialchars_output(rcube_label('preferhtml')), 122 123 $input_pagesize->show($CONFIG['prefer_html']?1:0)); 123 124 … … 128 129 $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 129 130 $field_id, 130 r cube_label('prettydate'),131 rep_specialchars_output(rcube_label('prettydate')), 131 132 $input_prettydate->show($CONFIG['prettydate']?1:0)); 132 133
Note: See TracChangeset
for help on using the changeset viewer.
