From 66bc13da957b8897ebc6a18e3cb99da39c48ac4b Mon Sep 17 00:00:00 2001 From: tbrehm Date: Wed, 15 Sep 2010 14:35:24 +0000 Subject: [PATCH] Updated Dovecot sql user queries. --- install/tpl/debian6_dovecot-sql.conf.master | 1 + install/tpl/debian_dovecot-sql.conf.master | 2 +- install/tpl/fedora_dovecot-sql.conf.master | 2 +- install/tpl/opensuse_dovecot-sql.conf.master | 2 +- interface/web/client/reseller_edit.php | 7 +++++++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/install/tpl/debian6_dovecot-sql.conf.master b/install/tpl/debian6_dovecot-sql.conf.master index 0258b23bd..73dd0fc00 100644 --- a/install/tpl/debian6_dovecot-sql.conf.master +++ b/install/tpl/debian6_dovecot-sql.conf.master @@ -121,5 +121,6 @@ connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_se default_pass_scheme = CRYPT password_query = SELECT password FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' +#user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' user_query = SELECT email AS user, maildir AS home, CONCAT('*:storage=', quota , 'B') AS quota_rule FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' diff --git a/install/tpl/debian_dovecot-sql.conf.master b/install/tpl/debian_dovecot-sql.conf.master index 523237da7..8777d73c1 100644 --- a/install/tpl/debian_dovecot-sql.conf.master +++ b/install/tpl/debian_dovecot-sql.conf.master @@ -121,6 +121,6 @@ connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_se default_pass_scheme = CRYPT password_query = SELECT password FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' -user_query = SELECT email as user, maildir as home, CONCAT(maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' +user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' diff --git a/install/tpl/fedora_dovecot-sql.conf.master b/install/tpl/fedora_dovecot-sql.conf.master index 3053e3c42..17f7422c1 100644 --- a/install/tpl/fedora_dovecot-sql.conf.master +++ b/install/tpl/fedora_dovecot-sql.conf.master @@ -134,4 +134,4 @@ connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_se default_pass_scheme = CRYPT password_query = SELECT password FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' -user_query = SELECT email as user, maildir as home, CONCAT(maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' +user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' diff --git a/install/tpl/opensuse_dovecot-sql.conf.master b/install/tpl/opensuse_dovecot-sql.conf.master index 71b0c58c8..17f7422c1 100644 --- a/install/tpl/opensuse_dovecot-sql.conf.master +++ b/install/tpl/opensuse_dovecot-sql.conf.master @@ -134,4 +134,4 @@ connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_se default_pass_scheme = CRYPT password_query = SELECT password FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' -user_query = SELECT email as user, maildir as home, CONCAT(maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', quota) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' +user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' diff --git a/interface/web/client/reseller_edit.php b/interface/web/client/reseller_edit.php index 44c65be45..747c92439 100644 --- a/interface/web/client/reseller_edit.php +++ b/interface/web/client/reseller_edit.php @@ -200,6 +200,13 @@ class page_action extends tform_actions { $app->db->query($sql); } + // ensure that a reseller is not converted to a client in demo mode when client_id <= 2 + if($conf['demo_mode'] == true && $this->id <= 2) { + if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] != -1) { + $app->db->query('UPDATE client set limit_client = -1 WHERE client_id = '.$this->id); + } + } + // reseller status changed if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] != $this->oldDataRecord["limit_client"]) { $modules = $conf['interface_modules_enabled'] . ',client'; -- GitLab