Skip to content

Commit

Permalink
Finalized 0.1beta2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
thomascube committed Aug 6, 2006
1 parent 27a398c commit aade7b9
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 40 deletions.
16 changes: 13 additions & 3 deletions INSTALL
Expand Up @@ -33,8 +33,8 @@ INSTALLATION
DATABASE SETUP DATABASE SETUP
============== ==============


* MySQL * MySQL 4.0.x
------- -------------
Setting up the mysql database can be done by creating an empty database, Setting up the mysql database can be done by creating an empty database,
importing the table layout and granting the proper permissions to the importing the table layout and granting the proper permissions to the
roundcube user. Here is an example of that procedure: roundcube user. Here is an example of that procedure:
Expand All @@ -46,9 +46,19 @@ roundcube user. Here is an example of that procedure:
> quit > quit
# mysql roundcubemail < SQL/mysql.initial.sql # mysql roundcubemail < SQL/mysql.initial.sql



* MySQL 4.1.x/5.x
-----------------
For MySQL version 4.1 and up, it's recommended to create the database for For MySQL version 4.1 and up, it's recommended to create the database for
RoundCube with the following command: RoundCube with utf-8 charset. Here's an example of the init procedure:

# mysql
> CREATE DATABASE 'roundcubemail' DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; > CREATE DATABASE 'roundcubemail' DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
> GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost
IDENTIFIED BY 'password';
> quit

# mysql roundcubemail < SQL/mysql5.initial.sql




* SQLite * SQLite
Expand Down
2 changes: 1 addition & 1 deletion SQL/mysql.initial.sql
@@ -1,5 +1,5 @@
-- RoundCube Webmail initial database structure -- RoundCube Webmail initial database structure
-- Version 0.1b -- Version 0.1beta2
-- --


-- -------------------------------------------------------- -- --------------------------------------------------------
Expand Down
126 changes: 126 additions & 0 deletions SQL/mysql5.initial.sql
@@ -0,0 +1,126 @@
-- RoundCube Webmail initial database structure
-- Version 0.1beta2
--

-- --------------------------------------------------------

SET FOREIGN_KEY_CHECKS=0;


-- Table structure for table `session`

CREATE TABLE `session` (
`sess_id` varchar(40) NOT NULL,
`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,
`vars` text NOT NULL,
PRIMARY KEY(`sess_id`)
) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;


-- Table structure for table `users`

CREATE TABLE `users` (
`user_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` varchar(128) NOT NULL,
`mail_host` varchar(128) NOT NULL,
`alias` varchar(128) NOT NULL,
`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',
`preferences` text NOT NULL,
PRIMARY KEY(`user_id`)
) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;


-- Table structure for table `messages`

CREATE TABLE `messages` (
`message_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`del` tinyint(1) NOT NULL DEFAULT '0',
`cache_key` varchar(128) NOT NULL,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`idx` int(11) UNSIGNED NOT NULL DEFAULT '0',
`uid` int(11) UNSIGNED NOT NULL DEFAULT '0',
`subject` varchar(255) NOT NULL,
`from` varchar(255) NOT NULL,
`to` varchar(255) NOT NULL,
`cc` varchar(255) NOT NULL,
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`size` int(11) UNSIGNED NOT NULL DEFAULT '0',
`headers` text NOT NULL,
`body` longtext,
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY(`message_id`),
INDEX `cache_key`(`cache_key`),
INDEX `idx`(`idx`),
INDEX `uid`(`uid`),
CONSTRAINT `User_ID_FK_messages` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`)
ON DELETE CASCADE
ON UPDATE CASCADE
) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;


-- Table structure for table `cache`

CREATE TABLE `cache` (
`cache_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`session_id` varchar(40),
`cache_key` varchar(128) NOT NULL,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`data` longtext NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY(`cache_id`),
INDEX `cache_key`(`cache_key`),
INDEX `session_id`(`session_id`),
CONSTRAINT `User_ID_FK_cache` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`)
ON DELETE CASCADE
ON UPDATE CASCADE
) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;


-- Table structure for table `contacts`

CREATE TABLE `contacts` (
`contact_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`del` tinyint(1) NOT NULL DEFAULT '0',
`name` varchar(128) NOT NULL,
`email` varchar(128) NOT NULL,
`firstname` varchar(128) NOT NULL,
`surname` varchar(128) NOT NULL,
`vcard` text NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY(`contact_id`),
CONSTRAINT `User_ID_FK_contacts` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`)
ON DELETE CASCADE
ON UPDATE CASCADE
) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;


