Commit bbc6570c authored by Marius Cramer's avatar Marius Cramer

Converted all windows line breaks to unix line breaks (coding guidelines!)

parent b533b414
<?php
/*
Copyright (c) 2012, ISPConfig UG
Contributors: web wack creations, http://www.web-wack.at
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// Constants describing instances
define('INSTANCE_PENDING', 0);
define('INSTANCE_INSTALL', 1);
define('INSTANCE_ERROR', 2);
define('INSTANCE_SUCCESS', 3);
define('INSTANCE_REMOVE', 4);
// Constants describing packages
define('PACKAGE_LOCKED', 1);
define('PACKAGE_ENABLED', 2);
define('PACKAGE_OUTDATED', 3);
define('PACKAGE_ERROR_NOMETA', 4);
class ApsBase
{
protected $log_prefix = '';
protected $fetch_url = '';
protected $aps_version = '';
protected $packages_dir = '';
protected $temp_pkg_dir = '';
protected $interface_pkg_dir = '';
protected $interface_mode = false; // server mode by default
/**
* Constructor
*
* @param $app the application instance (db handle + log method)
* @param $interface_mode act in interface (true) or server mode (false)
* @param $log_prefix a prefix to set before all log entries
*/
public function __construct($app, $log_prefix = 'APS: ', $interface_mode = false)
{
$this->log_prefix = $log_prefix;
$this->interface_mode = $interface_mode;
$this->fetch_url = 'apscatalog.com';
$this->aps_version = '1';
$this->packages_dir = ISPC_ROOT_PATH.'/aps_packages';
$this->interface_pkg_dir = ISPC_ROOT_PATH.'/web/sites/aps_meta_packages';
}
/**
* Converts a given value to it's native representation in 1024 units
*
* @param $value the size to convert
* @return integer and string
*/
public function convertSize($value)
{
$unit = array('Bytes', 'KB', 'MB', 'GB', 'TB');
return @round($value/pow(1024, ($i = floor(log($value, 1024)))), 2).' '.$unit[$i];
}
/**
* Determine a specific xpath from a given SimpleXMLElement handle. If the
* element is found, it's string representation is returned. If not,
* the return value will stay empty
*
* @param $xml_handle the SimpleXMLElement handle
* @param $query the XPath query
* @param $array define whether to return an array or a string
* @return $ret the return string
*/
protected function getXPathValue($xml_handle, $query, $array = false)
{
$ret = '';
$xp_result = @($xml_handle->xpath($query)) ? $xml_handle->xpath($query) : false;
if($xp_result !== false) $ret = (($array === false) ? (string)$xp_result[0] : $xp_result);
return $ret;
}
}
<?php
/*
Copyright (c) 2012, ISPConfig UG
Contributors: web wack creations, http://www.web-wack.at
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// Constants describing instances
define('INSTANCE_PENDING', 0);
define('INSTANCE_INSTALL', 1);
define('INSTANCE_ERROR', 2);
define('INSTANCE_SUCCESS', 3);
define('INSTANCE_REMOVE', 4);
// Constants describing packages
define('PACKAGE_LOCKED', 1);
define('PACKAGE_ENABLED', 2);
define('PACKAGE_OUTDATED', 3);
define('PACKAGE_ERROR_NOMETA', 4);
class ApsBase
{
protected $log_prefix = '';
protected $fetch_url = '';
protected $aps_version = '';
protected $packages_dir = '';
protected $temp_pkg_dir = '';
protected $interface_pkg_dir = '';
protected $interface_mode = false; // server mode by default
/**
* Constructor
*
* @param $app the application instance (db handle + log method)
* @param $interface_mode act in interface (true) or server mode (false)
* @param $log_prefix a prefix to set before all log entries
*/
public function __construct($app, $log_prefix = 'APS: ', $interface_mode = false)
{
$this->log_prefix = $log_prefix;
$this->interface_mode = $interface_mode;
$this->fetch_url = 'apscatalog.com';
$this->aps_version = '1';
$this->packages_dir = ISPC_ROOT_PATH.'/aps_packages';
$this->interface_pkg_dir = ISPC_ROOT_PATH.'/web/sites/aps_meta_packages';
}
/**
* Converts a given value to it's native representation in 1024 units
*
* @param $value the size to convert
* @return integer and string
*/
public function convertSize($value)
{
$unit = array('Bytes', 'KB', 'MB', 'GB', 'TB');
return @round($value/pow(1024, ($i = floor(log($value, 1024)))), 2).' '.$unit[$i];
}
/**
* Determine a specific xpath from a given SimpleXMLElement handle. If the
* element is found, it's string representation is returned. If not,
* the return value will stay empty
*
* @param $xml_handle the SimpleXMLElement handle
* @param $query the XPath query
* @param $array define whether to return an array or a string
* @return $ret the return string
*/
protected function getXPathValue($xml_handle, $query, $array = false)
{
$ret = '';
$xp_result = @($xml_handle->xpath($query)) ? $xml_handle->xpath($query) : false;
if($xp_result !== false) $ret = (($array === false) ? (string)$xp_result[0] : $xp_result);
return $ret;
}
}
?>
\ No newline at end of file
This diff is collapsed.
<?php
/* Removed because tpl_default.php does not work
for($m = 0; $m < count($module['nav']); $m++) {
if($module['nav'][$m]['title'] == 'Interface') {
$module['nav'][$m]['items'][] = array( 'title' => 'Default Theme',
'target' => 'content',
'link' => 'admin/tpl_default.php',
'html_id' => 'tpl_default');
break;
}
}
*/
?>
<?php
/* Removed because tpl_default.php does not work
for($m = 0; $m < count($module['nav']); $m++) {
if($module['nav'][$m]['title'] == 'Interface') {
$module['nav'][$m]['items'][] = array( 'title' => 'Default Theme',
'target' => 'content',
'link' => 'admin/tpl_default.php',
'html_id' => 'tpl_default');
break;
}
}
*/
?>
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_iptables">
<div class="pnl_formsarea">
<fieldset class="inlineLabels">
<div class="ctrlHolder">
<label for="server_id">{tmpl_var name='server_id_txt'}</label>
<select name="server_id" id="server_id" class="selectInput">
{tmpl_var name='server_id'}
</select>
</div>
<div class="ctrlHolder">
<label for="table">{tmpl_var name='table_txt'}</label>
<select name="table" id="table" class="selectInput formLengthLimit">
{tmpl_var name='table'}
</select>
</div>
<div class="ctrlHolder">
<label for="protocol">{tmpl_var name='protocol_txt'}</label>
<select name="protocol" id="protocol" class="selectInput formLengthLimit">
{tmpl_var name='protocol'}
</select>
</div>
<div class="ctrlHolder">
<label for="singleport">{tmpl_var name='singleport_txt'}</label>
<input name="singleport" id="singleport" value="{tmpl_var name='singleport'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
</div>
<div class="ctrlHolder">
<label for="multiport">{tmpl_var name='multiport_txt'}</label>
<input name="multiport" id="multiport" value="{tmpl_var name='multiport'}" size="20" maxlength="40" type="text" class="textInput" />
</div>
<div class="ctrlHolder">
<label for="destination_ip">{tmpl_var name='destination_ip_txt'}</label>
<input name="destination_ip" id="destination_ip" value="{tmpl_var name='destination_ip'}" size="16" maxlength="20" type="text" class="textInput formLengthIPv4" />
</div>
<div class="ctrlHolder">
<label for="source_ip">{tmpl_var name='source_ip_txt'}</label>
<input name="source_ip" id="source_ip" value="{tmpl_var name='source_ip'}" size="16" maxlength="20" type="text" class="textInput formLengthIPv4" />
</div>
<div class="ctrlHolder">
<label for="state">{tmpl_var name='state_txt'}</label>
<input name="state" id="state" value="{tmpl_var name='state'}" size="16" maxlength="20" type="text" class="textInput" />
</div>
<div class="ctrlHolder">
<label for="target">{tmpl_var name='target_txt'}</label>
<select name="target" id="target" class="selectInput formLengthLimit">
{tmpl_var name='target'}
</select>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='active_txt'}</p>
<div class="multiField">
{tmpl_var name='active'}
</div>
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="buttonHolder buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onclick="submitForm('pageForm','admin/iptables_edit.php');">
<span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onclick="loadContent('admin/iptables_list.php');">
<span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_iptables">
<div class="pnl_formsarea">
<fieldset class="inlineLabels">
<div class="ctrlHolder">
<label for="server_id">{tmpl_var name='server_id_txt'}</label>
<select name="server_id" id="server_id" class="selectInput">
{tmpl_var name='server_id'}
</select>
</div>
<div class="ctrlHolder">
<label for="table">{tmpl_var name='table_txt'}</label>
<select name="table" id="table" class="selectInput formLengthLimit">
{tmpl_var name='table'}
</select>
</div>
<div class="ctrlHolder">
<label for="protocol">{tmpl_var name='protocol_txt'}</label>
<select name="protocol" id="protocol" class="selectInput formLengthLimit">
{tmpl_var name='protocol'}
</select>
</div>
<div class="ctrlHolder">
<label for="singleport">{tmpl_var name='singleport_txt'}</label>
<input name="singleport" id="singleport" value="{tmpl_var name='singleport'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
</div>
<div class="ctrlHolder">
<label for="multiport">{tmpl_var name='multiport_txt'}</label>
<input name="multiport" id="multiport" value="{tmpl_var name='multiport'}" size="20" maxlength="40" type="text" class="textInput" />
</div>
<div class="ctrlHolder">
<label for="destination_ip">{tmpl_var name='destination_ip_txt'}</label>
<input name="destination_ip" id="destination_ip" value="{tmpl_var name='destination_ip'}" size="16" maxlength="20" type="text" class="textInput formLengthIPv4" />
</div>
<div class="ctrlHolder">
<label for="source_ip">{tmpl_var name='source_ip_txt'}</label>
<input name="source_ip" id="source_ip" value="{tmpl_var name='source_ip'}" size="16" maxlength="20" type="text" class="textInput formLengthIPv4" />
</div>
<div class="ctrlHolder">
<label for="state">{tmpl_var name='state_txt'}</label>
<input name="state" id="state" value="{tmpl_var name='state'}" size="16" maxlength="20" type="text" class="textInput" />
</div>
<div class="ctrlHolder">
<label for="target">{tmpl_var name='target_txt'}</label>
<select name="target" id="target" class="selectInput formLengthLimit">
{tmpl_var name='target'}
</select>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='active_txt'}</p>
<div class="multiField">
{tmpl_var name='active'}
</div>
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="buttonHolder buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onclick="submitForm('pageForm','admin/iptables_edit.php');">
<span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onclick="loadContent('admin/iptables_list.php');">
<span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
</div>
\ No newline at end of file
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_system_config">
<div class="pnl_formsarea">
<fieldset class="inlineLabels"><legend><tmpl_var name="branding_txt">Branding</legend>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='allow_themechange_txt'}Allow users to change theme</p>
<div class="multiField">
{tmpl_var name='allow_themechange'}
</div>
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="buttonHolder buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/system_config_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/server_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_system_config">
<div class="pnl_formsarea">
<fieldset class="inlineLabels"><legend><tmpl_var name="branding_txt">Branding</legend>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='allow_themechange_txt'}Allow users to change theme</p>
<div class="multiField">
{tmpl_var name='allow_themechange'}
</div>
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="buttonHolder buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/system_config_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/server_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
</div>
\ No newline at end of file
<?php
/*
Copyright (c) 2007-2010, Till Brehm, projektfarm Gmbh and Oliver Vogel www.muv.com
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/******************************************
* Begin Form configuration
******************************************/
$tform_def_file = "form/client_template.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
//* Check permissions for module
$app->auth->check_module_permissions('client');
if(!$_SESSION["s"]["user"]["typ"] == 'admin') die('Client-Templates are only for Admins.');
// Loading classes
$app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');
class page_action extends tform_actions {
function onBeforeUpdate() {
global $app;
if(isset($this->dataRecord['template_type'])) {
//* Check if the template_type has been changed
$rec = $app->db->queryOneRecord("SELECT template_type from client_template WHERE template_id = ".$this->id);
if($rec['template_type'] != $this->dataRecord['template_type']) {
//* Add a error message and switch back to old server
$app->tform->errorMessage .= $app->lng('The template type can not be changed.');
$this->dataRecord['template_type'] = $rec['template_type'];
}
unset($rec);
}
}
/*
This function is called automatically right after
the data was successful updated in the database.
*/
function onAfterUpdate() {
global $app;
$app->uses('client_templates');
/*
* the template has changed. apply the new data to all clients
*/
if ($this->dataRecord["template_type"] == 'm'){
$sql = "SELECT client_id FROM client WHERE template_master = " . $this->id;
} else {
$sql = "SELECT client_id FROM client WHERE template_additional LIKE '%/" . $this->id . "/%' OR template_additional LIKE '" . $this->id . "/%' OR template_additional LIKE '%/" . $this->id . "' UNION SELECT client_id FROM client_template_assigned WHERE client_template_id = " . $this->id;
}
$clients = $app->db->queryAllRecords($sql);
if (is_array($clients)){
foreach ($clients as $client){
$app->client_templates->apply_client_templates($client['client_id']);
}
}
}
}
$page = new page_action;
$page->onLoad();
?>
<?php
/*
Copyright (c) 2007-2010, Till Brehm, projektfarm Gmbh and Oliver Vogel www.muv.com
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/******************************************
* Begin Form configuration
******************************************/
$tform_def_file = "form/client_template.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
//* Check permissions for module
$app->auth->check_module_permissions('client');
if(!$_SESSION["s"]["user"]["typ"] == 'admin') die('Client-Templates are only for Admins.');
// Loading classes
$app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');
class page_action extends tform_actions {
function onBeforeUpdate() {
global $app;
if(isset($this->dataRecord['template_type'])) {
//* Check if the template_type has been changed
$rec = $app->db->queryOneRecord("SELECT template_type from client_template WHERE template_id = ".$this->id);
if($rec['template_type'] != $this->dataRecord['template_type']) {
//* Add a error message and switch back to old server
$app->tform->errorMessage .= $app->lng('The template type can not be changed.');
$this->dataRecord['template_type'] = $rec['template_type'];
}
unset($rec);
}
}
/*
This function is called automatically right after
the data was successful updated in the database.
*/
function onAfterUpdate() {
global $app;
$app->uses('client_templates');
/*
* the template has changed. apply the new data to all clients
*/
if ($this->dataRecord["template_type"] == 'm'){
$sql = "SELECT client_id FROM client WHERE template_master = " . $this->id;
} else {
$sql = "SELECT client_id FROM client WHERE template_additional LIKE '%/" . $this->id . "/%' OR template_additional LIKE '" . $this->id . "/%' OR template_additional LIKE '%/" . $this->id . "' UNION SELECT client_id FROM client_template_assigned WHERE client_template_id = " . $this->id;
}
$clients = $app->db->queryAllRecords($sql);
if (is_array($clients)){
foreach ($clients as $client){
$app->client_templates->apply_client_templates($client['client_id']);
}
}
}
}
$page = new page_action;
$page->onLoad();
?>
<?php
class dashlet_mailquota {
function show() {
global $app, $conf;
//* Loading Template
$app->uses('tpl');
$tpl = new tpl;
$tpl->newTemplate("dashlets/templates/mailquota.htm");
$wb = array();
$lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_mailquota.lng';
if(is_file($lng_file)) include($lng_file);
$tpl->setVar($wb);
$tmp_rec = $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'email_quota' ORDER BY created DESC");
$monitor_data = array();
if(is_array($tmp_rec)) {
foreach ($tmp_rec as $tmp_mon) {
//$monitor_data = array_merge_recursive($monitor_data,unserialize($app->db->unquote($tmp_mon['data'])));
$tmp_array = unserialize($app->db->unquote($tmp_mon['data']));
if(is_array($tmp_array)) {
foreach($tmp_array as $username => $data) {
if(!$monitor_data[$username]['used']) $monitor_data[$username]['used'] = $data['used'];