diff --git a/actions/admin/settings/120.system.php b/actions/admin/settings/120.system.php index d896eb6a..e676f5c0 100644 --- a/actions/admin/settings/120.system.php +++ b/actions/admin/settings/120.system.php @@ -71,7 +71,7 @@ return array( 'label' => $lng['serversettings']['system_realtime_port'], 'settinggroup' => 'system', 'varname' => 'realtime_port', - 'type' => 'int', + 'type' => (function_exists('socket_create') ? 'int' : 'hidden'), 'int_max' => 65535, 'default' => 0, 'save_method' => 'storeSettingField', diff --git a/admin_customers.php b/admin_customers.php index 0b23ecc5..5e84e76c 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -781,11 +781,18 @@ if($page == 'customers' $mysqls = - 1; } - $number_of_aps_packages = intval_ressource($_POST['number_of_aps_packages']); + if($settings['aps']['aps_active'] == '1') + { + $number_of_aps_packages = intval_ressource($_POST['number_of_aps_packages']); - if(isset($_POST['number_of_aps_packages_ul'])) + if(isset($_POST['number_of_aps_packages_ul'])) + { + $number_of_aps_packages = - 1; + } + } + else { - $number_of_aps_packages = - 1; + $number_of_aps_packages = 0; } $createstdsubdomain = intval($_POST['createstdsubdomain']); diff --git a/admin_domains.php b/admin_domains.php index d3da78d7..e57ccbe9 100644 --- a/admin_domains.php +++ b/admin_domains.php @@ -624,7 +624,9 @@ if($page == 'domains' elseif($action == 'edit' && $id != 0) { - $result = $db->query_first("SELECT `d`.`id`, `d`.`domain`, `d`.`customerid`, `d`.`adminid`, `d`.`email_only`, `d`.`documentroot`, `d`.`ssl`, `d`.`ssl_redirect`, `d`.`ssl_ipandport`,`d`.`ipandport`, `d`.`aliasdomain`, `d`.`isbinddomain`, `d`.`isemaildomain`, `d`.`subcanemaildomain`, `d`.`dkim`, `d`.`caneditdomain`, `d`.`zonefile`, `d`.`wwwserveralias`, `d`.`openbasedir`, `d`.`safemode`, `d`.`speciallogfile`, `d`.`specialsettings`, `d`.`add_date`, `d`.`registration_date`, `c`.`loginname`, `c`.`name`, `c`.`firstname`, `c`.`company`, `d`.`phpsettingid`, `d`.`mod_fcgid_starter`, `d`.`mod_fcgid_maxrequests` " . "FROM `" . TABLE_PANEL_DOMAINS . "` `d` " . "LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) " . "WHERE `d`.`parentdomainid`='0' AND `d`.`id`='" . (int)$id . "'" . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = '" . (int)$userinfo['adminid'] . "' ")); + $result = $db->query_first("SELECT `d`.*, `c`.* FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) + WHERE `d`.`parentdomainid`='0' AND `d`.`id`='" . (int)$id . "'" + . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = '" . (int)$userinfo['adminid'] . "' ")); if($result['domain'] != '') { diff --git a/customer_domains.php b/customer_domains.php index 08a43357..1e6fa0e2 100644 --- a/customer_domains.php +++ b/customer_domains.php @@ -439,9 +439,9 @@ elseif($page == 'domains') || $ssl_redirect != $result['ssl_redirect']) { $log->logAction(USR_ACTION, LOG_INFO, "edited domain '" . $idna_convert->decode($result['domain']) . "'"); + $result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `documentroot`='" . $db->escape($path) . "', `isemaildomain`='" . (int)$isemaildomain . "', `iswildcarddomain`='" . (int)$iswildcarddomain . "', `aliasdomain`=" . (($aliasdomain != 0 && $alias_check == 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ",`openbasedir_path`='" . $db->escape($openbasedir_path) . "', `ssl_redirect`='" . $ssl_redirect . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'"); inserttask('1'); inserttask('4'); - $result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `documentroot`='" . $db->escape($path) . "', `isemaildomain`='" . (int)$isemaildomain . "', `iswildcarddomain`='" . (int)$iswildcarddomain . "', `aliasdomain`=" . (($aliasdomain != 0 && $alias_check == 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ",`openbasedir_path`='" . $db->escape($openbasedir_path) . "', `ssl_redirect`='" . $ssl_redirect . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'"); } redirectTo($filename, Array('page' => $page, 's' => $s)); diff --git a/customer_traffic.php b/customer_traffic.php index cdc6df88..2f06f992 100644 --- a/customer_traffic.php +++ b/customer_traffic.php @@ -174,17 +174,13 @@ if(!is_null($month) } else { - $result = $db->query("(SELECT SUM(`http`) as sum FROM `" . TABLE_PANEL_TRAFFIC . "` - WHERE `customerid` = '" . $userinfo['customerid'] . "' - GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12) UNION - (SELECT SUM(`ftp_up`+`ftp_down`) FROM `" . TABLE_PANEL_TRAFFIC . "` - WHERE `customerid` = '" . $userinfo['customerid'] . "' - GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12) UNION - (SELECT SUM(`mail`) FROM `" . TABLE_PANEL_TRAFFIC . "` - WHERE `customerid` = '" . $userinfo['customerid'] . "' - GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12) ORDER BY sum DESC LIMIT 1"); - $row = $db->fetch_array($result); - $traf['max'] = ($row[0] > $row[1] ? ($row[0] > $row[2] ? $row[0] : $row[2]) : ($row[1] > $row[2] ? $row[1] : $row[2]));; + $result = $db->query("SELECT MAX(`http`), MAX(`ftp_up`+`ftp_down`), MAX(`mail`) + FROM `" . TABLE_PANEL_TRAFFIC . "` + WHERE `customerid`='" . $userinfo['customerid'] . "' + GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12"); + $row = mysql_fetch_row($result); + rsort($row); + $traf['max'] = ($row[0] > $row[1] ? ($row[0] > $row[2] ? $row[0] : $row[2]) : ($row[1] > $row[2] ? $row[1] : $row[2])); $result = $db->query("SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid` = '" . $userinfo['customerid'] . "' GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12"); diff --git a/lib/functions/filedir/function.makePathfield.php b/lib/functions/filedir/function.makePathfield.php index 071250b6..3cca7572 100644 --- a/lib/functions/filedir/function.makePathfield.php +++ b/lib/functions/filedir/function.makePathfield.php @@ -48,7 +48,7 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '') if(sizeof($dirList) > 0) { - if(sizeof(dirList) <= 100) + if(sizeof($dirList) <= 100) { $field = '