get rid of last function file
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -103,9 +103,6 @@ class FroxlorInstall
|
|||||||
$this->_sendHeaders();
|
$this->_sendHeaders();
|
||||||
// check if we have a valid installation already
|
// check if we have a valid installation already
|
||||||
$this->_checkUserdataFile();
|
$this->_checkUserdataFile();
|
||||||
// include the functions
|
|
||||||
require $this->_basepath . '/lib/functions/constant.formfields.php';
|
|
||||||
require $this->_basepath . '/lib/functions/constant.logger.php';
|
|
||||||
// include the MySQL-Table-Definitions
|
// include the MySQL-Table-Definitions
|
||||||
require $this->_basepath . '/lib/tables.inc.php';
|
require $this->_basepath . '/lib/tables.inc.php';
|
||||||
// include language
|
// include language
|
||||||
|
|||||||
@@ -189,9 +189,6 @@ class MasterCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
unset($sql['root_password']);
|
unset($sql['root_password']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Includes the Functions
|
|
||||||
require \Froxlor\Froxlor::getInstallDir() . '/lib/functions/constant.formfields.php';
|
|
||||||
|
|
||||||
// Includes the MySQL-Tabledefinitions etc.
|
// Includes the MySQL-Tabledefinitions etc.
|
||||||
require \Froxlor\Froxlor::getInstallDir() . '/lib/tables.inc.php';
|
require \Froxlor\Froxlor::getInstallDir() . '/lib/tables.inc.php';
|
||||||
fwrite(self::$debugHandler, 'Table definitions included' . "\n");
|
fwrite(self::$debugHandler, 'Table definitions included' . "\n");
|
||||||
|
|||||||
@@ -135,15 +135,15 @@ class Form
|
|||||||
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
|
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
|
||||||
if (($plausibility_check = self::checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false) {
|
if (($plausibility_check = self::checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false) {
|
||||||
if (is_array($plausibility_check) && isset($plausibility_check[0])) {
|
if (is_array($plausibility_check) && isset($plausibility_check[0])) {
|
||||||
if ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK) {
|
if ($plausibility_check[0] == \Froxlor\Validate\Check::FORMFIELDS_PLAUSIBILITY_CHECK_OK) {
|
||||||
// Nothing to do here, everything's okay
|
// Nothing to do here, everything's okay
|
||||||
} elseif ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR) {
|
} elseif ($plausibility_check[0] == \Froxlor\Validate\Check::FORMFIELDS_PLAUSIBILITY_CHECK_ERROR) {
|
||||||
unset($plausibility_check[0]);
|
unset($plausibility_check[0]);
|
||||||
$error = $plausibility_check[1];
|
$error = $plausibility_check[1];
|
||||||
unset($plausibility_check[1]);
|
unset($plausibility_check[1]);
|
||||||
$targetname = implode(' ', $plausibility_check);
|
$targetname = implode(' ', $plausibility_check);
|
||||||
\Froxlor\UI\Response::standard_error($error, $targetname);
|
\Froxlor\UI\Response::standard_error($error, $targetname);
|
||||||
} elseif ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION) {
|
} elseif ($plausibility_check[0] == \Froxlor\Validate\Check::FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION) {
|
||||||
unset($plausibility_check[0]);
|
unset($plausibility_check[0]);
|
||||||
$question = $plausibility_check[1];
|
$question = $plausibility_check[1];
|
||||||
unset($plausibility_check[1]);
|
unset($plausibility_check[1]);
|
||||||
@@ -239,15 +239,15 @@ class Form
|
|||||||
if (! $only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) {
|
if (! $only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) {
|
||||||
if (($plausibility_check = self::checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false) {
|
if (($plausibility_check = self::checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false) {
|
||||||
if (is_array($plausibility_check) && isset($plausibility_check[0])) {
|
if (is_array($plausibility_check) && isset($plausibility_check[0])) {
|
||||||
if ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK) {
|
if ($plausibility_check[0] == \Froxlor\Validate\Check::FORMFIELDS_PLAUSIBILITY_CHECK_OK) {
|
||||||
// Nothing to do here, everything's okay
|
// Nothing to do here, everything's okay
|
||||||
} elseif ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR) {
|
} elseif ($plausibility_check[0] == \Froxlor\Validate\Check::FORMFIELDS_PLAUSIBILITY_CHECK_ERROR) {
|
||||||
unset($plausibility_check[0]);
|
unset($plausibility_check[0]);
|
||||||
$error = $plausibility_check[1];
|
$error = $plausibility_check[1];
|
||||||
unset($plausibility_check[1]);
|
unset($plausibility_check[1]);
|
||||||
$targetname = implode(' ', $plausibility_check);
|
$targetname = implode(' ', $plausibility_check);
|
||||||
\Froxlor\UI\Response::standard_error($error, $targetname);
|
\Froxlor\UI\Response::standard_error($error, $targetname);
|
||||||
} elseif ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION) {
|
} elseif ($plausibility_check[0] == \Froxlor\Validate\Check::FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION) {
|
||||||
unset($plausibility_check[0]);
|
unset($plausibility_check[0]);
|
||||||
$question = $plausibility_check[1];
|
$question = $plausibility_check[1];
|
||||||
unset($plausibility_check[1]);
|
unset($plausibility_check[1]);
|
||||||
|
|||||||
@@ -6,10 +6,16 @@ use Froxlor\Settings;
|
|||||||
class Check
|
class Check
|
||||||
{
|
{
|
||||||
|
|
||||||
|
const FORMFIELDS_PLAUSIBILITY_CHECK_OK = 0;
|
||||||
|
|
||||||
|
const FORMFIELDS_PLAUSIBILITY_CHECK_ERROR = 1;
|
||||||
|
|
||||||
|
const FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION = 2;
|
||||||
|
|
||||||
public static function checkFcgidPhpFpm($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
public static function checkFcgidPhpFpm($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
||||||
{
|
{
|
||||||
$returnvalue = array(
|
$returnvalue = array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
||||||
);
|
);
|
||||||
|
|
||||||
$check_array = array(
|
$check_array = array(
|
||||||
@@ -38,7 +44,7 @@ class Check
|
|||||||
// the other interface is activated already and STAYS activated
|
// the other interface is activated already and STAYS activated
|
||||||
if ((int) Settings::Get($check_array[$fieldname]['other_enabled']) == 1) {
|
if ((int) Settings::Get($check_array[$fieldname]['other_enabled']) == 1) {
|
||||||
$returnvalue = array(
|
$returnvalue = array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
||||||
$check_array[$fieldname]['other_enabled_lng']
|
$check_array[$fieldname]['other_enabled_lng']
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -48,7 +54,7 @@ class Check
|
|||||||
} else {
|
} else {
|
||||||
// not, bot are nogo
|
// not, bot are nogo
|
||||||
$returnvalue = $returnvalue = array(
|
$returnvalue = $returnvalue = array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
||||||
'fcgidandphpfpmnogoodtogether'
|
'fcgidandphpfpmnogoodtogether'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -74,7 +80,7 @@ class Check
|
|||||||
|
|
||||||
if (Validate::validate_ip2($host_entry, true, 'invalidip', true, true) == false && Validate::validateDomain($host_entry) == false && Validate::validateLocalHostname($host_entry) == false && $host_entry != '%') {
|
if (Validate::validate_ip2($host_entry, true, 'invalidip', true, true) == false && Validate::validateDomain($host_entry) == false && Validate::validateLocalHostname($host_entry) == false && $host_entry != '%') {
|
||||||
return array(
|
return array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
||||||
'invalidmysqlhost',
|
'invalidmysqlhost',
|
||||||
$host_entry
|
$host_entry
|
||||||
);
|
);
|
||||||
@@ -82,7 +88,7 @@ class Check
|
|||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,12 +96,12 @@ class Check
|
|||||||
{
|
{
|
||||||
if (0 == strlen(trim($newfieldvalue)) || Validate::validateDomain($newfieldvalue) === false) {
|
if (0 == strlen(trim($newfieldvalue)) || Validate::validateDomain($newfieldvalue) === false) {
|
||||||
return array(
|
return array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
||||||
'invalidhostname'
|
'invalidhostname'
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return array(
|
return array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -143,17 +149,17 @@ class Check
|
|||||||
// neither dir can be within the other nor can they be equal
|
// neither dir can be within the other nor can they be equal
|
||||||
if (substr($newdir, 0, strlen($cdir)) == $cdir || substr($cdir, 0, strlen($newdir)) == $newdir || $newdir == $cdir) {
|
if (substr($newdir, 0, strlen($cdir)) == $cdir || substr($cdir, 0, strlen($newdir)) == $newdir || $newdir == $cdir) {
|
||||||
$returnvalue = array(
|
$returnvalue = array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
||||||
'fcgidpathcannotbeincustomerdoc'
|
'fcgidpathcannotbeincustomerdoc'
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$returnvalue = array(
|
$returnvalue = array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$returnvalue = array(
|
$returnvalue = array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,14 +169,14 @@ class Check
|
|||||||
public static function checkPhpInterfaceSetting($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
public static function checkPhpInterfaceSetting($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
||||||
{
|
{
|
||||||
$returnvalue = array(
|
$returnvalue = array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
||||||
);
|
);
|
||||||
|
|
||||||
if ((int) Settings::Get('system.mod_fcgid') == 1) {
|
if ((int) Settings::Get('system.mod_fcgid') == 1) {
|
||||||
// fcgid only works for apache and lighttpd
|
// fcgid only works for apache and lighttpd
|
||||||
if (strtolower($newfieldvalue) != 'apache2' && strtolower($newfieldvalue) != 'lighttpd') {
|
if (strtolower($newfieldvalue) != 'apache2' && strtolower($newfieldvalue) != 'lighttpd') {
|
||||||
$returnvalue = array(
|
$returnvalue = array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
||||||
'fcgidstillenableddeadlock'
|
'fcgidstillenableddeadlock'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -188,7 +194,7 @@ class Check
|
|||||||
$returnvalue = array();
|
$returnvalue = array();
|
||||||
if (Validate::validateUsername($newfieldvalue, Settings::Get('panel.unix_names'), 14 - strlen($allnewfieldvalues['customer_mysqlprefix'])) === true) {
|
if (Validate::validateUsername($newfieldvalue, Settings::Get('panel.unix_names'), 14 - strlen($allnewfieldvalues['customer_mysqlprefix'])) === true) {
|
||||||
$returnvalue = array(
|
$returnvalue = array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$errmsg = 'accountprefixiswrong';
|
$errmsg = 'accountprefixiswrong';
|
||||||
@@ -196,7 +202,7 @@ class Check
|
|||||||
$errmsg = 'mysqlprefixiswrong';
|
$errmsg = 'mysqlprefixiswrong';
|
||||||
}
|
}
|
||||||
$returnvalue = array(
|
$returnvalue = array(
|
||||||
FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_ERROR,
|
||||||
$errmsg
|
$errmsg
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This file is part of the Froxlor project.
|
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the COPYING
|
|
||||||
* file that was distributed with this source code. You can also view the
|
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
|
||||||
*
|
|
||||||
* @copyright (c) the authors
|
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
|
||||||
* @package Functions
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
if (! defined('FORMFIELDS_PLAUSIBILITY_CHECK_OK'))
|
|
||||||
define('FORMFIELDS_PLAUSIBILITY_CHECK_OK', 0);
|
|
||||||
if (! defined('FORMFIELDS_PLAUSIBILITY_CHECK_ERROR'))
|
|
||||||
define('FORMFIELDS_PLAUSIBILITY_CHECK_ERROR', 1);
|
|
||||||
if (! defined('FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION'))
|
|
||||||
define('FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION', 2);
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This file is part of the Froxlor project.
|
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the COPYING
|
|
||||||
* file that was distributed with this source code. You can also view the
|
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
|
||||||
*
|
|
||||||
* @copyright (c) the authors
|
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
|
||||||
* @package Functions
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
@@ -35,9 +35,6 @@ require dirname(__DIR__) . '/vendor/autoload.php';
|
|||||||
// include table definitions
|
// include table definitions
|
||||||
require dirname(__DIR__) . '/lib/tables.inc.php';
|
require dirname(__DIR__) . '/lib/tables.inc.php';
|
||||||
|
|
||||||
// include consts
|
|
||||||
require dirname(__DIR__) . '/lib/functions/constant.formfields.php';
|
|
||||||
|
|
||||||
use Froxlor\Database\Database;
|
use Froxlor\Database\Database;
|
||||||
use Froxlor\Settings;
|
use Froxlor\Settings;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user