-- Table structure for table `identities`

CREATE TABLE `identities` (
`identity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`del` tinyint(1) NOT NULL DEFAULT '0',
`standard` tinyint(1) NOT NULL DEFAULT '0',
`name` varchar(128) NOT NULL,
`organization` varchar(128) NOT NULL,
`email` varchar(128) NOT NULL,
`reply-to` varchar(128) NOT NULL,
`bcc` varchar(128) NOT NULL,
`signature` text NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY(`identity_id`),
CONSTRAINT `User_ID_FK_identities` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`)
ON DELETE CASCADE
ON UPDATE CASCADE
) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;


SET FOREIGN_KEY_CHECKS=1;
2 changes: 1 addition & 1 deletion UPGRADING
Expand Up @@ -116,7 +116,7 @@ form version 0.1-beta
- replace index.php - replace index.php
- replace all files in folder /program/ - replace all files in folder /program/
- replace all files in folder /skins/default/ - replace all files in folder /skins/default/
- add these lines to /config/db.inc.php - add these line to /config/db.inc.php
$rcmail_config['db_persistent'] = TRUE; $rcmail_config['db_persistent'] = TRUE;
- add these lines to /config/main.inc.php - add these lines to /config/main.inc.php
$rcmail_config['drafts_mbox'] = 'Drafts'; $rcmail_config['drafts_mbox'] = 'Drafts';
Expand Down
15 changes: 6 additions & 9 deletions index.php
Expand Up @@ -2,9 +2,9 @@
/* /*
+-----------------------------------------------------------------------+ +-----------------------------------------------------------------------+
| RoundCube Webmail IMAP Client | | RoundCube Webmail IMAP Client |
| Version 0.1-20060718 | | Version 0.1-beta2 |
| | | |
| Copyright (C) 2005, RoundCube Dev. - Switzerland | | Copyright (C) 2005-2006, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL | | Licensed under the GNU GPL |
| | | |
| Redistribution and use in source and binary forms, with or without | | Redistribution and use in source and binary forms, with or without |
Expand Down Expand Up @@ -40,7 +40,7 @@
*/ */


define('RCMAIL_VERSION', '0.1-20060718'); define('RCMAIL_VERSION', '0.1-beta2');


// define global vars // define global vars
$CHARSET = 'UTF-8'; $CHARSET = 'UTF-8';
Expand Down Expand Up @@ -95,7 +95,6 @@




// catch some url/post parameters // catch some url/post parameters
//$_auth = get_input_value('_auth', RCUBE_INPUT_GPC);
$_task = get_input_value('_task', RCUBE_INPUT_GPC); $_task = get_input_value('_task', RCUBE_INPUT_GPC);
$_action = get_input_value('_action', RCUBE_INPUT_GPC); $_action = get_input_value('_action', RCUBE_INPUT_GPC);
$_framed = (!empty($_GET['_framed']) || !empty($_POST['_framed'])); $_framed = (!empty($_GET['_framed']) || !empty($_POST['_framed']));
Expand Down Expand Up @@ -290,10 +289,7 @@
if ($_action=='rss') if ($_action=='rss')
include('program/steps/mail/rss.inc'); include('program/steps/mail/rss.inc');


// kill compose entry from session
// if (isset($_SESSION['compose']))
// rcmail_compose_cleanup();

// make sure the message count is refreshed // make sure the message count is refreshed
$IMAP->messagecount($_SESSION['mbox'], 'ALL', TRUE); $IMAP->messagecount($_SESSION['mbox'], 'ALL', TRUE);
} }
Expand Down Expand Up @@ -344,7 +340,8 @@
if ($_action=='save-prefs') if ($_action=='save-prefs')
include('program/steps/settings/save_prefs.inc'); include('program/steps/settings/save_prefs.inc');


