enum au lieu de varchar

This commit is contained in:
Alan Garcia 2012-08-24 14:52:24 +00:00
parent bbfa9f3434
commit 85d4bc5723
3 changed files with 7 additions and 7 deletions

View File

@ -275,7 +275,7 @@ class m_mail {
$err->raise("mail",_("The email %s is special, it can't be deleted"),$mail);
return false;
}
if ($db->f("mailbox_action")!="" || $db->f("mail_action")!="") { // will be deleted soon ...
if ($db->f("mailbox_action")!="OK" || $db->f("mail_action")!="OK") { // will be deleted soon ...
$err->raise("mail",_("The email %s is already marked for deletion, it can't be deleted"),$mail);
return false;
}
@ -338,8 +338,8 @@ class m_mail {
if ($db->f("islocal")) {
// If it's a pop/imap mailbox, mark it for deletion
$db->query("UPDATE address SET mail_action='', `enabled`=1 WHERE id='$mail_id';");
$db->query("UPDATE mailbox SET mail_action='' WHERE address_id='$mail_id';");
$db->query("UPDATE address SET mail_action='OK', `enabled`=1 WHERE id='$mail_id';");
$db->query("UPDATE mailbox SET mail_action='OK' WHERE address_id='$mail_id';");
$err->raise("mail",_("The email %s has been undeleted"),$mail);
return true;
} else {

View File

@ -246,7 +246,7 @@ CREATE TABLE IF NOT EXISTS `address` (
`enabled` int(1) unsigned NOT NULL DEFAULT '1', -- Enabled flag.
`expire_date` datetime DEFAULT NULL, -- Expiration date, used for temporary addresses.
`update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Update date, for technical usage only.
`mail_action` varchar(8) NOT NULL, -- mail_action is DELETE or DELETING when deleting a mailbox by cron
`mail_action` enum('OK','DELETE','DELETING') NOT NULL default 'OK', -- mail_action is DELETE or DELETING when deleting a mailbox by cron
PRIMARY KEY (`id`),
UNIQUE INDEX `fk_domain_id` (`domain_id`,`address`)
) COMMENT = 'This is the main address table. It represents an address as in RFC2822';
@ -266,7 +266,7 @@ CREATE TABLE IF NOT EXISTS `mailbox` (
`bytes` bigint(20) NOT NULL DEFAULT '0', -- number of bytes in the mailbox, filled by dovecot
`messages` int(11) NOT NULL DEFAULT '0', -- number of messages in the mailbox, filled by dovecot
`lastlogin` datetime NOT NULL, -- Last login, filled by dovecot
`mail_action` varchar(8) NOT NULL, -- mail_action is DELETE or DELETING when deleting a mailbox by cron
`mail_action` enum('OK','DELETE','DELETING') NOT NULL default 'OK', -- mail_action is DELETE or DELETING when deleting a mailbox by cron
PRIMARY KEY (`id`),
UNIQUE KEY `address_id` (`address_id`)
) COMMENT = 'Table containing local deliverd mailboxes.';

View File

@ -91,7 +91,7 @@ CREATE TABLE IF NOT EXISTS `address` (
`enabled` int(1) unsigned NOT NULL DEFAULT '1', -- Enabled flag.
`expire_date` datetime DEFAULT NULL, -- Expiration date, used for temporary addresses.
`update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Update date, for technical usage only.
`mail_action` varchar(8) NOT NULL, -- mail_action is DELETE or DELETING when deleting a mailbox by cron
`mail_action` enum('OK','DELETE','DELETING') NOT NULL default 'OK', -- mail_action is DELETE or DELETING when deleting a mailbox by cron
PRIMARY KEY (`id`),
UNIQUE INDEX `fk_domain_id` (`domain_id`,`address`)
) COMMENT = 'This is the main address table. It represents an address as in RFC2822';
@ -111,7 +111,7 @@ CREATE TABLE IF NOT EXISTS `mailbox` (
`bytes` bigint(20) NOT NULL DEFAULT '0', -- number of bytes in the mailbox, filled by dovecot
`messages` int(11) NOT NULL DEFAULT '0', -- number of messages in the mailbox, filled by dovecot
`lastlogin` datetime NOT NULL, -- Last login, filled by dovecot
`mail_action` varchar(8) NOT NULL, -- mail_action is DELETE or DELETING when deleting a mailbox by cron
`mail_action` enum('OK','DELETE','DELETING') NOT NULL default 'OK', -- mail_action is DELETE or DELETING when deleting a mailbox by cron
PRIMARY KEY (`id`),
UNIQUE KEY `address_id` (`address_id`)
) COMMENT = 'Table containing local deliverd mailboxes.';