remove some unused functions and migrated some more functions to PDO database class, refs #1287
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -27,7 +27,7 @@ if(($page == 'settings' || $page == 'overview')
|
||||
&& $userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
$settings_data = loadConfigArrayDir('./actions/admin/settings/');
|
||||
$settings = loadSettings($settings_data, $db);
|
||||
$settings = loadSettings($settings_data);
|
||||
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
|
||||
@@ -1,49 +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 getAdmins($limit_resource = '') {
|
||||
|
||||
global $db, $theme;
|
||||
|
||||
$additional_conditions = '';
|
||||
$additional_conditions_array = array();
|
||||
if(getSessionUserDetail('customers_see_all') != true)
|
||||
{
|
||||
$additional_conditions_array[] = '`adminid` = \'' . (int)getSessionUserDetail('adminid') . '\'';
|
||||
}
|
||||
if($limit_resource != '')
|
||||
{
|
||||
$additional_conditions_array[] = '(`' . $limit_resource . '_used` < `' . $limit_resource . '` OR `' . $limit_resource . '` = \'-1\')';
|
||||
}
|
||||
if(!empty($additional_conditions_array))
|
||||
{
|
||||
$additional_conditions = ' WHERE ' . implode(' AND ', $additional_conditions_array) . ' ';
|
||||
}
|
||||
|
||||
$query = 'SELECT `adminid`, `loginname`, `name`, `firstname`, `company` FROM `' . TABLE_PANEL_ADMINS . '` ' . $additional_conditions . ' ORDER BY `name` ASC';
|
||||
$result = $db->query($query);
|
||||
$admins_array = array();
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
$admins_array[$row['adminid']] = getCorrectFullUserDetails($row) . ' (' . $row['loginname'] . ')';
|
||||
}
|
||||
|
||||
return $admins_array;
|
||||
}
|
||||
@@ -17,19 +17,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
function getCustomerDetail($customerid, $varname)
|
||||
{
|
||||
global $db, $theme;
|
||||
function getCustomerDetail($customerid, $varname) {
|
||||
|
||||
$query = 'SELECT `' . $db->escape($varname) . '` FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `customerid` = \'' . (int)$customerid . '\'';
|
||||
$customer = $db->query_first($query);
|
||||
$customer_stmt = Database::prepare("
|
||||
SELECT `' . $varname . '` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid` = :customerid
|
||||
");
|
||||
$customer = Database::pexecute_first($customer_stmt, array('customerid' => $customerid));
|
||||
|
||||
if(isset($customer[$varname]))
|
||||
{
|
||||
if (isset($customer[$varname])) {
|
||||
return $customer[$varname];
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* returns the customer-id of a customer by given domain
|
||||
*
|
||||
* @param string $domain users domain
|
||||
*
|
||||
* @return int customers id
|
||||
*/
|
||||
function getCustomerIdByDomain($domain = null)
|
||||
{
|
||||
global $db, $theme;
|
||||
|
||||
$result = $db->query_first("SELECT `customerid` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain` = '".$domain."'");
|
||||
if(is_array($result)
|
||||
&& isset($result['customerid'])
|
||||
) {
|
||||
return $result['customerid'];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1,49 +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 getCustomers($limit_resource = '')
|
||||
{
|
||||
global $db, $theme;
|
||||
|
||||
$additional_conditions = '';
|
||||
$additional_conditions_array = array();
|
||||
if(getSessionUserDetail('customers_see_all') != true)
|
||||
{
|
||||
$additional_conditions_array[] = '`adminid` = \'' . (int)getSessionUserDetail('adminid') . '\'';
|
||||
}
|
||||
if($limit_resource != '')
|
||||
{
|
||||
$additional_conditions_array[] = '(`' . $limit_resource . '_used` < `' . $limit_resource . '` OR `' . $limit_resource . '` = \'-1\')';
|
||||
}
|
||||
if(!empty($additional_conditions_array))
|
||||
{
|
||||
$additional_conditions = ' WHERE ' . implode(' AND ', $additional_conditions_array) . ' ';
|
||||
}
|
||||
|
||||
$query = 'SELECT `customerid`, `loginname`, `name`, `firstname`, `company` FROM `' . TABLE_PANEL_CUSTOMERS . '` ' . $additional_conditions . ' ORDER BY `name` ASC';
|
||||
$result = $db->query($query);
|
||||
$customers_array = array();
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
$customers_array[$row['customerid']] = getCorrectFullUserDetails($row) . ' (' . $row['loginname'] . ')';
|
||||
}
|
||||
|
||||
return $customers_array;
|
||||
}
|
||||
@@ -17,24 +17,22 @@
|
||||
*
|
||||
*/
|
||||
|
||||
function getIpAddresses()
|
||||
{
|
||||
global $db, $theme;
|
||||
function getIpAddresses() {
|
||||
|
||||
$result_stmt = Database::query("
|
||||
SELECT `id`, `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` ORDER BY `ip` ASC, `port` ASC
|
||||
");
|
||||
|
||||
$query = 'SELECT `id`, `ip`, `port` FROM `' . TABLE_PANEL_IPSANDPORTS . '` ORDER BY `ip` ASC, `port` ASC';
|
||||
$result = $db->query($query);
|
||||
$system_ipaddress_array = array();
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if(!isset($system_ipaddress_array[$row['ip']])
|
||||
&& !in_array($row['ip'], $system_ipaddress_array))
|
||||
{
|
||||
if(filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
|
||||
{
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
if (!isset($system_ipaddress_array[$row['ip']])
|
||||
&& !in_array($row['ip'], $system_ipaddress_array)
|
||||
) {
|
||||
if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$row['ip'] = '[' . $row['ip'] . ']';
|
||||
}
|
||||
|
||||
$system_ipaddress_array[$row['ip']] = $row['ip'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,38 +17,46 @@
|
||||
*
|
||||
*/
|
||||
|
||||
function getIpPortCombinations($ssl = false)
|
||||
{
|
||||
global $db, $theme;
|
||||
function getIpPortCombinations($ssl = false) {
|
||||
|
||||
global $userinfo;
|
||||
|
||||
$additional_conditions_params = array();
|
||||
$additional_conditions_array = array();
|
||||
|
||||
if ($userinfo['ip'] != '-1') {
|
||||
$admin_ip_stmt = Database::prepare("
|
||||
SELECT `id`, `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id` = :ipid
|
||||
");
|
||||
$admin_ip = Database::pexecute_first($admin_ip_stmt, array('ipid' => $userinfo['ip']));
|
||||
|
||||
$additional_conditions_array[] = "`ip` = :adminip";
|
||||
$additional_conditions_params['adminip'] = $admin_ip['ip'];
|
||||
$admin_ip = null;
|
||||
}
|
||||
|
||||
if ($ssl !== null) {
|
||||
$additional_conditions_array[] = "`ssl` = :ssl";
|
||||
$additional_conditions_params['ssl'] = ($ssl === true ? '1' : '0' );
|
||||
}
|
||||
|
||||
$additional_conditions = '';
|
||||
$additional_conditions_array = array();
|
||||
if(getSessionUserDetail('ip') != '-1')
|
||||
{
|
||||
$admin_ip = $db->query_first('SELECT `id`, `ip`, `port` FROM `' . TABLE_PANEL_IPSANDPORTS . '` WHERE `id` = \'' . (int)getSessionUserDetail('ip') . '\' ORDER BY `ip`, `port` ASC');
|
||||
$additional_conditions_array[] = '`ip` = \'' . $admin_ip['ip'] . '\'';
|
||||
unset($admin_ip);
|
||||
}
|
||||
if($ssl !== null)
|
||||
{
|
||||
$additional_conditions_array[] = '`ssl` = \'' . ( $ssl === true ? '1' : '0' ) . '\'';
|
||||
}
|
||||
if(!empty($additional_conditions_array))
|
||||
{
|
||||
$additional_conditions = ' WHERE ' . implode(' AND ', $additional_conditions_array) . ' ';
|
||||
if (count($additional_conditions_array) > 0) {
|
||||
$additional_conditions = " WHERE " . implode(" AND ", $additional_conditions_array) . " ";
|
||||
}
|
||||
|
||||
$query = 'SELECT `id`, `ip`, `port` FROM `' . TABLE_PANEL_IPSANDPORTS . '` ' . $additional_conditions . ' ORDER BY `ip` ASC, `port` ASC';
|
||||
$result = $db->query($query);
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `id`, `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` " .
|
||||
$additional_conditions . " ORDER BY `ip` ASC, `port` ASC
|
||||
");
|
||||
|
||||
Database::pexecute($result_stmt, $additional_conditions_params);
|
||||
$system_ipaddress_array = array();
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if(filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
|
||||
{
|
||||
$row['ip'] = '[' . $row['ip'] . ']';
|
||||
while($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$row['ip'] = '[' . $row['ip'] . ']';
|
||||
}
|
||||
|
||||
$system_ipaddress_array[$row['id']] = $row['ip'] . ':' . $row['port'];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,38 +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 getLanguages()
|
||||
{
|
||||
global $db, $theme;
|
||||
|
||||
$query = 'SELECT * FROM `' . TABLE_PANEL_LANGUAGE . '` ';
|
||||
$result = $db->query($query);
|
||||
$languages_array = array();
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if(!isset($languages_array[$row['language']])
|
||||
&& !in_array($row['language'], $languages_array))
|
||||
{
|
||||
$languages_array[$row['language']] = html_entity_decode($row['language']);
|
||||
}
|
||||
}
|
||||
|
||||
return $languages_array;
|
||||
}
|
||||
@@ -7,12 +7,14 @@
|
||||
*
|
||||
* @return string customers loginname
|
||||
*/
|
||||
function getLoginNameByUid($uid = null)
|
||||
{
|
||||
global $db, $theme;
|
||||
function getLoginNameByUid($uid = null) {
|
||||
|
||||
$result = $db->query_first("SELECT `loginname` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `guid` = '".(int)$uid."'");
|
||||
if(is_array($result)
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `loginname` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `guid` = :guid
|
||||
");
|
||||
$result = Database::pexecute_first($result_stmt, array('guid' => $uid));
|
||||
|
||||
if (is_array($result)
|
||||
&& isset($result['loginname'])
|
||||
) {
|
||||
return $result['loginname'];
|
||||
|
||||
@@ -20,26 +20,20 @@
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getPhpConfigs()
|
||||
{
|
||||
global $db, $theme;
|
||||
function getPhpConfigs() {
|
||||
|
||||
$query = 'SELECT * FROM `' . TABLE_PANEL_PHPCONFIGS . '` ';
|
||||
$result = $db->query($query, false, true);
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");
|
||||
$result = Database::pexecute_first($result_stmt, null, false);
|
||||
$configs_array = array();
|
||||
|
||||
// if the table does not yet exist, we just use the default php.ini
|
||||
if(!$result)
|
||||
{
|
||||
if ($result == false) {
|
||||
$configs_array[1] = 'Default php.ini';
|
||||
}
|
||||
else
|
||||
{
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if(!isset($configs_array[$row['id']])
|
||||
&& !in_array($row['id'], $configs_array))
|
||||
{
|
||||
} else {
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if (!isset($configs_array[$row['id']])
|
||||
&& !in_array($row['id'], $configs_array)
|
||||
) {
|
||||
$configs_array[$row['id']] = html_entity_decode($row['description']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +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 Functions
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* this function checks whether $server_id (multi-server) is set
|
||||
* in userdata.inc.php and returns the value. If not set or invalid,
|
||||
* always return the id of the master (which is '0')
|
||||
*
|
||||
* @return int server_id of current server
|
||||
* @since 0.9.14-svn7
|
||||
*/
|
||||
function getServerId() {
|
||||
|
||||
global $server_id, $theme;
|
||||
|
||||
if(isset($server_id)
|
||||
&& is_numeric($server_id)
|
||||
&& $server_id > 0
|
||||
) {
|
||||
return $server_id;
|
||||
}
|
||||
// return default (master)
|
||||
return 0;
|
||||
}
|
||||
@@ -1,32 +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 getSessionUserDetail($varname)
|
||||
{
|
||||
global $userinfo, $theme;
|
||||
|
||||
if(isset($userinfo[$varname]))
|
||||
{
|
||||
return $userinfo[$varname];
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -27,16 +27,16 @@
|
||||
* @author Florian Lippert <flo@syscp.org>
|
||||
*/
|
||||
|
||||
function inserttask($type, $param1 = '', $param2 = '', $param3 = '', $param4 = '')
|
||||
{
|
||||
global $db, $settings, $theme;
|
||||
function inserttask($type, $param1 = '', $param2 = '', $param3 = '', $param4 = '') {
|
||||
|
||||
if($type == '1'
|
||||
|| $type == '3'
|
||||
|| $type == '4'
|
||||
|| $type == '5'
|
||||
|| $type == '10')
|
||||
{
|
||||
global $settings;
|
||||
|
||||
if ($type == '1'
|
||||
|| $type == '3'
|
||||
|| $type == '4'
|
||||
|| $type == '5'
|
||||
|| $type == '10'
|
||||
) {
|
||||
// 4 = bind -> if bind disabled -> no task
|
||||
if ($type == '4' && $settings['system']['bind_enable'] == '0') {
|
||||
return;
|
||||
@@ -45,49 +45,68 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '', $param4 = '
|
||||
if ($type == '10' && $settings['system']['diskquota_enabled'] == '0') {
|
||||
return;
|
||||
}
|
||||
$db->query('DELETE FROM `' . TABLE_PANEL_TASKS . '` WHERE `type`="' . $type . '"');
|
||||
$db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`) VALUES ("' . $type . '")');
|
||||
}
|
||||
elseif($type == '2'
|
||||
&& $param1 != ''
|
||||
&& $param2 != ''
|
||||
&& $param3 != ''
|
||||
&& ($param4 == 0 || $param4 == 1)
|
||||
$del_stmt = Database::prepare("
|
||||
DELETE FROM `" . TABLE_PANEL_TASKS . "` WHERE `type` = :type
|
||||
");
|
||||
Database::pexecute($del_stmt, array('type' => $type));
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_TASKS . "` SET `type` = :type
|
||||
");
|
||||
Database::pexecute($ins_stmt, array('type' => $type));
|
||||
|
||||
} elseif ($type == '2'
|
||||
&& $param1 != ''
|
||||
&& $param2 != ''
|
||||
&& $param3 != ''
|
||||
&& ($param4 == 0 || $param4 == 1)
|
||||
) {
|
||||
$data = Array();
|
||||
$data = array();
|
||||
$data['loginname'] = $param1;
|
||||
$data['uid'] = $param2;
|
||||
$data['gid'] = $param3;
|
||||
$data['store_defaultindex'] = $param4;
|
||||
$data = serialize($data);
|
||||
$db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("2", "' . $db->escape($data) . '")');
|
||||
}
|
||||
elseif($type == '6'
|
||||
&& $param1 != '')
|
||||
{
|
||||
$data = Array();
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_TASKS . "` SET `type` = '2', `data` = :data
|
||||
");
|
||||
Database::pexecute($ins_stmt, array('data' => $data));
|
||||
|
||||
} elseif ($type == '6'
|
||||
&& $param1 != ''
|
||||
) {
|
||||
$data = array();
|
||||
$data['loginname'] = $param1;
|
||||
$data = serialize($data);
|
||||
$db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("6", "' . $db->escape($data) . '")');
|
||||
}
|
||||
elseif($type == '7'
|
||||
&& $param1 != ''
|
||||
&& $param2 != '')
|
||||
{
|
||||
$data = Array();
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_TASKS . "` SET `type` = '6', `data` = :data
|
||||
");
|
||||
Database::pexecute($ins_stmt, array('data' => $data));
|
||||
|
||||
} elseif ($type == '7'
|
||||
&& $param1 != ''
|
||||
&& $param2 != ''
|
||||
) {
|
||||
$data = array();
|
||||
$data['loginname'] = $param1;
|
||||
$data['email'] = $param2;
|
||||
$data = serialize($data);
|
||||
$db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("7", "' . $db->escape($data) . '")');
|
||||
}
|
||||
elseif($type == '8'
|
||||
&& $param1 != ''
|
||||
&& $param2 != '')
|
||||
{
|
||||
$data = Array();
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_TASKS . "` SET `type` = '7', `data` = :data
|
||||
");
|
||||
Database::pexecute($ins_stmt, array('data' => $data));
|
||||
|
||||
} elseif ($type == '8'
|
||||
&& $param1 != ''
|
||||
&& $param2 != ''
|
||||
) {
|
||||
$data = array();
|
||||
$data['loginname'] = $param1;
|
||||
$data['homedir'] = $param2;
|
||||
$data = serialize($data);
|
||||
$db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("8", "' . $db->escape($data) . '")');
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_TASKS . "` SET `type` = '8', `data` = :data
|
||||
");
|
||||
Database::pexecute($ins_stmt, array('data' => $data));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,23 +15,24 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* returns true or false whether a
|
||||
* given domain id is the std-subdomain
|
||||
* of a customer
|
||||
/**
|
||||
* returns true or false whether a given domain id
|
||||
* is the std-subdomain of a customer
|
||||
*
|
||||
* @param int domain-id
|
||||
* @param int domain-id
|
||||
*
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
function isCustomerStdSubdomain($did = 0)
|
||||
{
|
||||
global $db, $theme;
|
||||
function isCustomerStdSubdomain($did = 0) {
|
||||
|
||||
if($did > 0)
|
||||
{
|
||||
$result = $db->query_first("SELECT `customerid` FROM `".TABLE_PANEL_CUSTOMERS."` WHERE `standardsubdomain` = '".(int)$did."'");
|
||||
if(is_array($result)
|
||||
if ($did > 0) {
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `customerid` FROM `".TABLE_PANEL_CUSTOMERS."`
|
||||
WHERE `standardsubdomain` = :did
|
||||
");
|
||||
$result = Database::pexecute($result_stmt, array('did' => $did));
|
||||
|
||||
if (is_array($result)
|
||||
&& isset($result['customerid'])
|
||||
&& $result['customerid'] > 0
|
||||
) {
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Functions
|
||||
* @version $$
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -20,16 +19,13 @@
|
||||
*
|
||||
* @return array array of enabled redirect-codes
|
||||
*/
|
||||
function getRedirectCodesArray()
|
||||
{
|
||||
global $db, $theme;
|
||||
function getRedirectCodesArray() {
|
||||
|
||||
$sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC";
|
||||
$result = $db->query($sql);
|
||||
$result_stmt = Database::query($sql);
|
||||
|
||||
$codes = array();
|
||||
while($rc = $db->fetch_array($result))
|
||||
{
|
||||
while ($rc = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$codes[] = $rc;
|
||||
}
|
||||
|
||||
@@ -42,16 +38,15 @@ function getRedirectCodesArray()
|
||||
*
|
||||
* @return array array of enabled redirect-codes
|
||||
*/
|
||||
function getRedirectCodes()
|
||||
{
|
||||
global $db, $lng, $theme;
|
||||
function getRedirectCodes() {
|
||||
|
||||
global $lng;
|
||||
|
||||
$sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC";
|
||||
$result = $db->query($sql);
|
||||
$result_stmt = Database::query($sql);
|
||||
|
||||
$codes = array();
|
||||
while($rc = $db->fetch_array($result))
|
||||
{
|
||||
while ($rc = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$codes[$rc['id']] = $rc['code']. ' ('.$lng['redirect_desc'][$rc['desc']].')';
|
||||
}
|
||||
|
||||
@@ -66,20 +61,19 @@ function getRedirectCodes()
|
||||
*
|
||||
* @return string redirect-code
|
||||
*/
|
||||
function getDomainRedirectCode($domainid = 0)
|
||||
{
|
||||
global $db, $theme;
|
||||
function getDomainRedirectCode($domainid = 0) {
|
||||
|
||||
$code = '';
|
||||
if($domainid > 0)
|
||||
{
|
||||
$sql = "SELECT `r`.`code` as `redirect`
|
||||
FROM `".TABLE_PANEL_REDIRECTCODES."` `r`, `".TABLE_PANEL_DOMAINREDIRECTS."` `rc`
|
||||
WHERE `r`.`id` = `rc`.`rid` and `rc`.`did` = '".(int)$domainid."'";
|
||||
if ($domainid > 0) {
|
||||
|
||||
$result = $db->query_first($sql);
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `r`.`code` as `redirect`
|
||||
FROM `".TABLE_PANEL_REDIRECTCODES."` `r`, `".TABLE_PANEL_DOMAINREDIRECTS."` `rc`
|
||||
WHERE `r`.`id` = `rc`.`rid` and `rc`.`did` = :domainid
|
||||
");
|
||||
$result = Database::pexecute_first($result_stmt, array('domainid' => $domainid));
|
||||
|
||||
if(is_array($result)
|
||||
if (is_array($result)
|
||||
&& isset($result['redirect'])
|
||||
) {
|
||||
$code = ($result['redirect'] == '---') ? '' : $result['redirect'];
|
||||
@@ -96,20 +90,18 @@ function getDomainRedirectCode($domainid = 0)
|
||||
*
|
||||
* @return integer redirect-code-id
|
||||
*/
|
||||
function getDomainRedirectId($domainid = 0)
|
||||
{
|
||||
global $db, $theme;
|
||||
function getDomainRedirectId($domainid = 0) {
|
||||
|
||||
$code = 1;
|
||||
if($domainid > 0)
|
||||
{
|
||||
$sql = "SELECT `r`.`id` as `redirect`
|
||||
FROM `".TABLE_PANEL_REDIRECTCODES."` `r`, `".TABLE_PANEL_DOMAINREDIRECTS."` `rc`
|
||||
WHERE `r`.`id` = `rc`.`rid` and `rc`.`did` = '".(int)$domainid."'";
|
||||
if ($domainid > 0) {
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `r`.`id` as `redirect`
|
||||
FROM `".TABLE_PANEL_REDIRECTCODES."` `r`, `".TABLE_PANEL_DOMAINREDIRECTS."` `rc`
|
||||
WHERE `r`.`id` = `rc`.`rid` and `rc`.`did` = :domainid
|
||||
");
|
||||
$result = Database::pexecute_first($result_stmt, array('domainid' => $domainid));
|
||||
|
||||
$result = $db->query_first($sql);
|
||||
|
||||
if(is_array($result)
|
||||
if (is_array($result)
|
||||
&& isset($result['redirect'])
|
||||
) {
|
||||
$code = (int)$result['redirect'];
|
||||
@@ -126,13 +118,12 @@ function getDomainRedirectId($domainid = 0)
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
function addRedirectToDomain($domainid = 0, $redirect = 1)
|
||||
{
|
||||
global $db, $theme;
|
||||
if($domainid > 0)
|
||||
{
|
||||
$db->query("INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."`
|
||||
SET `rid` = '".(int)$redirect."', `did` = '".(int)$domainid."'");
|
||||
function addRedirectToDomain($domainid = 0, $redirect = 1) {
|
||||
if ($domainid > 0) {
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."` SET `rid` = :rid, `did` = :did
|
||||
");
|
||||
Database::pexecute($ins_stmt, array('rid' => $redirect, 'did' => $domainid));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,20 +136,21 @@ function addRedirectToDomain($domainid = 0, $redirect = 1)
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
function updateRedirectOfDomain($domainid = 0, $redirect = false)
|
||||
{
|
||||
global $db, $theme;
|
||||
function updateRedirectOfDomain($domainid = 0, $redirect = false) {
|
||||
|
||||
if($redirect == false)
|
||||
{
|
||||
if ($redirect == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if($domainid > 0)
|
||||
{
|
||||
$db->query("DELETE FROM `".TABLE_PANEL_DOMAINREDIRECTS."`
|
||||
WHERE `did` = '".(int)$domainid."'");
|
||||
$db->query("INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."`
|
||||
SET `rid` = '".(int)$redirect."', `did` = '".(int)$domainid."'");
|
||||
if ($domainid > 0) {
|
||||
$del_stmt = Database::prepare("
|
||||
DELETE FROM `".TABLE_PANEL_DOMAINREDIRECTS."` WHERE `did` = :domainid
|
||||
");
|
||||
Database::pexecute($del_stmt, array('domainid' => $domainid));
|
||||
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."` SET `rid` = :rid, `did` = :did
|
||||
");
|
||||
Database::pexecute($ins_stmt, array('rid' => $redirect, 'did' => $domainid));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,34 +17,50 @@
|
||||
*
|
||||
*/
|
||||
|
||||
function loadSettings(&$settings_data, $db)
|
||||
{
|
||||
function loadSettings(&$settings_data) {
|
||||
|
||||
$settings = array();
|
||||
|
||||
if(is_array($settings_data) && isset($settings_data['groups']) && is_array($settings_data['groups']))
|
||||
{
|
||||
foreach($settings_data['groups'] as $settings_part => $settings_part_details)
|
||||
{
|
||||
if(is_array($settings_part_details) && isset($settings_part_details['fields']) && is_array($settings_part_details['fields']))
|
||||
{
|
||||
foreach($settings_part_details['fields'] as $field_name => $field_details)
|
||||
{
|
||||
if(isset($field_details['settinggroup']) && isset($field_details['varname']) && isset($field_details['default']))
|
||||
{
|
||||
$row = $db->query_first('SELECT `settinggroup`, `varname`, `value` FROM `' . TABLE_PANEL_SETTINGS . '` WHERE `settinggroup` = \'' . $db->escape($field_details['settinggroup']) . '\' AND `varname` = \'' . $db->escape($field_details['varname']) . '\' ');
|
||||
if(!empty($row))
|
||||
{
|
||||
if (is_array($settings_data)
|
||||
&& isset($settings_data['groups'])
|
||||
&& is_array($settings_data['groups'])
|
||||
) {
|
||||
|
||||
// prepare for use in for-loop
|
||||
$row_stmt = Database::prepare("
|
||||
SELECT `settinggroup`, `varname`, `value`
|
||||
FROM `" . TABLE_PANEL_SETTINGS . "`
|
||||
WHERE `settinggroup` = :group AND `varname` = :varname
|
||||
");
|
||||
|
||||
foreach ($settings_data['groups'] as $settings_part => $settings_part_details) {
|
||||
|
||||
if (is_array($settings_part_details)
|
||||
&& isset($settings_part_details['fields'])
|
||||
&& is_array($settings_part_details['fields'])
|
||||
) {
|
||||
|
||||
foreach ($settings_part_details['fields'] as $field_name => $field_details) {
|
||||
|
||||
if (isset($field_details['settinggroup'])
|
||||
&& isset($field_details['varname'])
|
||||
&& isset($field_details['default'])
|
||||
) {
|
||||
// execute prepared statement
|
||||
$row = Database::pexecute_first($row_stmt, array(
|
||||
'group' => $field_details['settinggroup'],
|
||||
'varname' => $field_details['varname']
|
||||
));
|
||||
|
||||
if (!empty($row)) {
|
||||
$varvalue = $row['value'];
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$varvalue = $field_details['default'];
|
||||
}
|
||||
|
||||
$settings[$field_details['settinggroup']][$field_details['varname']] = $varvalue;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
$varvalue = false;
|
||||
}
|
||||
|
||||
@@ -56,5 +72,3 @@ function loadSettings(&$settings_data, $db)
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -17,11 +17,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
function saveSetting($settinggroup, $varname, $newvalue)
|
||||
{
|
||||
global $db, $theme;
|
||||
$query = 'UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = \'' . $db->escape($newvalue) . '\' WHERE `settinggroup` = \'' . $db->escape($settinggroup) . '\' AND `varname`=\'' . $db->escape($varname) . '\'';
|
||||
return $db->query($query);
|
||||
}
|
||||
function saveSetting($settinggroup, $varname, $newvalue) {
|
||||
|
||||
?>
|
||||
$upd_stmt = Database::Prepare("
|
||||
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = :newvalue
|
||||
WHERE `settinggroup` = :group AND `varname` = :varname
|
||||
");
|
||||
Database::pexecute($upd_stmt, array('newvalue' => $newvalue, 'group' => $settinggroup, 'varname' => $varname));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -21,27 +21,32 @@ function storeSettingDefaultIp($fieldname, $fielddata, $newfieldvalue) {
|
||||
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
||||
|
||||
if ($returnvalue !== false
|
||||
&& is_array($fielddata)
|
||||
&& isset($fielddata['settinggroup'])
|
||||
&& $fielddata['settinggroup'] == 'system'
|
||||
&& isset($fielddata['varname'])
|
||||
&& $fielddata['varname'] == 'defaultip'
|
||||
&& is_array($fielddata)
|
||||
&& isset($fielddata['settinggroup'])
|
||||
&& $fielddata['settinggroup'] == 'system'
|
||||
&& isset($fielddata['varname'])
|
||||
&& $fielddata['varname'] == 'defaultip'
|
||||
) {
|
||||
global $db, $theme;
|
||||
|
||||
$customerstddomains_result = $db->query("SELECT `standardsubdomain` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `standardsubdomain` <> '0'");
|
||||
$customerstddomains_result_stmt = Database::prepare("
|
||||
SELECT `standardsubdomain` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `standardsubdomain` <> '0'
|
||||
");
|
||||
Database::pexecute($customerstddomains_result_stmt);
|
||||
|
||||
$ids = array();
|
||||
|
||||
while($customerstddomains_row = $db->fetch_array($customerstddomains_result)) {
|
||||
while ($customerstddomains_row = $customerstddomains_result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$ids[] = (int)$customerstddomains_row['standardsubdomain'];
|
||||
}
|
||||
|
||||
if(count($ids) > 0) {
|
||||
$db->query("UPDATE `" . TABLE_DOMAINTOIP . "` SET
|
||||
`id_ipandports`='" . (int)$newfieldvalue . "'
|
||||
WHERE `id_domain` IN ('" . implode(', ', $ids) . "')
|
||||
AND `id_ipandports` = '" . $db->escape(getSetting('system', 'defaultip')) . "'"
|
||||
);
|
||||
if (count($ids) > 0) {
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_DOMAINTOIP . "` SET
|
||||
`id_ipandports` = :newval
|
||||
WHERE `id_domain` IN ('" . implode(', ', $ids) . "')
|
||||
AND `id_ipandports` = :defaultip
|
||||
");
|
||||
Database::pexecute($upd_stmt, array('newval' => $newfieldvalue, 'defaultip' => getSetting('system', 'defaultip')));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,20 +35,25 @@ function storeSettingDefaultTheme($fieldname, $fielddata, $newfieldvalue) {
|
||||
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
||||
|
||||
if ($returnvalue !== false
|
||||
&& is_array($fielddata)
|
||||
&& isset($fielddata['settinggroup'])
|
||||
&& $fielddata['settinggroup'] == 'panel'
|
||||
&& isset($fielddata['varname'])
|
||||
&& $fielddata['varname'] == 'default_theme'
|
||||
&& is_array($fielddata)
|
||||
&& isset($fielddata['settinggroup'])
|
||||
&& $fielddata['settinggroup'] == 'panel'
|
||||
&& isset($fielddata['varname'])
|
||||
&& $fielddata['varname'] == 'default_theme'
|
||||
) {
|
||||
global $db;
|
||||
// now, if changing themes is disabled we recursivly set
|
||||
// the new theme (customers and admin, depending on settings)
|
||||
if (getSetting('panel', 'allow_theme_change_customer') == '0') {
|
||||
$db->query("UPDATE `".TABLE_PANEL_CUSTOMERS."` SET `theme`='".$db->escape($newfieldvalue)."'");
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `".TABLE_PANEL_CUSTOMERS."` SET `theme` = :theme
|
||||
");
|
||||
Database::pexecute($upd_stmt, array('theme' => $newfieldvalue));
|
||||
}
|
||||
if (getSetting('panel', 'allow_theme_change_admin') == '0') {
|
||||
$db->query("UPDATE `".TABLE_PANEL_ADMINS."` SET `theme`='".$db->escape($newfieldvalue)."'");
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `".TABLE_PANEL_ADMINS."` SET `theme` = :theme
|
||||
");
|
||||
Database::pexecute($upd_stmt, array('theme' => $newfieldvalue));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,30 +17,41 @@
|
||||
*
|
||||
*/
|
||||
|
||||
function storeSettingHostname($fieldname, $fielddata, $newfieldvalue)
|
||||
{
|
||||
function storeSettingHostname($fieldname, $fielddata, $newfieldvalue) {
|
||||
|
||||
global $idna_convert;
|
||||
|
||||
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
||||
|
||||
if($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'hostname')
|
||||
{
|
||||
global $db, $idna_convert, $theme;
|
||||
if ($returnvalue !== false
|
||||
&& is_array($fielddata)
|
||||
&& isset($fielddata['settinggroup'])
|
||||
&& $fielddata['settinggroup'] == 'system'
|
||||
&& isset($fielddata['varname'])
|
||||
&& $fielddata['varname'] == 'hostname'
|
||||
) {
|
||||
$newfieldvalue = $idna_convert->encode($newfieldvalue);
|
||||
|
||||
$customerstddomains_result = $db->query('SELECT `standardsubdomain` FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `standardsubdomain` <> \'0\'');
|
||||
$customerstddomains_result_stmt = Database::prepare("
|
||||
SELECT `standardsubdomain` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `standardsubdomain` <> '0'
|
||||
");
|
||||
Database::pexecute($customerstddomains_result_stmt);
|
||||
|
||||
$ids = array();
|
||||
|
||||
while($customerstddomains_row = $db->fetch_array($customerstddomains_result))
|
||||
{
|
||||
while ($customerstddomains_row = $customerstddomains_result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$ids[] = (int)$customerstddomains_row['standardsubdomain'];
|
||||
}
|
||||
|
||||
if(count($ids) > 0)
|
||||
{
|
||||
$db->query('UPDATE `' . TABLE_PANEL_DOMAINS . '` SET `domain` = REPLACE(`domain`, \'' . $db->escape(getSetting('system', 'hostname')) . '\', \'' . $db->escape($newfieldvalue) . '\') WHERE `id` IN (\'' . implode('\',\'', $ids) . '\')');
|
||||
if (count($ids) > 0) {
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
||||
`domain` = REPLACE(`domain`, :host, :newval)
|
||||
WHERE `id` IN ('" . implode(', ', $ids) . "')
|
||||
");
|
||||
Database::pexecute($upd_stmt, array('host' => getSetting('system', 'hostname'), 'newval' => $newfieldvalue));
|
||||
}
|
||||
}
|
||||
|
||||
return $returnvalue;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -16,28 +16,35 @@
|
||||
*
|
||||
*/
|
||||
|
||||
function storeSettingResetCatchall($fieldname, $fielddata, $newfieldvalue)
|
||||
{
|
||||
function storeSettingResetCatchall($fieldname, $fielddata, $newfieldvalue) {
|
||||
|
||||
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
||||
|
||||
if($returnvalue !== false
|
||||
if ($returnvalue !== false
|
||||
&& is_array($fielddata)
|
||||
&& isset($fielddata['settinggroup'])
|
||||
&& $fielddata['settinggroup'] == 'catchall'
|
||||
&& isset($fielddata['varname'])
|
||||
&& $fielddata['varname'] == 'catchall_enabled'
|
||||
&& $newfieldvalue == '0')
|
||||
{
|
||||
global $db;
|
||||
$result = $db->query("SELECT `id`, `email`, `email_full`, `iscatchall` FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `iscatchall`='1'");
|
||||
&& $newfieldvalue == '0'
|
||||
) {
|
||||
|
||||
while($result_row = $db->fetch_array($result))
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_MAIL_VIRTUAL . "` SET `email` = '" . $db->escape($result_row['email_full']) . "', `iscatchall` = '0' WHERE `id`='" . (int)$result_row['id'] . "'");
|
||||
$result_stmt = Database::query("
|
||||
SELECT `id`, `email`, `email_full`, `iscatchall` FROM `" . TABLE_MAIL_VIRTUAL . "`
|
||||
WHERE `iscatchall` = '1'
|
||||
");
|
||||
|
||||
if (Database::num_rows() > 0) {
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_MAIL_VIRTUAL . "` SET `email` = :email, `iscatchall` = '0' WHERE `id` = :id
|
||||
");
|
||||
|
||||
while ($result_row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
Database::pexecute($upd_stmt, array('email' => $result_row['email_full'], 'id' => $result_row['id']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $returnvalue;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -15,11 +15,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
function setCycleOfCronjob($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
||||
{
|
||||
global $settings, $db, $theme;
|
||||
function setCycleOfCronjob($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues) {
|
||||
|
||||
switch($newfieldvalue)
|
||||
switch ($newfieldvalue)
|
||||
{
|
||||
case 0:
|
||||
$interval = 'DAY';
|
||||
@@ -38,7 +36,7 @@ function setCycleOfCronjob($fieldname, $fielddata, $newfieldvalue, $allnewfieldv
|
||||
break;
|
||||
}
|
||||
|
||||
$db->query("UPDATE `cronjobs_run` SET `interval` = '1 ".$interval."' WHERE `cronfile` = 'cron_used_tickets_reset.php';");
|
||||
Database::query("UPDATE `cronjobs_run` SET `interval` = '1 ".$interval."' WHERE `cronfile` = 'cron_used_tickets_reset.php';");
|
||||
|
||||
return array(FORMFIELDS_PLAUSIBILITY_CHECK_OK);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ if (get_magic_quotes_gpc()) {
|
||||
* Selects settings from MySQL-Table
|
||||
*/
|
||||
$settings_data = loadConfigArrayDir('actions/admin/settings/');
|
||||
$settings = loadSettings($settings_data, $db);
|
||||
$settings = loadSettings($settings_data);
|
||||
|
||||
/**
|
||||
* SESSION MANAGEMENT
|
||||
@@ -434,9 +434,10 @@ if (AREA == 'admin' || AREA == 'customer') {
|
||||
/**
|
||||
* header information about open tickets (only if used)
|
||||
*/
|
||||
$awaitingtickets = 0;
|
||||
$awaitingtickets_text = '';
|
||||
if ($settings['ticket']['enabled'] == '1') {
|
||||
$awaitingtickets = 0;
|
||||
$awaitingtickets_text = '';
|
||||
|
||||
$opentickets = 0;
|
||||
|
||||
if (AREA == 'admin' && isset($userinfo['adminid'])) {
|
||||
|
||||
Reference in New Issue
Block a user