From f278b423533461bbb2dd349a69d5fbe73aa9c9fe Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Sat, 30 Nov 2013 16:07:23 +0100 Subject: [PATCH] fix wrong parameter-name in admin-customers; check for disabled imap/pop3 when adding mail-accounts as customer, fixes #1298 Signed-off-by: Michael Kaufmann (d00p) --- admin_customers.php | 2 +- customer_email.php | 7 ++++++- lng/english.lng.php | 3 ++- lng/german.lng.php | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/admin_customers.php b/admin_customers.php index 657e8b62..c5d6ef53 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -1415,7 +1415,7 @@ if ($page == 'customers' // Disable or enable IMAP Login for customers Mail Accounts if ($email_imap != $result['imap']) { $upd_stmt = Database::prepare("UPDATE `" . TABLE_MAIL_USERS . "` SET `imap` = :imap WHERE `customerid` = :customerid"); - Database::pexecute($upd_stmt, array('pop3' => $email_imap, 'customerid' => $id)); + Database::pexecute($upd_stmt, array('imap' => $email_imap, 'customerid' => $id)); } $upd_data = array( diff --git a/customer_email.php b/customer_email.php index b44b9caf..2bfd1786 100644 --- a/customer_email.php +++ b/customer_email.php @@ -403,12 +403,17 @@ if ($page == 'overview') { } elseif ($page == 'accounts') { if ($action == 'add' && $id != 0) { // ensure the int is a positive one - if (isset($_POST['email_quota'])) { $quota = validate($_POST['email_quota'], 'email_quota', '/^\d+$/', 'vmailquotawrong'); } if ($userinfo['email_accounts'] == '-1' || ($userinfo['email_accounts_used'] < $userinfo['email_accounts'])) { + + // check for imap||pop3 == 1, see #1298 + if ($userinfo['imap'] != '1' && $userinfo['pop3'] != '1') { + standard_error('notallowedtouseaccounts'); + } + $stmt = Database::prepare("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid`, `popaccountid`, `domainid` FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`= :cid AND `id`= :id" diff --git a/lng/english.lng.php b/lng/english.lng.php index 8bd8503f..badfc524 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1981,4 +1981,5 @@ $lng['error']['sslredirectonlypossiblewithsslipport'] = 'Using the SSL redirect $lng['error']['fcgidstillenableddeadlock'] = 'FCGID is currently active.
Please deactivate it before switching to another webserver than Apache2'; $lng['error']['send_report_title'] = 'Send error report'; $lng['error']['send_report_desc'] = 'Thank you for reporting this error and helping us to froxlor improve froxlor.
This is the email which will be sent to the froxlor developer team:'; -$lng['error']['send_report'] = 'Send report'; \ No newline at end of file +$lng['error']['send_report'] = 'Send report'; +$lng['error']['notallowedtouseaccounts'] = 'Your account does not allow using IMAP/POP3. You cannot add email accounts.'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 1639b666..a8a85d8e 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1707,4 +1707,5 @@ $lng['error']['sslredirectonlypossiblewithsslipport'] = 'Eine SSL-Weiterleitung $lng['error']['fcgidstillenableddeadlock'] = 'FCGID ist derzeit aktiviert.
Bitte deaktiviere es, um einen anderen Webserver als Apache2 auswählen zu können.'; $lng['error']['send_report_title'] = 'Fehler melden'; $lng['error']['send_report_desc'] = 'Danke, dass Sie uns diesen Fehler melden und damit helfen Froxlor zu verbessern.
Folgender Bericht wird per Mail an das Froxlor Entwickler Team gesendet.'; -$lng['error']['send_report'] = 'Fehlerbericht senden'; \ No newline at end of file +$lng['error']['send_report'] = 'Fehlerbericht senden'; +$lng['error']['notallowedtouseaccounts'] = 'Ihrem Konto ist die Nutzung von IMAP/POP3 nicht erlaubt, daher können keine E-Mail Konten angelegt werden';