more removing of aps/autoresponder/backup
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Language
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Function domainHasApsInstances
|
||||
*
|
||||
* Checks if a given domain id
|
||||
* is used for APS instances
|
||||
* (if APS enabled, else always false)
|
||||
*
|
||||
* @param int domain-id
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function domainHasApsInstances($domainid = 0) {
|
||||
|
||||
global $settings, $theme;
|
||||
|
||||
if ($settings['aps']['aps_active'] == '1') {
|
||||
if ($domainid > 0) {
|
||||
$instances_stmt = Database::prepare("
|
||||
SELECT COUNT(`ID`) AS `count` FROM `" . TABLE_APS_SETTINGS . "`
|
||||
WHERE `Name` = 'main_domain' AND `Value` = :domainid"
|
||||
);
|
||||
$instances = Database::pexecute_first($instances_stmt, array('domainid' => $domainid));
|
||||
|
||||
if ((int)$instances['count'] != 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package APS
|
||||
*
|
||||
*/
|
||||
|
||||
function getXPathValue($xmlobj = null, $path = null, $single = true)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
$tmpxml = new DynamicProperties;
|
||||
$tmpxml = ($xmlobj->xpath($path)) ? $xmlobj->xpath($path) : false;
|
||||
|
||||
if($result !== false)
|
||||
{
|
||||
$result = ($single == true) ? (string)$tmpxml[0] : $tmpxml;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Functions
|
||||
*
|
||||
*/
|
||||
|
||||
function storeSettingApsPhpExtensions($fieldname, $fielddata, $newfieldvalue)
|
||||
{
|
||||
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
||||
|
||||
if($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'aps' && isset($fielddata['varname']) && $fielddata['varname'] == 'php-extension')
|
||||
{
|
||||
$newfieldvalue_array = explode(',', $newfieldvalue);
|
||||
|
||||
if(in_array('mcrypt', $newfieldvalue_array))
|
||||
{
|
||||
$functions = 'mcrypt_encrypt,mcrypt_decrypt';
|
||||
}
|
||||
else
|
||||
{
|
||||
$functions = '';
|
||||
}
|
||||
|
||||
if($functions != getSetting('aps', 'php-function'))
|
||||
{
|
||||
saveSetting('aps', 'php-function', $functions);
|
||||
}
|
||||
}
|
||||
|
||||
return $returnvalue;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Functions
|
||||
*
|
||||
*/
|
||||
|
||||
function storeSettingApsWebserverModules($fieldname, $fielddata, $newfieldvalue)
|
||||
{
|
||||
if(is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'aps' && isset($fielddata['varname']) && $fielddata['varname'] == 'webserver-module')
|
||||
{
|
||||
$newfieldvalue_array = explode(',', $newfieldvalue);
|
||||
|
||||
if(in_array('mod_rewrite', $newfieldvalue_array))
|
||||
{
|
||||
// Don't have to guess if we have to remove the leading comma as mod_rewrite is set anyways when we're here...
|
||||
$newfieldvalue .= ',mod_rewrite.c';
|
||||
}
|
||||
|
||||
if(in_array('htaccess', $newfieldvalue_array))
|
||||
{
|
||||
$htaccess = 'htaccess';
|
||||
}
|
||||
else
|
||||
{
|
||||
$htaccess = '';
|
||||
}
|
||||
|
||||
if($htaccess != getSetting('aps', 'webserver-htaccess'))
|
||||
{
|
||||
saveSetting('aps', 'webserver-htaccess', $htaccess);
|
||||
}
|
||||
}
|
||||
|
||||
return storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Functions
|
||||
*
|
||||
*/
|
||||
|
||||
if(!function_exists('sys_get_temp_dir'))
|
||||
{
|
||||
/**
|
||||
* function will return the temporary directory where we can write data
|
||||
* function exists as a fallback for php versions lower than 5.2.1
|
||||
* source copied from php.net
|
||||
*
|
||||
* @author Sven Skrabal <info@nexpa.de>
|
||||
*/
|
||||
|
||||
function sys_get_temp_dir()
|
||||
{
|
||||
// Try to get from environment variable
|
||||
|
||||
if(!empty($_ENV['TMP']))
|
||||
{
|
||||
return realpath($_ENV['TMP']);
|
||||
}
|
||||
elseif(!empty($_ENV['TMPDIR']))
|
||||
{
|
||||
return realpath($_ENV['TMPDIR']);
|
||||
}
|
||||
elseif(!empty($_ENV['TEMP']))
|
||||
{
|
||||
return realpath($_ENV['TEMP']);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Detect by creating a temporary file
|
||||
// Try to use system's temporary directory
|
||||
// as random name shouldn't exist
|
||||
|
||||
$temp_file = tempnam(md5(uniqid(rand(), true)), '');
|
||||
|
||||
if($temp_file)
|
||||
{
|
||||
$temp_dir = realpath(dirname($temp_file));
|
||||
unlink($temp_file);
|
||||
return $temp_dir;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* Function getNextCronjobs
|
||||
*
|
||||
* checks which cronjobs have to be executed
|
||||
@@ -206,40 +206,6 @@ function getOutstandingTasks() {
|
||||
}
|
||||
}
|
||||
|
||||
$query2 = "SELECT DISTINCT `Task` FROM `".TABLE_APS_TASKS."` ORDER BY `Task` ASC";
|
||||
$result2 = Database::query($query2);
|
||||
|
||||
while ($row2 = $result2->fetch(PDO::FETCH_ASSOC)) {
|
||||
// install
|
||||
if ($row2['Task'] == '1') {
|
||||
$task_desc = $lng['tasks']['aps_task_install'];
|
||||
}
|
||||
// remove
|
||||
elseif ($row2['Task'] == '2') {
|
||||
$task_desc = $lng['tasks']['aps_task_remove'];
|
||||
}
|
||||
// reconfigure
|
||||
elseif ($row2['Task'] == '3') {
|
||||
$task_desc = $lng['tasks']['aps_task_reconfigure'];
|
||||
}
|
||||
// upgrade
|
||||
elseif ($row2['Task'] == '4') {
|
||||
$task_desc = $lng['tasks']['aps_task_upgrade'];
|
||||
}
|
||||
// system update
|
||||
elseif ($row2['Task'] == '5') {
|
||||
$task_desc = $lng['tasks']['aps_task_sysupdate'];
|
||||
}
|
||||
// system download
|
||||
elseif ($row2['Task'] == '6') {
|
||||
$task_desc = $lng['tasks']['aps_task_sysdownload'];
|
||||
}
|
||||
|
||||
if($task_desc != '') {
|
||||
$tasks .= '<li>'.$task_desc.'</li>';
|
||||
}
|
||||
}
|
||||
|
||||
if (trim($tasks) == '') {
|
||||
$value .= '<li>'.$lng['tasks']['noneoutstanding'].'</li>';
|
||||
} else {
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
*/
|
||||
|
||||
function updateCounters($returndebuginfo = false) {
|
||||
global $theme;
|
||||
$returnval = array();
|
||||
@@ -119,14 +118,6 @@ function updateCounters($returndebuginfo = false) {
|
||||
$admin_resources[$customer['adminid']]['email_quota_used']+= intval_ressource($customer['email_quota']);
|
||||
}
|
||||
|
||||
if(!isset($admin_resources[$customer['adminid']]['email_autoresponder_used'])) {
|
||||
$admin_resources[$customer['adminid']]['email_autoresponder_used'] = 0;
|
||||
}
|
||||
|
||||
if($customer['email_autoresponder'] != '-1') {
|
||||
$admin_resources[$customer['adminid']]['email_autoresponder_used']+= intval_ressource($customer['email_autoresponder']);
|
||||
}
|
||||
|
||||
if(!isset($admin_resources[$customer['adminid']]['subdomains_used'])) {
|
||||
$admin_resources[$customer['adminid']]['subdomains_used'] = 0;
|
||||
}
|
||||
@@ -135,14 +126,6 @@ function updateCounters($returndebuginfo = false) {
|
||||
$admin_resources[$customer['adminid']]['subdomains_used']+= intval_ressource($customer['subdomains']);
|
||||
}
|
||||
|
||||
if(!isset($admin_resources[$customer['adminid']]['aps_packages_used'])) {
|
||||
$admin_resources[$customer['adminid']]['aps_packages_used'] = 0;
|
||||
}
|
||||
|
||||
if($customer['aps_packages'] != '-1') {
|
||||
$admin_resources[$customer['adminid']]['aps_packages_used']+= intval_ressource($customer['aps_packages']);
|
||||
}
|
||||
|
||||
$customer_mysqls_stmt = Database::prepare('SELECT COUNT(*) AS `number_mysqls` FROM `' . TABLE_PANEL_DATABASES . '`
|
||||
WHERE `customerid` = :cid'
|
||||
);
|
||||
@@ -192,14 +175,6 @@ function updateCounters($returndebuginfo = false) {
|
||||
$customer_email_quota_stmt = Database::prepare('SELECT SUM(`quota`) AS `email_quota` FROM `' . TABLE_MAIL_USERS . '` WHERE `customerid` = :cid');
|
||||
$customer_email_quota = Database::pexecute_first($customer_email_quota_stmt, array("cid" => $customer['customerid']));
|
||||
$customer['email_quota_used_new'] = (int)$customer_email_quota['email_quota'];
|
||||
|
||||
$customer_email_autoresponder_stmt = Database::prepare('SELECT COUNT(*) AS `number_autoresponder` FROM `' . TABLE_MAIL_AUTORESPONDER . '` WHERE `customerid` = :cid');
|
||||
$customer_email_autoresponder = Database::pexecute_first($customer_email_autoresponder_stmt, array("cid" => $customer['customerid']));
|
||||
$customer['email_autoresponder_used_new'] = (int)$customer_email_autoresponder['number_autoresponder'];
|
||||
|
||||
$customer_aps_packages_stmt = Database::prepare('SELECT COUNT(*) AS `number_apspackages` FROM `' . TABLE_APS_INSTANCES . '` WHERE `CustomerID` = :cid');
|
||||
$customer_aps_packages = Database::pexecute_first($customer_aps_packages_stmt, array("cid" => $customer['customerid']));
|
||||
$customer['aps_packages_used_new'] = (int)$customer_aps_packages['number_apspackages'];
|
||||
|
||||
$stmt = Database::prepare('UPDATE `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
SET `mysqls_used` = :mysqls_used,
|
||||
@@ -207,11 +182,9 @@ function updateCounters($returndebuginfo = false) {
|
||||
`email_accounts_used` = :email_accounts_used,
|
||||
`email_forwarders_used` = :email_forwarders_used,
|
||||
`email_quota_used` = :email_quota_used,
|
||||
`email_autoresponder_used` = :email_autoresponder_used,
|
||||
`ftps_used` = :ftps_used,
|
||||
`tickets_used` = :tickets_used,
|
||||
`subdomains_used` = :subdomains_used,
|
||||
`aps_packages_used` = :aps_packages_used
|
||||
`subdomains_used` = :subdomains_used
|
||||
WHERE `customerid` = :cid'
|
||||
);
|
||||
$params = array(
|
||||
@@ -220,11 +193,9 @@ function updateCounters($returndebuginfo = false) {
|
||||
"email_accounts_used" => $customer['email_accounts_used_new'],
|
||||
"email_forwarders_used" => $customer['email_forwarders_used_new'],
|
||||
"email_quota_used" => $customer['email_quota_used_new'],
|
||||
"email_autoresponder_used" => $customer['email_autoresponder_used_new'],
|
||||
"ftps_used" => $customer['ftps_used_new'],
|
||||
"tickets_used" => $customer['tickets_used_new'],
|
||||
"subdomains_used" => $customer['subdomains_used_new'],
|
||||
"aps_packages_used" => $customer['aps_packages_used_new'],
|
||||
"cid" => $customer['customerid']
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
@@ -306,23 +277,11 @@ function updateCounters($returndebuginfo = false) {
|
||||
|
||||
$admin['email_quota_used_new'] = $admin_resources[$admin['adminid']]['email_quota_used'];
|
||||
|
||||
if(!isset($admin_resources[$admin['adminid']]['email_autoresponder_used'])) {
|
||||
$admin_resources[$admin['adminid']]['email_autoresponder_used'] = 0;
|
||||
}
|
||||
|
||||
$admin['email_autoresponder_used_new'] = $admin_resources[$admin['adminid']]['email_autoresponder_used'];
|
||||
|
||||
if(!isset($admin_resources[$admin['adminid']]['subdomains_used'])) {
|
||||
$admin_resources[$admin['adminid']]['subdomains_used'] = 0;
|
||||
}
|
||||
|
||||
$admin['subdomains_used_new'] = $admin_resources[$admin['adminid']]['subdomains_used'];
|
||||
|
||||
if(!isset($admin_resources[$admin['adminid']]['aps_packages_used'])) {
|
||||
$admin_resources[$admin['adminid']]['aps_packages_used'] = 0;
|
||||
}
|
||||
|
||||
$admin['aps_packages_used_new'] = $admin_resources[$admin['adminid']]['aps_packages_used'];
|
||||
|
||||
$stmt = Database::prepare('UPDATE `' . TABLE_PANEL_ADMINS . '`
|
||||
SET `customers_used` = :customers_used,
|
||||
@@ -333,12 +292,10 @@ function updateCounters($returndebuginfo = false) {
|
||||
`email_accounts_used` = :email_accounts_used,
|
||||
`email_forwarders_used` = :email_forwarders_used,
|
||||
`email_quota_used` = :email_quota_used,
|
||||
`email_autoresponder_used` = :email_autoresponder_used,
|
||||
`ftps_used` = :ftps_used,
|
||||
`tickets_used` = :tickets_used,
|
||||
`subdomains_used` = :subdomains_used,
|
||||
`traffic_used` = :traffic_used,
|
||||
`aps_packages_used` = :aps_packages_used
|
||||
`traffic_used` = :traffic_used
|
||||
WHERE `adminid` = :aid'
|
||||
);
|
||||
$params = array(
|
||||
@@ -350,12 +307,10 @@ function updateCounters($returndebuginfo = false) {
|
||||
"email_accounts_used" => $admin['email_accounts_used_new'],
|
||||
"email_forwarders_used" => $admin['email_forwarders_used_new'],
|
||||
"email_quota_used" => $admin['email_quota_used_new'],
|
||||
"email_autoresponder_used" => $admin['email_autoresponder_used_new'],
|
||||
"ftps_used" => $admin['ftps_used_new'],
|
||||
"tickets_used" => $admin['tickets_used_new'],
|
||||
"subdomains_used" => $admin['subdomains_used_new'],
|
||||
"traffic_used" => $admin['traffic_used_new'],
|
||||
"aps_packages_used" => $admin['aps_packages_used_new'],
|
||||
"aid" => $admin['adminid']
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
Reference in New Issue
Block a user