auto-format all files; add table-definitions to test-bootstrap file

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-21 12:24:07 +01:00
parent 1ff784198c
commit 97b5439c0d
209 changed files with 6840 additions and 4534 deletions

View File

@@ -3,6 +3,7 @@ namespace Froxlor\Api\Commands;
use Froxlor\Database as Database;
use Froxlor\Settings as Settings;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
@@ -11,12 +12,12 @@ use Froxlor\Settings as Settings;
* 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 API
* @since 0.10.0
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package API
* @since 0.10.0
*
*/
class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity
{

View File

@@ -3,7 +3,6 @@ namespace Froxlor\Api\Commands;
use Froxlor\Database as Database;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).

View File

@@ -3,6 +3,7 @@ namespace Froxlor\Api\Commands;
use Froxlor\Database as Database;
use Froxlor\Settings as Settings;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
@@ -11,12 +12,12 @@ use Froxlor\Settings as Settings;
* 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 API
* @since 0.10.0
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package API
* @since 0.10.0
*
*/
class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity
{

View File

@@ -1,5 +1,4 @@
<?php
namespace Froxlor\Cli;
/**
@@ -16,7 +15,6 @@ namespace Froxlor\Cli;
* @package Cron
*
*/
class ConfigServicesCmd extends CmdLineHandler
{

View File

@@ -2,7 +2,7 @@
namespace Froxlor\Cron\Http;
use Froxlor\Database\Database;
use \Froxlor\Settings;
use Froxlor\Settings;
use Froxlor\Cron\Http\Php\Fpm;
use Froxlor\Cron\Http\Php\PhpInterface;

View File

@@ -2,7 +2,7 @@
namespace Froxlor\Cron\Http;
use Froxlor\Database\Database;
use \Froxlor\Settings;
use Froxlor\Settings;
use Froxlor\Cron\Http\Php\PhpInterface;
/**
@@ -14,27 +14,25 @@ use Froxlor\Cron\Http\Php\PhpInterface;
* 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 Cron
*
* @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 Cron
*
*/
class ApacheFcgi extends Apache
{
protected function composePhpOptions($domain, $ssl_vhost = false)
{
$php_options_text = '';
if($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1')
{
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
$php = new PhpInterface($domain);
$phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']);
$phpconfig = $php->getPhpConfig((int) $domain['phpsettingid']);
if((int)Settings::Get('phpfpm.enabled') == 1)
{
if ((int) Settings::Get('phpfpm.enabled') == 1) {
$srvName = 'fpm.external';
if ($domain['ssl'] == 1 && $ssl_vhost) {
$srvName = 'ssl-fpm.external';
@@ -42,116 +40,107 @@ class ApacheFcgi extends Apache
// #1317 - perl is executed via apache and therefore, when using fpm, does not know the user
// which perl is supposed to run as, hence the need for Suexec need
if (customerHasPerlEnabled($domain['customerid'])) {
$php_options_text.= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
$php_options_text .= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
}
// mod_proxy stuff for apache-2.4
if (Settings::Get('system.apache24') == '1'
&& Settings::Get('phpfpm.use_mod_proxy') == '1'
) {
if (Settings::Get('system.apache24') == '1' && Settings::Get('phpfpm.use_mod_proxy') == '1') {
$filesmatch = $phpconfig['fpm_settings']['limit_extensions'];
$extensions = explode(" ", $filesmatch);
$filesmatch = "";
foreach ($extensions as $ext) {
$filesmatch .= substr($ext, 1).'|';
$filesmatch .= substr($ext, 1) . '|';
}
// start block, cut off last pipe and close block
$filesmatch = '('.str_replace(".", "\.", substr($filesmatch, 0, -1)).')';
$php_options_text.= ' <FilesMatch \.'.$filesmatch.'$>'. "\n";
$php_options_text.= ' SetHandler proxy:unix:' . $php->getInterface()->getSocketFile() . '|fcgi://localhost'. "\n";
$php_options_text.= ' </FilesMatch>' . "\n";
$filesmatch = '(' . str_replace(".", "\.", substr($filesmatch, 0, - 1)) . ')';
$php_options_text .= ' <FilesMatch \.' . $filesmatch . '$>' . "\n";
$php_options_text .= ' SetHandler proxy:unix:' . $php->getInterface()->getSocketFile() . '|fcgi://localhost' . "\n";
$php_options_text .= ' </FilesMatch>' . "\n";
$mypath_dir = new \Froxlor\Http\Directory($domain['documentroot']);
// only create the require all granted if there is not active directory-protection
// for this path, as this would be the first require and therefore grant all access
if ($mypath_dir->isUserProtected() == false) {
$php_options_text.= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
// only create the require all granted if there is not active directory-protection
// for this path, as this would be the first require and therefore grant all access
if ($mypath_dir->isUserProtected() == false) {
$php_options_text .= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
if ($phpconfig['pass_authorizationheader'] == '1') {
$php_options_text.= ' CGIPassAuth On' . "\n";
$php_options_text .= ' CGIPassAuth On' . "\n";
}
$php_options_text.= ' Require all granted' . "\n";
$php_options_text.= ' AllowOverride All' . "\n";
$php_options_text.= ' </Directory>' . "\n";
} elseif ($phpconfig['pass_authorizationheader'] == '1') {
$php_options_text .= ' Require all granted' . "\n";
$php_options_text .= ' AllowOverride All' . "\n";
$php_options_text .= ' </Directory>' . "\n";
} elseif ($phpconfig['pass_authorizationheader'] == '1') {
// allow Pass of Authorization header
$php_options_text.= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
$php_options_text.= ' CGIPassAuth On' . "\n";
$php_options_text.= ' </Directory>' . "\n";
}
$php_options_text .= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
$php_options_text .= ' CGIPassAuth On' . "\n";
$php_options_text .= ' </Directory>' . "\n";
}
} else {
$addheader = "";
if ($phpconfig['pass_authorizationheader'] == '1') {
$addheader = " -pass-header Authorization";
}
$php_options_text.= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . $phpconfig['fpm_settings']['idle_timeout'] . $addheader . "\n";
$php_options_text.= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
$php_options_text .= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . $phpconfig['fpm_settings']['idle_timeout'] . $addheader . "\n";
$php_options_text .= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
$filesmatch = $phpconfig['fpm_settings']['limit_extensions'];
$extensions = explode(" ", $filesmatch);
$filesmatch = "";
foreach ($extensions as $ext) {
$filesmatch .= substr($ext, 1).'|';
$filesmatch .= substr($ext, 1) . '|';
}
// start block, cut off last pipe and close block
$filesmatch = '('.str_replace(".", "\.", substr($filesmatch, 0, -1)).')';
$php_options_text.= ' <FilesMatch \.'.$filesmatch.'$>'. "\n";
$php_options_text.= ' SetHandler php-fastcgi'. "\n";
$php_options_text.= ' Action php-fastcgi /fastcgiphp' . "\n";
$php_options_text.= ' Options +ExecCGI' . "\n";
$php_options_text.= ' </FilesMatch>' . "\n";
$filesmatch = '(' . str_replace(".", "\.", substr($filesmatch, 0, - 1)) . ')';
$php_options_text .= ' <FilesMatch \.' . $filesmatch . '$>' . "\n";
$php_options_text .= ' SetHandler php-fastcgi' . "\n";
$php_options_text .= ' Action php-fastcgi /fastcgiphp' . "\n";
$php_options_text .= ' Options +ExecCGI' . "\n";
$php_options_text .= ' </FilesMatch>' . "\n";
// >=apache-2.4 enabled?
if (Settings::Get('system.apache24') == '1') {
$mypath_dir = new \Froxlor\Http\Directory($domain['documentroot']);
// only create the require all granted if there is not active directory-protection
// for this path, as this would be the first require and therefore grant all access
if ($mypath_dir->isUserProtected() == false) {
$php_options_text.= ' Require all granted' . "\n";
$php_options_text.= ' AllowOverride All' . "\n";
}
$mypath_dir = new \Froxlor\Http\Directory($domain['documentroot']);
// only create the require all granted if there is not active directory-protection
// for this path, as this would be the first require and therefore grant all access
if ($mypath_dir->isUserProtected() == false) {
$php_options_text .= ' Require all granted' . "\n";
$php_options_text .= ' AllowOverride All' . "\n";
}
} else {
$php_options_text.= ' Order allow,deny' . "\n";
$php_options_text.= ' allow from all' . "\n";
$php_options_text .= ' Order allow,deny' . "\n";
$php_options_text .= ' allow from all' . "\n";
}
$php_options_text.= ' </Directory>' . "\n";
$php_options_text.= ' Alias /fastcgiphp ' . $php->getInterface()->getAliasConfigDir() . $srvName . "\n";
$php_options_text .= ' </Directory>' . "\n";
$php_options_text .= ' Alias /fastcgiphp ' . $php->getInterface()->getAliasConfigDir() . $srvName . "\n";
}
}
else
{
$php_options_text.= ' FcgidIdleTimeout ' . Settings::Get('system.mod_fcgid_idle_timeout') . "\n";
if((int)Settings::Get('system.mod_fcgid_wrapper') == 0)
{
$php_options_text.= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
$php_options_text.= ' ScriptAlias /php/ ' . $php->getInterface()->getConfigDir() . "\n";
}
else
{
$php_options_text.= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
$php_options_text.= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
} else {
$php_options_text .= ' FcgidIdleTimeout ' . Settings::Get('system.mod_fcgid_idle_timeout') . "\n";
if ((int) Settings::Get('system.mod_fcgid_wrapper') == 0) {
$php_options_text .= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
$php_options_text .= ' ScriptAlias /php/ ' . $php->getInterface()->getConfigDir() . "\n";
} else {
$php_options_text .= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
$php_options_text .= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
$file_extensions = explode(' ', $phpconfig['file_extensions']);
$php_options_text.= ' <FilesMatch "\.(' . implode('|', $file_extensions) . ')$">' . "\n";
$php_options_text.= ' SetHandler fcgid-script' . "\n";
foreach($file_extensions as $file_extension)
{
$php_options_text.= ' FcgidWrapper ' . $php->getInterface()->getStarterFile() . ' .' . $file_extension . "\n";
$php_options_text .= ' <FilesMatch "\.(' . implode('|', $file_extensions) . ')$">' . "\n";
$php_options_text .= ' SetHandler fcgid-script' . "\n";
foreach ($file_extensions as $file_extension) {
$php_options_text .= ' FcgidWrapper ' . $php->getInterface()->getStarterFile() . ' .' . $file_extension . "\n";
}
$php_options_text.= ' Options +ExecCGI' . "\n";
$php_options_text.= ' </FilesMatch>' . "\n";
$php_options_text .= ' Options +ExecCGI' . "\n";
$php_options_text .= ' </FilesMatch>' . "\n";
// >=apache-2.4 enabled?
if (Settings::Get('system.apache24') == '1') {
$mypath_dir = new \Froxlor\Http\Directory($domain['documentroot']);
// only create the require all granted if there is not active directory-protection
// for this path, as this would be the first require and therefore grant all access
if ($mypath_dir->isUserProtected() == false) {
$php_options_text.= ' Require all granted' . "\n";
$php_options_text.= ' AllowOverride All' . "\n";
}
$mypath_dir = new \Froxlor\Http\Directory($domain['documentroot']);
// only create the require all granted if there is not active directory-protection
// for this path, as this would be the first require and therefore grant all access
if ($mypath_dir->isUserProtected() == false) {
$php_options_text .= ' Require all granted' . "\n";
$php_options_text .= ' AllowOverride All' . "\n";
}
} else {
$php_options_text.= ' Order allow,deny' . "\n";
$php_options_text.= ' allow from all' . "\n";
$php_options_text .= ' Order allow,deny' . "\n";
$php_options_text .= ' allow from all' . "\n";
}
$php_options_text.= ' </Directory>' . "\n";
$php_options_text .= ' </Directory>' . "\n";
}
}
@@ -161,10 +150,8 @@ class ApacheFcgi extends Apache
// create php.ini (fpm does nothing here, as it
// defines ini-settings in its pool config)
$php->getInterface()->createIniFile($phpconfig);
}
else
{
$php_options_text.= ' # PHP is disabled for this vHost' . "\n";
} else {
$php_options_text .= ' # PHP is disabled for this vHost' . "\n";
}
return $php_options_text;
@@ -172,23 +159,16 @@ class ApacheFcgi extends Apache
public function createOwnVhostStarter()
{
if (Settings::Get('system.mod_fcgid_ownvhost') == '1'
|| (Settings::Get('phpfpm.enabled') == '1'
&& Settings::Get('phpfpm.enabled_ownvhost') == '1')
) {
if (Settings::Get('system.mod_fcgid_ownvhost') == '1' || (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.enabled_ownvhost') == '1')) {
$mypath = \Froxlor\Froxlor::getInstallDir();
if (Settings::Get('system.mod_fcgid_ownvhost') == '1')
{
if (Settings::Get('system.mod_fcgid_ownvhost') == '1') {
$user = Settings::Get('system.mod_fcgid_httpuser');
$group = Settings::Get('system.mod_fcgid_httpgroup');
}
elseif(Settings::Get('phpfpm.enabled') == '1'
&& Settings::Get('phpfpm.enabled_ownvhost') == '1'
) {
} elseif (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.enabled_ownvhost') == '1') {
$user = Settings::Get('phpfpm.vhost_httpuser');
$group = Settings::Get('phpfpm.vhost_httpgroup');
// get fpm config
$fpm_sel_stmt = Database::prepare("
SELECT f.id FROM `" . TABLE_PANEL_FPMDAEMONS . "` f
@@ -204,8 +184,8 @@ class ApacheFcgi extends Apache
'id' => 'none',
'domain' => Settings::Get('system.hostname'),
'adminid' => 1, /* first admin-user (superadmin) */
'mod_fcgid_starter' => -1,
'mod_fcgid_maxrequests' => -1,
'mod_fcgid_starter' => - 1,
'mod_fcgid_maxrequests' => - 1,
'guid' => $user,
'openbasedir' => 0,
'email' => Settings::Get('panel.adminmail'),

View File

@@ -1,4 +1,7 @@
<?php if (!defined('MASTER_CRONJOB')) die('You cannot access this file directly!');
<?php
if (! defined('MASTER_CRONJOB'))
die('You cannot access this file directly!');
/**
* This file is part of the Froxlor project.
@@ -8,17 +11,16 @@
* 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 Cron
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron
*
*/
use \Froxlor\Database;
use \Froxlor\Settings;
use Froxlor\Database;
use Froxlor\Settings;
if ((int)Settings::Get('system.report_webmax') > 0)
{
if ((int) Settings::Get('system.report_webmax') > 0) {
/**
* report about diskusage for customers
*/
@@ -34,11 +36,7 @@ if ((int)Settings::Get('system.report_webmax') > 0)
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
if (isset($row['diskspace'])
&& $row['diskspace_used'] != null
&& $row['diskspace_used'] > 0
&& (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int)Settings::Get('system.report_webmax')
) {
if (isset($row['diskspace']) && $row['diskspace_used'] != null && $row['diskspace_used'] > 0 && (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int) Settings::Get('system.report_webmax')) {
$rep_userinfo = array(
'name' => $row['name'],
@@ -58,12 +56,16 @@ if ((int)Settings::Get('system.report_webmax') > 0)
SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`
WHERE `language` = :deflang
");
$lngfile = Database::pexecute_first($lngfile_stmt, array('deflang' => $row['def_language']));
$lngfile = Database::pexecute_first($lngfile_stmt, array(
'deflang' => $row['def_language']
));
if ($lngfile !== null) {
$langfile = $lngfile['file'];
} else {
$lngfile = Database::pexecute_first($lngfile_stmt, array('deflang' => Settings::Get('panel.standardlanguage')));
$lngfile = Database::pexecute_first($lngfile_stmt, array(
'deflang' => Settings::Get('panel.standardlanguage')
));
$langfile = $lngfile['file'];
}
@@ -99,7 +101,7 @@ if ((int)Settings::Get('system.report_webmax') > 0)
$mail->MsgHTML(nl2br($mail_body));
$mail->AddAddress($row['email'], $row['name']);
$mail->Send();
} catch(\PHPMailer\PHPMailer\Exception $e) {
} catch (\PHPMailer\PHPMailer\Exception $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (Exception $e) {
@@ -117,7 +119,9 @@ if ((int)Settings::Get('system.report_webmax') > 0)
UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `reportsent` = '2'
WHERE `customerid` = :customerid
");
Database::pexecute($upd_stmt, array('customerid' => $row['customerid']));
Database::pexecute($upd_stmt, array(
'customerid' => $row['customerid']
));
}
}
@@ -130,11 +134,7 @@ if ((int)Settings::Get('system.report_webmax') > 0)
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
if (isset($row['diskspace'])
&& $row['diskspace_used'] != null
&& $row['diskspace_used'] > 0
&& (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int)Settings::Get('system.report_webmax')
) {
if (isset($row['diskspace']) && $row['diskspace_used'] != null && $row['diskspace_used'] > 0 && (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int) Settings::Get('system.report_webmax')) {
$replace_arr = array(
'NAME' => $row['name'],
@@ -148,12 +148,16 @@ if ((int)Settings::Get('system.report_webmax') > 0)
SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`
WHERE `language` = :deflang
");
$lngfile = Database::pexecute_first($lngfile_stmt, array('deflang' => $row['def_language']));
$lngfile = Database::pexecute_first($lngfile_stmt, array(
'deflang' => $row['def_language']
));
if ($lngfile !== null) {
$langfile = $lngfile['file'];
} else {
$lngfile = Database::pexecute_first($lngfile_stmt, array('deflang' => Settings::Get('panel.standardlanguage')));
$lngfile = Database::pexecute_first($lngfile_stmt, array(
'deflang' => Settings::Get('panel.standardlanguage')
));
$langfile = $lngfile['file'];
}
@@ -189,7 +193,7 @@ if ((int)Settings::Get('system.report_webmax') > 0)
$mail->MsgHTML(nl2br($mail_body));
$mail->AddAddress($row['email'], $row['name']);
$mail->Send();
} catch(\PHPMailer\PHPMailer\Exception $e) {
} catch (\PHPMailer\PHPMailer\Exception $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (Exception $e) {
@@ -207,7 +211,9 @@ if ((int)Settings::Get('system.report_webmax') > 0)
UPDATE `" . TABLE_PANEL_ADMINS . "` SET `reportsent` = '2'
WHERE `adminid` = :adminid
");
Database::pexecute($upd_stmt, array('adminid' => $row['adminid']));
Database::pexecute($upd_stmt, array(
'adminid' => $row['adminid']
));
}
}
} // webmax > 0

View File

@@ -70,8 +70,9 @@ class FroxlorLogger
/**
* return FroxlorLogger instance
*
* @param array $userinfo unused
*
* @param array $userinfo
* unused
*
* @return FroxlorLogger
*/
public static function getInstanceOf($userinfo = null)

View File

@@ -5,33 +5,38 @@ use Froxlor\Settings;
class Statistics
{
/**
* Create or modify the AWStats configuration file for the given domain.
* Modified by Berend Dekens to allow custom configurations.
*
* @param logFile
* @param siteDomain
* @param hostAliases
* @param
* logFile
* @param
* siteDomain
* @param
* hostAliases
* @return null
*/
public static function createAWStatsConf($logFile, $siteDomain, $hostAliases, $customerDocroot, $awstats_params = array()) {
public static function createAWStatsConf($logFile, $siteDomain, $hostAliases, $customerDocroot, $awstats_params = array())
{
// Generation header
$header = "## GENERATED BY FROXLOR\n";
$header2 = "## Do not remove the line above! This tells Froxlor to update this configuration\n## If you wish to manually change this configuration file, remove the first line to make sure Froxlor won't rebuild this file\n## Generated for domain {SITE_DOMAIN} on " . date('l dS \of F Y h:i:s A') . "\n";
$awstats_dir = \Froxlor\FileDir::makeCorrectDir($customerDocroot.'/awstats/'.$siteDomain.'/');
if (!is_dir($awstats_dir)) {
\Froxlor\FileDir::safe_exec('mkdir -p '.escapeshellarg($awstats_dir));
$awstats_dir = \Froxlor\FileDir::makeCorrectDir($customerDocroot . '/awstats/' . $siteDomain . '/');
if (! is_dir($awstats_dir)) {
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($awstats_dir));
}
// chown created folder, #258
self::makeChownWithNewStats($awstats_params);
// weird but could happen...
if (!is_dir(Settings::Get('system.awstats_conf'))) {
\Froxlor\FileDir::safe_exec('mkdir -p '.escapeshellarg(Settings::Get('system.awstats_conf')));
if (! is_dir(Settings::Get('system.awstats_conf'))) {
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(Settings::Get('system.awstats_conf')));
}
// These are the variables we will replace
$regex = array(
'/\{LOG_FILE\}/',
@@ -47,82 +52,78 @@ class Statistics
$awstats_dir,
\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_conf'))
);
// File names
$domain_file = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.' . $siteDomain . '.conf');
$model_file = \Froxlor\Froxlor::getInstallDir().'/templates/misc/awstats/awstats.froxlor.model.conf';
$domain_file = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.awstats_conf') . '/awstats.' . $siteDomain . '.conf');
$model_file = \Froxlor\Froxlor::getInstallDir() . '/templates/misc/awstats/awstats.froxlor.model.conf';
$model_file = \Froxlor\FileDir::makeCorrectFile($model_file);
// Test if the file exists
if (file_exists($domain_file)) {
// Check for the generated header - if this is a manual modification we won't update
$awstats_domain_conf = fopen($domain_file, 'r');
if (fgets($awstats_domain_conf, strlen($header)) != $header) {
fclose($awstats_domain_conf);
return;
}
// Close the file
fclose($awstats_domain_conf);
}
$awstats_domain_conf = fopen($domain_file, 'w');
$awstats_model_conf = fopen($model_file, 'r');
// Write the header
fwrite($awstats_domain_conf, $header);
fwrite($awstats_domain_conf, preg_replace($regex, $replace, $header2));
// Write the configuration file
while (($line = fgets($awstats_model_conf, 4096)) !== false) {
if (!preg_match('/^#/', $line)
&& trim($line) != ''
) {
fwrite($awstats_domain_conf, preg_replace($regex, $replace, $line));
}
if (! preg_match('/^#/', $line) && trim($line) != '') {
fwrite($awstats_domain_conf, preg_replace($regex, $replace, $line));
}
}
fclose($awstats_domain_conf);
fclose($awstats_model_conf);
}
/**
* chowns either awstats or webalizer folder,
* either with webserver-user or - if fcgid
* is used - the customers name, #258
*
* @param array $row array if panel_customers
*
* @param array $row
* array if panel_customers
*
* @return void
*/
public static function makeChownWithNewStats($row) {
public static function makeChownWithNewStats($row)
{
// get correct user
if ((Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1')
&& isset($row['deactivated'])
&& $row['deactivated'] == '0'
) {
$user = $row['loginname'];
$group = $row['loginname'];
} else {
$user = $row['guid'];
$group = $row['guid'];
}
// get correct directory
$dir = $row['documentroot'];
if (Settings::Get('system.awstats_enabled') == '1') {
$dir .= '/awstats/';
} else {
$dir .= '/webalizer/';
}
// only run chown if directory exists
if (file_exists($dir)) {
// run chown
\Froxlor\FileDir::safe_exec('chown -R '.escapeshellarg($user).':'.escapeshellarg($group).' '.escapeshellarg(\Froxlor\FileDir::makeCorrectDir($dir)));
}
if ((Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1') && isset($row['deactivated']) && $row['deactivated'] == '0') {
$user = $row['loginname'];
$group = $row['loginname'];
} else {
$user = $row['guid'];
$group = $row['guid'];
}
// get correct directory
$dir = $row['documentroot'];
if (Settings::Get('system.awstats_enabled') == '1') {
$dir .= '/awstats/';
} else {
$dir .= '/webalizer/';
}
// only run chown if directory exists
if (file_exists($dir)) {
// run chown
\Froxlor\FileDir::safe_exec('chown -R ' . escapeshellarg($user) . ':' . escapeshellarg($group) . ' ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir($dir)));
}
}
}

View File

@@ -1,10 +1,8 @@
<?php
namespace Froxlor;
use Froxlor\Database\Database;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
@@ -13,14 +11,14 @@ use Froxlor\Database\Database;
* 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 Michael Kaufmann <mkaufmann@nutime.de>
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes
*
* @since 0.9.31
*
* @copyright (c) the authors
* @author Michael Kaufmann <mkaufmann@nutime.de>
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes
*
* @since 0.9.31
*
*/
/**
@@ -28,12 +26,12 @@ use Froxlor\Database\Database;
*
* Interaction with settings from the db
*
* @copyright (c) the authors
* @author Michael Kaufmann <mkaufmann@nutime.de>
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes
*
* @copyright (c) the authors
* @author Michael Kaufmann <mkaufmann@nutime.de>
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes
*
* @method static mixed Get ($setting = null) return a setting-value by its group and varname separated by a dot (group.varname)
* @method static boolean Set ($setting = null, $value = null, $instant_save = true) update a setting / set a new value
* @method static boolean IsInList ($setting = null, $entry = null) tests if a setting-value that i s a comma separated list contains an entry
@@ -41,7 +39,8 @@ use Froxlor\Database\Database;
* @method static boolean Flush () Store all un-saved changes to the database and re-read in all settings
* @method static void Stash () forget all un-saved changes to settings
*/
class Settings {
class Settings
{
/**
* current settings object
@@ -75,12 +74,13 @@ class Settings {
/**
* private constructor, reads in all settings
*/
private function __construct() {
private function __construct()
{
$this->_readSettings();
self::$_updatedata = array();
// prepare statement
self::$_updstmt = Database::prepare("
UPDATE `".TABLE_PANEL_SETTINGS."` SET `value` = :value
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = :value
WHERE `settinggroup` = :group AND `varname` = :varname
");
}
@@ -89,7 +89,8 @@ class Settings {
* Read in all settings from the database
* and set the internal $_data array
*/
private function _readSettings() {
private function _readSettings()
{
$result_stmt = Database::query("
SELECT `settingid`, `settinggroup`, `varname`, `value`
FROM `" . TABLE_PANEL_SETTINGS . "`
@@ -108,11 +109,12 @@ class Settings {
* @param string $varname
* @param string $value
*/
private function _storeSetting($group = null, $varname = null, $value = null) {
private function _storeSetting($group = null, $varname = null, $value = null)
{
$upd_data = array(
'group' => $group,
'varname' => $varname,
'value' => $value
'group' => $group,
'varname' => $varname,
'value' => $value
);
Database::pexecute(self::$_updstmt, $upd_data);
}
@@ -120,14 +122,16 @@ class Settings {
/**
* return a setting-value by its group and varname
*
* @param string $setting a group and a varname separated by a dot (group.varname)
*
* @param string $setting
* a group and a varname separated by a dot (group.varname)
*
* @return mixed
*/
public function pGet($setting = null) {
public function pGet($setting = null)
{
$sstr = explode(".", $setting);
// no separator - do'h
if (!isset($sstr[1])) {
if (! isset($sstr[1])) {
return null;
}
$result = null;
@@ -140,35 +144,40 @@ class Settings {
/**
* tests if a setting-value that i s a comma separated list contains an entry
*
* @param string $setting a group and a varname separated by a dot (group.varname)
* @param string $entry the entry that is expected to be in the list
*
* @param string $setting
* a group and a varname separated by a dot (group.varname)
* @param string $entry
* the entry that is expected to be in the list
*
* @return boolean true, if the list contains $entry
*/
public function pIsInList($setting = null, $entry = null) {
$s=Settings::Get($setting);
if ($s==null) {
public function pIsInList($setting = null, $entry = null)
{
$s = Settings::Get($setting);
if ($s == null) {
return false;
}
$slist = explode(",",$s);
$slist = explode(",", $s);
return in_array($entry, $slist);
}
/**
* update a setting / set a new value
*
* @param string $setting a group and a varname separated by a dot (group.varname)
* @param string $setting
* a group and a varname separated by a dot (group.varname)
* @param string $value
* @param boolean $instant_save
*
* @return bool
*/
public function pSet($setting = null, $value = null, $instant_save = true) {
public function pSet($setting = null, $value = null, $instant_save = true)
{
// check whether the setting exists
if (Settings::Get($setting) !== null) {
// set new value in array
$sstr = explode(".", $setting);
if (!isset($sstr[1])) {
if (! isset($sstr[1])) {
return false;
}
self::$_data[$sstr[0]][$sstr[1]] = $value;
@@ -177,12 +186,12 @@ class Settings {
$this->_storeSetting($sstr[0], $sstr[1], $value);
} else {
// set temporary data for usage
if (!isset(self::$_data[$sstr[0]]) || !is_array(self::$_data[$sstr[0]])) {
if (! isset(self::$_data[$sstr[0]]) || ! is_array(self::$_data[$sstr[0]])) {
self::$_data[$sstr[0]] = array();
}
self::$_data[$sstr[0]][$sstr[1]] = $value;
// set update-data when invoking Flush()
if (!isset(self::$_updatedata[$sstr[0]]) || !is_array(self::$_updatedata[$sstr[0]])) {
if (! isset(self::$_updatedata[$sstr[0]]) || ! is_array(self::$_updatedata[$sstr[0]])) {
self::$_updatedata[$sstr[0]] = array();
}
self::$_updatedata[$sstr[0]][$sstr[1]] = $value;
@@ -195,31 +204,33 @@ class Settings {
/**
* add a new setting to the database (mainly used in updater)
*
* @param string $setting a group and a varname separated by a dot (group.varname)
* @param string $setting
* a group and a varname separated by a dot (group.varname)
* @param string $value
*
* @return boolean
*/
public function pAddNew($setting = null, $value = null) {
public function pAddNew($setting = null, $value = null)
{
// first check if it doesn't exist
if (Settings::Get($setting) === null) {
// validate parameter
$sstr = explode(".", $setting);
if (!isset($sstr[1])) {
if (! isset($sstr[1])) {
return false;
}
// prepare statement
$ins_stmt = Database::prepare("
INSERT INTO `".TABLE_PANEL_SETTINGS."` SET
INSERT INTO `" . TABLE_PANEL_SETTINGS . "` SET
`settinggroup` = :group,
`varname` = :varname,
`value` = :value
");
$ins_data = array(
'group' => $sstr[0],
'varname' => $sstr[1],
'value' => $value
'group' => $sstr[0],
'varname' => $sstr[1],
'value' => $value
);
Database::pexecute($ins_stmt, $ins_data);
// also set new value to internal array and make it available
@@ -233,7 +244,8 @@ class Settings {
* Store all un-saved changes to the database and
* re-read in all settings
*/
public function pFlush() {
public function pFlush()
{
if (is_array(self::$_updatedata) && count(self::$_updatedata) > 0) {
// save all un-saved changes to the settings
foreach (self::$_updatedata as $group => $vargroup) {
@@ -252,7 +264,8 @@ class Settings {
/**
* forget all un-saved changes to settings
*/
public function pStash() {
public function pStash()
{
// empty update array
self::$_updatedata = array();
}
@@ -262,7 +275,8 @@ class Settings {
*
* @return object
*/
private static function getInstance() {
private static function getInstance()
{
// do we got an object already?
if (self::$_obj == null) {
self::$_obj = new self();
@@ -280,12 +294,16 @@ class Settings {
*
* @return mixed
*/
public static function __callStatic($name, $args) {
public static function __callStatic($name, $args)
{
// as our functions are not static and therefore cannot
// be called statically, we prefix a 'p' to all of
// our public functions so we can use Settings::functionname()
// which looks cooler and is easier to use
$callback = array(self::getInstance(), "p".$name);
$callback = array(
self::getInstance(),
"p" . $name
);
$result = call_user_func_array($callback, $args);
return $result;
}

View File

@@ -13,7 +13,7 @@ class Cronjob
* Checks if the system's last guid is not higher than the one saved
* in froxlor's database. If it's higher, froxlor needs to
* set its last guid to this one to avoid conflicts with libnss-users
*
*
* @return null
*/
public static function checkLastGuid()

View File

@@ -137,7 +137,7 @@ class Crypt
return $available_pwdhashes;
}
/**
* Function validatePassword
*
@@ -145,78 +145,37 @@ class Crypt
* we check against the length, if not matched
* an error message will be output and 'exit' is called
*
* @param string $password the password to validate
*
* @param string $password
* the password to validate
*
* @return string either the password or an errormessage+exit
*/
public static function validatePassword($password = null, $json_response = false) {
public static function validatePassword($password = null, $json_response = false)
{
if (Settings::Get('panel.password_min_length') > 0) {
$password = validate(
$password,
Settings::Get('panel.password_min_length'),
'/^.{'.(int)Settings::Get('panel.password_min_length').',}$/D',
'notrequiredpasswordlength',
array(),
$json_response
);
$password = validate($password, Settings::Get('panel.password_min_length'), '/^.{' . (int) Settings::Get('panel.password_min_length') . ',}$/D', 'notrequiredpasswordlength', array(), $json_response);
}
if (Settings::Get('panel.password_regex') != '') {
$password = validate(
$password,
Settings::Get('panel.password_regex'),
Settings::Get('panel.password_regex'),
'notrequiredpasswordcomplexity',
array(),
$json_response
);
$password = validate($password, Settings::Get('panel.password_regex'), Settings::Get('panel.password_regex'), 'notrequiredpasswordcomplexity', array(), $json_response);
} else {
if (Settings::Get('panel.password_alpha_lower')) {
$password = validate(
$password,
'/.*[a-z]+.*/',
'/.*[a-z]+.*/',
'notrequiredpasswordcomplexity',
array(),
$json_response
);
$password = validate($password, '/.*[a-z]+.*/', '/.*[a-z]+.*/', 'notrequiredpasswordcomplexity', array(), $json_response);
}
if (Settings::Get('panel.password_alpha_upper')) {
$password = validate(
$password,
'/.*[A-Z]+.*/',
'/.*[A-Z]+.*/',
'notrequiredpasswordcomplexity',
array(),
$json_response
);
$password = validate($password, '/.*[A-Z]+.*/', '/.*[A-Z]+.*/', 'notrequiredpasswordcomplexity', array(), $json_response);
}
if (Settings::Get('panel.password_numeric')) {
$password = validate(
$password,
'/.*[0-9]+.*/',
'/.*[0-9]+.*/',
'notrequiredpasswordcomplexity',
array(),
$json_response
);
$password = validate($password, '/.*[0-9]+.*/', '/.*[0-9]+.*/', 'notrequiredpasswordcomplexity', array(), $json_response);
}
if (Settings::Get('panel.password_special_char_required')) {
$password = validate(
$password,
'/.*[' . preg_quote(Settings::Get('panel.password_special_char')) . ']+.*/',
'/.*[' . preg_quote(Settings::Get('panel.password_special_char')) . ']+.*/',
'notrequiredpasswordcomplexity',
array(),
$json_response
);
$password = validate($password, '/.*[' . preg_quote(Settings::Get('panel.password_special_char')) . ']+.*/', '/.*[' . preg_quote(Settings::Get('panel.password_special_char')) . ']+.*/', 'notrequiredpasswordcomplexity', array(), $json_response);
}
}
return $password;
}
/**
* Function validatePasswordLogin
*
@@ -225,22 +184,26 @@ class Crypt
* additionally it updates the hash if the system settings changed
* or if the very old md5() sum is used
*
* @param array $userinfo user-data from table
* @param string $password the password to validate
* @param string $table either panel_customers or panel_admins
* @param string $uid user-id-field in $table
*
* @param array $userinfo
* user-data from table
* @param string $password
* the password to validate
* @param string $table
* either panel_customers or panel_admins
* @param string $uid
* user-id-field in $table
*
* @return boolean
*/
public static function validatePasswordLogin($userinfo = null, $password = null, $table = 'panel_customers', $uid = 'customerid') {
public static function validatePasswordLogin($userinfo = null, $password = null, $table = 'panel_customers', $uid = 'customerid')
{
$systype = 3; // SHA256
if (Settings::Get('system.passwordcryptfunc') !== null) {
$systype = (int)Settings::Get('system.passwordcryptfunc');
$systype = (int) Settings::Get('system.passwordcryptfunc');
}
$pwd_hash = $userinfo['password'];
$update_hash = false;
// check for good'ole md5
if (strlen($pwd_hash) == 32 && ctype_xdigit($pwd_hash)) {
@@ -254,34 +217,31 @@ class Crypt
// check whether the hash needs to be updated
$hash_type_chk = substr($pwd_hash, 0, 3);
if (($systype == 1 && $hash_type_chk != '$1$') || // MD5
($systype == 2 && $hash_type_chk != '$2$') || // BLOWFISH
($systype == 3 && $hash_type_chk != '$5$') || // SHA256
($systype == 4 && $hash_type_chk != '$6$') // SHA512
) {
$update_hash = true;
}
($systype == 2 && $hash_type_chk != '$2$') || // BLOWFISH
($systype == 3 && $hash_type_chk != '$5$') || // SHA256
($systype == 4 && $hash_type_chk != '$6$')) // SHA512
{
$update_hash = true;
}
}
if ($pwd_hash == $pwd_check) {
// check for update of hash (only if our database is ready to handle the bigger string)
$is_ready = (version_compare2("0.9.33", \Froxlor\Froxlor::getVersion()) <= 0 ? true : false);
if ($update_hash && $is_ready) {
$upd_stmt = \Froxlor\Database\Database::prepare("
UPDATE " . $table . " SET `password` = :newpasswd WHERE `" . $uid . "` = :uid
");
$params = array (
$params = array(
'newpasswd' => self::makeCryptPassword($password),
'uid' => $userinfo[$uid]
);
\Froxlor\Database\Database::pexecute($upd_stmt, $params);
}
return true;
}
return false;
}
}

View File

@@ -9,20 +9,22 @@ namespace Froxlor\UI;
* 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 Classes
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes
*
*/
class HtmlForm
{
/**
* internal tmp-variable to store form
*
* @var string
*/
private static $_form = '';
private static $_filename = '';
public static function genHTMLForm($data = array())
@@ -32,46 +34,43 @@ class HtmlForm
self::$_form = '';
foreach($data as $fdata)
{
foreach ($data as $fdata) {
$sections = $fdata['sections'];
foreach($sections as $section)
{
foreach ($sections as $section) {
/*
* here be section title & image
*/
*/
$title = $section['title'];
$image = $section['image'];
if(isset($section['visible']) && $section['visible'] === false)
{
if (isset($section['visible']) && $section['visible'] === false) {
continue;
}
if (!isset($section['nobuttons']) || $section['nobuttons'] == false) {
if (! isset($section['nobuttons']) || $section['nobuttons'] == false) {
eval("self::\$_form .= \"" . Template::getTemplate("misc/form/table_section", "1") . "\";");
} else {
$nob = true;
}
$nexto = false;
foreach($section['fields'] as $fieldname => $fielddata)
{
if(isset($fielddata['visible']) && $fielddata['visible'] === false)
{
foreach ($section['fields'] as $fieldname => $fielddata) {
if (isset($fielddata['visible']) && $fielddata['visible'] === false) {
continue;
}
if ($nexto === false || (isset($fielddata['next_to']) && $nexto['field'] != $fielddata['next_to'])) {
$label = $fielddata['label'];
$desc = (isset($fielddata['desc']) ? $fielddata['desc'] : '');
$style = (isset($fielddata['style']) ? ' class="'.$fielddata['style'].'"' : '');
$style = (isset($fielddata['style']) ? ' class="' . $fielddata['style'] . '"' : '');
$mandatory = self::_getMandatoryFlag($fielddata);
$data_field = self::_parseDataField($fieldname, $fielddata);
if (isset($fielddata['has_nextto'])) {
$nexto = array('field' => $fieldname);
$data_field.='{NEXTTOFIELD_'.$fieldname.'}';
$nexto = array(
'field' => $fieldname
);
$data_field .= '{NEXTTOFIELD_' . $fieldname . '}';
} else {
$nexto = false;
}
@@ -79,12 +78,8 @@ class HtmlForm
} else {
$data_field = self::_parseDataField($fieldname, $fielddata);
$data_field = str_replace("\t", "", $data_field);
$data_field = $fielddata['next_to_prefix'].$data_field;
self::$_form = str_replace(
'{NEXTTOFIELD_'.$fielddata['next_to'].'}',
$data_field,
self::$_form
);
$data_field = $fielddata['next_to_prefix'] . $data_field;
self::$_form = str_replace('{NEXTTOFIELD_' . $fielddata['next_to'] . '}', $data_field, self::$_form);
$nexto = false;
}
}
@@ -92,7 +87,7 @@ class HtmlForm
}
// add save/reset buttons at the end of the form
if (!$nob) {
if (! $nob) {
eval("self::\$_form .= \"" . Template::getTemplate("misc/form/table_end", "1") . "\";");
}
@@ -101,41 +96,48 @@ class HtmlForm
private static function _parseDataField($fieldname, $data = array())
{
switch($data['type'])
{
switch ($data['type']) {
case 'text':
return self::_textBox($fieldname, $data); break;
return self::_textBox($fieldname, $data);
break;
case 'textul':
return self::_textBox($fieldname, $data, 'text', true); break;
return self::_textBox($fieldname, $data, 'text', true);
break;
case 'password':
return self::_textBox($fieldname, $data, 'password'); break;
return self::_textBox($fieldname, $data, 'password');
break;
case 'hidden':
return self::_textBox($fieldname, $data, 'hidden'); break;
return self::_textBox($fieldname, $data, 'hidden');
break;
case 'yesno':
return self::_yesnoBox($data); break;
return self::_yesnoBox($data);
break;
case 'select':
return self::_selectBox($fieldname, $data); break;
return self::_selectBox($fieldname, $data);
break;
case 'label':
return self::_labelField($data); break;
return self::_labelField($data);
break;
case 'textarea':
return self::_textArea($fieldname, $data); break;
return self::_textArea($fieldname, $data);
break;
case 'checkbox':
return self::_checkbox($fieldname, $data); break;
return self::_checkbox($fieldname, $data);
break;
case 'file':
return self::_file($fieldname, $data); break;
return self::_file($fieldname, $data);
break;
case 'int':
return self::_int($fieldname, $data); break;
return self::_int($fieldname, $data);
break;
}
}
private static function _getMandatoryFlag($data = array())
{
if(isset($data['mandatory']))
{
if (isset($data['mandatory'])) {
return '&nbsp;<span class="red">*</span>';
}
elseif(isset($data['mandatory_ex']))
{
} elseif (isset($data['mandatory_ex'])) {
return '&nbsp;<span class="red">**</span>';
}
return '';
@@ -145,14 +147,14 @@ class HtmlForm
{
$return = '';
$extras = '';
if(isset($data['maxlength'])) {
$extras .= ' maxlength="'.$data['maxlength'].'"';
if (isset($data['maxlength'])) {
$extras .= ' maxlength="' . $data['maxlength'] . '"';
}
if(isset($data['size'])) {
$extras .= ' size="'.$data['size'].'"';
if (isset($data['size'])) {
$extras .= ' size="' . $data['size'] . '"';
}
if(isset($data['autocomplete'])) {
$extras .= ' autocomplete="'.$data['autocomplete'].'"';
if (isset($data['autocomplete'])) {
$extras .= ' autocomplete="' . $data['autocomplete'] . '"';
}
// add support to save reloaded forms
@@ -164,10 +166,9 @@ class HtmlForm
$value = '';
}
$ulfield = ($unlimited == true ? '&nbsp;'.$data['ul_field'] : '');
if(isset($data['display']) && $data['display'] != '')
{
$ulfield = '<strong>'.$data['display'].'</strong>';
$ulfield = ($unlimited == true ? '&nbsp;' . $data['ul_field'] : '');
if (isset($data['display']) && $data['display'] != '') {
$ulfield = '<strong>' . $data['display'] . '</strong>';
}
eval("\$return = \"" . Template::getTemplate("misc/form/input_text", "1") . "\";");
@@ -178,11 +179,11 @@ class HtmlForm
{
$return = '';
$extras = '';
if(isset($data['cols'])) {
$extras .= ' cols="'.$data['cols'].'"';
if (isset($data['cols'])) {
$extras .= ' cols="' . $data['cols'] . '"';
}
if(isset($data['rows'])) {
$extras .= ' rows="'.$data['rows'].'"';
if (isset($data['rows'])) {
$extras .= ' rows="' . $data['rows'] . '"';
}
// add support to save reloaded forms
@@ -221,12 +222,10 @@ class HtmlForm
}
return '<select
id="'.$fieldname.'"
name="'.$fieldname.'"
'.(isset($data['class']) ? ' class="'.$data['class'] .'" ' : '').'
>'
.$select_var.
'</select>';
id="' . $fieldname . '"
name="' . $fieldname . '"
' . (isset($data['class']) ? ' class="' . $data['class'] . '" ' : '') . '
>' . $select_var . '</select>';
}
/**
@@ -234,32 +233,36 @@ class HtmlForm
*
* <code>
* $data = array(
* 'label' => $lng['customer']['email_imap'],
* 'type' => 'checkbox',
* 'values' => array(
* array( 'label' => 'active',
* 'value' => '1'
* )
* ),
* 'value' => array('1'),
* 'mandatory' => true
* )
* 'label' => $lng['customer']['email_imap'],
* 'type' => 'checkbox',
* 'values' => array(
* array( 'label' => 'active',
* 'value' => '1'
* )
* ),
* 'value' => array('1'),
* 'mandatory' => true
* )
* </code>
*
* @param string $fieldname contains the fieldname
* @param array $data contains the data array
* @param string $fieldname
* contains the fieldname
* @param array $data
* contains the data array
*/
public static function _checkbox($fieldname = '', $data = array()) {
public static function _checkbox($fieldname = '', $data = array())
{
// $data['value'] contains checked items
$checked = array();
if (isset($data['value'])) {
$checked = $data['value'];
}
if (isset($_SESSION['requestData'])) {
if(isset($_SESSION['requestData'][$fieldname])) {
$checked = array($_SESSION['requestData'][$fieldname]);
if (isset($_SESSION['requestData'][$fieldname])) {
$checked = array(
$_SESSION['requestData'][$fieldname]
);
}
}
@@ -272,12 +275,12 @@ class HtmlForm
// will contain the output
$output = "";
foreach($data['values'] as $val) {
foreach ($data['values'] as $val) {
$key = $val['label'];
// is this box checked?
$isChecked = '';
if (is_array($checked) && count($checked) > 0) {
foreach($checked as $tmp) {
foreach ($checked as $tmp) {
if ($tmp == $val['value']) {
$isChecked = ' checked="checked" ';
break;
@@ -286,10 +289,10 @@ class HtmlForm
}
$output .= '<label>';
if (empty($isArray)) {
$output .= '<input type="hidden" name="'.$fieldname.'" value="0" />';
$output .= '<input type="hidden" name="' . $fieldname . '" value="0" />';
}
$output .= '<input type="checkbox" name="'.$fieldname.$isArray.'" value="'.$val['value'].'" '.$isChecked.'/>';
$output .= $key.'</label>';
$output .= '<input type="checkbox" name="' . $fieldname . $isArray . '" value="' . $val['value'] . '" ' . $isChecked . '/>';
$output .= $key . '</label>';
}
return $output;
@@ -299,8 +302,8 @@ class HtmlForm
{
$return = '';
$extras = '';
if(isset($data['maxlength'])) {
$extras .= ' maxlength="'.$data['maxlength'].'"';
if (isset($data['maxlength'])) {
$extras .= ' maxlength="' . $data['maxlength'] . '"';
}
// add support to save reloaded forms
@@ -312,9 +315,8 @@ class HtmlForm
$value = '';
}
if(isset($data['display']) && $data['display'] != '')
{
$ulfield = '<strong>'.$data['display'].'</strong>';
if (isset($data['display']) && $data['display'] != '') {
$ulfield = '<strong>' . $data['display'] . '</strong>';
}
eval("\$return = \"" . Template::getTemplate("misc/form/input_file", "1") . "\";");
@@ -325,11 +327,11 @@ class HtmlForm
{
$return = '';
$extras = '';
if(isset($data['int_min'])) {
$extras .= ' min="'.$data['int_min'].'"';
if (isset($data['int_min'])) {
$extras .= ' min="' . $data['int_min'] . '"';
}
if(isset($data['int_max'])) {
$extras .= ' max="'.$data['int_max'].'"';
if (isset($data['int_max'])) {
$extras .= ' max="' . $data['int_max'] . '"';
}
// add support to save reloaded forms

View File

@@ -1,7 +1,7 @@
<?php
namespace Froxlor\Validate\Form;
class String
class Strings
{
public static function validateFormFieldString($fieldname, $fielddata, $newfieldvalue)

View File

@@ -15,7 +15,6 @@
* @package AJAX
*
*/
require __DIR__ . '/vendor/autoload.php';
// Load the user settings
@@ -41,12 +40,12 @@ if ($action == "newsfeed") {
} else {
$feed = "https://inside.froxlor.org/news/";
}
if (function_exists("simplexml_load_file") == false) {
outputItem("Newsfeed not available due to missing php-simplexml extension", "Please install the php-simplexml extension in order to view our newsfeed.");
exit();
}
if (function_exists('curl_version')) {
$output = \Froxlor\Http\HttpClient::urlGet($feed);
$news = simplexml_load_string(trim($output));
@@ -54,17 +53,17 @@ if ($action == "newsfeed") {
outputItem("Newsfeed not available due to missing php-curl extension", "Please install the php-curl extension in order to view our newsfeed.");
exit();
}
if ($news !== false) {
for ($i = 0; $i < 3; $i ++) {
$item = $news->channel->item[$i];
$title = (string) $item->title;
$link = (string) $item->link;
$date = date("Y-m-d G:i", strtotime($item->pubDate));
$content = preg_replace("/[\r\n]+/", " ", strip_tags($item->description));
$content = substr($content, 0, 150) . "...";
outputItem($title, $content, $link, $date);
}
} else {
@@ -80,20 +79,20 @@ function outputItem($title, $content, $link = null, $date = null)
<div class=\"newsfeed-body clearfix\">
<div class=\"header\">
<strong class=\"primary-font\">";
if (! empty($link)) {
echo "<a href=\"{$link}\" target=\"_blank\">";
}
echo $title;
if (! empty($link)) {
echo "</a>";
}
echo "</strong>";
if (! empty($date)) {
echo "<small class=\"pull-right text-muted\">
if (! empty($link)) {
echo "<a href=\"{$link}\" target=\"_blank\">";
}
echo $title;
if (! empty($link)) {
echo "</a>";
}
echo "</strong>";
if (! empty($date)) {
echo "<small class=\"pull-right text-muted\">
<i class=\"fa fa-clock-o fa-fw\"></i> {$date}
</small>";
}
echo "</div>
}
echo "</div>
<p>
{$content}
</p>

View File

@@ -14,14 +14,16 @@
* @package Classes
*
*/
class htmlform
{
/**
* internal tmp-variable to store form
*
* @var string
*/
private static $_form = '';
private static $_filename = '';
public static function genHTMLForm($data = array())
@@ -31,46 +33,43 @@ class htmlform
self::$_form = '';
foreach($data as $fdata)
{
foreach ($data as $fdata) {
$sections = $fdata['sections'];
foreach($sections as $section)
{
foreach ($sections as $section) {
/*
* here be section title & image
*/
*/
$title = $section['title'];
$image = $section['image'];
if(isset($section['visible']) && $section['visible'] === false)
{
if (isset($section['visible']) && $section['visible'] === false) {
continue;
}
if (!isset($section['nobuttons']) || $section['nobuttons'] == false) {
if (! isset($section['nobuttons']) || $section['nobuttons'] == false) {
eval("self::\$_form .= \"" . getTemplate("misc/form/table_section", "1") . "\";");
} else {
$nob = true;
}
$nexto = false;
foreach($section['fields'] as $fieldname => $fielddata)
{
if(isset($fielddata['visible']) && $fielddata['visible'] === false)
{
foreach ($section['fields'] as $fieldname => $fielddata) {
if (isset($fielddata['visible']) && $fielddata['visible'] === false) {
continue;
}
if ($nexto === false || (isset($fielddata['next_to']) && $nexto['field'] != $fielddata['next_to'])) {
$label = $fielddata['label'];
$desc = (isset($fielddata['desc']) ? $fielddata['desc'] : '');
$style = (isset($fielddata['style']) ? ' class="'.$fielddata['style'].'"' : '');
$style = (isset($fielddata['style']) ? ' class="' . $fielddata['style'] . '"' : '');
$mandatory = self::_getMandatoryFlag($fielddata);
$data_field = self::_parseDataField($fieldname, $fielddata);
if (isset($fielddata['has_nextto'])) {
$nexto = array('field' => $fieldname);
$data_field.='{NEXTTOFIELD_'.$fieldname.'}';
$nexto = array(
'field' => $fieldname
);
$data_field .= '{NEXTTOFIELD_' . $fieldname . '}';
} else {
$nexto = false;
}
@@ -78,12 +77,8 @@ class htmlform
} else {
$data_field = self::_parseDataField($fieldname, $fielddata);
$data_field = str_replace("\t", "", $data_field);
$data_field = $fielddata['next_to_prefix'].$data_field;
self::$_form = str_replace(
'{NEXTTOFIELD_'.$fielddata['next_to'].'}',
$data_field,
self::$_form
);
$data_field = $fielddata['next_to_prefix'] . $data_field;
self::$_form = str_replace('{NEXTTOFIELD_' . $fielddata['next_to'] . '}', $data_field, self::$_form);
$nexto = false;
}
}
@@ -91,7 +86,7 @@ class htmlform
}
// add save/reset buttons at the end of the form
if (!$nob) {
if (! $nob) {
eval("self::\$_form .= \"" . getTemplate("misc/form/table_end", "1") . "\";");
}
@@ -100,41 +95,48 @@ class htmlform
private static function _parseDataField($fieldname, $data = array())
{
switch($data['type'])
{
switch ($data['type']) {
case 'text':
return self::_textBox($fieldname, $data); break;
return self::_textBox($fieldname, $data);
break;
case 'textul':
return self::_textBox($fieldname, $data, 'text', true); break;
return self::_textBox($fieldname, $data, 'text', true);
break;
case 'password':
return self::_textBox($fieldname, $data, 'password'); break;
return self::_textBox($fieldname, $data, 'password');
break;
case 'hidden':
return self::_textBox($fieldname, $data, 'hidden'); break;
return self::_textBox($fieldname, $data, 'hidden');
break;
case 'yesno':
return self::_yesnoBox($data); break;
return self::_yesnoBox($data);
break;
case 'select':
return self::_selectBox($fieldname, $data); break;
return self::_selectBox($fieldname, $data);
break;
case 'label':
return self::_labelField($data); break;
return self::_labelField($data);
break;
case 'textarea':
return self::_textArea($fieldname, $data); break;
return self::_textArea($fieldname, $data);
break;
case 'checkbox':
return self::_checkbox($fieldname, $data); break;
return self::_checkbox($fieldname, $data);
break;
case 'file':
return self::_file($fieldname, $data); break;
return self::_file($fieldname, $data);
break;
case 'int':
return self::_int($fieldname, $data); break;
return self::_int($fieldname, $data);
break;
}
}
private static function _getMandatoryFlag($data = array())
{
if(isset($data['mandatory']))
{
if (isset($data['mandatory'])) {
return '&nbsp;<span class="red">*</span>';
}
elseif(isset($data['mandatory_ex']))
{
} elseif (isset($data['mandatory_ex'])) {
return '&nbsp;<span class="red">**</span>';
}
return '';
@@ -144,14 +146,14 @@ class htmlform
{
$return = '';
$extras = '';
if(isset($data['maxlength'])) {
$extras .= ' maxlength="'.$data['maxlength'].'"';
if (isset($data['maxlength'])) {
$extras .= ' maxlength="' . $data['maxlength'] . '"';
}
if(isset($data['size'])) {
$extras .= ' size="'.$data['size'].'"';
if (isset($data['size'])) {
$extras .= ' size="' . $data['size'] . '"';
}
if(isset($data['autocomplete'])) {
$extras .= ' autocomplete="'.$data['autocomplete'].'"';
if (isset($data['autocomplete'])) {
$extras .= ' autocomplete="' . $data['autocomplete'] . '"';
}
// add support to save reloaded forms
@@ -163,10 +165,9 @@ class htmlform
$value = '';
}
$ulfield = ($unlimited == true ? '&nbsp;'.$data['ul_field'] : '');
if(isset($data['display']) && $data['display'] != '')
{
$ulfield = '<strong>'.$data['display'].'</strong>';
$ulfield = ($unlimited == true ? '&nbsp;' . $data['ul_field'] : '');
if (isset($data['display']) && $data['display'] != '') {
$ulfield = '<strong>' . $data['display'] . '</strong>';
}
eval("\$return = \"" . getTemplate("misc/form/input_text", "1") . "\";");
@@ -177,11 +178,11 @@ class htmlform
{
$return = '';
$extras = '';
if(isset($data['cols'])) {
$extras .= ' cols="'.$data['cols'].'"';
if (isset($data['cols'])) {
$extras .= ' cols="' . $data['cols'] . '"';
}
if(isset($data['rows'])) {
$extras .= ' rows="'.$data['rows'].'"';
if (isset($data['rows'])) {
$extras .= ' rows="' . $data['rows'] . '"';
}
// add support to save reloaded forms
@@ -220,12 +221,10 @@ class htmlform
}
return '<select
id="'.$fieldname.'"
name="'.$fieldname.'"
'.(isset($data['class']) ? ' class="'.$data['class'] .'" ' : '').'
>'
.$select_var.
'</select>';
id="' . $fieldname . '"
name="' . $fieldname . '"
' . (isset($data['class']) ? ' class="' . $data['class'] . '" ' : '') . '
>' . $select_var . '</select>';
}
/**
@@ -233,32 +232,36 @@ class htmlform
*
* <code>
* $data = array(
* 'label' => $lng['customer']['email_imap'],
* 'type' => 'checkbox',
* 'values' => array(
* array( 'label' => 'active',
* 'value' => '1'
* )
* ),
* 'value' => array('1'),
* 'mandatory' => true
* )
* 'label' => $lng['customer']['email_imap'],
* 'type' => 'checkbox',
* 'values' => array(
* array( 'label' => 'active',
* 'value' => '1'
* )
* ),
* 'value' => array('1'),
* 'mandatory' => true
* )
* </code>
*
* @param string $fieldname contains the fieldname
* @param array $data contains the data array
* @param string $fieldname
* contains the fieldname
* @param array $data
* contains the data array
*/
public static function _checkbox($fieldname = '', $data = array()) {
public static function _checkbox($fieldname = '', $data = array())
{
// $data['value'] contains checked items
$checked = array();
if (isset($data['value'])) {
$checked = $data['value'];
}
if (isset($_SESSION['requestData'])) {
if(isset($_SESSION['requestData'][$fieldname])) {
$checked = array($_SESSION['requestData'][$fieldname]);
if (isset($_SESSION['requestData'][$fieldname])) {
$checked = array(
$_SESSION['requestData'][$fieldname]
);
}
}
@@ -271,12 +274,12 @@ class htmlform
// will contain the output
$output = "";
foreach($data['values'] as $val) {
foreach ($data['values'] as $val) {
$key = $val['label'];
// is this box checked?
$isChecked = '';
if (is_array($checked) && count($checked) > 0) {
foreach($checked as $tmp) {
foreach ($checked as $tmp) {
if ($tmp == $val['value']) {
$isChecked = ' checked="checked" ';
break;
@@ -285,10 +288,10 @@ class htmlform
}
$output .= '<label>';
if (empty($isArray)) {
$output .= '<input type="hidden" name="'.$fieldname.'" value="0" />';
$output .= '<input type="hidden" name="' . $fieldname . '" value="0" />';
}
$output .= '<input type="checkbox" name="'.$fieldname.$isArray.'" value="'.$val['value'].'" '.$isChecked.'/>';
$output .= $key.'</label>';
$output .= '<input type="checkbox" name="' . $fieldname . $isArray . '" value="' . $val['value'] . '" ' . $isChecked . '/>';
$output .= $key . '</label>';
}
return $output;
@@ -298,8 +301,8 @@ class htmlform
{
$return = '';
$extras = '';
if(isset($data['maxlength'])) {
$extras .= ' maxlength="'.$data['maxlength'].'"';
if (isset($data['maxlength'])) {
$extras .= ' maxlength="' . $data['maxlength'] . '"';
}
// add support to save reloaded forms
@@ -311,9 +314,8 @@ class htmlform
$value = '';
}
if(isset($data['display']) && $data['display'] != '')
{
$ulfield = '<strong>'.$data['display'].'</strong>';
if (isset($data['display']) && $data['display'] != '') {
$ulfield = '<strong>' . $data['display'] . '</strong>';
}
eval("\$return = \"" . getTemplate("misc/form/input_file", "1") . "\";");
@@ -324,11 +326,11 @@ class htmlform
{
$return = '';
$extras = '';
if(isset($data['int_min'])) {
$extras .= ' min="'.$data['int_min'].'"';
if (isset($data['int_min'])) {
$extras .= ' min="' . $data['int_min'] . '"';
}
if(isset($data['int_max'])) {
$extras .= ' max="'.$data['int_max'].'"';
if (isset($data['int_max'])) {
$extras .= ' max="' . $data['int_max'] . '"';
}
// add support to save reloaded forms

View File

@@ -15,19 +15,25 @@
* @package Panel
*
*/
class linker {
class linker
{
private $protocol = '';
private $username = '';
private $password = '';
private $hostname = '';
private $port = 80;
private $filename = 'index.php';
private $args = array();
public function __construct($file = 'index.php', $sessionid = '', $hostname = '', $protocol = '', $port = '', $username = '', $password = '') {
public function __construct($file = 'index.php', $sessionid = '', $hostname = '', $protocol = '', $port = '', $username = '', $password = '')
{
// Set the basic parts of our URL
$this->protocol = $protocol;
$this->username = $username;
@@ -39,40 +45,59 @@ class linker {
$this->args['s'] = $sessionid;
}
public function __set($key, $value) {
public function __set($key, $value)
{
switch (strtolower($key)) {
case 'protocol': $this->protocol = $value; break;
case 'username': $this->username = $value; break;
case 'password': $this->password = $value; break;
case 'hostname': $this->hostname = $value; break;
case 'port': $this->port = $value; break;
case 'filename': $this->filename = $value; break;
default: return false;
case 'protocol':
$this->protocol = $value;
break;
case 'username':
$this->username = $value;
break;
case 'password':
$this->password = $value;
break;
case 'hostname':
$this->hostname = $value;
break;
case 'port':
$this->port = $value;
break;
case 'filename':
$this->filename = $value;
break;
default:
return false;
}
return true;
}
public function add($key, $value) {
public function add($key, $value)
{
// Add a new value to our parameters (overwrite = enabled)
$this->args[$key] = $value;
}
public function del($key) {
public function del($key)
{
// If the key exists in our array -> delete it
if (isset($this->args[$key])) {
unset($this->args[$key]);
}
}
public function delAll() {
public function delAll()
{
// Just resetting the array
// Until the sessionid can be removed: save it
// @TODO: Remove this
$this->args = array('s' => $this->args['s']);
$this->args = array(
's' => $this->args['s']
);
}
public function getLink() {
public function getLink()
{
$link = '';
// Build the basic URL
@@ -132,7 +157,7 @@ class linker {
// Loop through arguments and add them to the link
foreach ($this->args as $key => $value) {
// For all but the first argument, prepend "&amp;"
if (substr($link, -1) != "?") {
if (substr($link, - 1) != "?") {
$link .= "&";
}

View File

@@ -19,91 +19,113 @@
/**
* Class to manage paging system
*
* @package Functions
*/
class paging {
class paging
{
/**
* Userinfo
*
* @var array
*/
private $userinfo = array();
/**
* MySQL-Table
*
* @var string
*/
private $table = '';
/**
* Fields with description which should be selectable
*
* @var array
*/
private $fields = array();
/**
* Entries per page
*
* @var int
*/
private $entriesperpage = 0;
/**
* Number of entries of table
*
* @var int
*/
private $entries = 0;
/**
* Sortorder, asc or desc
*
* @var string
*/
public $sortorder = 'asc';
/**
* Sortfield
*
* @var string
*/
public $sortfield = '';
/**
* Searchfield
*
* @var string
*/
private $searchfield = '';
/**
* Searchtext
*
* @var string
*/
private $searchtext = '';
/**
* Pagenumber
*
* @var int
*/
private $pageno = 0;
/**
* Switch natsorting on/off
*
* @var bool
*/
private $natSorting = false;
private $_limit = 0;
/**
* Class constructor. Loads settings from request or from userdata and saves them to session.
*
* @param array userinfo
* @param string Name of Table
* @param array Fields, in format array( 'fieldname_in_mysql' => 'field_caption' )
* @param int *deprecated* entries per page
* @param bool *deprecated* Switch natsorting on/off (global, affects all calls of sort)
* @param int $default_field default sorting-field-index
* @param string $default_order default sorting order 'asc' or 'desc'
* Class constructor.
* Loads settings from request or from userdata and saves them to session.
*
* @param
* array userinfo
* @param
* string Name of Table
* @param
* array Fields, in format array( 'fieldname_in_mysql' => 'field_caption' )
* @param
* int *deprecated* entries per page
* @param
* bool *deprecated* Switch natsorting on/off (global, affects all calls of sort)
* @param int $default_field
* default sorting-field-index
* @param string $default_order
* default sorting order 'asc' or 'desc'
*
*/
public function __construct($userinfo, $table, $fields, $entriesperpage = 0, $natSorting = false, $default_field = 0, $default_order = 'asc', $limit = 0) {
public function __construct($userinfo, $table, $fields, $entriesperpage = 0, $natSorting = false, $default_field = 0, $default_order = 'asc', $limit = 0)
{
// entries per page and natsorting-flag are not
// passed as parameter anymore, because these are
@@ -113,7 +135,7 @@ class paging {
$this->userinfo = $userinfo;
if (!is_array($this->userinfo['lastpaging'])) {
if (! is_array($this->userinfo['lastpaging'])) {
$this->userinfo['lastpaging'] = json_decode($this->userinfo['lastpaging'], true);
}
@@ -124,21 +146,12 @@ class paging {
$checklastpaging = (isset($this->userinfo['lastpaging']['table']) && $this->userinfo['lastpaging']['table'] == $this->table);
$this->userinfo['lastpaging']['table'] = $this->table;
if (isset($_REQUEST['sortorder'])
&& (strtolower($_REQUEST['sortorder']) == 'desc'
|| strtolower($_REQUEST['sortorder']) == 'asc')
) {
if (isset($_REQUEST['sortorder']) && (strtolower($_REQUEST['sortorder']) == 'desc' || strtolower($_REQUEST['sortorder']) == 'asc')) {
$this->sortorder = strtolower($_REQUEST['sortorder']);
} else {
if ($checklastpaging
&& isset($this->userinfo['lastpaging']['sortorder'])
&& (strtolower($this->userinfo['lastpaging']['sortorder']) == 'desc'
|| strtolower($this->userinfo['lastpaging']['sortorder']) == 'asc')
) {
if ($checklastpaging && isset($this->userinfo['lastpaging']['sortorder']) && (strtolower($this->userinfo['lastpaging']['sortorder']) == 'desc' || strtolower($this->userinfo['lastpaging']['sortorder']) == 'asc')) {
$this->sortorder = strtolower($this->userinfo['lastpaging']['sortorder']);
} else {
$this->sortorder = $default_order;
}
@@ -146,15 +159,10 @@ class paging {
$this->userinfo['lastpaging']['sortorder'] = $this->sortorder;
if (isset($_REQUEST['sortfield'])
&& isset($fields[$_REQUEST['sortfield']])
) {
if (isset($_REQUEST['sortfield']) && isset($fields[$_REQUEST['sortfield']])) {
$this->sortfield = $_REQUEST['sortfield'];
} else {
if ($checklastpaging
&& isset($this->userinfo['lastpaging']['sortfield'])
&& isset($fields[$this->userinfo['lastpaging']['sortfield']])
) {
if ($checklastpaging && isset($this->userinfo['lastpaging']['sortfield']) && isset($fields[$this->userinfo['lastpaging']['sortfield']])) {
$this->sortfield = $this->userinfo['lastpaging']['sortfield'];
} else {
$fieldnames = array_keys($fields);
@@ -164,15 +172,10 @@ class paging {
$this->userinfo['lastpaging']['sortfield'] = $this->sortfield;
if (isset($_REQUEST['searchfield'])
&& isset($fields[$_REQUEST['searchfield']])
) {
if (isset($_REQUEST['searchfield']) && isset($fields[$_REQUEST['searchfield']])) {
$this->searchfield = $_REQUEST['searchfield'];
} else {
if ($checklastpaging
&& isset($this->userinfo['lastpaging']['searchfield'])
&& isset($fields[$this->userinfo['lastpaging']['searchfield']])
) {
if ($checklastpaging && isset($this->userinfo['lastpaging']['searchfield']) && isset($fields[$this->userinfo['lastpaging']['searchfield']])) {
$this->searchfield = $this->userinfo['lastpaging']['searchfield'];
} else {
$fieldnames = array_keys($fields);
@@ -182,16 +185,10 @@ class paging {
$this->userinfo['lastpaging']['searchfield'] = $this->searchfield;
if (isset($_REQUEST['searchtext'])
&& (preg_match('/[-_@\p{L}\p{N}*.]+$/u', $_REQUEST['searchtext'])
|| $_REQUEST['searchtext'] === '')
) {
if (isset($_REQUEST['searchtext']) && (preg_match('/[-_@\p{L}\p{N}*.]+$/u', $_REQUEST['searchtext']) || $_REQUEST['searchtext'] === '')) {
$this->searchtext = trim($_REQUEST['searchtext']);
} else {
if ($checklastpaging
&& isset($this->userinfo['lastpaging']['searchtext'])
&& preg_match('/[-_@\p{L}\p{N}*.]+$/u', $this->userinfo['lastpaging']['searchtext'])
) {
if ($checklastpaging && isset($this->userinfo['lastpaging']['searchtext']) && preg_match('/[-_@\p{L}\p{N}*.]+$/u', $this->userinfo['lastpaging']['searchtext'])) {
$this->searchtext = $this->userinfo['lastpaging']['searchtext'];
} else {
$this->searchtext = '';
@@ -200,15 +197,10 @@ class paging {
$this->userinfo['lastpaging']['searchtext'] = $this->searchtext;
if (isset($_REQUEST['pageno'])
&& intval($_REQUEST['pageno']) != 0
) {
if (isset($_REQUEST['pageno']) && intval($_REQUEST['pageno']) != 0) {
$this->pageno = intval($_REQUEST['pageno']);
} else {
if ($checklastpaging
&& isset($this->userinfo['lastpaging']['pageno'])
&& intval($this->userinfo['lastpaging']['pageno']) != 0
) {
if ($checklastpaging && isset($this->userinfo['lastpaging']['pageno']) && intval($this->userinfo['lastpaging']['pageno']) != 0) {
$this->pageno = intval($this->userinfo['lastpaging']['pageno']);
} else {
$this->pageno = 1;
@@ -232,17 +224,18 @@ class paging {
'adminsession' => $userinfo['adminsession']
);
\Froxlor\Database\Database::pexecute($upd_stmt, $upd_data);
$this->_limit = $limit;
}
/**
* Sets number of entries and adjusts pageno if the number of entries doesn't correspond to the pageno.
*
* @param int entries
* @param
* int entries
*/
public function setEntries($entries) {
public function setEntries($entries)
{
$this->entries = $entries;
if (($this->pageno - 1) * $this->entriesperpage > $this->entries) {
@@ -255,10 +248,12 @@ class paging {
/**
* Checks if a row should be displayed or not, used in loops
*
* @param int number of row
* @param
* int number of row
* @return bool to display or not to display, that's the question
*/
public function checkDisplay($count) {
public function checkDisplay($count)
{
$begin = (intval($this->pageno) - 1) * intval($this->entriesperpage);
$end = (intval($this->pageno) * intval($this->entriesperpage));
return (($count >= $begin && $count < $end) || $this->entriesperpage == 0);
@@ -267,10 +262,12 @@ class paging {
/**
* Returns condition code for sql query
*
* @param bool should returned condition code start with WHERE (false) or AND (true)?
* @param
* bool should returned condition code start with WHERE (false) or AND (true)?
* @return string the condition code
*/
public function getSqlWhere($append = false) {
public function getSqlWhere($append = false)
{
if ($this->searchtext != '') {
if ($append == true) {
$condition = ' AND ';
@@ -280,8 +277,8 @@ class paging {
$searchfield = explode('.', $this->searchfield);
foreach ($searchfield as $id => $field) {
if (substr($field, -1, 1) != '`') {
$field.= '`';
if (substr($field, - 1, 1) != '`') {
$field .= '`';
}
if ($field{0} != '`') {
@@ -292,9 +289,13 @@ class paging {
}
$searchfield = implode('.', $searchfield);
$ops = array('<', '>', '=');
$ops = array(
'<',
'>',
'='
);
// check if we use an operator or not
$useOper = 0;
$oper = "=";
@@ -302,32 +303,32 @@ class paging {
$useOper = 1;
$oper = substr($this->searchtext, 0, 1);
}
// check for diskspace and whether searchtext is a number
// in any other case the logical-operators would make no sense
if (strpos($searchfield, 'diskspace') > 0 && is_numeric(substr($this->searchtext, $useOper))) {
// anything with diskspace is *1024
$searchtext = ((int)substr($this->searchtext, $useOper))*1024;
$searchtext = ((int) substr($this->searchtext, $useOper)) * 1024;
$useOper = 1;
} elseif (strpos($searchfield, 'traffic') > 0 && is_numeric(substr($this->searchtext, $useOper))) {
// anything with traffic is *1024*1024
$searchtext = ((int)substr($this->searchtext, $useOper))*1024*1024;
$searchtext = ((int) substr($this->searchtext, $useOper)) * 1024 * 1024;
$useOper = 1;
} else {
// any other field
$searchtext = substr($this->searchtext, $useOper);
}
if ($useOper == 1 && is_numeric(substr($this->searchtext, $useOper))) {
// now as we use >, < or = we use the given operator and not LIKE
$condition.= $searchfield . " ".$oper." " . \Froxlor\Database\Database::quote($searchtext);
$condition .= $searchfield . " " . $oper . " " . \Froxlor\Database\Database::quote($searchtext);
} else {
$searchtext = str_replace('*', '%', $this->searchtext);
// append wildcards if user did not enter any
if (strpos($searchtext,'%') === false) $searchtext='%'.$searchtext.'%';
$condition.= $searchfield . " LIKE " . \Froxlor\Database\Database::quote($searchtext);
if (strpos($searchtext, '%') === false)
$searchtext = '%' . $searchtext . '%';
$condition .= $searchfield . " LIKE " . \Froxlor\Database\Database::quote($searchtext);
}
} else {
$condition = '';
}
@@ -338,15 +339,16 @@ class paging {
/**
* Returns "order by"-code for sql query
*
* @param bool Switch natsorting on/off (local, affects just this call)
* @param
* bool Switch natsorting on/off (local, affects just this call)
* @return string the "order by"-code
*/
public function getSqlOrderBy($natSorting = null) {
public function getSqlOrderBy($natSorting = null)
{
$sortfield = explode('.', $this->sortfield);
foreach ($sortfield as $id => $field) {
if (substr($field, -1, 1) != '`') {
$field.= '`';
if (substr($field, - 1, 1) != '`') {
$field .= '`';
}
if ($field{0} != '`') {
@@ -359,9 +361,7 @@ class paging {
$sortfield = implode('.', $sortfield);
$sortorder = strtoupper($this->sortorder);
if ($natSorting == true
|| ($natSorting === null && $this->natSorting == true)
) {
if ($natSorting == true || ($natSorting === null && $this->natSorting == true)) {
// Acts similar to php's natsort(), found in one comment at http://my.opera.com/cpr/blog/show.dml/160556
$sortcode = "ORDER BY CONCAT( IF( ASCII( LEFT( " . $sortfield . ", 5 ) ) > 57,
LEFT( " . $sortfield . ", 1 ), 0 ),
@@ -381,11 +381,11 @@ class paging {
*
* @return string always empty
*/
public function getSqlLimit() {
public function getSqlLimit()
{
if ($this->_limit > 0) {
$_offset = ($this->pageno - 1) * $this->_limit;
return ' LIMIT '.$_offset.','.$this->_limit;
return ' LIMIT ' . $_offset . ',' . $this->_limit;
}
/**
* currently not in use
@@ -396,22 +396,26 @@ class paging {
/**
* Returns html code for sorting field
*
* @param array Language array
* @param
* array Language array
* @return string the html sortcode
*/
public function getHtmlSortCode($lng, $break = false) {
public function getHtmlSortCode($lng, $break = false)
{
$sortcode = '';
$fieldoptions = '';
$orderoptions = '';
foreach ($this->fields as $fieldname => $fieldcaption) {
$fieldoptions.= makeoption($fieldcaption, $fieldname, $this->sortfield, true, true);
$fieldoptions .= makeoption($fieldcaption, $fieldname, $this->sortfield, true, true);
}
$breakorws = ($break ? '<br />' : '&nbsp;');
foreach (array('asc' => $lng['panel']['ascending'], 'desc' => $lng['panel']['descending']) as $sortordertype => $sortorderdescription) {
$orderoptions.= makeoption($sortorderdescription, $sortordertype, $this->sortorder, true, true);
foreach (array(
'asc' => $lng['panel']['ascending'],
'desc' => $lng['panel']['descending']
) as $sortordertype => $sortorderdescription) {
$orderoptions .= makeoption($sortorderdescription, $sortordertype, $this->sortorder, true, true);
}
eval("\$sortcode =\"" . getTemplate("misc/htmlsortcode", '1') . "\";");
@@ -421,17 +425,17 @@ class paging {
/**
* Returns html code for sorting arrows
*
* @param string URL to use as base for links
* @param string If set, only this field will be returned
* @param
* string URL to use as base for links
* @param
* string If set, only this field will be returned
* @return mixed An array or a string (if field is set) of html code of arrows
*/
public function getHtmlArrowCode($baseurl, $field = '') {
public function getHtmlArrowCode($baseurl, $field = '')
{
global $theme;
if ($field != ''
&& isset($this->fields[$field])
) {
if ($field != '' && isset($this->fields[$field])) {
$baseurl = htmlspecialchars($baseurl);
$fieldname = htmlspecialchars($field);
eval("\$arrowcode =\"" . getTemplate("misc/htmlarrowcode", '1') . "\";");
@@ -450,16 +454,17 @@ class paging {
/**
* Returns html code for searching field
*
* @param array Language array
* @param
* array Language array
* @return string the html searchcode
*/
public function getHtmlSearchCode($lng) {
public function getHtmlSearchCode($lng)
{
$searchcode = '';
$fieldoptions = '';
$searchtext = htmlspecialchars($this->searchtext);
foreach ($this->fields as $fieldname => $fieldcaption) {
$fieldoptions.= makeoption($fieldcaption, $fieldname, $this->searchfield, true, true);
$fieldoptions .= makeoption($fieldcaption, $fieldname, $this->searchfield, true, true);
}
eval("\$searchcode =\"" . getTemplate("misc/htmlsearchcode", '1') . "\";");
return $searchcode;
@@ -468,10 +473,12 @@ class paging {
/**
* Returns html code for paging
*
* @param string URL to use as base for links
* @param
* string URL to use as base for links
* @return string the html pagingcode
*/
public function getHtmlPagingCode($baseurl) {
public function getHtmlPagingCode($baseurl)
{
if ($this->entriesperpage == 0) {
return '';
} else {
@@ -479,7 +486,7 @@ class paging {
}
if ($this->entries % $this->entriesperpage != 0) {
$pages++;
$pages ++;
}
if ($pages > 1) {
@@ -495,14 +502,14 @@ class paging {
}
$pagingcode = '<a href="' . htmlspecialchars($baseurl) . '&amp;pageno=1">&laquo;</a> <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) - 1) == 0 ? '1' : intval($this->pageno) - 1) . '">&lt;</a>&nbsp;';
for ($i = $start;$i <= $stop;$i++) {
for ($i = $start; $i <= $stop; $i ++) {
if ($i != $this->pageno) {
$pagingcode.= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . $i . '">' . $i . '</a>&nbsp;';
$pagingcode .= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . $i . '">' . $i . '</a>&nbsp;';
} else {
$pagingcode.= ' <strong>' . $i . '</strong>&nbsp;';
$pagingcode .= ' <strong>' . $i . '</strong>&nbsp;';
}
}
$pagingcode.= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) + 1) > $pages ? $pages : intval($this->pageno) + 1) . '">&gt;</a> <a href="' . $baseurl . '&amp;pageno=' . $pages . '">&raquo;</a>';
$pagingcode .= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) + 1) > $pages ? $pages : intval($this->pageno) + 1) . '">&gt;</a> <a href="' . $baseurl . '&amp;pageno=' . $pages . '">&raquo;</a>';
} else {
$pagingcode = '';
}

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<froxlor>
<distribution name="Gentoo" version="2.2" defaulteditor="/usr/bin/nano">
<distribution name="Gentoo" version="2.2"
defaulteditor="/usr/bin/nano">
<services>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -915,8 +916,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -931,7 +932,8 @@ gmysql-password=
</file>
<command><![CDATA[/etc/init.d/pdns restart]]></command>
</daemon>
<daemon name="powerdns_bind" title="PowerDNS via bind-backend">
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[emerge net-dns/pdns]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[
@@ -1458,8 +1460,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
#local-ipv6=YOUR_IPv6_(if_any)
bind-config=<BIND_CONFIG_PATH>named.conf
@@ -1495,8 +1497,8 @@ bind-check-interval=180
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1540,8 +1542,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1552,8 +1554,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1602,8 +1604,8 @@ root: root@<SERVERNAME>
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
# Postfix programs paths settings
command_directory = /usr/sbin
@@ -1727,8 +1729,8 @@ debugger_command =
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true" mode="append">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true" mode="append">
<content><![CDATA[
# Add this lines to be able to use dovecot as delivery agent
# Dovecot LDA
@@ -1750,8 +1752,8 @@ dovecot unix - n n - - pipe
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
# Postfix programs paths settings
command_directory = /usr/sbin
@@ -1880,8 +1882,8 @@ debugger_command =
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true" mode="append">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true" mode="append">
<content><![CDATA[
# Add this lines to be able to use dovecot as delivery agent
# Dovecot LDA
@@ -1903,8 +1905,8 @@ dovecot unix - n n - - pipe
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
# Postfix programs paths settings
command_directory = /usr/sbin
@@ -2000,7 +2002,8 @@ debugger_command =
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/sasl2/smtpd.conf" chown="root:root" chmod="0600">
<file name="/etc/sasl2/smtpd.conf" chown="root:root"
chmod="0600">
<content><![CDATA[
pwcheck_method: auxprop
auxprop_plugin: sql
@@ -2024,7 +2027,8 @@ sql_select: SELECT password_enc FROM mail_users WHERE username='%u@%r' OR email=
<!-- IMAP/POP3 services -->
<service type="mail" title="{{lng.admin.configfiles.mail}}">
<!-- Dovecot -->
<daemon name="dovecot" version="2" title="Dovecot" default="true">
<daemon name="dovecot" version="2" title="Dovecot"
default="true">
<command><![CDATA[echo "net-mail/dovecot mysql managesieve sieve" >> /etc/portage/package.use]]></command>
<install><![CDATA[emerge net-mail/dovecot]]></install>
<file name="/etc/dovecot/dovecot.conf" chown="root:root"
@@ -2132,8 +2136,8 @@ protocol lda {
]]>
</content>
</file>
<file name="/etc/dovecot/dovecot-sql.conf.ext" chown="root:root"
chmod="0600" backup="true">
<file name="/etc/dovecot/dovecot-sql.conf.ext"
chown="root:root" chmod="0600" backup="true">
<content><![CDATA[
driver = mysql
connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD>
@@ -2144,8 +2148,8 @@ iterate_query = "SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:root"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/20-managesieve.conf"
chown="root:root" chmod="0644" backup="true">
<content><![CDATA[
##
## ManageSieve specific settings
@@ -2226,8 +2230,8 @@ protocol sieve {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/90-sieve.conf" chown="root:root"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/90-sieve.conf"
chown="root:root" chmod="0644" backup="true">
<content><![CDATA[
##
## Settings for the Sieve interpreter
@@ -2496,8 +2500,8 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3)
]]>
</content>
</file>
<file name="/etc/courier-imap/pop3d" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier-imap/pop3d" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
##VERSION: $Id: pop3d.dist.in,v 1.11 2004/10/30 15:39:38 mrsam Exp $
#
@@ -2629,8 +2633,8 @@ PRERUN=
]]>
</content>
</file>
<file name="/etc/courier-imap/imapd" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier-imap/imapd" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
##VERSION: $Id: imapd.dist.in,v 1.32 2004/11/25 04:57:04 mrsam Exp $
#
@@ -3011,8 +3015,8 @@ PRERUN=
]]>
</content>
</file>
<file name="/etc/courier-imap/pop3d-ssl" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier-imap/pop3d-ssl" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
##VERSION: $Id: pop3d-ssl.dist.in,v 1.12 2004/10/21 00:45:35 mrsam Exp $
#
@@ -3203,8 +3207,8 @@ MAILDIRPATH=.maildir
]]>
</content>
</file>
<file name="/etc/courier-imap/imapd-ssl" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier-imap/imapd-ssl" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
##VERSION: $Id: imapd-ssl.dist.in,v 1.11 2004/10/21 00:45:35 mrsam Exp $
#
@@ -3422,7 +3426,8 @@ MAILDIRPATH=.maildir
<daemon name="proftpd" title="ProFTPd" default="true">
<command><![CDATA[echo "net-ftp/proftpd mysql" >> /etc/portage/package.use]]></command>
<install><![CDATA[emerge net-ftp/proftpd]]></install>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700">
<file name="/etc/proftpd/create-cert.sh" chown="root:0"
chmod="0700">
<content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
@@ -3434,8 +3439,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
# Server settings
ServerName "<SERVERNAME> FTP Server"
@@ -3582,8 +3587,8 @@ MISC_OTHER="-A -x -j -Z"
]]>
</content>
</file>
<file name="/etc/pureftpd-mysql.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/pureftpd-mysql.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
MYSQLServer <SQL_HOST>
#MYSQLPort 3306
@@ -3607,8 +3612,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cu
<daemon name="vsftpd" title="vsftpd">
<command><![CDATA[echo "net-ftp/vsftpd pam" >> /etc/portage/package.use]]></command>
<install><![CDATA[emerge net-ftp/vsftpd sys-auth/pam_mysql]]></install>
<file name="/etc/vsftpd/vsftpd.conf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/vsftpd/vsftpd.conf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
listen=YES
#listen_ipv6=YES
@@ -3680,7 +3685,8 @@ account required pam_mysql.so user=<SQL_UNPRIVILEGED_USER> passwd=<SQL_UN
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true">
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[
#
@@ -3699,17 +3705,19 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[emerge www-misc/awstats]]></install>
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon>
<!-- libnss-mysql -->
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<daemon name="libnss"
title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[emerge sys-auth/libnss-mysql]]></install>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
backup="true">
<file name="/etc/libnss-mysql.cfg" chown="root:root"
chmod="0600" backup="true">
<content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \
@@ -3804,7 +3812,8 @@ aliases: files
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<install><![CDATA[emerge app-admin/logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644">
<file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[
#
# Froxlor logrotate snipet
@@ -3858,12 +3867,13 @@ aliases: files
<content><![CDATA[# remove "-D PHP5" from /etc/conf.d/apache2]]></content>
</command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- PHP-FPM -->
<daemon name="php-fpm" title="PHP-FPM (alternative to mod_php)">
<daemon name="php-fpm"
title="PHP-FPM (alternative to mod_php)">
<command><![CDATA[echo "dev-lang/php fpm" >> /etc/portage/package.use]]></command>
<install><![CDATA[emerge dev-lang/php sys-auth/libnss-mysql]]></install>
<commands index="1">
@@ -3896,7 +3906,7 @@ aliases: files
</visibility>
<command><![CDATA[# remove "-D PHP5" from /etc/conf.d/apache2]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<froxlor>
<distribution name="Debian" codename="Jessie" version="8.x" defaulteditor="/usr/bin/nano">
<distribution name="Debian" codename="Jessie"
version="8.x" defaulteditor="/usr/bin/nano">
<services>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -43,7 +44,8 @@
</commands>
</general>
<!-- HTTP Apache -->
<daemon name="apache" version="2.4" title="Apache 2.4" default="true">
<daemon name="apache" version="2.4" title="Apache 2.4"
default="true">
<install><![CDATA[apt-get install apache2]]></install>
<include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command>
@@ -904,8 +906,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -920,7 +922,8 @@ gmysql-password=
</file>
<command><![CDATA[/etc/init.d/pdns restart]]></command>
</daemon>
<daemon name="powerdns_bind" title="PowerDNS via bind-backend">
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[
@@ -1447,8 +1450,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# Bind backend configuration
@@ -1494,8 +1497,8 @@ bind-check-interval=180
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1539,8 +1542,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1551,8 +1554,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1599,8 +1602,8 @@ root: root@<SERVERNAME>
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
# Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter
@@ -2325,8 +2328,8 @@ virtual_mailbox_limit = 0
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
#
# Postfix master process configuration file. For details on the format
@@ -2577,8 +2580,8 @@ dict {
]]>
</content>
</file>
<file name="/etc/dovecot/dovecot-sql.conf.ext" chown="root:root"
chmod="0600" backup="true">
<file name="/etc/dovecot/dovecot-sql.conf.ext"
chown="root:root" chmod="0600" backup="true">
<content><![CDATA[
# This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-sql.conf.ext
@@ -3237,8 +3240,8 @@ mail_access_groups = vmail
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/10-master.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/10-master.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
#default_process_limit = 100
#default_client_limit = 1000
@@ -3492,8 +3495,8 @@ protocol imap {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/20-managesieve.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
##
## ManageSieve specific settings
@@ -3795,8 +3798,8 @@ plugin {
</commands>
</general>
<!-- Dovecot with postfix -->
<daemon name="dovecot_postfix" version="2" title="Dovecot with postfix"
default="true">
<daemon name="dovecot_postfix" version="2"
title="Dovecot with postfix" default="true">
<include>//service[@type='mail']/general/installs[@index=1]
</include>
<include>//service[@type='mail']/general/files[@index=1]
@@ -3805,7 +3808,8 @@ plugin {
</include>
</daemon>
<!-- Dovecot with exim4 -->
<daemon name="dovecot_exim4" version="2" title="Dovecot with exim4">
<daemon name="dovecot_exim4" version="2"
title="Dovecot with exim4">
<include>//service[@type='mail']/general/installs[@index=1]
</include>
<include>//service[@type='mail']/general/files[@index=1]
@@ -3819,7 +3823,8 @@ plugin {
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700">
<file name="/etc/proftpd/create-cert.sh" chown="root:0"
chmod="0700">
<content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
@@ -3831,8 +3836,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -4026,8 +4031,8 @@ Include /etc/proftpd/conf.d/
]]>
</content>
</file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644"
backup="true">
<file name="/etc/proftpd/modules.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
#
# This file is used to manage DSO modules and features.
@@ -4194,7 +4199,8 @@ SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4},%{5}, %{6}
]]>
</content>
</file>
<file name="/etc/proftpd/tls.conf" chown="root:root" chmod="0644" backup="true">
<file name="/etc/proftpd/tls.conf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
<IfModule mod_tls.c>
TLSEngine on
@@ -4226,14 +4232,15 @@ TLSVerifyClient off
<!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd">
<install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install>
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0" chmod="0644">
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0"
chmod="0644">
<content><![CDATA[
1000
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chown="root:0" chmod="0644">
<content><![CDATA[
/etc/pure-ftpd/db/mysql.conf
]]>
@@ -4260,8 +4267,8 @@ yes
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/PAMAuthentication"
chown="root:0" chmod="0644">
<content><![CDATA[
no
]]>
@@ -4407,7 +4414,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0" chmod="0644">
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0"
chmod="0644">
<content><![CDATA[
21
]]>
@@ -4451,7 +4459,8 @@ UPLOADGID=
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true">
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[
#
@@ -4470,7 +4479,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
@@ -4479,14 +4489,15 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon>
<!-- libnss-mysql -->
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<daemon name="libnss"
title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install nscd
wget http://debian.froxlor.org/pool/main/libn/libnss-mysql-bg/libnss-mysql-bg_1.5-3+frx1_amd64.deb
dpkg -i libnss-mysql-bg_1.5-3+frx1_amd64.deb
rm libnss-mysql-bg_1.5-3+frx1_amd64.deb
]]></install>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
backup="true">
<file name="/etc/libnss-mysql.cfg" chown="root:root"
chmod="0600" backup="true">
<content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \
@@ -4584,7 +4595,8 @@ aliases: files
<visibility mode="notisdir">/etc/insserv/overrides</visibility>
<content><![CDATA[mkdir -p /etc/insserv/overrides]]></content>
</command>
<file name="/etc/insserv/overrides/apache2" chown="root:root" chmod="0644">
<file name="/etc/insserv/overrides/apache2" chown="root:root"
chmod="0644">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}</visibility>
<content><![CDATA[
#!/bin/sh
@@ -4599,7 +4611,8 @@ aliases: files
]]>
</content>
</file>
<file name="/etc/insserv/overrides/lighttpd" chown="root:root" chmod="0644">
<file name="/etc/insserv/overrides/lighttpd" chown="root:root"
chmod="0644">
<visibility mode="equals" value="lighttpd">{{settings.system.webserver}}</visibility>
<content><![CDATA[
#!/bin/sh
@@ -4616,7 +4629,8 @@ aliases: files
]]>
</content>
</file>
<file name="/etc/insserv/overrides/nginx" chown="root:root" chmod="0644">
<file name="/etc/insserv/overrides/nginx" chown="root:root"
chmod="0644">
<visibility mode="equals" value="nginx">{{settings.system.webserver}}</visibility>
<content><![CDATA[
#!/bin/sh
@@ -4631,7 +4645,8 @@ aliases: files
]]>
</content>
</file>
<file name="/etc/insserv/overrides/nscd" chown="root:root" chmod="0644">
<file name="/etc/insserv/overrides/nscd" chown="root:root"
chmod="0644">
<content><![CDATA[
#!/bin/sh
### BEGIN INIT INFO
@@ -4647,7 +4662,8 @@ aliases: files
</file>
</daemon>
<!-- libnss-extrausers -->
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<daemon name="libnssextrausers"
title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
<commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -4687,7 +4703,8 @@ aliases: files
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<install><![CDATA[apt-get install logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644">
<file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[
#
# Froxlor logrotate snipet
@@ -4722,12 +4739,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php5]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- PHP-FPM -->
<daemon name="php-fpm" title="PHP-FPM (alternative to mod_php)">
<daemon name="php-fpm"
title="PHP-FPM (alternative to mod_php)">
<commands index="1">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
@@ -4765,7 +4783,7 @@ aliases: files
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<froxlor>
<distribution name="Ubuntu" codename="Precise" version="12.04" defaulteditor="/usr/bin/nano" deprecated="true">
<distribution name="Ubuntu" codename="Precise"
version="12.04" defaulteditor="/usr/bin/nano" deprecated="true">
<services>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -370,8 +371,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -386,7 +387,8 @@ gmysql-password=
</file>
<command><![CDATA[/etc/init.d/pdns restart]]></command>
</daemon>
<daemon name="powerdns_bind" title="PowerDNS via bind-backend">
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[
@@ -410,8 +412,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any speficied: <AXFRSERVERS>
@@ -453,8 +455,8 @@ local-address=<SERVERIP>,127.0.0.1
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -498,8 +500,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -510,8 +512,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -558,8 +560,8 @@ root: root@<SERVERNAME>
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
## General Postfix configuration
# FQDN from Froxlor
@@ -654,8 +656,8 @@ debugger_command =
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true" mode="append">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true" mode="append">
<content><![CDATA[
# Add these lines to be able to use dovecot as delivery agent
# Dovecot LDA
@@ -676,8 +678,8 @@ dovecot unix - n n - - pipe
<install><![CDATA[apt-get install libsasl2-2 libsasl2-modules libsasl2-modules-sql]]></install>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
## General Postfix configuration
# should be the default domain from your provider eg. "server100.provider.tld"
@@ -791,7 +793,8 @@ sql_select: SELECT password FROM mail_users WHERE username='%u@%r' OR email='%u@
<!-- IMAP/POP3 services -->
<service type="mail" title="{{lng.admin.configfiles.mail}}">
<!-- Dovecot -->
<daemon name="dovecot" version="2" title="Dovecot" default="true">
<daemon name="dovecot" version="2" title="Dovecot"
default="true">
<install><![CDATA[apt-get install dovecot-imapd dovecot-pop3d dovecot-postfix dovecot-mysql dovecot-managesieved dovecot-sieve mail-stack-delivery]]></install>
<file name="/etc/dovecot/conf.d/01-mail-stack-delivery.conf"
chown="root:root" chmod="0644" backup="true">
@@ -882,8 +885,8 @@ service auth {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/10-auth.conf" chown="root:root"
chmod="0640" backup="true">
<file name="/etc/dovecot/conf.d/10-auth.conf"
chown="root:root" chmod="0640" backup="true">
<content><![CDATA[
##
## Authentication processes
@@ -1015,7 +1018,8 @@ auth_mechanisms = plain login
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/auth-sql.conf.ext" chown="root:0" chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/auth-sql.conf.ext"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
passdb {
driver = sql
@@ -1045,8 +1049,8 @@ iterate_query = SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3
<!-- Courier -->
<daemon name="courier" title="Courier">
<install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install>
<file name="/etc/courier/authdaemonrc" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier/authdaemonrc" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
##VERSION: $Id: authdaemonrc.in,v 1.8 2001/10/07 02:16:22 mrsam Exp $
#
@@ -1119,8 +1123,8 @@ authdaemonvar=/var/run/courier/authdaemon
]]>
</content>
</file>
<file name="/etc/courier/authmysqlrc" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier/authmysqlrc" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
MYSQL_SERVER <SQL_HOST>
MYSQL_USERNAME <SQL_UNPRIVILEGED_USER>
@@ -1148,7 +1152,8 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3)
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700">
<file name="/etc/proftpd/create-cert.sh" chown="root:0"
chmod="0700">
<content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
@@ -1160,8 +1165,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -1296,8 +1301,8 @@ Include /etc/proftpd/tls.conf
]]>
</content>
</file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644"
backup="true">
<file name="/etc/proftpd/modules.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
#
# This file is used to manage DSO modules and features.
@@ -1403,7 +1408,8 @@ SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4},%{5}, %{6}
]]>
</content>
</file>
<file name="/etc/proftpd/tls.conf" chown="root:root" chmod="0644" backup="true">
<file name="/etc/proftpd/tls.conf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
<IfModule mod_tls.c>
TLSEngine on
@@ -1435,14 +1441,15 @@ TLSVerifyClient off
<!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd">
<install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install>
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0" chmod="0644">
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0"
chmod="0644">
<content><![CDATA[
1000
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chown="root:0" chmod="0644">
<content><![CDATA[
/etc/pure-ftpd/db/mysql.conf
]]>
@@ -1469,8 +1476,8 @@ yes
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/PAMAuthentication"
chown="root:0" chmod="0644">
<content><![CDATA[
no
]]>
@@ -1500,7 +1507,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0" chmod="0644">
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0"
chmod="0644">
<content><![CDATA[
21
]]>
@@ -1523,7 +1531,8 @@ UPLOADGID=
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true">
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[
#
@@ -1542,7 +1551,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
@@ -1551,10 +1561,11 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon>
<!-- libnss-mysql -->
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<daemon name="libnss"
title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install libnss-mysql-bg nscd]]></install>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
backup="true">
<file name="/etc/libnss-mysql.cfg" chown="root:root"
chmod="0600" backup="true">
<content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \
@@ -1646,7 +1657,8 @@ aliases: files
<command><![CDATA[nscd --invalidate=group]]></command>
</daemon>
<!-- libnss-extrausers -->
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<daemon name="libnssextrausers"
title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
<commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -1686,7 +1698,8 @@ aliases: files
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<install><![CDATA[apt-get install logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644">
<file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[
#
# Froxlor logrotate snipet
@@ -1721,12 +1734,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php5]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- PHP-FPM -->
<daemon name="php-fpm" title="PHP-FPM (alternative to mod_php)">
<daemon name="php-fpm"
title="PHP-FPM (alternative to mod_php)">
<commands index="1">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
@@ -1764,7 +1778,7 @@ aliases: files
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<froxlor>
<distribution name="RHEL / CentOS" version="7" defaulteditor="/usr/bin/nano">
<distribution name="RHEL / CentOS" version="7"
defaulteditor="/usr/bin/nano">
<services>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -87,8 +88,8 @@ Alias "/.well-known/acme-challenge" "{{settings.system.letsencryptchallengepath}
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -132,8 +133,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -144,8 +145,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -164,16 +165,16 @@ query = SELECT gid FROM mail_users WHERE email = '%s'
</commands>
</general>
<!-- postfix with dovecot -->
<daemon name="postfix_dovecot" version="2.10" title="Postfix with dovecot"
default="true">
<daemon name="postfix_dovecot" version="2.10"
title="Postfix with dovecot" default="true">
<include>//service[@type='smtp']/general/commands[@index=1]
</include>
<include>//service[@type='smtp']/general/installs[@index=1]
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
## General Postfix configuration
# FQDN from Froxlor
@@ -262,8 +263,8 @@ debugger_command =
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true" mode="append">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true" mode="append">
<content><![CDATA[
# added for Froxlor
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}
@@ -277,7 +278,8 @@ dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dove
<!-- IMAP/POP3 services -->
<service type="mail" title="{{lng.admin.configfiles.mail}}">
<!-- Dovecot -->
<daemon name="dovecot" version="2.2" title="Dovecot" default="true">
<daemon name="dovecot" version="2.2" title="Dovecot"
default="true">
<install><![CDATA[yum install dovecot dovecot-mysql dovecot-pigeonhole]]></install>
<file name="/etc/dovecot/dovecot.conf" chown="root:root"
chmod="0644" backup="true">
@@ -504,8 +506,8 @@ auth_mechanisms = plain
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/10-logging.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/10-logging.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
##
## Log destination.
@@ -1215,8 +1217,8 @@ protocol lda {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/15-mailboxes.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/15-mailboxes.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
##
## Mailbox definitions
@@ -1364,8 +1366,8 @@ protocol lmtp {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/20-managesieve.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
##
## ManageSieve specific settings
@@ -1821,10 +1823,11 @@ iterate_query = SELECT username AS user FROM mail_users
<!-- FTP services -->
<service type="ftp" title="{{lng.admin.configfiles.ftp}}">
<!-- Proftpd -->
<daemon name="proftpd" version="1.3" title="ProFTPd" default="true">
<daemon name="proftpd" version="1.3" title="ProFTPd"
default="true">
<install><![CDATA[yum install proftpd proftpd-mysql]]></install>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
# This is the ProFTPD configuration file
#
@@ -2284,7 +2287,8 @@ ControlsLog /var/log/proftpd/controls.log
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true">
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[
#
@@ -2303,17 +2307,19 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon>
<!-- libnss-mysql -->
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<daemon name="libnss"
title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[yum --enablerepo=extras install epel-release]]></install>
<install><![CDATA[yum install libnss-mysql nscd]]></install>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
backup="true">
<file name="/etc/libnss-mysql.cfg" chown="root:root"
chmod="0600" backup="true">
<content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \
@@ -2413,7 +2419,8 @@ aliases: files nisplus
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<install><![CDATA[yum install logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644">
<file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[
#
# Froxlor logrotate snipet

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<froxlor>
<distribution name="Debian" codename="Stretch" version="9.x" defaulteditor="/bin/nano">
<distribution name="Debian" codename="Stretch"
version="9.x" defaulteditor="/bin/nano">
<services>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -43,7 +44,8 @@
</commands>
</general>
<!-- HTTP Apache -->
<daemon name="apache" version="2.4" title="Apache 2.4" default="true">
<daemon name="apache" version="2.4" title="Apache 2.4"
default="true">
<install><![CDATA[apt-get install apache2]]></install>
<include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command>
@@ -893,8 +895,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -909,7 +911,8 @@ gmysql-password=
</file>
<command><![CDATA[/etc/init.d/pdns restart]]></command>
</daemon>
<daemon name="powerdns_bind" title="PowerDNS via bind-backend">
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[
@@ -1436,8 +1439,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# Bind backend configuration
@@ -1483,8 +1486,8 @@ bind-check-interval=180
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1528,8 +1531,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1540,8 +1543,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1588,8 +1591,8 @@ root: root@<SERVERNAME>
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
# Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter
@@ -2334,8 +2337,8 @@ virtual_mailbox_limit = 0
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
#
# Postfix master process configuration file. For details on the format
@@ -2586,8 +2589,8 @@ dict {
]]>
</content>
</file>
<file name="/etc/dovecot/dovecot-sql.conf.ext" chown="root:root"
chmod="0600" backup="true">
<file name="/etc/dovecot/dovecot-sql.conf.ext"
chown="root:root" chmod="0600" backup="true">
<content><![CDATA[
# This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-sql.conf.ext
@@ -3246,8 +3249,8 @@ mail_access_groups = vmail
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/10-master.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/10-master.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
#default_process_limit = 100
#default_client_limit = 1000
@@ -3569,8 +3572,8 @@ protocol imap {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/20-managesieve.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
##
## ManageSieve specific settings
@@ -3872,8 +3875,8 @@ plugin {
</commands>
</general>
<!-- Dovecot with postfix -->
<daemon name="dovecot_postfix" version="2" title="Dovecot with postfix"
default="true">
<daemon name="dovecot_postfix" version="2"
title="Dovecot with postfix" default="true">
<include>//service[@type='mail']/general/installs[@index=1]
</include>
<include>//service[@type='mail']/general/files[@index=1]
@@ -3887,7 +3890,8 @@ plugin {
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700">
<file name="/etc/proftpd/create-cert.sh" chown="root:0"
chmod="0700">
<content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
@@ -3899,8 +3903,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -4094,8 +4098,8 @@ Include /etc/proftpd/conf.d/
]]>
</content>
</file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644"
backup="true">
<file name="/etc/proftpd/modules.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
#
# This file is used to manage DSO modules and features.
@@ -4262,7 +4266,8 @@ SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4},%{5}, %{6}
]]>
</content>
</file>
<file name="/etc/proftpd/tls.conf" chown="root:root" chmod="0644" backup="true">
<file name="/etc/proftpd/tls.conf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
<IfModule mod_tls.c>
TLSEngine on
@@ -4294,14 +4299,15 @@ TLSVerifyClient off
<!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd">
<install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install>
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0" chmod="0644">
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0"
chmod="0644">
<content><![CDATA[
1000
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chown="root:0" chmod="0644">
<content><![CDATA[
/etc/pure-ftpd/db/mysql.conf
]]>
@@ -4328,8 +4334,8 @@ yes
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/PAMAuthentication"
chown="root:0" chmod="0644">
<content><![CDATA[
no
]]>
@@ -4475,7 +4481,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0" chmod="0644">
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0"
chmod="0644">
<content><![CDATA[
21
]]>
@@ -4519,7 +4526,8 @@ UPLOADGID=
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true">
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[
#
@@ -4538,7 +4546,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
@@ -4547,7 +4556,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon>
<!-- libnss-extrausers -->
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<daemon name="libnssextrausers"
title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
<commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -4587,7 +4597,8 @@ aliases: files
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<install><![CDATA[apt-get install logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644">
<file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[
#
# Froxlor logrotate snipet
@@ -4622,12 +4633,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.0]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- PHP-FPM -->
<daemon name="php-fpm" title="PHP-FPM (alternative to mod_php)">
<daemon name="php-fpm"
title="PHP-FPM (alternative to mod_php)">
<install>
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
@@ -4659,7 +4671,7 @@ aliases: files
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<froxlor>
<distribution name="Ubuntu" codename="Trusty" version="14.04" defaulteditor="/usr/bin/nano">
<distribution name="Ubuntu" codename="Trusty"
version="14.04" defaulteditor="/usr/bin/nano">
<services>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -408,8 +409,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -424,7 +425,8 @@ gmysql-password=
</file>
<command><![CDATA[service pdns restart]]></command>
</daemon>
<daemon name="powerdns_bind" title="PowerDNS via bind-backend">
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true">
<content><![CDATA[
@@ -450,8 +452,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any speficied: <AXFRSERVERS>
@@ -493,8 +495,8 @@ local-address=<SERVERIP>,127.0.0.1
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -538,8 +540,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -550,8 +552,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -598,8 +600,8 @@ root: root@<SERVERNAME>
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
## General Postfix configuration
# FQDN from Froxlor
@@ -694,8 +696,8 @@ debugger_command =
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true" mode="append">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true" mode="append">
<content><![CDATA[
# Add these lines to be able to use dovecot as delivery agent
# Dovecot LDA
@@ -716,8 +718,8 @@ dovecot unix - n n - - pipe
<install><![CDATA[apt-get install libsasl2-2 libsasl2-modules libsasl2-modules-sql]]></install>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
## General Postfix configuration
# should be the default domain from your provider eg. "server100.provider.tld"
@@ -831,7 +833,8 @@ sql_select: SELECT password FROM mail_users WHERE username='%u@%r' OR email='%u@
<!-- IMAP/POP3 services -->
<service type="mail" title="{{lng.admin.configfiles.mail}}">
<!-- Dovecot -->
<daemon name="dovecot" version="2" title="Dovecot" default="true">
<daemon name="dovecot" version="2" title="Dovecot"
default="true">
<install><![CDATA[apt-get install dovecot-imapd dovecot-pop3d dovecot-mysql mail-stack-delivery]]></install>
<file name="/etc/dovecot/conf.d/99-mail-stack-delivery.conf"
chown="root:root" chmod="0644" backup="true">
@@ -909,8 +912,8 @@ service auth {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/10-auth.conf" chown="root:root"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/10-auth.conf"
chown="root:root" chmod="0644" backup="true">
<content><![CDATA[
##
## Authentication processes
@@ -1059,8 +1062,8 @@ iterate_query = SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3
<!-- Courier -->
<daemon name="courier" title="Courier">
<install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install>
<file name="/etc/courier/authdaemonrc" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier/authdaemonrc" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
##VERSION: $Id: authdaemonrc.in,v 1.8 2001/10/07 02:16:22 mrsam Exp $
#
@@ -1133,8 +1136,8 @@ authdaemonvar=/var/run/courier/authdaemon
]]>
</content>
</file>
<file name="/etc/courier/authmysqlrc" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier/authmysqlrc" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
MYSQL_SERVER <SQL_HOST>
MYSQL_USERNAME <SQL_UNPRIVILEGED_USER>
@@ -1162,7 +1165,8 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3)
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700">
<file name="/etc/proftpd/create-cert.sh" chown="root:0"
chmod="0700">
<content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
@@ -1174,8 +1178,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -1310,8 +1314,8 @@ Include /etc/proftpd/tls.conf
]]>
</content>
</file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644"
backup="true">
<file name="/etc/proftpd/modules.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
#
# This file is used to manage DSO modules and features.
@@ -1417,7 +1421,8 @@ SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4},%{5}, %{6}
]]>
</content>
</file>
<file name="/etc/proftpd/tls.conf" chown="root:root" chmod="0644" backup="true">
<file name="/etc/proftpd/tls.conf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
<IfModule mod_tls.c>
TLSEngine on
@@ -1449,14 +1454,15 @@ TLSVerifyClient off
<!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd">
<install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install>
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0" chmod="0644">
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0"
chmod="0644">
<content><![CDATA[
1000
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chown="root:0" chmod="0644">
<content><![CDATA[
/etc/pure-ftpd/db/mysql.conf
]]>
@@ -1483,8 +1489,8 @@ yes
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/PAMAuthentication"
chown="root:0" chmod="0644">
<content><![CDATA[
no
]]>
@@ -1514,7 +1520,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0" chmod="0644">
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0"
chmod="0644">
<content><![CDATA[
21
]]>
@@ -1537,7 +1544,8 @@ UPLOADGID=
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true">
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[
#
@@ -1556,7 +1564,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
@@ -1565,10 +1574,11 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon>
<!-- libnss-mysql -->
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<daemon name="libnss"
title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install libnss-mysql-bg nscd]]></install>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
backup="true">
<file name="/etc/libnss-mysql.cfg" chown="root:root"
chmod="0600" backup="true">
<content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \
@@ -1660,7 +1670,8 @@ aliases: files
<command><![CDATA[nscd --invalidate=group]]></command>
</daemon>
<!-- libnss-extrausers -->
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<daemon name="libnssextrausers"
title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
<commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -1700,7 +1711,8 @@ aliases: files
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<install><![CDATA[apt-get install logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644">
<file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[
#
# Froxlor logrotate snipet
@@ -1735,12 +1747,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php5]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- PHP-FPM -->
<daemon name="php-fpm" title="PHP-FPM (alternative to mod_php)">
<daemon name="php-fpm"
title="PHP-FPM (alternative to mod_php)">
<commands index="1">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
@@ -1778,7 +1791,7 @@ aliases: files
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<froxlor>
<distribution name="Ubuntu" codename="Xenial" version="16.04.x" defaulteditor="/bin/nano">
<distribution name="Ubuntu" codename="Xenial"
version="16.04.x" defaulteditor="/bin/nano">
<services>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -43,7 +44,8 @@
</commands>
</general>
<!-- HTTP Apache -->
<daemon name="apache" version="2.4" title="Apache 2.4" default="true">
<daemon name="apache" version="2.4" title="Apache 2.4"
default="true">
<install><![CDATA[apt-get install apache2]]></install>
<include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command>
@@ -904,8 +906,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -920,7 +922,8 @@ gmysql-password=
</file>
<command><![CDATA[/etc/init.d/pdns restart]]></command>
</daemon>
<daemon name="powerdns_bind" title="PowerDNS via bind-backend">
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[
@@ -1447,8 +1450,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# Bind backend configuration
@@ -1494,8 +1497,8 @@ bind-check-interval=180
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1539,8 +1542,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1551,8 +1554,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1599,8 +1602,8 @@ root: root@<SERVERNAME>
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
# Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter
@@ -2345,8 +2348,8 @@ virtual_mailbox_limit = 0
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
#
# Postfix master process configuration file. For details on the format
@@ -2597,8 +2600,8 @@ dict {
]]>
</content>
</file>
<file name="/etc/dovecot/dovecot-sql.conf.ext" chown="root:root"
chmod="0600" backup="true">
<file name="/etc/dovecot/dovecot-sql.conf.ext"
chown="root:root" chmod="0600" backup="true">
<content><![CDATA[
# This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-sql.conf.ext
@@ -3257,8 +3260,8 @@ mail_access_groups = vmail
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/10-master.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/10-master.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
#default_process_limit = 100
#default_client_limit = 1000
@@ -3580,8 +3583,8 @@ protocol imap {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/20-managesieve.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
##
## ManageSieve specific settings
@@ -3883,8 +3886,8 @@ plugin {
</commands>
</general>
<!-- Dovecot with postfix -->
<daemon name="dovecot_postfix" version="2" title="Dovecot with postfix"
default="true">
<daemon name="dovecot_postfix" version="2"
title="Dovecot with postfix" default="true">
<include>//service[@type='mail']/general/installs[@index=1]
</include>
<include>//service[@type='mail']/general/files[@index=1]
@@ -3898,7 +3901,8 @@ plugin {
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700">
<file name="/etc/proftpd/create-cert.sh" chown="root:0"
chmod="0700">
<content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
@@ -3910,8 +3914,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -4105,8 +4109,8 @@ Include /etc/proftpd/conf.d/
]]>
</content>
</file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644"
backup="true">
<file name="/etc/proftpd/modules.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
#
# This file is used to manage DSO modules and features.
@@ -4273,7 +4277,8 @@ SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4},%{5}, %{6}
]]>
</content>
</file>
<file name="/etc/proftpd/tls.conf" chown="root:root" chmod="0644" backup="true">
<file name="/etc/proftpd/tls.conf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
<IfModule mod_tls.c>
TLSEngine on
@@ -4305,14 +4310,15 @@ TLSVerifyClient off
<!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd">
<install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install>
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0" chmod="0644">
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0"
chmod="0644">
<content><![CDATA[
1000
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chown="root:0" chmod="0644">
<content><![CDATA[
/etc/pure-ftpd/db/mysql.conf
]]>
@@ -4339,8 +4345,8 @@ yes
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/PAMAuthentication"
chown="root:0" chmod="0644">
<content><![CDATA[
no
]]>
@@ -4486,7 +4492,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0" chmod="0644">
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0"
chmod="0644">
<content><![CDATA[
21
]]>
@@ -4530,7 +4537,8 @@ UPLOADGID=
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true">
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[
#
@@ -4549,7 +4557,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
@@ -4558,7 +4567,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon>
<!-- libnss-extrausers -->
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<daemon name="libnssextrausers"
title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
<commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -4598,7 +4608,8 @@ aliases: files
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<install><![CDATA[apt-get install logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644">
<file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[
#
# Froxlor logrotate snipet
@@ -4633,12 +4644,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.0]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- PHP-FPM -->
<daemon name="php-fpm" title="PHP-FPM (alternative to mod_php)">
<daemon name="php-fpm"
title="PHP-FPM (alternative to mod_php)">
<install>
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
@@ -4670,7 +4682,7 @@ aliases: files
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>

View File

@@ -1,5 +1,4 @@
<?php
if (! defined('MASTER_CRONJOB'))
die('You cannot access this file directly!');

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'admin_add' => array(
'title' => $lng['admin']['admin_add'],
@@ -39,7 +38,7 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'def_language' => array(
'label' => $lng['login']['language'],
@@ -74,7 +73,10 @@ return array(
'label' => $lng['usersettings']['custom_notes']['show'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
)
@@ -93,8 +95,11 @@ return array(
'label' => $lng['admin']['change_serversettings'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
'customers' => array(
@@ -109,8 +114,11 @@ return array(
'label' => $lng['admin']['customers_see_all'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
'domains' => array(
@@ -125,16 +133,22 @@ return array(
'label' => $lng['admin']['domains_see_all'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
'caneditphpsettings' => array(
'label' => $lng['admin']['caneditphpsettings'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
'diskspace' => array(

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'admin_edit' => array(
'title' => $lng['admin']['admin_edit'],
@@ -32,14 +31,19 @@ return array(
'deactivated' => array(
'label' => $lng['admin']['deactivated_user'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['deactivated']),
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['deactivated']
),
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true)
),
'admin_password' => array(
'label' => $lng['login']['password'].'&nbsp;('.$lng['panel']['emptyfornochanges'].')',
'label' => $lng['login']['password'] . '&nbsp;(' . $lng['panel']['emptyfornochanges'] . ')',
'type' => 'password',
'autocomplete' => 'off',
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true)
@@ -88,9 +92,14 @@ return array(
'label' => $lng['usersettings']['custom_notes']['show'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['custom_notes_show'])
'value' => array(
$result['custom_notes_show']
)
)
)
),
@@ -107,10 +116,15 @@ return array(
'change_serversettings' => array(
'label' => $lng['admin']['change_serversettings'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['change_serversettings'])
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['change_serversettings']
)
),
'customers' => array(
'label' => $lng['admin']['customers'],
@@ -123,10 +137,15 @@ return array(
'customers_see_all' => array(
'label' => $lng['admin']['customers_see_all'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['customers_see_all'])
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['customers_see_all']
)
),
'domains' => array(
'label' => $lng['admin']['domains'],
@@ -139,18 +158,28 @@ return array(
'domains_see_all' => array(
'label' => $lng['admin']['domains_see_all'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['domains_see_all'])
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['domains_see_all']
)
),
'caneditphpsettings' => array(
'label' => $lng['admin']['caneditphpsettings'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['caneditphpsettings'])
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['caneditphpsettings']
)
),
'diskspace' => array(
'label' => $lng['customer']['diskspace'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'cronjobs_edit' => array(
'title' => $lng['admin']['cronjob_edit'],
@@ -33,9 +32,14 @@ return array(
'label' => $lng['admin']['activated'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['isactive'])
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['isactive']
)
),
'interval_value' => array(
'label' => $lng['cronjob']['cronjobintervalv'],

View File

@@ -159,7 +159,7 @@ return array(
)
),
'section_cpre' => array(
'visible' => !empty($hosting_plans),
'visible' => ! empty($hosting_plans),
'title' => $lng['admin']['plans']['use_plan'],
'image' => 'icons/user_add.png',
'fields' => array(

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'customer_edit' => array(
'title' => $lng['admin']['customer_edit'],
@@ -35,23 +34,33 @@ return array(
'value' => $result['documentroot']
),
'createstdsubdomain' => array(
'label' => $lng['admin']['stdsubdomain_add'].'?',
'label' => $lng['admin']['stdsubdomain_add'] . '?',
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(($result['standardsubdomain'] != '0') ? '1' : '0')
'value' => array(
($result['standardsubdomain'] != '0') ? '1' : '0'
)
),
'deactivated' => array(
'label' => $lng['admin']['deactivated_user'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['deactivated'])
'value' => array(
$result['deactivated']
)
),
'new_customer_password' => array(
'label' => $lng['login']['password'].'&nbsp;('.$lng['panel']['emptyfornochanges'].')',
'label' => $lng['login']['password'] . '&nbsp;(' . $lng['panel']['emptyfornochanges'] . ')',
'type' => 'password',
'autocomplete' => 'off'
),
@@ -59,7 +68,7 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'def_language' => array(
'label' => $lng['login']['language'],
@@ -144,14 +153,19 @@ return array(
'label' => $lng['usersettings']['custom_notes']['show'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['custom_notes_show'])
'value' => array(
$result['custom_notes_show']
)
)
)
),
'section_cpre' => array(
'visible' => !empty($hosting_plans),
'visible' => ! empty($hosting_plans),
'title' => $lng['admin']['plans']['use_plan'],
'image' => 'icons/user_add.png',
'fields' => array(
@@ -227,18 +241,28 @@ return array(
'label' => $lng['customer']['email_imap'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['imap']
),
'value' => array($result['imap']),
'mandatory' => true
),
'email_pop3' => array(
'label' => $lng['customer']['email_pop3'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['pop3']
),
'value' => array($result['pop3']),
'mandatory' => true
),
'ftps' => array(
@@ -257,36 +281,51 @@ return array(
'ul_field' => $mysqls_ul
),
'phpenabled' => array(
'label' => $lng['admin']['phpenabled'].'?',
'label' => $lng['admin']['phpenabled'] . '?',
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['phpenabled'])
'value' => array(
$result['phpenabled']
)
),
'allowed_phpconfigs' => array(
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false),
'label' => $lng['admin']['phpsettings']['title'],
'type' => 'checkbox',
'values' => $phpconfigs,
'value' => isset($result['allowed_phpconfigs']) && !empty($result['allowed_phpconfigs']) ? json_decode($result['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY) : array(),
'value' => isset($result['allowed_phpconfigs']) && ! empty($result['allowed_phpconfigs']) ? json_decode($result['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY) : array(),
'is_array' => 1
),
'perlenabled' => array(
'label' => $lng['admin']['perlenabled'].'?',
'label' => $lng['admin']['perlenabled'] . '?',
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['perlenabled'])
'value' => array(
$result['perlenabled']
)
),
'dnsenabled' => array(
'label' => $lng['admin']['dnsenabled'].'?',
'label' => $lng['admin']['dnsenabled'] . '?',
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['dnsenabled']
),
'value' => array($result['dnsenabled']),
'visible' => (\Froxlor\Settings::Get('system.dnsenabled') == '1' ? true : false)
),
'logviewenabled' => array(
@@ -298,7 +337,9 @@ return array(
'value' => '1'
)
),
'value' => array($result['logviewenabled'])
'value' => array(
$result['logviewenabled']
)
)
)
),

View File

@@ -155,7 +155,9 @@ return array(
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
),
'writeerrorlog' => array(
'label' => $lng['admin']['writeerrorlog']['title'],
@@ -167,7 +169,9 @@ return array(
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
)
)
),
@@ -216,7 +220,7 @@ return array(
'desc' => $lng['admin']['domain_http2']['description'],
'type' => 'checkbox',
'values' => array(
array (
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
@@ -265,22 +269,18 @@ return array(
'value' => array()
),
'ocsp_stapling' => array(
'visible' => ($ssl_ipsandports != '' ? true : false) &&
\Froxlor\Settings::Get('system.webserver') != 'lighttpd',
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd',
'label' => $lng['admin']['domain_ocsp_stapling']['title'],
'desc' => $lng['admin']['domain_ocsp_stapling']['description'] .
(\Froxlor\Settings::Get('system.webserver') == 'nginx' ?
$lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] :
""),
'desc' => $lng['admin']['domain_ocsp_stapling']['description'] . (\Froxlor\Settings::Get('system.webserver') == 'nginx' ? $lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] : ""),
'type' => 'checkbox',
'values' => array(
array (
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
)
)
),
'section_c' => array(

View File

@@ -187,7 +187,9 @@ return array(
'value' => '1'
)
),
'value' => array($result['writeaccesslog'])
'value' => array(
$result['writeaccesslog']
)
),
'writeerrorlog' => array(
'label' => $lng['admin']['writeerrorlog']['title'],
@@ -199,7 +201,9 @@ return array(
'value' => '1'
)
),
'value' => array($result['writeerrorlog'])
'value' => array(
$result['writeerrorlog']
)
)
)
),
@@ -252,7 +256,7 @@ return array(
'desc' => $lng['admin']['domain_http2']['description'],
'type' => 'checkbox',
'values' => array(
array (
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
@@ -307,16 +311,12 @@ return array(
)
),
'ocsp_stapling' => array(
'visible' => ($ssl_ipsandports != '' ? true : false) &&
\Froxlor\Settings::Get('system.webserver') != 'lighttpd',
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd',
'label' => $lng['admin']['domain_ocsp_stapling']['title'],
'desc' => $lng['admin']['domain_ocsp_stapling']['description'] .
(\Froxlor\Settings::Get('system.webserver') == 'nginx' ?
$lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] :
""),
'desc' => $lng['admin']['domain_ocsp_stapling']['description'] . (\Froxlor\Settings::Get('system.webserver') == 'nginx' ? $lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] : ""),
'type' => 'checkbox',
'values' => array(
array (
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
@@ -324,7 +324,7 @@ return array(
'value' => array(
$result['ocsp_stapling']
)
),
)
)
),
'section_c' => array(

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'domain_import' => array(
'title' => $lng['domains']['domain_import'],
@@ -28,7 +27,7 @@ return array(
'label' => $lng['admin']['customer'],
'type' => 'select',
'select_var' => $customers,
'mandatory' => true,
'mandatory' => true
),
'separator' => array(
'label' => $lng['domains']['import_separator'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'ipsandports_add' => array(
'title' => $lng['admin']['ipsandports']['add'],
@@ -40,30 +39,45 @@ return array(
'image' => 'icons/ipsports_add.png',
'fields' => array(
'listen_statement' => array(
'visible' => !$is_nginx,
'visible' => ! $is_nginx,
'label' => $lng['admin']['ipsandports']['create_listen_statement'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
),
'namevirtualhost_statement' => array(
'visible' => $is_apache && !$is_apache24,
'visible' => $is_apache && ! $is_apache24,
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
),
'vhostcontainer' => array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
),
'docroot' => array(
'label' => $lng['admin']['ipsandports']['docroot']['title'],
@@ -83,9 +97,14 @@ return array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
)
)
),
@@ -112,7 +131,10 @@ return array(
'label' => $lng['admin']['ipsandports']['enable_ssl'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'ipsandports_edit' => array(
'title' => $lng['admin']['ipsandports']['edit'],
@@ -42,30 +41,45 @@ return array(
'image' => 'icons/ipsports_edit.png',
'fields' => array(
'listen_statement' => array(
'visible' => !$is_nginx,
'visible' => ! $is_nginx,
'label' => $lng['admin']['ipsandports']['create_listen_statement'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['listen_statement'])
'value' => array(
$result['listen_statement']
)
),
'namevirtualhost_statement' => array(
'visible' => $is_apache && !$is_apache24,
'visible' => $is_apache && ! $is_apache24,
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['namevirtualhost_statement'])
'value' => array(
$result['namevirtualhost_statement']
)
),
'vhostcontainer' => array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['vhostcontainer'])
'value' => array(
$result['vhostcontainer']
)
),
'docroot' => array(
'label' => $lng['admin']['ipsandports']['docroot']['title'],
@@ -87,9 +101,14 @@ return array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['vhostcontainer_servername_statement'])
'value' => array(
$result['vhostcontainer_servername_statement']
)
)
)
),
@@ -117,9 +136,14 @@ return array(
'label' => $lng['admin']['ipsandports']['enable_ssl'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['ssl'])
'value' => array(
$result['ssl']
)
),
'ssl_cert_file' => array(
'label' => $lng['admin']['ipsandports']['ssl_cert_file'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'fpmconfig_add' => array(
'title' => $lng['admin']['phpsettings']['addsettings'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'fpmconfig_edit' => array(
'title' => $lng['admin']['phpsettings']['editsettings'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'phpconfig_add' => array(
'title' => $lng['admin']['phpsettings']['addsettings'],
@@ -60,19 +59,22 @@ return array(
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
'type' => 'text'
),
'mod_fcgid_umask' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_umask']['title'],
'type' => 'text',
'maxlength' => 3,
'value' => '022'
),
'mod_fcgid_umask' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_umask']['title'],
'type' => 'text',
'maxlength' => 3,
'value' => '022'
),
'phpfpm_enable_slowlog' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
@@ -95,7 +97,10 @@ return array(
'label' => $lng['admin']['phpsettings']['pass_authorizationheader'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
@@ -104,7 +109,10 @@ return array(
'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
@@ -118,49 +126,49 @@ return array(
'max_children' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 1
),
'start_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 20
),
'min_spare_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 5
),
'max_spare_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 35
),
'max_requests' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 0
),
'idle_timeout' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 30
),
'limit_extensions' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'text',
'value' => '.php'
),

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'phpconfig_edit' => array(
'title' => $lng['admin']['phpsettings']['editsettings'],
@@ -55,29 +54,34 @@ return array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_starter']['title'],
'type' => 'text',
'value' => ((int)$result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '')
'value' => ((int) $result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '')
),
'mod_fcgid_maxrequests' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
'type' => 'text',
'value' => ((int)$result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '')
'value' => ((int) $result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '')
),
'mod_fcgid_umask' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_umask']['title'],
'type' => 'text',
'maxlength' => 3,
'value' => $result['mod_fcgid_umask']
),
'mod_fcgid_umask' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_umask']['title'],
'type' => 'text',
'maxlength' => 3,
'value' => $result['mod_fcgid_umask']
),
'phpfpm_enable_slowlog' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['fpm_slowlog'])
'value' => array(
$result['fpm_slowlog']
)
),
'phpfpm_reqtermtimeout' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
@@ -98,17 +102,27 @@ return array(
'label' => $lng['admin']['phpsettings']['pass_authorizationheader'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['pass_authorizationheader'])
'value' => array(
$result['pass_authorizationheader']
)
),
'override_fpmconfig' => array(
'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['override_fpmconfig'])
'value' => array(
$result['override_fpmconfig']
)
),
'pm' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
@@ -120,49 +134,49 @@ return array(
'max_children' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['max_children']
),
'start_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['start_servers']
),
'min_spare_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['min_spare_servers']
),
'max_spare_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['max_spare_servers']
),
'max_requests' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['max_requests']
),
'idle_timeout' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['idle_timeout']
),
'limit_extensions' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'text',
'value' => $result['limit_extensions']
),

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'plans_add' => array(
'title' => $lng['admin']['plans']['add'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'plans_edit' => array(
'title' => $lng['admin']['plans']['edit'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'filetemplate_add' => array(
'title' => $lng['admin']['templates']['template_add'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'filetemplate_edit' => array(
'title' => $lng['admin']['templates']['template_edit'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'template_add' => array(
'title' => $lng['admin']['templates']['template_add'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'template_edit' => array(
'title' => $lng['admin']['templates']['template_edit'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'domain_ssleditor' => array(
'title' => $lng['panel']['ssleditor'],
@@ -45,7 +44,7 @@ return array(
'ssl_cert_chainfile' => array(
'style' => 'align-top',
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile_content'],
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'].$lng['admin']['ipsandports']['ssl_cert_chainfile_content_desc'],
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'] . $lng['admin']['ipsandports']['ssl_cert_chainfile_content_desc'],
'type' => 'textarea',
'cols' => 100,
'rows' => 15,
@@ -54,7 +53,7 @@ return array(
'ssl_ca_file' => array(
'style' => 'align-top',
'label' => $lng['admin']['ipsandports']['ssl_ca_file_content'],
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'].$lng['admin']['ipsandports']['ssl_ca_file_content_desc'],
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'] . $lng['admin']['ipsandports']['ssl_ca_file_content_desc'],
'type' => 'textarea',
'cols' => 100,
'rows' => 15,

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'domain_add' => array(
'title' => $lng['domains']['subdomain_add'],
@@ -43,7 +42,7 @@ return array(
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null).(isset($pathSelect['note']) ? $pathSelect['note'].'<br />'.$pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null) . (isset($pathSelect['note']) ? $pathSelect['note'] . '<br />' . $pathSelect['value'] : ''),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
@@ -89,7 +88,10 @@ return array(
'desc' => $lng['domains']['ssl_redirect']['description'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
@@ -99,7 +101,10 @@ return array(
'desc' => $lng['customer']['letsencrypt']['description'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
@@ -116,7 +121,10 @@ return array(
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
@@ -125,12 +133,15 @@ return array(
'desc' => $lng['admin']['domain_hsts_preload']['description'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
),
),
)
)
)
)
)
);

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'domain_edit' => array(
'title' => $lng['domains']['subdomain_edit'],
@@ -42,7 +41,7 @@ return array(
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null).(isset($pathSelect['note']) ? '<br />'.$pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
@@ -68,13 +67,18 @@ return array(
'select_var' => $serveraliasoptions
),
'isemaildomain' => array(
'visible' => ((( $result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2' ) && $result['parentdomainid'] != '0') ? true : false),
'visible' => ((($result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2') && $result['parentdomainid'] != '0') ? true : false),
'label' => 'Emaildomain',
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['isemaildomain'])
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['isemaildomain']
)
),
'openbasedir_path' => array(
'visible' => ($result['openbasedir'] == '1') ? true : false,
@@ -100,9 +104,14 @@ return array(
'desc' => $lng['domains']['ssl_redirect']['description'] . ($result['temporary_ssl_redirect'] > 1 ? $lng['domains']['ssl_redirect_temporarilydisabled'] : ''),
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['ssl_redirect'])
'value' => array(
$result['ssl_redirect']
)
),
'letsencrypt' => array(
'visible' => \Froxlor\Settings::Get('system.leenabled') == '1' ? true : false,
@@ -110,9 +119,14 @@ return array(
'desc' => $lng['customer']['letsencrypt']['description'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['letsencrypt'])
'value' => array(
$result['letsencrypt']
)
),
'hsts_maxage' => array(
'label' => $lng['admin']['domain_hsts_maxage']['title'],
@@ -127,21 +141,31 @@ return array(
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['hsts_sub'])
'value' => array(
$result['hsts_sub']
)
),
'hsts_preload' => array(
'label' => $lng['admin']['domain_hsts_preload']['title'],
'desc' => $lng['admin']['domain_hsts_preload']['description'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['hsts_preload'])
),
'value' => array(
$result['hsts_preload']
)
)
)
),
)
)
)
);

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'emails_accountchangepasswd' => array(
'title' => $lng['menue']['main']['changepassword'],
@@ -38,7 +37,7 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'value' => \Froxlor\System\Crypt::generatePassword()
)
)
)

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'emails_accountchangequota' => array(
'title' => $lng['emails']['quota_edit'],
@@ -30,7 +29,7 @@ return array(
'value' => $result['email_full']
),
'email_quota' => array(
'label' => $lng['emails']['quota'].' (MiB)',
'label' => $lng['emails']['quota'] . ' (MiB)',
'type' => 'text',
'value' => $result['quota']
)

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'emails_add' => array(
'title' => $lng['emails']['emails_add'],
@@ -40,8 +39,11 @@ return array(
'label' => $lng['emails']['iscatchall'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
)
)

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'emails_addaccount' => array(
'title' => $lng['emails']['account_add'],
@@ -38,7 +37,7 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'email_quota' => array(
'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false),

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'emails_addforwarder' => array(
'title' => $lng['emails']['forwarder_add'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'emails_edit' => array(
'title' => $lng['emails']['emails_edit'],
@@ -34,29 +33,29 @@ return array(
'visible' => ($result['popaccountid'] != 0 ? true : false),
'label' => $lng['emails']['account'],
'type' => 'label',
'value' => $lng['panel']['yes'].'&nbsp;[<a href="'.$filename.'?page=accounts&amp;action=changepw&amp;id='.$result['id'].'&amp;s='.$s.'">'.$lng['menue']['main']['changepassword'].'</a>] [<a href="'.$filename.'?page=accounts&amp;action=delete&amp;id='.$result['id'].'&amp;s='.$s.'">'.$lng['emails']['account_delete'].'</a>]'
'value' => $lng['panel']['yes'] . '&nbsp;[<a href="' . $filename . '?page=accounts&amp;action=changepw&amp;id=' . $result['id'] . '&amp;s=' . $s . '">' . $lng['menue']['main']['changepassword'] . '</a>] [<a href="' . $filename . '?page=accounts&amp;action=delete&amp;id=' . $result['id'] . '&amp;s=' . $s . '">' . $lng['emails']['account_delete'] . '</a>]'
),
'account_no' => array(
'visible' => ($result['popaccountid'] == 0 ? true : false),
'label' => $lng['emails']['account'],
'type' => 'label',
'value' => $lng['panel']['no'].'&nbsp;[<a href="'.$filename.'?page=accounts&amp;action=add&amp;id='.$result['id'].'&amp;s='.$s.'">'.$lng['emails']['account_add'].'</a>]'
'value' => $lng['panel']['no'] . '&nbsp;[<a href="' . $filename . '?page=accounts&amp;action=add&amp;id=' . $result['id'] . '&amp;s=' . $s . '">' . $lng['emails']['account_add'] . '</a>]'
),
'mail_quota' => array(
'visible' => ($result['popaccountid'] != 0 && \Froxlor\Settings::Get('system.mail_quota_enabled')),
'label' => $lng['customer']['email_quota'],
'type' => 'label',
'value' => $result['quota'].' MiB [<a href="'.$filename.'?page=accounts&amp;action=changequota&amp;id='.$result['id'].'&amp;s='.$s.'">'.$lng['emails']['quota_edit'].'</a>]'
'value' => $result['quota'] . ' MiB [<a href="' . $filename . '?page=accounts&amp;action=changequota&amp;id=' . $result['id'] . '&amp;s=' . $s . '">' . $lng['emails']['quota_edit'] . '</a>]'
),
'mail_catchall' => array(
'label' => $lng['emails']['catchall'],
'type' => 'label',
'value' => ($result['iscatchall'] == 0 ? $lng['panel']['no'] : $lng['panel']['yes']).' [<a href="'.$filename.'?page='.$page.'&amp;action=togglecatchall&amp;id='.$result['id'].'&amp;s='.$s.'">'.$lng['panel']['toggle'].'</a>]'
'value' => ($result['iscatchall'] == 0 ? $lng['panel']['no'] : $lng['panel']['yes']) . ' [<a href="' . $filename . '?page=' . $page . '&amp;action=togglecatchall&amp;id=' . $result['id'] . '&amp;s=' . $s . '">' . $lng['panel']['toggle'] . '</a>]'
),
'mail_fwds' => array(
'label' => $lng['emails']['forwarders'].' ('.$forwarders_count.')',
'label' => $lng['emails']['forwarders'] . ' (' . $forwarders_count . ')',
'type' => 'label',
'value' => $forwarders.' <a href="'.$filename.'?page=forwarders&amp;action=add&amp;id='.$result['id'].'&amp;s='.$s.'">'.$lng['emails']['forwarder_add'].'</a>'
'value' => $forwarders . ' <a href="' . $filename . '?page=forwarders&amp;action=add&amp;id=' . $result['id'] . '&amp;s=' . $s . '">' . $lng['emails']['forwarder_add'] . '</a>'
)
)
)

View File

@@ -25,7 +25,7 @@ return array(
'fields' => array(
'path' => array(
'label' => $lng['panel']['backuppath']['title'],
'desc' => $lng['panel']['backuppath']['description'].'<br>'.(\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '<br />'.$pathSelect['value'] : ''),
'desc' => $lng['panel']['backuppath']['description'] . '<br>' . (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
@@ -44,7 +44,9 @@ return array(
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
),
'backup_mail' => array(
'label' => $lng['extras']['backup_mail'],
@@ -55,7 +57,9 @@ return array(
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
),
'backup_dbs' => array(
'label' => $lng['extras']['backup_dbs'],
@@ -66,7 +70,9 @@ return array(
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
)
)
)

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'htaccess_add' => array(
'title' => $lng['extras']['pathoptions_add'],
@@ -26,7 +25,7 @@ return array(
'fields' => array(
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '<br />'.$pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
@@ -35,8 +34,11 @@ return array(
'label' => $lng['extras']['directory_browsing'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
'error404path' => array(
@@ -61,8 +63,11 @@ return array(
'label' => $lng['extras']['execute_perl'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
)
)

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'htaccess_edit' => array(
'title' => $lng['extras']['pathoptions_edit'],
@@ -33,9 +32,14 @@ return array(
'label' => $lng['extras']['directory_browsing'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['options_indexes'])
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['options_indexes']
)
),
'error404path' => array(
'label' => $lng['extras']['errordocument404path'],
@@ -62,9 +66,14 @@ return array(
'label' => $lng['extras']['execute_perl'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['options_cgi'])
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['options_cgi']
)
)
)
)

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'htpasswd_add' => array(
'title' => $lng['extras']['directoryprotection_add'],
@@ -26,7 +25,7 @@ return array(
'fields' => array(
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '<br />'.$pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
@@ -44,7 +43,7 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'directory_authname' => array(
'label' => $lng['extras']['htpasswdauthname'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'htpasswd_edit' => array(
'title' => $lng['extras']['directoryprotection_edit'],
@@ -43,7 +42,7 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'directory_authname' => array(
'label' => $lng['extras']['htpasswdauthname'],

View File

@@ -13,7 +13,6 @@
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
*/
return array(
'ftp_add' => array(
'title' => $lng['ftp']['account_add'],
@@ -32,7 +31,7 @@ return array(
'visible' => (\Froxlor\Settings::Get('customer.ftpatdomain') == '1' ? true : false),
'label' => $lng['domains']['domainname'],
'type' => 'select',
'select_var' => (isset($domains) ? $domains : ""),
'select_var' => (isset($domains) ? $domains : "")
),
'ftp_description' => array(
'label' => $lng['panel']['ftpdesc'] = 'FTP description',
@@ -40,7 +39,7 @@ return array(
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '<br />'.$pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
@@ -54,21 +53,24 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'sendinfomail' => array(
'label' => $lng['customer']['sendinfomail'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
'shell' => array(
'visible' => (\Froxlor\Settings::Get('system.allow_customer_shell') == '1' ? true : false),
'label' => $lng['panel']['shell'],
'type' => 'select',
'select_var' => (isset($shells) ? $shells : ""),
'select_var' => (isset($shells) ? $shells : "")
)
)
)

View File

@@ -13,7 +13,6 @@
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
*/
return array(
'ftp_edit' => array(
'title' => $lng['ftp']['account_edit'],
@@ -26,7 +25,7 @@ return array(
'username' => array(
'label' => $lng['login']['username'],
'type' => 'label',
'value' => $result['username'],
'value' => $result['username']
),
'ftp_description' => array(
'label' => $lng['panel']['ftpdesc'] = 'FTP description',
@@ -35,7 +34,7 @@ return array(
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '<br />'.$pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
@@ -50,13 +49,13 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'shell' => array(
'visible' => (\Froxlor\Settings::Get('system.allow_customer_shell') == '1' ? true : false),
'label' => $lng['panel']['shell'],
'type' => 'select',
'select_var' => (isset($shells) ? $shells : ""),
'select_var' => (isset($shells) ? $shells : "")
)
)
)

View File

@@ -14,48 +14,48 @@
* @package Formfields
*/
return array(
'mysql_add' => array(
'title' => $lng['mysql']['database_create'],
'image' => 'icons/mysql_add.png',
'sections' => array(
'section_a' => array(
'title' => $lng['mysql']['database_create'],
'image' => 'icons/mysql_add.png',
'fields' => array(
'description' => array(
'label' => $lng['mysql']['databasedescription'],
'type' => 'text'
),
'mysql_server' => array(
'visible' => (1 < $count_mysqlservers ? true : false),
'label' => $lng['mysql']['mysql_server'],
'type' => 'select',
'select_var' => $mysql_servers
),
'mysql_password' => array(
'label' => $lng['login']['password'],
'type' => 'password',
'autocomplete' => 'off'
),
'mysql_password_suggestion' => array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'sendinfomail' => array(
'label' => $lng['customer']['sendinfomail'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
)
)
)
)
)
'mysql_add' => array(
'title' => $lng['mysql']['database_create'],
'image' => 'icons/mysql_add.png',
'sections' => array(
'section_a' => array(
'title' => $lng['mysql']['database_create'],
'image' => 'icons/mysql_add.png',
'fields' => array(
'description' => array(
'label' => $lng['mysql']['databasedescription'],
'type' => 'text'
),
'mysql_server' => array(
'visible' => (1 < $count_mysqlservers ? true : false),
'label' => $lng['mysql']['mysql_server'],
'type' => 'select',
'select_var' => $mysql_servers
),
'mysql_password' => array(
'label' => $lng['login']['password'],
'type' => 'password',
'autocomplete' => 'off'
),
'mysql_password_suggestion' => array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'sendinfomail' => array(
'label' => $lng['customer']['sendinfomail'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
)
)
)
)
)
);

View File

@@ -14,43 +14,43 @@
* @package Formfields
*/
return array(
'mysql_edit' => array(
'title' => $lng['mysql']['database_edit'],
'image' => 'icons/mysql_edit.png',
'sections' => array(
'section_a' => array(
'title' => $lng['mysql']['database_edit'],
'image' => 'icons/mysql_edit.png',
'fields' => array(
'databasename' => array(
'label' => $lng['mysql']['databasename'],
'type' => 'label',
'value' => $result['databasename']
),
'description' => array(
'label' => $lng['mysql']['databasedescription'],
'type' => 'text',
'value' => $result['description']
),
'mysql_server' => array(
'visible' => (1 < $count_mysqlservers ? true : false),
'label' => $lng['mysql']['mysql_server'],
'type' => 'label',
'value' => $sql_root['caption']
),
'mysql_password' => array(
'label' => $lng['changepassword']['new_password_ifnotempty'],
'type' => 'password',
'autocomplete' => 'off'
),
'mysql_password_suggestion' => array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword()
)
)
)
)
)
'mysql_edit' => array(
'title' => $lng['mysql']['database_edit'],
'image' => 'icons/mysql_edit.png',
'sections' => array(
'section_a' => array(
'title' => $lng['mysql']['database_edit'],
'image' => 'icons/mysql_edit.png',
'fields' => array(
'databasename' => array(
'label' => $lng['mysql']['databasename'],
'type' => 'label',
'value' => $result['databasename']
),
'description' => array(
'label' => $lng['mysql']['databasedescription'],
'type' => 'text',
'value' => $result['description']
),
'mysql_server' => array(
'visible' => (1 < $count_mysqlservers ? true : false),
'label' => $lng['mysql']['mysql_server'],
'type' => 'label',
'value' => $sql_root['caption']
),
'mysql_password' => array(
'label' => $lng['changepassword']['new_password_ifnotempty'],
'type' => 'password',
'autocomplete' => 'off'
),
'mysql_password_suggestion' => array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword()
)
)
)
)
)
);

View File

@@ -16,7 +16,6 @@
* @package Functions
*
*/
$libdirname = dirname(__FILE__);
includeFunctions($libdirname . '/functions/');
@@ -24,17 +23,13 @@ includeFunctions($libdirname . '/functions/');
function includeFunctions($dirname)
{
$dirhandle = opendir($dirname);
while(false !== ($filename = readdir($dirhandle)))
{
if($filename != '.' && $filename != '..' && $filename != '')
{
if((substr($filename, 0, 9) == 'function.' || substr($filename, 0, 9) == 'constant.') && substr($filename, -4 ) == '.php')
{
include($dirname . $filename);
while (false !== ($filename = readdir($dirhandle))) {
if ($filename != '.' && $filename != '..' && $filename != '') {
if ((substr($filename, 0, 9) == 'function.' || substr($filename, 0, 9) == 'constant.') && substr($filename, - 4) == '.php') {
include ($dirname . $filename);
}
if(is_dir($dirname . $filename))
{
if (is_dir($dirname . $filename)) {
includeFunctions($dirname . $filename . '/');
}
}
@@ -50,19 +45,22 @@ Autoloader::init();
* iterates through given directory and includes
* the file which matches $classname
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2013-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Autoloader
* @since 0.9.29.1
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2013-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Autoloader
* @since 0.9.29.1
*/
class Autoloader {
class Autoloader
{
/**
* returns a new AutoLoader-object
*
* @return Autoloader
*/
public static function init() {
public static function init()
{
return new self();
}
@@ -71,9 +69,13 @@ class Autoloader {
*
* @return null
*/
public function __construct() {
public function __construct()
{
// register autoload.function
spl_autoload_register(array($this, 'doAutoload'));
spl_autoload_register(array(
$this,
'doAutoload'
));
}
/**
@@ -85,11 +87,12 @@ class Autoloader {
* @throws Exception
* @return boolean
*/
public function doAutoload($class) {
public function doAutoload($class)
{
// define the paths where to look for classes
$paths = array(
dirname(dirname(__FILE__)) . '/install/'
dirname(dirname(__FILE__)) . '/install/'
);
// don't load anything from a namespace, it's not our responsibility
@@ -102,12 +105,10 @@ class Autoloader {
// valid directory?
if (is_dir($path)) {
// create RecursiveIteratorIterator
$its = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($path)
);
$its = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
// check every file
foreach ($its as $fullFileName => $it ) {
foreach ($its as $fullFileName => $it) {
// does it match the Filename pattern?
if (preg_match("/^(class|module|interface|abstract|)\.?$class\.php$/i", $it->getFilename())) {
// include the file and return from the loop
@@ -117,10 +118,10 @@ class Autoloader {
}
} else {
// yikes - no valid directory to check
throw new Exception("Cannot autoload from directory '".$path."'. No such directory.");
throw new Exception("Cannot autoload from directory '" . $path . "'. No such directory.");
}
}
// yikes - class not found
throw new Exception("Could not find class '".$class."'");
throw new Exception("Could not find class '" . $class . "'");
}
}

View File

@@ -16,15 +16,11 @@
* @package Functions
*
*/
function getFormFieldDataBool($fieldname, $fielddata, &$input)
{
if(isset($input[$fieldname]) && ($input[$fieldname] === '1' || $input[$fieldname] === 1 || $input[$fieldname] === true || strtolower($input[$fieldname]) === 'yes' || strtolower($input[$fieldname]) === 'ja'))
{
if (isset($input[$fieldname]) && ($input[$fieldname] === '1' || $input[$fieldname] === 1 || $input[$fieldname] === true || strtolower($input[$fieldname]) === 'yes' || strtolower($input[$fieldname]) === 'ja')) {
$newfieldvalue = '1';
}
else
{
} else {
$newfieldvalue = '0';
}

View File

@@ -16,7 +16,6 @@
* @package Functions
*
*/
function getFormFieldOutputBool($fieldname, $fielddata, $do_show = true)
{
$label = $fielddata['label'];

View File

@@ -16,15 +16,11 @@
* @package Functions
*
*/
function validateFormFieldBool($fieldname, $fielddata, $newfieldvalue)
{
if($newfieldvalue === '1' || $newfieldvalue === 1 || $newfieldvalue === true || strtolower($newfieldvalue) === 'yes' || strtolower($newfieldvalue) === 'ja' || $newfieldvalue === '0' || $newfieldvalue === 0 || $newfieldvalue === false || strtolower($newfieldvalue) === 'no' || strtolower($newfieldvalue) === 'nein' || strtolower($newfieldvalue) === '')
{
if ($newfieldvalue === '1' || $newfieldvalue === 1 || $newfieldvalue === true || strtolower($newfieldvalue) === 'yes' || strtolower($newfieldvalue) === 'ja' || $newfieldvalue === '0' || $newfieldvalue === 0 || $newfieldvalue === false || strtolower($newfieldvalue) === 'no' || strtolower($newfieldvalue) === 'nein' || strtolower($newfieldvalue) === '') {
return true;
}
else
{
} else {
return 'noboolean';
}
}

View File

@@ -16,10 +16,9 @@
* @package Functions
*
*/
if(!defined('FORMFIELDS_PLAUSIBILITY_CHECK_OK'))
if (! defined('FORMFIELDS_PLAUSIBILITY_CHECK_OK'))
define('FORMFIELDS_PLAUSIBILITY_CHECK_OK', 0);
if(!defined('FORMFIELDS_PLAUSIBILITY_CHECK_ERROR'))
if (! defined('FORMFIELDS_PLAUSIBILITY_CHECK_ERROR'))
define('FORMFIELDS_PLAUSIBILITY_CHECK_ERROR', 1);
if(!defined('FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION'))
if (! defined('FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION'))
define('FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION', 2);

View File

@@ -16,11 +16,9 @@
* @package Functions
*
*/
function getFormFieldOutputDate($fieldname, $fielddata, $do_show = true)
{
if(isset($fielddata['date_timestamp']) && $fielddata['date_timestamp'] === true)
{
if (isset($fielddata['date_timestamp']) && $fielddata['date_timestamp'] === true) {
$fielddata['value'] = date('Y-m-d', $fielddata['value']);
}

View File

@@ -16,11 +16,9 @@
* @package Functions
*
*/
function manipulateFormFieldDataDate($fieldname, $fielddata, $newfieldvalue)
{
if(isset($fielddata['date_timestamp']) && $fielddata['date_timestamp'] === true)
{
if (isset($fielddata['date_timestamp']) && $fielddata['date_timestamp'] === true) {
$newfieldvalue = strtotime($newfieldvalue);
}

View File

@@ -16,17 +16,13 @@
* @package Functions
*
*/
function validateFormFieldDate($fieldname, $fielddata, $newfieldvalue)
{
if($newfieldvalue == '0000-00-00' || preg_match('/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', $newfieldvalue))
{
if ($newfieldvalue == '0000-00-00' || preg_match('/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', $newfieldvalue)) {
$returnvalue = true;
}
else
{
} else {
$returnvalue = false;
}
return $returnvalue;
}

View File

@@ -14,7 +14,6 @@
* @package Functions
*
*/
function getFormFieldOutputFile($fieldname, $fielddata, $do_show = true)
{
$label = $fielddata['label'];

View File

@@ -14,7 +14,6 @@
* @package Functions
*
*/
function validateFormFieldFile($fieldname, $fielddata, $newfieldvalue)
{
return true;

View File

@@ -16,32 +16,25 @@
* @package Functions
*
*/
function buildForm($form)
{
$fields = '';
if(validateFormDefinition($form))
{
foreach($form['groups'] as $groupname => $groupdetails)
{
if(isset($groupdetails['title']) && $groupdetails['title'] != '')
{
if (validateFormDefinition($form)) {
foreach ($form['groups'] as $groupname => $groupdetails) {
if (isset($groupdetails['title']) && $groupdetails['title'] != '') {
$fields .= getFormGroupOutput($groupname, $groupdetails);
}
if(validateFieldDefinition($groupdetails))
{
if (validateFieldDefinition($groupdetails)) {
// Prefetch form fields
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
}
// Collect form field output
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
$fields .= getFormFieldOutput($fieldname, $fielddetails);
}
}

View File

@@ -14,9 +14,8 @@
* @package Settings
*
*/
function buildFormEx($form, $part = '') {
function buildFormEx($form, $part = '')
{
$fields = '';
if (validateFormDefinition($form)) {
@@ -26,18 +25,18 @@ function buildFormEx($form, $part = '') {
if (isset($groupdetails['title']) && $groupdetails['title'] != '') {
$fields .= getFormOverviewGroupOutput($groupname, $groupdetails);
}
}
// only show one section
} // only show one section
elseif ($part != '' && ($groupname == $part || $part == 'all')) {
/**
* this part checks for the 'websrv_avail' entry in the settings-array
* if found, we check if the current webserver is in the array. If this
* if found, we check if the current webserver is in the array.
* If this
* is not the case, we change the setting type to "hidden", #502
*/
$do_show = true;
if (isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail'])) {
$websrv = Settings::Get('system.webserver');
if (!in_array($websrv, $groupdetails['websrv_avail'])) {
if (! in_array($websrv, $groupdetails['websrv_avail'])) {
$do_show = false;
}
}
@@ -49,24 +48,24 @@ function buildFormEx($form, $part = '') {
$do_show = $groupdetails['visible'];
}
//if ($do_show) {
if (isset($groupdetails['title']) && $groupdetails['title'] != '') {
$fields .= getFormGroupOutput($groupname, $groupdetails);
// if ($do_show) {
if (isset($groupdetails['title']) && $groupdetails['title'] != '') {
$fields .= getFormGroupOutput($groupname, $groupdetails);
}
if (validateFieldDefinition($groupdetails)) {
// Prefetch form fields
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
}
if (validateFieldDefinition($groupdetails)) {
// Prefetch form fields
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
}
// Collect form field output
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
$fields .= getFormFieldOutput($fieldname, $fielddetails);
}
// Collect form field output
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
$fields .= getFormFieldOutput($fieldname, $fielddetails);
}
//}
}
// }
}
}
}

View File

@@ -16,16 +16,12 @@
* @package Functions
*
*/
function checkPlausibilityFormField($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
{
$returnvalue = '';
if(is_array($fielddata) && isset($fielddata['plausibility_check_method']) && $fielddata['plausibility_check_method'] != '' && function_exists($fielddata['plausibility_check_method']))
{
if (is_array($fielddata) && isset($fielddata['plausibility_check_method']) && $fielddata['plausibility_check_method'] != '' && function_exists($fielddata['plausibility_check_method'])) {
$returnvalue = call_user_func($fielddata['plausibility_check_method'], $fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues);
}
else
{
} else {
$returnvalue = false;
}
return $returnvalue;

View File

@@ -16,26 +16,17 @@
* @package Functions
*
*/
function getFormFieldData($fieldname, $fielddata, &$input)
{
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldData' . ucfirst($fielddata['type'])))
{
if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldData' . ucfirst($fielddata['type']))) {
$gfdFunc = 'getFormFieldData' . ucfirst($fielddata['type']);
$newfieldvalue = $gfdFunc($fieldname, $fielddata, $input);
}
else
{
if(isset($input[$fieldname]))
{
} else {
if (isset($input[$fieldname])) {
$newfieldvalue = $input[$fieldname];
}
elseif(isset($fielddata['default']))
{
} elseif (isset($fielddata['default'])) {
$newfieldvalue = $fielddata['default'];
}
else
{
} else {
$newfieldvalue = false;
}
}

View File

@@ -16,17 +16,12 @@
* @package Functions
*
*/
function getFormFieldOutput($fieldname, $fielddata) {
function getFormFieldOutput($fieldname, $fielddata)
{
global $lng;
$returnvalue = '';
if (is_array($fielddata)
&& isset($fielddata['type'])
&& $fielddata['type'] != ''
&& function_exists('getFormFieldOutput' . ucfirst($fielddata['type']))
) {
if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldOutput' . ucfirst($fielddata['type']))) {
if (isset($fielddata['label']) && is_array($fielddata['label'])) {
if (isset($fielddata['label']['title']) && isset($fielddata['label']['description'])) {
$fielddata['label'] = '<b>' . $fielddata['label']['title'] . '</b><br />' . $fielddata['label']['description'];
@@ -35,7 +30,7 @@ function getFormFieldOutput($fieldname, $fielddata) {
}
}
if (!isset($fielddata['value'])) {
if (! isset($fielddata['value'])) {
if (isset($fielddata['default'])) {
$fielddata['value'] = $fielddata['default'];
} else {
@@ -45,15 +40,16 @@ function getFormFieldOutput($fieldname, $fielddata) {
/**
* this part checks for the 'websrv_avail' entry in the settings-array
* if found, we check if the current webserver is in the array. If this
* if found, we check if the current webserver is in the array.
* If this
* is not the case, we change the setting type to "hidden", #502
*/
$do_show = true;
if (isset($fielddata['websrv_avail']) && is_array($fielddata['websrv_avail'])) {
$websrv = Settings::Get('system.webserver');
if (!in_array($websrv, $fielddata['websrv_avail'])) {
if (! in_array($websrv, $fielddata['websrv_avail'])) {
$do_show = false;
$fielddata['label'].= sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $fielddata['websrv_avail']));
$fielddata['label'] .= sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $fielddata['websrv_avail']));
}
}
@@ -62,14 +58,14 @@ function getFormFieldOutput($fieldname, $fielddata) {
// be false due to websrv_avail
if (isset($fielddata['visible']) && $do_show) {
$do_show = $fielddata['visible'];
if (!$do_show) {
$fielddata['label'].= $lng['serversettings']['option_unavailable'];
if (! $do_show) {
$fielddata['label'] .= $lng['serversettings']['option_unavailable'];
}
}
//if ($do_show) {
$returnvalue = call_user_func('getFormFieldOutput' . ucfirst($fielddata['type']), $fieldname, $fielddata, $do_show);
//}
// if ($do_show) {
$returnvalue = call_user_func('getFormFieldOutput' . ucfirst($fielddata['type']), $fieldname, $fielddata, $do_show);
// }
}
return $returnvalue;
}

View File

@@ -16,16 +16,15 @@
* @package Functions
*
*/
function getFormGroupOutput($groupname, $groupdetails) {
function getFormGroupOutput($groupname, $groupdetails)
{
global $lng, $theme;
eval("\$group = \"" . \Froxlor\UI\Template::getTemplate("settings/settings_group") . "\";");
return $group;
}
function getFormOverviewGroupOutput($groupname, $groupdetails) {
function getFormOverviewGroupOutput($groupname, $groupdetails)
{
global $lng, $filename, $s, $theme;
$group = '';
@@ -34,38 +33,28 @@ function getFormOverviewGroupOutput($groupname, $groupdetails) {
$activated = true;
$option = '';
if(isset($groupdetails['fields']))
{
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
if(isset($fielddetails['overview_option'])
&& $fielddetails['overview_option'] == true
) {
if($fielddetails['type'] != 'option'
&& $fielddetails['type'] != 'bool')
{
if (isset($groupdetails['fields'])) {
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
if (isset($fielddetails['overview_option']) && $fielddetails['overview_option'] == true) {
if ($fielddetails['type'] != 'option' && $fielddetails['type'] != 'bool') {
\Froxlor\UI\Response::standard_error('overviewsettingoptionisnotavalidfield');
}
if($fielddetails['type'] == 'option')
{
if ($fielddetails['type'] == 'option') {
$options_array = $fielddetails['option_options'];
$options = '';
foreach($options_array as $value => $vtitle)
{
$options .= makeoption($vtitle, $value, Settings::Get($fielddetails['settinggroup'].'.'.$fielddetails['varname']));
foreach ($options_array as $value => $vtitle) {
$options .= makeoption($vtitle, $value, Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname']));
}
$option.= $fielddetails['label'].':&nbsp;';
$option.= '<select class="dropdown_noborder" name="'.$fieldname.'">';
$option.= $options;
$option.= '</select>';
$option .= $fielddetails['label'] . ':&nbsp;';
$option .= '<select class="dropdown_noborder" name="' . $fieldname . '">';
$option .= $options;
$option .= '</select>';
$activated = true;
}
else
{
$option.= $lng['admin']['activated'].':&nbsp;';
$option.= makeyesno($fieldname, '1', '0', Settings::Get($fielddetails['settinggroup'].'.'.$fielddetails['varname']));
$activated = (int)Settings::Get($fielddetails['settinggroup'].'.'.$fielddetails['varname']);
} else {
$option .= $lng['admin']['activated'] . ':&nbsp;';
$option .= makeyesno($fieldname, '1', '0', Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname']));
$activated = (int) Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname']);
}
}
}
@@ -73,13 +62,14 @@ function getFormOverviewGroupOutput($groupname, $groupdetails) {
/**
* this part checks for the 'websrv_avail' entry in the settings
* if found, we check if the current webserver is in the array. If this
* if found, we check if the current webserver is in the array.
* If this
* is not the case, we change the setting type to "hidden", #502
*/
$do_show = true;
if (isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail'])) {
$websrv = Settings::Get('system.webserver');
if (!in_array($websrv, $groupdetails['websrv_avail'])) {
if (! in_array($websrv, $groupdetails['websrv_avail'])) {
$do_show = false;
$title .= sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $groupdetails['websrv_avail']));
// hack disabled flag into select-box

View File

@@ -16,11 +16,9 @@
* @package Functions
*
*/
function manipulateFormFieldData($fieldname, $fielddata, $newfieldvalue)
{
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('manipulateFormFieldData' . ucfirst($fielddata['type'])))
{
if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('manipulateFormFieldData' . ucfirst($fielddata['type']))) {
$newfieldvalue = call_user_func('manipulateFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata, $newfieldvalue);
}

View File

@@ -16,12 +16,10 @@
* @package Functions
*
*/
function prefetchFormFieldData($fieldname, $fielddata)
{
$returnvalue = array();
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('prefetchFormFieldData' . ucfirst($fielddata['type'])))
{
if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('prefetchFormFieldData' . ucfirst($fielddata['type']))) {
$returnvalue = call_user_func('prefetchFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata);
}
return $returnvalue;

View File

@@ -16,45 +16,33 @@
* @package Functions
*
*/
function processForm(&$form, &$input, $url_params = array())
{
if(validateFormDefinition($form))
{
if (validateFormDefinition($form)) {
$submitted_fields = array();
$changed_fields = array();
$saved_fields = array();
foreach($form['groups'] as $groupname => $groupdetails)
{
if(validateFieldDefinition($groupdetails))
{
foreach ($form['groups'] as $groupname => $groupdetails) {
if (validateFieldDefinition($groupdetails)) {
// Prefetch form fields
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
}
}
}
foreach($form['groups'] as $groupname => $groupdetails)
{
if(validateFieldDefinition($groupdetails))
{
foreach ($form['groups'] as $groupname => $groupdetails) {
if (validateFieldDefinition($groupdetails)) {
// Validate fields
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
$newfieldvalue = getFormFieldData($fieldname, $fielddetails, $input);
if($newfieldvalue != $fielddetails['value'])
{
if(($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true)
{
if ($newfieldvalue != $fielddetails['value']) {
if (($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true) {
\Froxlor\UI\Response::standard_error($error, $fieldname);
}
else
{
} else {
$changed_fields[$fieldname] = $newfieldvalue;
}
}
@@ -64,51 +52,37 @@ function processForm(&$form, &$input, $url_params = array())
}
}
foreach($form['groups'] as $groupname => $groupdetails)
{
if(validateFieldDefinition($groupdetails))
{
foreach ($form['groups'] as $groupname => $groupdetails) {
if (validateFieldDefinition($groupdetails)) {
// Check fields for plausibility
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
if(($plausibility_check = checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false)
{
if(is_array($plausibility_check) && isset($plausibility_check[0]))
{
if($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK)
{
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
if (($plausibility_check = checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false) {
if (is_array($plausibility_check) && isset($plausibility_check[0])) {
if ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK) {
// Nothing to do here, everything's okay
}
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR)
{
} elseif ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR) {
unset($plausibility_check[0]);
$error = $plausibility_check[1];
unset($plausibility_check[1]);
$targetname = implode(' ', $plausibility_check);
\Froxlor\UI\Response::standard_error($error, $targetname);
}
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION)
{
} elseif ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION) {
unset($plausibility_check[0]);
$question = $plausibility_check[1];
unset($plausibility_check[1]);
$targetname = implode(' ', $plausibility_check);
if(!isset($input[$question]))
{
if(is_array($url_params) && isset($url_params['filename']))
{
if (! isset($input[$question])) {
if (is_array($url_params) && isset($url_params['filename'])) {
$filename = $url_params['filename'];
unset($url_params['filename']);
}
else
{
} else {
$filename = '';
}
ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array($question => $question)), $targetname);
ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array(
$question => $question
)), $targetname);
}
}
else
{
} else {
\Froxlor\UI\Response::standard_error('plausibilitychecknotunderstood');
}
}
@@ -117,21 +91,14 @@ function processForm(&$form, &$input, $url_params = array())
}
}
foreach($form['groups'] as $groupname => $groupdetails)
{
if(validateFieldDefinition($groupdetails))
{
foreach ($form['groups'] as $groupname => $groupdetails) {
if (validateFieldDefinition($groupdetails)) {
// Save fields
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
if(isset($changed_fields[$fieldname]))
{
if(($saved_field = saveFormField($fieldname, $fielddetails, manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false)
{
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
if (isset($changed_fields[$fieldname])) {
if (($saved_field = saveFormField($fieldname, $fielddetails, manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false) {
$saved_fields = array_merge($saved_fields, $saved_field);
}
else
{
} else {
\Froxlor\UI\Response::standard_error('errorwhensaving', $fieldname);
}
}
@@ -146,26 +113,17 @@ function processForm(&$form, &$input, $url_params = array())
function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_all, $settings_part, $only_enabledisable)
{
if(validateFormDefinition($form))
{
if (validateFormDefinition($form)) {
$submitted_fields = array();
$changed_fields = array();
$saved_fields = array();
foreach($form['groups'] as $groupname => $groupdetails)
{
if(($settings_part && $part == $groupname)
|| $settings_all
|| $only_enabledisable
){
if(validateFieldDefinition($groupdetails))
{
foreach ($form['groups'] as $groupname => $groupdetails) {
if (($settings_part && $part == $groupname) || $settings_all || $only_enabledisable) {
if (validateFieldDefinition($groupdetails)) {
// Prefetch form fields
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
if(!$only_enabledisable
|| ($only_enabledisable && isset($fielddetails['overview_option']))
) {
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
if (! $only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) {
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
}
@@ -174,29 +132,17 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_
}
}
foreach($form['groups'] as $groupname => $groupdetails)
{
if(($settings_part && $part == $groupname)
|| $settings_all
|| $only_enabledisable
){
if(validateFieldDefinition($groupdetails))
{
foreach ($form['groups'] as $groupname => $groupdetails) {
if (($settings_part && $part == $groupname) || $settings_all || $only_enabledisable) {
if (validateFieldDefinition($groupdetails)) {
// Validate fields
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
if(!$only_enabledisable
|| ($only_enabledisable && isset($fielddetails['overview_option']))
) {
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
if (! $only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) {
$newfieldvalue = getFormFieldData($fieldname, $fielddetails, $input);
if($newfieldvalue != $fielddetails['value'])
{
if(($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true)
{
if ($newfieldvalue != $fielddetails['value']) {
if (($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true) {
\Froxlor\UI\Response::standard_error($error, $fieldname);
}
else
{
} else {
$changed_fields[$fieldname] = $newfieldvalue;
}
}
@@ -208,58 +154,39 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_
}
}
foreach($form['groups'] as $groupname => $groupdetails)
{
if(($settings_part && $part == $groupname)
|| $settings_all
|| $only_enabledisable
){
if(validateFieldDefinition($groupdetails))
{
foreach ($form['groups'] as $groupname => $groupdetails) {
if (($settings_part && $part == $groupname) || $settings_all || $only_enabledisable) {
if (validateFieldDefinition($groupdetails)) {
// Check fields for plausibility
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
if(!$only_enabledisable
|| ($only_enabledisable && isset($fielddetails['overview_option']))
) {
if(($plausibility_check = checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false)
{
if(is_array($plausibility_check) && isset($plausibility_check[0]))
{
if($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK)
{
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
if (! $only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) {
if (($plausibility_check = checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false) {
if (is_array($plausibility_check) && isset($plausibility_check[0])) {
if ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK) {
// Nothing to do here, everything's okay
}
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR)
{
} elseif ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR) {
unset($plausibility_check[0]);
$error = $plausibility_check[1];
unset($plausibility_check[1]);
$targetname = implode(' ', $plausibility_check);
\Froxlor\UI\Response::standard_error($error, $targetname);
}
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION)
{
} elseif ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION) {
unset($plausibility_check[0]);
$question = $plausibility_check[1];
unset($plausibility_check[1]);
$targetname = implode(' ', $plausibility_check);
if(!isset($input[$question]))
{
if(is_array($url_params) && isset($url_params['filename']))
{
if (! isset($input[$question])) {
if (is_array($url_params) && isset($url_params['filename'])) {
$filename = $url_params['filename'];
unset($url_params['filename']);
}
else
{
} else {
$filename = '';
}
ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array($question => $question)), $targetname);
ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array(
$question => $question
)), $targetname);
}
}
else
{
} else {
\Froxlor\UI\Response::standard_error('plausibilitychecknotunderstood');
}
}
@@ -270,28 +197,16 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_
}
}
foreach($form['groups'] as $groupname => $groupdetails)
{
if(($settings_part && $part == $groupname)
|| $settings_all
|| $only_enabledisable
){
if(validateFieldDefinition($groupdetails))
{
foreach ($form['groups'] as $groupname => $groupdetails) {
if (($settings_part && $part == $groupname) || $settings_all || $only_enabledisable) {
if (validateFieldDefinition($groupdetails)) {
// Save fields
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
{
if(!$only_enabledisable
|| ($only_enabledisable && isset($fielddetails['overview_option']))
) {
if(isset($changed_fields[$fieldname]))
{
if(($saved_field = saveFormField($fieldname, $fielddetails, manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false)
{
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
if (! $only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) {
if (isset($changed_fields[$fieldname])) {
if (($saved_field = saveFormField($fieldname, $fielddetails, manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false) {
$saved_fields = array_merge($saved_fields, $saved_field);
}
else
{
} else {
\Froxlor\UI\Response::standard_error('errorwhensaving', $fieldname);
}
}

View File

@@ -16,8 +16,9 @@
* @package Functions
*
*/
function returnField($fieldname, $fielddata, $newfieldvalue)
{
return array($fieldname => $newfieldvalue);
return array(
$fieldname => $newfieldvalue
);
}

View File

@@ -16,20 +16,17 @@
* @package Functions
*
*/
function saveForm($fielddata, $newfieldvalue)
{
$returnvalue = '';
if(is_array($fielddata) && isset($fielddata['save_method']) && $fielddata['save_method'] != '')
{
$returnvalue = call_user_func(array('\\Froxlor\\Settings\\Store', $fielddata['save_method']), $fielddata, $newfieldvalue);
}
elseif(is_array($fielddata) && !isset($fielddata['save_method']))
{
if (is_array($fielddata) && isset($fielddata['save_method']) && $fielddata['save_method'] != '') {
$returnvalue = call_user_func(array(
'\\Froxlor\\Settings\\Store',
$fielddata['save_method']
), $fielddata, $newfieldvalue);
} elseif (is_array($fielddata) && ! isset($fielddata['save_method'])) {
$returnvalue = true;
}
else
{
} else {
$returnvalue = false;
}
return $returnvalue;

View File

@@ -16,15 +16,13 @@
* @package Functions
*
*/
function validateFormDefinition($form)
{
$returnvalue = false;
if(is_array($form) && !empty($form) && isset($form['groups']) && is_array($form['groups']) && !empty($form['groups']))
{
if (is_array($form) && ! empty($form) && isset($form['groups']) && is_array($form['groups']) && ! empty($form['groups'])) {
$returnvalue = true;
}
return $returnvalue;
}

View File

@@ -16,16 +16,12 @@
* @package Functions
*
*/
function validateFormField($fieldname, $fielddata, $newfieldvalue)
{
$returnvalue = '';
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('validateFormField' . ucfirst($fielddata['type'])))
{
if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('validateFormField' . ucfirst($fielddata['type']))) {
$returnvalue = call_user_func('validateFormField' . ucfirst($fielddata['type']), $fieldname, $fielddata, $newfieldvalue);
}
else
{
} else {
$returnvalue = 'validation method not found';
}
return $returnvalue;

View File

@@ -16,13 +16,11 @@
* @package Functions
*
*/
function getFormFieldOutputHidden($fieldname, $fielddata)
{
$returnvalue = '<input type="hidden" name="' . $fieldname . '" value="' . htmlentities($fielddata['value']) . '" />';
if(isset($fielddata['label']) && $fielddata['label'] != '')
{
if (isset($fielddata['label']) && $fielddata['label'] != '') {
$label = $fielddata['label'];
$value = htmlentities($fielddata['value']);
eval("\$returnvalue .= \"" . \Froxlor\UI\Template::getTemplate("formfields/hidden", true) . "\";");

View File

@@ -16,7 +16,6 @@
* @package Functions
*
*/
function validateFormFieldHidden($fieldname, $fielddata, $newfieldvalue)
{
/**
@@ -24,15 +23,9 @@ function validateFormFieldHidden($fieldname, $fielddata, $newfieldvalue)
* because it might be possible that the cronjob ran
* while settings have been edited (bug #52)
*/
if($newfieldvalue === $fielddata['value']
|| $fieldname == 'system_last_tasks_run'
|| $fieldname == 'system_last_traffic_run'
|| $fieldname == 'system_lastcronrun'
) {
if ($newfieldvalue === $fielddata['value'] || $fieldname == 'system_last_tasks_run' || $fieldname == 'system_last_traffic_run' || $fieldname == 'system_lastcronrun') {
return true;
}
else
{
} else {
return 'hiddenfieldvaluechanged';
}
}

View File

@@ -16,7 +16,6 @@
* @package Functions
*
*/
function getFormFieldOutputHiddenString($fieldname, $fielddata, $do_show = true)
{
$label = $fielddata['label'];

View File

@@ -16,100 +16,71 @@
* @package Functions
*
*/
function validateFormFieldHiddenString($fieldname, $fielddata, $newfieldvalue)
{
if(isset($fielddata['string_delimiter']) && $fielddata['string_delimiter'] != '')
{
if (isset($fielddata['string_delimiter']) && $fielddata['string_delimiter'] != '') {
$newfieldvalues = explode($fielddata['string_delimiter'], $newfieldvalue);
unset($fielddata['string_delimiter']);
$returnvalue = true;
foreach($newfieldvalues as $single_newfieldvalue)
{
foreach ($newfieldvalues as $single_newfieldvalue) {
/**
* don't use tabs in value-fields, #81
*/
* don't use tabs in value-fields, #81
*/
$single_newfieldvalue = str_replace("\t", " ", $single_newfieldvalue);
$single_returnvalue = validateFormFieldString($fieldname, $fielddata, $single_newfieldvalue);
if($single_returnvalue !== true)
{
if ($single_returnvalue !== true) {
$returnvalue = $single_returnvalue;
break;
}
}
}
else
{
} else {
$returnvalue = false;
/**
* don't use tabs in value-fields, #81
*/
* don't use tabs in value-fields, #81
*/
$newfieldvalue = str_replace("\t", " ", $newfieldvalue);
if(isset($fielddata['string_type']) && $fielddata['string_type'] == 'mail')
{
if (isset($fielddata['string_type']) && $fielddata['string_type'] == 'mail') {
$returnvalue = (filter_var($newfieldvalue, FILTER_VALIDATE_EMAIL) == $newfieldvalue);
}
elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'url')
{
} elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'url') {
$returnvalue = validateUrl($newfieldvalue);
}
elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'dir')
{
} elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'dir') {
// add trailing slash to validate path if needed
// refs #331
if(substr($newfieldvalue, -1) != '/') {
$newfieldvalue.= '/';
if (substr($newfieldvalue, - 1) != '/') {
$newfieldvalue .= '/';
}
$returnvalue = ($newfieldvalue == \Froxlor\FileDir::makeCorrectDir($newfieldvalue));
}
elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'file')
{
} elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'file') {
$returnvalue = ($newfieldvalue == \Froxlor\FileDir::makeCorrectFile($newfieldvalue));
}
elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'filedir')
{
} elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'filedir') {
$returnvalue = (($newfieldvalue == \Froxlor\FileDir::makeCorrectDir($newfieldvalue)) || ($newfieldvalue == \Froxlor\FileDir::makeCorrectFile($newfieldvalue)));
}
elseif(preg_match('/^[^\r\n\t\f\0]*$/D', $newfieldvalue))
{
} elseif (preg_match('/^[^\r\n\t\f\0]*$/D', $newfieldvalue)) {
$returnvalue = true;
}
if(isset($fielddata['string_regexp']) && $fielddata['string_regexp'] != '')
{
if(preg_match($fielddata['string_regexp'], $newfieldvalue))
{
if (isset($fielddata['string_regexp']) && $fielddata['string_regexp'] != '') {
if (preg_match($fielddata['string_regexp'], $newfieldvalue)) {
$returnvalue = true;
}
else
{
} else {
$returnvalue = false;
}
}
if(isset($fielddata['string_emptyallowed']) && $fielddata['string_emptyallowed'] === true && $newfieldvalue === '')
{
if (isset($fielddata['string_emptyallowed']) && $fielddata['string_emptyallowed'] === true && $newfieldvalue === '') {
$returnvalue = true;
}
elseif(isset($fielddata['string_emptyallowed']) && $fielddata['string_emptyallowed'] === false && $newfieldvalue === '')
{
} elseif (isset($fielddata['string_emptyallowed']) && $fielddata['string_emptyallowed'] === false && $newfieldvalue === '') {
$returnvalue = 'stringmustntbeempty';
}
}
if($returnvalue === true)
{
if ($returnvalue === true) {
return true;
}
elseif($returnvalue === false)
{
} elseif ($returnvalue === false) {
return 'stringformaterror';
}
else
{
} else {
return $returnvalue;
}
}

View File

@@ -16,16 +16,12 @@
* @package Functions
*
*/
function getFormFieldDataInt($fieldname, $fielddata, &$input)
{
if(isset($input[$fieldname]))
{
$newfieldvalue = (int)$input[$fieldname];
}
else
{
$newfieldvalue = (int)$fielddata['default'];
if (isset($input[$fieldname])) {
$newfieldvalue = (int) $input[$fieldname];
} else {
$newfieldvalue = (int) $fielddata['default'];
}
return $newfieldvalue;

View File

@@ -16,7 +16,6 @@
* @package Functions
*
*/
function getFormFieldOutputInt($fieldname, $fielddata, $do_show = true)
{
return getFormFieldOutputString($fieldname, $fielddata, $do_show);

View File

@@ -16,17 +16,14 @@
* @package Functions
*
*/
function validateFormFieldInt($fieldname, $fielddata, $newfieldvalue)
{
if(isset($fielddata['int_min']) && (int)$newfieldvalue < (int)$fielddata['int_min'])
{
return('intvaluetoolow');
if (isset($fielddata['int_min']) && (int) $newfieldvalue < (int) $fielddata['int_min']) {
return ('intvaluetoolow');
}
if(isset($fielddata['int_max']) && (int)$newfieldvalue > (int)$fielddata['int_max'])
{
return('intvaluetoohigh');
if (isset($fielddata['int_max']) && (int) $newfieldvalue > (int) $fielddata['int_max']) {
return ('intvaluetoohigh');
}
return true;

View File

@@ -16,7 +16,6 @@
* @package Functions
*
*/
function getFormFieldOutputLabel($fieldname, $fielddata)
{
$label = $fielddata['label'];

View File

@@ -16,11 +16,9 @@
* @package Functions
*
*/
function validateFormFieldLabel($fieldname, $fielddata, $newfieldvalue)
{
// Return false, in case we happen to have that field in our $input array, so someone doesn't get the chance to save crap to our database
// TODO: Throw some error that actually makes sense - false would just throw unknown error
return false;
}

View File

@@ -16,20 +16,15 @@
* @package Functions
*
*/
function getFormFieldDataOption($fieldname, $fielddata, &$input)
{
if(isset($input[$fieldname]))
{
if (isset($input[$fieldname])) {
$newfieldvalue = $input[$fieldname];
}
else
{
} else {
$newfieldvalue = $fielddata['default'];
}
if(is_array($newfieldvalue))
{
if (is_array($newfieldvalue)) {
$newfieldvalue = implode(',', $newfieldvalue);
}

View File

@@ -16,28 +16,22 @@
* @package Functions
*
*/
function getFormFieldOutputOption($fieldname, $fielddata, $do_show = true)
{
$returnvalue = '';
if(isset($fielddata['option_options']) && is_array($fielddata['option_options']) && !empty($fielddata['option_options']))
{
if(isset($fielddata['option_mode']) && $fielddata['option_mode'] == 'multiple')
{
if (isset($fielddata['option_options']) && is_array($fielddata['option_options']) && ! empty($fielddata['option_options'])) {
if (isset($fielddata['option_mode']) && $fielddata['option_mode'] == 'multiple') {
$multiple = true;
$fielddata['value'] = explode(',', $fielddata['value']);
}
else
{
} else {
$multiple = false;
}
$label = $fielddata['label'];
$options_array = $fielddata['option_options'];
$options = '';
foreach($options_array as $value => $title)
{
foreach ($options_array as $value => $title) {
$options .= makeoption($title, $value, $fielddata['value']);
}
eval("\$returnvalue = \"" . \Froxlor\UI\Template::getTemplate("formfields/option", true) . "\";");

View File

@@ -16,15 +16,13 @@
* @package Functions
*
*/
function prefetchFormFieldDataOption($fieldname, $fielddata)
{
$returnvalue = array();
if((!isset($fielddata['option_options']) || !is_array($fielddata['option_options']) || empty($fielddata['option_options'])) && (isset($fielddata['option_options_method']) && function_exists($fielddata['option_options_method'])))
{
if ((! isset($fielddata['option_options']) || ! is_array($fielddata['option_options']) || empty($fielddata['option_options'])) && (isset($fielddata['option_options_method']) && function_exists($fielddata['option_options_method']))) {
$returnvalue['options'] = call_user_func($fielddata['option_options_method']);
}
return $returnvalue;
}

View File

@@ -16,30 +16,22 @@
* @package Functions
*
*/
function validateFormFieldOption($fieldname, $fielddata, $newfieldvalue)
{
$returnvalue = true;
if(isset($fielddata['option_mode']) && $fielddata['option_mode'] == 'multiple')
{
if (isset($fielddata['option_mode']) && $fielddata['option_mode'] == 'multiple') {
$options = explode(',', $newfieldvalue);
foreach($options as $option)
{
foreach ($options as $option) {
$returnvalue = ($returnvalue && isset($fielddata['option_options'][$option]));
}
}
else
{
} else {
$returnvalue = isset($fielddata['option_options'][$newfieldvalue]);
}
if($returnvalue === true || $fielddata['visible'] == false)
{
if ($returnvalue === true || $fielddata['visible'] == false) {
return true;
}
else
{
} else {
if (isset($fielddata['option_emptyallowed']) && $fielddata['option_emptyallowed']) {
return true;
}

Some files were not shown because too many files have changed in this diff Show More