6 Commits
4.3 ... 4.3.3

Author SHA1 Message Date
Boris Gulay
da17fb896b Bump up version 2020-12-17 00:15:05 +03:00
Boris Gulay
afc4f54594 Merge branch 'master' of bitbucket.org:BoresExpress/ident_switch 2020-12-16 23:57:08 +03:00
Boris Gulay
7795a0fbf9 Fix SQlite scripts. Thanx to T S. Closes #76 2020-12-16 23:56:28 +03:00
Boris Gulay
6fa82d6ba5 Fix missing comma 2020-06-06 23:27:58 +03:00
Boris Gulay
fff6c6b95a Update readme 2020-06-01 17:28:54 +03:00
Boris Gulay
92d0f40e3c Add version to composer.json 2020-06-01 17:28:20 +03:00
5 changed files with 114 additions and 9 deletions

View File

@@ -32,6 +32,6 @@ This plugin allows users to switch between different accounts (including remote)
* Versions 1.X (not supported any more) - for Roundcube v1.1 * Versions 1.X (not supported any more) - for Roundcube v1.1
* Versions 2.X (not supported any more) - for Roundcube v1.2 * Versions 2.X (not supported any more) - for Roundcube v1.2
* Versions 3.X (not supported any more) - for Roundcube v1.3 * Versions 3.X (not supported any more) - for Roundcube v1.3
* Versions 4.x - for Roundcube v1.3 and upcoming 1.4. * Versions 4.x - for Roundcube v1.3 and 1.4.
Please specify version like "~2.0" in your composer.json file for ident_switch requirement. In this case you will stay inside compatible branch until you manually update your Roundcube installation. Please specify version like "~2.0" in your composer.json file for ident_switch requirement. In this case you will stay inside compatible branch until you manually update your Roundcube installation.

View File

@@ -21,19 +21,31 @@ CREATE TABLE ident_switch
imap_port imap_port
integer integer
CHECK(imap_port > 0 AND imap_port <= 65535), CHECK(imap_port > 0 AND imap_port <= 65535),
imap_delimiter imap_delimiter
char(1), char(1),
label label
varchar(32), varchar(32),
flags flags
integer integer
NOT NULL NOT NULL
DEFAULT(0), DEFAULT(0),
smtp_host smtp_host
varchar(64), varchar(64),
smtp_port smtp_port
integer integer
CHECK(smtp_port > 0 AND smtp_port <= 65535), CHECK(smtp_port > 0 AND smtp_port <= 65535),
smtp_auth
smallint
NOT NULL
DEFAULT 1,
drafts_mbox
varchar(64),
sent_mbox
varchar(64),
junk_mbox
varchar(64),
trash_mbox
varchar(64),
UNIQUE (user_id, label) UNIQUE (user_id, label)
); );
CREATE INDEX IX_ident_switch_user_id ON ident_switch(user_id); CREATE INDEX IX_ident_switch_user_id ON ident_switch(user_id);

92
SQL/sqlite/2020121600.sql Normal file
View File

@@ -0,0 +1,92 @@
PRAGMA foreign_keys=off;
BEGIN TRANSACTION;
ALTER TABLE ident_switch RENAME TO ident_switch_old;
CREATE TABLE ident_switch
(
id
integer
PRIMARY KEY,
user_id
integer
NOT NULL
REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE,
iid
integer
NOT NULL
REFERENCES identities(identity_id) ON DELETE CASCADE ON UPDATE CASCADE
UNIQUE,
username
varchar(64),
password
varchar(64),
imap_host
varchar(64),
imap_port
integer
CHECK(imap_port > 0 AND imap_port <= 65535),
imap_delimiter
char(1),
label
varchar(32),
flags
integer
NOT NULL
DEFAULT(0),
smtp_host
varchar(64),
smtp_port
integer
CHECK(smtp_port > 0 AND smtp_port <= 65535),
smtp_auth
smallint
NOT NULL
DEFAULT 1,
drafts_mbox
varchar(64),
sent_mbox
varchar(64),
junk_mbox
varchar(64),
trash_mbox
varchar(64),
UNIQUE (user_id, label)
);
CREATE INDEX IX_ident_switch_user_id ON ident_switch(user_id);
CREATE INDEX IX_ident_switch_iid on ident_switch(iid);
INSERT OR ROLLBACK INTO
ident_switch (
id,
user_id,
iid,
username,
password,
imap_host,
imap_port,
label,
flags,
smtp_host,
smtp_port
)
SELECT
id,
user_id,
iid,
username,
password,
imap_host,
imap_port,
label,
flags,
smtp_host,
smtp_port
FROM
ident_switch_old;
DROP TABLE
ident_switch_old;
COMMIT;
PRAGMA foreign_keys=on;

View File

@@ -5,6 +5,7 @@
"homepage": "https://bitbucket.org/BoresExpress/ident_switch", "homepage": "https://bitbucket.org/BoresExpress/ident_switch",
"keywords": ["identity", "imap", "mail", "switch"], "keywords": ["identity", "imap", "mail", "switch"],
"license": "GPL-3.0+", "license": "GPL-3.0+",
"version": "4.3.2",
"authors": [ "authors": [
{ {
"name": "Boris Gulay", "name": "Boris Gulay",

View File

@@ -163,7 +163,7 @@ class ident_switch extends rcube_plugin
$rc = rcmail::get_instance(); $rc = rcmail::get_instance();
$sql = 'SELECT smtp_host, flags, smtp_port, username, smtp_auth password FROM ' . $rc->db->table_name(self::TABLE) . ' WHERE iid = ? AND user_id = ?'; $sql = 'SELECT smtp_host, flags, smtp_port, username, smtp_auth, password FROM ' . $rc->db->table_name(self::TABLE) . ' WHERE iid = ? AND user_id = ?';
$q = $rc->db->query($sql, $iid ,$rc->user->ID); $q = $rc->db->query($sql, $iid ,$rc->user->ID);
$r = $rc->db->fetch_assoc($q); $r = $rc->db->fetch_assoc($q);
if (is_array($r)) if (is_array($r))