From deb19f26254b5f853cbd3fedbebf0ded4ce440fa Mon Sep 17 00:00:00 2001 From: Florian Aders Date: Mon, 22 Feb 2016 12:10:06 +0100 Subject: [PATCH] Removed unnecessary exit - calls Signed-off-by: Florian Aders --- admin_admins.php | 1 - admin_apcuinfo.php | 1 - admin_customers.php | 2 -- admin_domains.php | 3 --- admin_index.php | 2 -- admin_opcacheinfo.php | 1 - admin_templates.php | 4 ---- admin_traffic.php | 1 - customer_domains.php | 25 ++++++++++--------------- customer_email.php | 8 +++----- customer_ftp.php | 2 -- customer_index.php | 2 -- lib/functions.php | 5 ----- 13 files changed, 13 insertions(+), 44 deletions(-) diff --git a/admin_admins.php b/admin_admins.php index 466581ff..32e5de12 100644 --- a/admin_admins.php +++ b/admin_admins.php @@ -155,7 +155,6 @@ if ($page == 'admins' if ($result['loginname'] != '') { if ($result['adminid'] == $userinfo['userid']) { standard_error('youcantdeleteyourself'); - exit; } if (isset($_POST['send']) diff --git a/admin_apcuinfo.php b/admin_apcuinfo.php index d8c6dc3b..55c255ab 100644 --- a/admin_apcuinfo.php +++ b/admin_apcuinfo.php @@ -46,7 +46,6 @@ if (!function_exists('apcu_cache_info') || !function_exists('apcu_sma_info') ) { standard_error($lng['error']['no_apcuinfo']); - exit(); } if ($page == 'showinfo' diff --git a/admin_customers.php b/admin_customers.php index dc76d81f..2b369b7f 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -554,7 +554,6 @@ if ($page == 'customers' || ($subdomains == '-1' && $userinfo['subdomains'] != '-1') ) { standard_error('youcantallocatemorethanyouhave'); - exit; } // Either $name and $firstname or the $company must be inserted @@ -1208,7 +1207,6 @@ if ($page == 'customers' || ($subdomains == '-1' && $userinfo['subdomains'] != '-1') ) { standard_error('youcantallocatemorethanyouhave'); - exit; } // Either $name and $firstname or the $company must be inserted diff --git a/admin_domains.php b/admin_domains.php index 6ce5490e..ef2e12ce 100644 --- a/admin_domains.php +++ b/admin_domains.php @@ -301,7 +301,6 @@ if ($page == 'domains' if ($_POST['domain'] == Settings::Get('system.hostname')) { standard_error('admin_domain_emailsystemhostname'); - exit; } $domain = $idna_convert->encode(preg_replace(array('/\:(\d)+$/', '/^https?\:\/\//'), '', validate($_POST['domain'], 'domain'))); @@ -756,7 +755,6 @@ if ($page == 'domains' || $_POST[$question_name] != $question_name ) { ask_yesno('admin_domain_' . $question_name, $filename, $params, $question_nr); - exit; } } $question_nr++; @@ -1520,7 +1518,6 @@ if ($page == 'domains' || $_POST[$question_name] != $question_name ) { ask_yesno('admin_domain_' . $question_name, $filename, $params); - exit; } } } diff --git a/admin_index.php b/admin_index.php index bf838f5e..baa1a2aa 100644 --- a/admin_index.php +++ b/admin_index.php @@ -42,7 +42,6 @@ if ($action == 'logout') { Database::pexecute($stmt, $params); redirectTo('index.php'); - exit; } if (isset($_POST['id'])) { @@ -201,7 +200,6 @@ if ($page == 'overview') { if (!validatePasswordLogin($userinfo,$old_password,TABLE_PANEL_ADMINS,'adminid')) { standard_error('oldpasswordnotcorrect'); - exit; } $new_password = validate($_POST['new_password'], 'new password'); diff --git a/admin_opcacheinfo.php b/admin_opcacheinfo.php index 9d45de9b..7f79d9ec 100644 --- a/admin_opcacheinfo.php +++ b/admin_opcacheinfo.php @@ -35,7 +35,6 @@ if ($action == 'reset' && if (!function_exists('opcache_get_configuration') ) { standard_error($lng['error']['no_opcacheinfo']); - exit(); } if ($page == 'showinfo' diff --git a/admin_templates.php b/admin_templates.php index 6c03ad94..cec93081 100644 --- a/admin_templates.php +++ b/admin_templates.php @@ -201,7 +201,6 @@ if ($action == '') { } else { standard_error('templatenotfound'); - exit; } } elseif($action == 'add') { @@ -358,7 +357,6 @@ if ($action == '') { eval("echo \"" . getTemplate("templates/templates_add_1") . "\";"); } else { standard_error('alltemplatesdefined'); - exit; } } else { @@ -371,7 +369,6 @@ if ($action == '') { if (Database::num_rows() == count($file_templates)) { standard_error('alltemplatesdefined'); - exit; } else { @@ -514,6 +511,5 @@ if ($action == '') { } else { standard_error('templatenotfound'); - exit; } } diff --git a/admin_traffic.php b/admin_traffic.php index 7c7b974e..fdf8b6da 100644 --- a/admin_traffic.php +++ b/admin_traffic.php @@ -27,7 +27,6 @@ if ($action == 'logout') { ); Database::pexecute($logout_stmt, array('adminid' => $userinfo['adminid'])); redirectTo('index.php'); - exit; } if (isset($_POST['id'])) { diff --git a/customer_domains.php b/customer_domains.php index 2364cde0..22ca19b6 100644 --- a/customer_domains.php +++ b/customer_domains.php @@ -87,21 +87,17 @@ if ($page == 'overview') { } } - $row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']); - if($row['termination_date'] != "") - { - $cdate = strtotime($row['termination_date'] . " 23:59:59"); - $today = time(); + $row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']); + if($row['termination_date'] != "") { + $cdate = strtotime($row['termination_date'] . " 23:59:59"); + $today = time(); - if($cdate < $today) - { - $row['termination_css'] = 'domain-expired'; - } - else - { - $row['termination_css'] = 'domain-canceled'; - } - } + if($cdate < $today) { + $row['termination_css'] = 'domain-expired'; + } else { + $row['termination_css'] = 'domain-canceled'; + } + } $domains_count++; $domain_array[$row['domain']] = $row; @@ -264,7 +260,6 @@ if ($page == 'overview') { if ($completedomain == Settings::Get('system.hostname')) { standard_error('admin_domain_emailsystemhostname'); - exit; } $completedomain_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` diff --git a/customer_email.php b/customer_email.php index 6503d169..5ec678b4 100644 --- a/customer_email.php +++ b/customer_email.php @@ -244,7 +244,6 @@ if ($page == 'overview') { standard_error('emailexistalready', $email_full); } elseif ($email_check['email'] == $email) { standard_error('youhavealreadyacatchallforthisdomain'); - exit; } else { $stmt = Database::prepare("INSERT INTO `" . TABLE_MAIL_VIRTUAL . "` (`customerid`, `email`, `email_full`, `iscatchall`, `domainid`) @@ -377,7 +376,6 @@ if ($page == 'overview') { if ($email_check['email'] == $email) { standard_error('youhavealreadyacatchallforthisdomain'); - exit; } else { $stmt = Database::prepare("UPDATE `" . TABLE_MAIL_VIRTUAL . "` SET `email` = :email , `iscatchall` = '1' @@ -461,7 +459,9 @@ if ($page == 'overview') { $maildirname=trim(Settings::Get('system.vmail_maildirname')); // Add trailing slash to Maildir if needed $maildirpath=$maildirname; - if (!empty($maildirname) and substr($maildirname,-1) != "/") $maildirpath.="/"; + if (!empty($maildirname) && substr($maildirname,-1) != "/") { + $maildirpath.="/"; + } $stmt = Database::prepare("INSERT INTO `" . TABLE_MAIL_USERS . "` (`customerid`, `email`, `username`, " . (Settings::Get('system.mailpwcleartext') == '1' ? '`password`, ' : '') . " `password_enc`, `homedir`, `maildir`, `uid`, `gid`, `domainid`, `postfix`, `quota`, `imap`, `pop3`) ". @@ -633,11 +633,9 @@ if ($page == 'overview') { if ($password == '') { standard_error(array('stringisempty', 'mypassword')); - exit; } elseif ($password == $result['email_full']) { standard_error('passwordshouldnotbeusername'); - exit; } $password = validatePassword($password); diff --git a/customer_ftp.php b/customer_ftp.php index 749cd49b..c46ef9ce 100644 --- a/customer_ftp.php +++ b/customer_ftp.php @@ -363,10 +363,8 @@ if ($page == 'overview') { if ($_setnewpass) { if ($password == '') { standard_error(array('stringisempty', 'mypassword')); - exit; } elseif ($result['username'] == $password) { standard_error('passwordshouldnotbeusername'); - exit; } $log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account password for '" . $result['username'] . "'"); $cryptPassword = makeCryptPassword($password); diff --git a/customer_index.php b/customer_index.php index 45d0d226..9d8772d7 100644 --- a/customer_index.php +++ b/customer_index.php @@ -40,7 +40,6 @@ if ($action == 'logout') { Database::pexecute($stmt, $params); redirectTo('index.php'); - exit; } if ($page == 'overview') { @@ -101,7 +100,6 @@ if ($page == 'overview') { $old_password = validate($_POST['old_password'], 'old password'); if (!validatePasswordLogin($userinfo,$old_password,TABLE_PANEL_CUSTOMERS,'customerid')) { standard_error('oldpasswordnotcorrect'); - exit; } $new_password = validatePassword($_POST['new_password'], 'new password'); diff --git a/lib/functions.php b/lib/functions.php index 2203a0b0..b69dc5b6 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -42,11 +42,6 @@ function includeFunctions($dirname) closedir($dirhandle); } -function exportDetails($fielddata, $newfieldvalue) -{ - print_r($newfieldvalue); -} - Autoloader::init(); /**