if ($_action=='folders' || $_action=='subscribe' || $_action=='unsubscribe' || $_action=='create-folder' || $_action=='rename-folder' || $_action=='delete-folder') if ($_action=='folders' || $_action=='subscribe' || $_action=='unsubscribe' ||
$_action=='create-folder' || $_action=='rename-folder' || $_action=='delete-folder')
include('program/steps/settings/manage_folders.inc'); include('program/steps/settings/manage_folders.inc');


} }
Expand Down
6 changes: 3 additions & 3 deletions program/include/main.inc
Expand Up @@ -170,9 +170,9 @@ function rcmail_authenticate_session()
{ {
$now = mktime(); $now = mktime();
$valid = ($_COOKIE['sessauth'] == rcmail_auth_hash(session_id(), $_SESSION['auth_time'])); $valid = ($_COOKIE['sessauth'] == rcmail_auth_hash(session_id(), $_SESSION['auth_time']));

// renew auth cookie every 5 minutes // renew auth cookie every 5 minutes (only for GET requests)
if (!$valid || ($now-$_SESSION['auth_time'] > 300)) if (!$valid || ($_SERVER['REQUEST_METHOD']!='POST' && $now-$_SESSION['auth_time'] > 300))
{ {
$_SESSION['auth_time'] = $now; $_SESSION['auth_time'] = $now;
setcookie('sessauth', rcmail_auth_hash(session_id(), $now)); setcookie('sessauth', rcmail_auth_hash(session_id(), $now));
Expand Down
13 changes: 11 additions & 2 deletions program/js/app.js
Expand Up @@ -878,8 +878,9 @@ function rcube_webmail()


if (this.task=='mail' && this.env.mailbox==this.env.drafts_mailbox) if (this.task=='mail' && this.env.mailbox==this.env.drafts_mailbox)
{ {
var uid = this.get_single_uid(); var uid;
url += '&_draft_uid='+uid+'&_mbox='+escape(this.env.mailbox); if (uid = this.get_single_uid())
url += '&_draft_uid='+uid+'&_mbox='+escape(this.env.mailbox);
} }
// modify url if we're in addressbook // modify url if we're in addressbook
else if (this.task=='addressbook') else if (this.task=='addressbook')
Expand Down Expand Up @@ -2185,6 +2186,8 @@ function rcube_webmail()
if (!this.gui_objects.attachmentlist) if (!this.gui_objects.attachmentlist)
return false; return false;


alert(content);

var li = document.createElement('LI'); var li = document.createElement('LI');
li.id = name; li.id = name;
li.innerHTML = content; li.innerHTML = content;
Expand Down Expand Up @@ -3598,6 +3601,12 @@ function rcube_webmail()
// send periodic request to check for recent messages // send periodic request to check for recent messages
this.check_for_recent = function() this.check_for_recent = function()
{ {
if (this.busy)
{
this.send_keep_alive();
return;
}

this.set_busy(true, 'checkingmail'); this.set_busy(true, 'checkingmail');
var d = new Date(); var d = new Date();
this.http_request('check-recent', '_t='+d.getTime()); this.http_request('check-recent', '_t='+d.getTime());
Expand Down
37 changes: 19 additions & 18 deletions program/steps/mail/compose.inc
Expand Up @@ -23,20 +23,20 @@
require_once('Mail/mimeDecode.php'); require_once('Mail/mimeDecode.php');


// remove an attachment // remove an attachment
if ($_action=='remove-attachment' && !empty($_GET['_filename'])) if ($_action=='remove-attachment' && preg_match('/^rcmfile([0-9]+)$/', $_GET['_file'], $regs))
{ {
if (is_array($_SESSION['compose']['attachments'])) $id = $regs[1];
foreach ($_SESSION['compose']['attachments'] as $i => $attachment) if (is_array($_SESSION['compose']['attachments'][$id]))
if ($attachment['name'] == $_GET['_filename']) {
{ @unlink($_SESSION['compose']['attachments'][$id]['path']);
@unlink($attachment['path']); $_SESSION['compose']['attachments'][$id] = NULL;
unset($_SESSION['compose']['attachments'][$i]); $commands = sprintf("parent.%s.remove_from_attachment_list('rcmfile%d');\n", $JS_OBJECT_NAME, $id);
$commands = sprintf("parent.%s.remove_from_attachment_list('%s');\n", $JS_OBJECT_NAME, $_GET['_filename']); rcube_remote_response($commands);
rcube_remote_response($commands); exit;
exit; }
}
} }



$MESSAGE_FORM = NULL; $MESSAGE_FORM = NULL;
$REPLY_MESSAGE = NULL; $REPLY_MESSAGE = NULL;
$FORWARD_MESSAGE = NULL; $FORWARD_MESSAGE = NULL;
Expand Down Expand Up @@ -480,7 +480,7 @@ function rcmail_create_forward_body($body)
{ {
if ($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id'] || if ($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id'] ||
(empty($part->disposition) && ($part->d_parameters['filename'] || $part->ctype_parameters['name']))) (empty($part->disposition) && ($part->d_parameters['filename'] || $part->ctype_parameters['name'])))
{ {
$tmp_path = tempnam($temp_dir, 'rcmAttmnt'); $tmp_path = tempnam($temp_dir, 'rcmAttmnt');
if ($fp = fopen($tmp_path, 'w')) if ($fp = fopen($tmp_path, 'w'))
{ {
Expand Down Expand Up @@ -621,20 +621,21 @@ function rcmail_compose_attachment_list($attrib)
if (is_array($_SESSION['compose']['attachments'])) if (is_array($_SESSION['compose']['attachments']))
{ {
if ($attrib['deleteicon']) if ($attrib['deleteicon'])
$button = sprintf('<img src="%s%s" alt="%s" border="0" / style="padding-right:2px;vertical-align:middle">', $button = sprintf('<img src="%s%s" alt="%s" border="0" style="padding-right:2px;vertical-align:middle" />',
$CONFIG['skin_path'], $CONFIG['skin_path'],
$attrib['deleteicon'], $attrib['deleteicon'],
rcube_label('delete')); rcube_label('delete'));
else else
$button = rcube_label('delete'); $button = rcube_label('delete');


foreach ($_SESSION['compose']['attachments'] as $i => $a_prop) foreach ($_SESSION['compose']['attachments'] as $id => $a_prop)
$out .= sprintf('<li id="%s"><a href="#" onclick="%s.command(\'remove-attachment\',\'%s\')" title="%s">%s</a>%s</li>', $out .= sprintf('<li id="rcmfile%d"><a href="#delete" onclick="return %s.command(\'remove-attachment\',\'rcmfile%d\', this)" title="%s">%s</a>%s</li>',
$a_prop['name'], $id,
$JS_OBJECT_NAME, $JS_OBJECT_NAME,
$a_prop['name'], $id,
rcube_label('delete'), rcube_label('delete'),
$button, $a_prop['name']); $button,
rep_specialchars_output($a_prop['name']));
} }


$OUTPUT->add_script(sprintf("%s.gui_object('attachmentlist', '%s');", $JS_OBJECT_NAME, $attrib['id'])); $OUTPUT->add_script(sprintf("%s.gui_object('attachmentlist', '%s');", $JS_OBJECT_NAME, $attrib['id']));
Expand Down
22 changes: 19 additions & 3 deletions program/steps/mail/upload.inc
Expand Up @@ -41,13 +41,29 @@ foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath)
$tmpfname = tempnam($temp_dir, 'rcmAttmnt'); $tmpfname = tempnam($temp_dir, 'rcmAttmnt');
if (move_uploaded_file($filepath, $tmpfname)) if (move_uploaded_file($filepath, $tmpfname))
{ {
$id = count($_SESSION['compose']['attachments']);
$_SESSION['compose']['attachments'][] = array('name' => $_FILES['_attachments']['name'][$i], $_SESSION['compose']['attachments'][] = array('name' => $_FILES['_attachments']['name'][$i],
'mimetype' => $_FILES['_attachments']['type'][$i], 'mimetype' => $_FILES['_attachments']['type'][$i],
'path' => $tmpfname); 'path' => $tmpfname);


$button = sprintf('<img src="%s/images/icons/remove-attachment.png" alt="%s" border="0" style="padding-right:2px;vertical-align:middle">', $CONFIG['skin_path'], rcube_label('delete')); if (is_file($CONFIG['skin_path'] . '/images/icons/remove-attachment.png'))
$content = sprintf('<a href="#" onclick="%s.command(\\\'remove-attachment\\\',\\\'%s\\\')" title="%s">%s</a>%s',$JS_OBJECT_NAME, $_FILES['_attachments']['name'][$i], rcube_label('delete'), $button, $_FILES['_attachments']['name'][$i]); $button = sprintf('<img src="%s/images/icons/remove-attachment.png" alt="%s" border="0" style="padding-right:2px;vertical-align:middle" />',
$response .= sprintf('parent.%s.add2attachment_list(\'%s\',\'%s\');',$JS_OBJECT_NAME, $_FILES['_attachments']['name'][$i], $content); $CONFIG['skin_path'],
rcube_label('delete'));
else
$button = rcube_label('delete');

$content = sprintf('<a href="#delete" onclick="return %s.command(\\\'remove-attachment\\\', \\\'rcmfile%d\\\', this)" title="%s">%s</a>%s',
$JS_OBJECT_NAME,
$id,
rcube_label('delete'),
$button,
rep_specialchars_output($_FILES['_attachments']['name'][$i], 'js'));

$response .= sprintf('parent.%s.add2attachment_list(\'rcmfile%d\',\'%s\');',
$JS_OBJECT_NAME,
$id,
$content);
} }
} }


Expand Down

0 comments on commit aade7b9

Please sign in to comment.