more function moving
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -45,7 +45,7 @@ return array(
|
||||
'type' => 'option',
|
||||
'default' => 0,
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => array('\\Froxlor\\System', 'getAvailablePasswordHashes'),
|
||||
'option_options_method' => array('\\Froxlor\\System\\Crypt', 'getAvailablePasswordHashes'),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_allow_error_report_admin' => array(
|
||||
|
||||
@@ -119,8 +119,8 @@ if ($page == 'overview') {
|
||||
|
||||
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||
|
||||
$cron_last_runs = getCronjobsLastRun();
|
||||
$outstanding_tasks = getOutstandingTasks();
|
||||
$cron_last_runs = \Froxlor\System\Cronjob::getCronjobsLastRun();
|
||||
$outstanding_tasks = \Froxlor\System\Cronjob::getOutstandingTasks();
|
||||
|
||||
$system_hostname = gethostname();
|
||||
$meminfo = explode("\n", @file_get_contents("/proc/meminfo"));
|
||||
|
||||
@@ -135,7 +135,7 @@ if ($page == 'overview') {
|
||||
|
||||
// Update ftp password
|
||||
if (isset($_POST['change_main_ftp']) && $_POST['change_main_ftp'] == 'true') {
|
||||
$cryptPassword = \Froxlor\System::makeCryptPassword($new_password);
|
||||
$cryptPassword = \Froxlor\System\Crypt::makeCryptPassword($new_password);
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
|
||||
SET `password` = :password
|
||||
WHERE `customerid` = :customerid
|
||||
|
||||
@@ -624,7 +624,7 @@ if ($action == 'resetpwd') {
|
||||
WHERE `customerid` = :userid");
|
||||
}
|
||||
Database::pexecute($stmt, array(
|
||||
"newpassword" => \Froxlor\System::makeCryptPassword($new_password),
|
||||
"newpassword" => \Froxlor\System\Crypt::makeCryptPassword($new_password),
|
||||
"userid" => $result['userid']
|
||||
));
|
||||
|
||||
|
||||
@@ -260,14 +260,14 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
}
|
||||
|
||||
if ($password == '') {
|
||||
$password = \Froxlor\System::generatePassword();
|
||||
$password = \Froxlor\System\Crypt::generatePassword();
|
||||
}
|
||||
|
||||
$_theme = Settings::Get('panel.default_theme');
|
||||
|
||||
$ins_data = array(
|
||||
'loginname' => $loginname,
|
||||
'password' => \Froxlor\System::makeCryptPassword($password),
|
||||
'password' => \Froxlor\System\Crypt::makeCryptPassword($password),
|
||||
'name' => $name,
|
||||
'email' => $email,
|
||||
'lang' => $def_language,
|
||||
@@ -530,7 +530,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
|
||||
if ($password != '') {
|
||||
$password = validatePassword($password, true);
|
||||
$password = \Froxlor\System::makeCryptPassword($password);
|
||||
$password = \Froxlor\System\Crypt::makeCryptPassword($password);
|
||||
} else {
|
||||
$password = $result['password'];
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
||||
}
|
||||
|
||||
if ($password == '') {
|
||||
$password = \Froxlor\System::generatePassword();
|
||||
$password = \Froxlor\System\Crypt::generatePassword();
|
||||
}
|
||||
|
||||
$_theme = Settings::Get('panel.default_theme');
|
||||
@@ -386,7 +386,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
||||
$ins_data = array(
|
||||
'adminid' => $this->getUserDetail('adminid'),
|
||||
'loginname' => $loginname,
|
||||
'passwd' => \Froxlor\System::makeCryptPassword($password),
|
||||
'passwd' => \Froxlor\System\Crypt::makeCryptPassword($password),
|
||||
'name' => $name,
|
||||
'firstname' => $firstname,
|
||||
'gender' => $gender,
|
||||
@@ -552,7 +552,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
||||
Database::pexecute($ins_stmt, $ins_data, true, true);
|
||||
|
||||
inserttask('1');
|
||||
$cryptPassword = \Froxlor\System::makeCryptPassword($password);
|
||||
$cryptPassword = \Froxlor\System\Crypt::makeCryptPassword($password);
|
||||
// add FTP-User
|
||||
// @fixme use Ftp-ApiCommand later
|
||||
$ins_stmt = Database::prepare("
|
||||
@@ -941,7 +941,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
||||
|
||||
if ($password != '') {
|
||||
$password = validatePassword($password, true);
|
||||
$password = \Froxlor\System::makeCryptPassword($password);
|
||||
$password = \Froxlor\System\Crypt::makeCryptPassword($password);
|
||||
} else {
|
||||
$password = $result['password'];
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
|
||||
}
|
||||
|
||||
// encrypt the password
|
||||
$cryptPassword = \Froxlor\System::makeCryptPassword($password);
|
||||
$cryptPassword = \Froxlor\System\Crypt::makeCryptPassword($password);
|
||||
|
||||
$email_user = substr($email_full, 0, strrpos($email_full, "@"));
|
||||
$email_domain = substr($email_full, strrpos($email_full, "@") + 1);
|
||||
@@ -347,7 +347,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
|
||||
standard_error('passwordshouldnotbeusername', '', true);
|
||||
}
|
||||
$password = validatePassword($password, true);
|
||||
$cryptPassword = \Froxlor\System::makeCryptPassword($password);
|
||||
$cryptPassword = \Froxlor\System\Crypt::makeCryptPassword($password);
|
||||
$upd_query .= (Settings::Get('system.mailpwcleartext') == '1' ? "`password` = :password, " : '') . "`password_enc`= :password_enc";
|
||||
$upd_params['password_enc'] = $cryptPassword;
|
||||
if (Settings::Get('system.mailpwcleartext') == '1') {
|
||||
|
||||
@@ -129,7 +129,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
||||
standard_error('passwordshouldnotbeusername', '', true);
|
||||
} else {
|
||||
$path = \Froxlor\FileDir::makeCorrectDir($customer['documentroot'] . '/' . $path);
|
||||
$cryptPassword = \Froxlor\System::makeCryptPassword($password);
|
||||
$cryptPassword = \Froxlor\System\Crypt::makeCryptPassword($password);
|
||||
|
||||
$stmt = Database::prepare("INSERT INTO `" . TABLE_FTP_USERS . "`
|
||||
(`customerid`, `username`, `description`, `password`, `homedir`, `login_enabled`, `uid`, `gid`, `shell`)
|
||||
@@ -358,7 +358,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
||||
if ($password == $result['username']) {
|
||||
standard_error('passwordshouldnotbeusername', '', true);
|
||||
}
|
||||
$cryptPassword = \Froxlor\System::makeCryptPassword($password);
|
||||
$cryptPassword = \Froxlor\System\Crypt::makeCryptPassword($password);
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
|
||||
SET `password` = :password
|
||||
|
||||
@@ -179,7 +179,7 @@ class Store
|
||||
* when fielddata[cronmodule] is set, this means enable/disable a cronjob
|
||||
*/
|
||||
if (isset($fielddata['cronmodule']) && $fielddata['cronmodule'] != '') {
|
||||
toggleCronStatus($fielddata['cronmodule'], $newfieldvalue);
|
||||
\Froxlor\System\Cronjob::toggleCronStatus($fielddata['cronmodule'], $newfieldvalue);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
194
lib/Froxlor/System/Cronjob.php
Normal file
194
lib/Froxlor/System/Cronjob.php
Normal file
@@ -0,0 +1,194 @@
|
||||
<?php
|
||||
namespace Froxlor\System;
|
||||
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\Database\Database;
|
||||
|
||||
class Cronjob
|
||||
{
|
||||
|
||||
public static function getCronjobsLastRun()
|
||||
{
|
||||
global $lng;
|
||||
|
||||
$query = "SELECT `lastrun`, `desc_lng_key` FROM `" . TABLE_PANEL_CRONRUNS . "` WHERE `isactive` = '1' ORDER BY `cronfile` ASC";
|
||||
$result = Database::query($query);
|
||||
|
||||
$cronjobs_last_run = '';
|
||||
while ($row = $result->fetch(\PDO::FETCH_ASSOC)) {
|
||||
|
||||
$lastrun = $lng['cronjobs']['notyetrun'];
|
||||
if ($row['lastrun'] > 0) {
|
||||
$lastrun = date('d.m.Y H:i:s', $row['lastrun']);
|
||||
}
|
||||
|
||||
$text = $lng['crondesc'][$row['desc_lng_key']];
|
||||
$value = $lastrun;
|
||||
|
||||
eval("\$cronjobs_last_run .= \"" . getTemplate("index/overview_item") . "\";");
|
||||
}
|
||||
|
||||
return $cronjobs_last_run;
|
||||
}
|
||||
|
||||
public static function toggleCronStatus($module = null, $isactive = 0)
|
||||
{
|
||||
if ($isactive != 1) {
|
||||
$isactive = 0;
|
||||
}
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `isactive` = :active WHERE `module` = :module");
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'active' => $isactive,
|
||||
'module' => $module
|
||||
));
|
||||
}
|
||||
|
||||
public static function getOutstandingTasks()
|
||||
{
|
||||
global $lng;
|
||||
|
||||
$query = "SELECT * FROM `" . TABLE_PANEL_TASKS . "` ORDER BY `type` ASC";
|
||||
$result = Database::query($query);
|
||||
|
||||
$value = '<ul class="cronjobtask">';
|
||||
$tasks = '';
|
||||
while ($row = $result->fetch(\PDO::FETCH_ASSOC)) {
|
||||
|
||||
if ($row['data'] != '') {
|
||||
$row['data'] = json_decode($row['data'], true);
|
||||
}
|
||||
|
||||
// rebuilding webserver-configuration
|
||||
if ($row['type'] == '1') {
|
||||
$task_desc = $lng['tasks']['rebuild_webserverconfig'];
|
||||
} // adding new user/
|
||||
elseif ($row['type'] == '2') {
|
||||
$loginname = '';
|
||||
if (is_array($row['data'])) {
|
||||
$loginname = $row['data']['loginname'];
|
||||
}
|
||||
$task_desc = $lng['tasks']['adding_customer'];
|
||||
$task_desc = str_replace('%loginname%', $loginname, $task_desc);
|
||||
} // rebuilding bind-configuration
|
||||
elseif ($row['type'] == '4') {
|
||||
$task_desc = $lng['tasks']['rebuild_bindconfig'];
|
||||
} // creating ftp-user directory
|
||||
elseif ($row['type'] == '5') {
|
||||
$task_desc = $lng['tasks']['creating_ftpdir'];
|
||||
} // deleting user-files
|
||||
elseif ($row['type'] == '6') {
|
||||
$loginname = '';
|
||||
if (is_array($row['data'])) {
|
||||
$loginname = $row['data']['loginname'];
|
||||
}
|
||||
$task_desc = $lng['tasks']['deleting_customerfiles'];
|
||||
$task_desc = str_replace('%loginname%', $loginname, $task_desc);
|
||||
} // deleting email-account
|
||||
elseif ($row['type'] == '7') {
|
||||
$task_desc = $lng['tasks']['remove_emailacc_files'];
|
||||
} // deleting ftp-account
|
||||
elseif ($row['type'] == '8') {
|
||||
$task_desc = $lng['tasks']['remove_ftpacc_files'];
|
||||
} // Set FS - quota
|
||||
elseif ($row['type'] == '10') {
|
||||
$task_desc = $lng['tasks']['diskspace_set_quota'];
|
||||
} // deleting user-files
|
||||
elseif ($row['type'] == '20') {
|
||||
$loginname = '';
|
||||
if (is_array($row['data'])) {
|
||||
$loginname = $row['data']['loginname'];
|
||||
}
|
||||
$task_desc = $lng['tasks']['backup_customerfiles'];
|
||||
$task_desc = str_replace('%loginname%', $loginname, $task_desc);
|
||||
} // re-generating of cron.d-file
|
||||
elseif ($row['type'] == '99') {
|
||||
$task_desc = $lng['tasks']['regenerating_crond'];
|
||||
} // unknown
|
||||
else {
|
||||
$task_desc = "ERROR: Unknown task type '" . $row['type'] . "'";
|
||||
}
|
||||
|
||||
if ($task_desc != '') {
|
||||
$tasks .= '<li>' . $task_desc . '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
if (trim($tasks) == '') {
|
||||
$value .= '<li>' . $lng['tasks']['noneoutstanding'] . '</li>';
|
||||
} else {
|
||||
$value .= $tasks;
|
||||
}
|
||||
|
||||
$value .= '</ul>';
|
||||
$text = $lng['tasks']['outstanding_tasks'];
|
||||
eval("\$outstanding_tasks = \"" . getTemplate("index/overview_item") . "\";");
|
||||
|
||||
return $outstanding_tasks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cronjob function to end a cronjob in a critical condition
|
||||
* but not without sending a notification mail to the admin
|
||||
*
|
||||
* @param string $message
|
||||
* @param string $subject
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function dieWithMail($message, $subject = "[froxlor] Cronjob error")
|
||||
{
|
||||
if (Settings::Get('system.send_cron_errors') == '1') {
|
||||
|
||||
$_mail = new \PHPMailer\PHPMailer\PHPMailer(true);
|
||||
$_mail->CharSet = "UTF-8";
|
||||
|
||||
if (Settings::Get('system.mail_use_smtp')) {
|
||||
$_mail->isSMTP();
|
||||
$_mail->Host = Settings::Get('system.mail_smtp_host');
|
||||
$_mail->SMTPAuth = Settings::Get('system.mail_smtp_auth') == '1' ? true : false;
|
||||
$_mail->Username = Settings::Get('system.mail_smtp_user');
|
||||
$_mail->Password = Settings::Get('system.mail_smtp_passwd');
|
||||
if (Settings::Get('system.mail_smtp_usetls')) {
|
||||
$_mail->SMTPSecure = 'tls';
|
||||
} else {
|
||||
$_mail->SMTPAutoTLS = false;
|
||||
}
|
||||
$_mail->Port = Settings::Get('system.mail_smtp_port');
|
||||
}
|
||||
|
||||
if (\PHPMailer\PHPMailer\PHPMailer::ValidateAddress(Settings::Get('panel.adminmail')) !== false) {
|
||||
// set return-to address and custom sender-name, see #76
|
||||
$_mail->SetFrom(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
|
||||
if (Settings::Get('panel.adminmail_return') != '') {
|
||||
$_mail->AddReplyTo(Settings::Get('panel.adminmail_return'), Settings::Get('panel.adminmail_defname'));
|
||||
}
|
||||
}
|
||||
|
||||
$_mailerror = false;
|
||||
$mailerr_msg = "";
|
||||
try {
|
||||
$_mail->Subject = $subject;
|
||||
$_mail->AltBody = $message;
|
||||
$_mail->MsgHTML(nl2br($message));
|
||||
$_mail->AddAddress(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
|
||||
$_mail->Send();
|
||||
} catch (\PHPMailer\PHPMailer\Exception $e) {
|
||||
$mailerr_msg = $e->errorMessage();
|
||||
$_mailerror = true;
|
||||
} catch (\Exception $e) {
|
||||
$mailerr_msg = $e->getMessage();
|
||||
$_mailerror = true;
|
||||
}
|
||||
|
||||
$_mail->ClearAddresses();
|
||||
|
||||
if ($_mailerror) {
|
||||
echo 'Error sending mail: ' . $mailerr_msg . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
die($message);
|
||||
}
|
||||
}
|
||||
@@ -3,14 +3,14 @@ namespace Froxlor\System;
|
||||
|
||||
use Froxlor\Settings;
|
||||
|
||||
class System
|
||||
class Crypt
|
||||
{
|
||||
|
||||
/**
|
||||
* Generates a random password
|
||||
*
|
||||
* @param boolean $isSalt
|
||||
* optional, create a hash for a salt used in \Froxlor\System::makeCryptPassword because crypt() does not like some special characters in its salts, default is false
|
||||
* optional, create a hash for a salt used in \Froxlor\System\Crypt::makeCryptPassword because crypt() does not like some special characters in its salts, default is false
|
||||
*/
|
||||
public static function generatePassword($isSalt = false)
|
||||
{
|
||||
@@ -137,68 +137,4 @@ class System
|
||||
|
||||
return $available_pwdhashes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cronjob function to end a cronjob in a critical condition
|
||||
* but not without sending a notification mail to the admin
|
||||
*
|
||||
* @param string $message
|
||||
* @param string $subject
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function dieWithMail($message, $subject = "[froxlor] Cronjob error")
|
||||
{
|
||||
if (Settings::Get('system.send_cron_errors') == '1') {
|
||||
|
||||
$_mail = new \PHPMailer\PHPMailer\PHPMailer(true);
|
||||
$_mail->CharSet = "UTF-8";
|
||||
|
||||
if (Settings::Get('system.mail_use_smtp')) {
|
||||
$_mail->isSMTP();
|
||||
$_mail->Host = Settings::Get('system.mail_smtp_host');
|
||||
$_mail->SMTPAuth = Settings::Get('system.mail_smtp_auth') == '1' ? true : false;
|
||||
$_mail->Username = Settings::Get('system.mail_smtp_user');
|
||||
$_mail->Password = Settings::Get('system.mail_smtp_passwd');
|
||||
if (Settings::Get('system.mail_smtp_usetls')) {
|
||||
$_mail->SMTPSecure = 'tls';
|
||||
} else {
|
||||
$_mail->SMTPAutoTLS = false;
|
||||
}
|
||||
$_mail->Port = Settings::Get('system.mail_smtp_port');
|
||||
}
|
||||
|
||||
if (\PHPMailer\PHPMailer\PHPMailer::ValidateAddress(Settings::Get('panel.adminmail')) !== false) {
|
||||
// set return-to address and custom sender-name, see #76
|
||||
$_mail->SetFrom(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
|
||||
if (Settings::Get('panel.adminmail_return') != '') {
|
||||
$_mail->AddReplyTo(Settings::Get('panel.adminmail_return'), Settings::Get('panel.adminmail_defname'));
|
||||
}
|
||||
}
|
||||
|
||||
$_mailerror = false;
|
||||
$mailerr_msg = "";
|
||||
try {
|
||||
$_mail->Subject = $subject;
|
||||
$_mail->AltBody = $message;
|
||||
$_mail->MsgHTML(nl2br($message));
|
||||
$_mail->AddAddress(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
|
||||
$_mail->Send();
|
||||
} catch (\PHPMailer\PHPMailer\Exception $e) {
|
||||
$mailerr_msg = $e->errorMessage();
|
||||
$_mailerror = true;
|
||||
} catch (\Exception $e) {
|
||||
$mailerr_msg = $e->getMessage();
|
||||
$_mailerror = true;
|
||||
}
|
||||
|
||||
$_mail->ClearAddresses();
|
||||
|
||||
if ($_mailerror) {
|
||||
echo 'Error sending mail: ' . $mailerr_msg . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
die($message);
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ return array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System::generatePassword(),
|
||||
'value' => \Froxlor\System\Crypt::generatePassword(),
|
||||
),
|
||||
'def_language' => array(
|
||||
'label' => $lng['login']['language'],
|
||||
|
||||
@@ -48,7 +48,7 @@ return array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System::generatePassword(),
|
||||
'value' => \Froxlor\System\Crypt::generatePassword(),
|
||||
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true)
|
||||
),
|
||||
'def_language' => array(
|
||||
|
||||
@@ -62,7 +62,7 @@ return array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System::generatePassword()
|
||||
'value' => \Froxlor\System\Crypt::generatePassword()
|
||||
),
|
||||
'sendpassword' => array(
|
||||
'label' => $lng['admin']['sendpassword'],
|
||||
|
||||
@@ -59,7 +59,7 @@ return array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System::generatePassword(),
|
||||
'value' => \Froxlor\System\Crypt::generatePassword(),
|
||||
),
|
||||
'def_language' => array(
|
||||
'label' => $lng['login']['language'],
|
||||
|
||||
@@ -101,7 +101,7 @@ return array(
|
||||
'desc' => $lng['domains']['ipandport_multi']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => $ipsandports,
|
||||
'value' => explode(',', Settings::Get('system.defaultip')),
|
||||
'value' => explode(',', \Froxlor\Settings::Get('system.defaultip')),
|
||||
'is_array' => 1,
|
||||
'mandatory' => true
|
||||
),
|
||||
@@ -133,7 +133,7 @@ return array(
|
||||
'rows' => 12
|
||||
),
|
||||
'notryfiles' => array(
|
||||
'visible' => (Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'),
|
||||
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'),
|
||||
'label' => $lng['admin']['notryfiles']['title'],
|
||||
'desc' => $lng['admin']['notryfiles']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -174,7 +174,7 @@ return array(
|
||||
'section_bssl' => array(
|
||||
'title' => $lng['admin']['webserversettings_ssl'],
|
||||
'image' => 'icons/domain_add.png',
|
||||
'visible' => Settings::Get('system.use_ssl') == '1' ? true : false,
|
||||
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? true : false,
|
||||
'fields' => array(
|
||||
'ssl_ipandport' => array(
|
||||
'label' => $lng['domains']['ipandport_ssl_multi']['title'],
|
||||
@@ -198,7 +198,7 @@ return array(
|
||||
'value' => array()
|
||||
),
|
||||
'letsencrypt' => array(
|
||||
'visible' => (Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? true : false) : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? true : false) : false),
|
||||
'label' => $lng['admin']['letsencrypt']['title'],
|
||||
'desc' => $lng['admin']['letsencrypt']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -211,7 +211,7 @@ return array(
|
||||
'value' => array()
|
||||
),
|
||||
'http2' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false) && Settings::Get('system.webserver') != 'lighttpd' && Settings::Get('system.http2_support') == '1',
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1',
|
||||
'label' => $lng['admin']['domain_http2']['title'],
|
||||
'desc' => $lng['admin']['domain_http2']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -266,10 +266,10 @@ return array(
|
||||
),
|
||||
'ocsp_stapling' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false) &&
|
||||
Settings::Get('system.webserver') != 'lighttpd',
|
||||
\Froxlor\Settings::Get('system.webserver') != 'lighttpd',
|
||||
'label' => $lng['admin']['domain_ocsp_stapling']['title'],
|
||||
'desc' => $lng['admin']['domain_ocsp_stapling']['description'] .
|
||||
(Settings::Get('system.webserver') == 'nginx' ?
|
||||
(\Froxlor\Settings::Get('system.webserver') == 'nginx' ?
|
||||
$lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] :
|
||||
""),
|
||||
'type' => 'checkbox',
|
||||
@@ -315,18 +315,18 @@ return array(
|
||||
)
|
||||
),
|
||||
'phpsettingid' => array(
|
||||
'visible' => (((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) ? true : false),
|
||||
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs
|
||||
),
|
||||
'mod_fcgid_starter' => array(
|
||||
'visible' => ((int) Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_starter']['title'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'mod_fcgid_maxrequests' => array(
|
||||
'visible' => ((int) Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
|
||||
'type' => 'text'
|
||||
)
|
||||
@@ -335,7 +335,7 @@ return array(
|
||||
'section_d' => array(
|
||||
'title' => $lng['admin']['nameserversettings'],
|
||||
'image' => 'icons/domain_add.png',
|
||||
'visible' => (Settings::Get('system.bind_enable') == '1' && $userinfo['change_serversettings'] == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.bind_enable') == '1' && $userinfo['change_serversettings'] == '1' ? true : false),
|
||||
'fields' => array(
|
||||
'isbinddomain' => array(
|
||||
'label' => 'Nameserver',
|
||||
@@ -391,7 +391,7 @@ return array(
|
||||
'select_var' => $subcanemaildomain
|
||||
),
|
||||
'dkim' => array(
|
||||
'visible' => (Settings::Get('dkim.use_dkim') == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('dkim.use_dkim') == '1' ? true : false),
|
||||
'label' => 'DomainKeys',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
|
||||
@@ -31,7 +31,7 @@ return array(
|
||||
),
|
||||
'customerid' => array(
|
||||
'label' => $lng['admin']['customer'],
|
||||
'type' => (Settings::Get('panel.allow_domain_change_customer') == '1' ? 'select' : 'label'),
|
||||
'type' => (\Froxlor\Settings::Get('panel.allow_domain_change_customer') == '1' ? 'select' : 'label'),
|
||||
'select_var' => (isset($customers) ? $customers : null),
|
||||
'value' => (isset($result['customername']) ? $result['customername'] : null),
|
||||
'mandatory' => true
|
||||
@@ -39,7 +39,7 @@ return array(
|
||||
'adminid' => array(
|
||||
'visible' => ($userinfo['customers_see_all'] == '1' ? true : false),
|
||||
'label' => $lng['admin']['admin'],
|
||||
'type' => (Settings::Get('panel.allow_domain_change_admin') == '1' ? 'select' : 'label'),
|
||||
'type' => (\Froxlor\Settings::Get('panel.allow_domain_change_admin') == '1' ? 'select' : 'label'),
|
||||
'select_var' => (isset($admins) ? $admins : null),
|
||||
'value' => (isset($result['adminname']) ? $result['adminname'] : null),
|
||||
'mandatory' => true
|
||||
@@ -163,7 +163,7 @@ return array(
|
||||
)
|
||||
),
|
||||
'notryfiles' => array(
|
||||
'visible' => (Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'),
|
||||
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'),
|
||||
'label' => $lng['admin']['notryfiles']['title'],
|
||||
'desc' => $lng['admin']['notryfiles']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -206,7 +206,7 @@ return array(
|
||||
'section_bssl' => array(
|
||||
'title' => $lng['admin']['webserversettings_ssl'],
|
||||
'image' => 'icons/domain_edit.png',
|
||||
'visible' => Settings::Get('system.use_ssl') == '1' ? true : false,
|
||||
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? true : false,
|
||||
'fields' => array(
|
||||
'ssl_ipandport' => array(
|
||||
'label' => $lng['domains']['ipandport_ssl_multi']['title'],
|
||||
@@ -232,7 +232,7 @@ return array(
|
||||
)
|
||||
),
|
||||
'letsencrypt' => array(
|
||||
'visible' => (Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? true : false) : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? true : false) : false),
|
||||
'label' => $lng['admin']['letsencrypt']['title'],
|
||||
'desc' => $lng['admin']['letsencrypt']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -247,7 +247,7 @@ return array(
|
||||
)
|
||||
),
|
||||
'http2' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false) && Settings::Get('system.webserver') != 'lighttpd' && Settings::Get('system.http2_support') == '1',
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1',
|
||||
'label' => $lng['admin']['domain_http2']['title'],
|
||||
'desc' => $lng['admin']['domain_http2']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -308,10 +308,10 @@ return array(
|
||||
),
|
||||
'ocsp_stapling' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false) &&
|
||||
Settings::Get('system.webserver') != 'lighttpd',
|
||||
\Froxlor\Settings::Get('system.webserver') != 'lighttpd',
|
||||
'label' => $lng['admin']['domain_ocsp_stapling']['title'],
|
||||
'desc' => $lng['admin']['domain_ocsp_stapling']['description'] .
|
||||
(Settings::Get('system.webserver') == 'nginx' ?
|
||||
(\Froxlor\Settings::Get('system.webserver') == 'nginx' ?
|
||||
$lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] :
|
||||
""),
|
||||
'type' => 'checkbox',
|
||||
@@ -359,7 +359,7 @@ return array(
|
||||
)
|
||||
),
|
||||
'phpsettingid' => array(
|
||||
'visible' => (((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) ? true : false),
|
||||
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs
|
||||
@@ -380,13 +380,13 @@ return array(
|
||||
)
|
||||
),
|
||||
'mod_fcgid_starter' => array(
|
||||
'visible' => ((int) Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => ((int) \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'] : '')
|
||||
),
|
||||
'mod_fcgid_maxrequests' => array(
|
||||
'visible' => ((int) Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => ((int) \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'] : '')
|
||||
@@ -396,7 +396,7 @@ return array(
|
||||
'section_d' => array(
|
||||
'title' => $lng['admin']['nameserversettings'],
|
||||
'image' => 'icons/domain_edit.png',
|
||||
'visible' => (Settings::Get('system.bind_enable') == '1' && $userinfo['change_serversettings'] == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.bind_enable') == '1' && $userinfo['change_serversettings'] == '1' ? true : false),
|
||||
'fields' => array(
|
||||
'isbinddomain' => array(
|
||||
'label' => 'Nameserver',
|
||||
@@ -455,7 +455,7 @@ return array(
|
||||
'select_var' => $subcanemaildomain
|
||||
),
|
||||
'dkim' => array(
|
||||
'visible' => (Settings::Get('dkim.use_dkim') == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('dkim.use_dkim') == '1' ? true : false),
|
||||
'label' => 'DomainKeys',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
|
||||
@@ -106,7 +106,7 @@ return array(
|
||||
'section_d' => array(
|
||||
'title' => $lng['admin']['ipsandports']['webserverssldomainconfig'],
|
||||
'image' => 'icons/ipsports_add.png',
|
||||
'visible' => (Settings::Get('system.use_ssl') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.use_ssl') == 1 ? true : false),
|
||||
'fields' => array(
|
||||
'ssl' => array(
|
||||
'label' => $lng['admin']['ipsandports']['enable_ssl'],
|
||||
|
||||
@@ -111,7 +111,7 @@ return array(
|
||||
'section_d' => array(
|
||||
'title' => $lng['admin']['ipsandports']['webserverssldomainconfig'],
|
||||
'image' => 'icons/ipsports_edit.png',
|
||||
'visible' => (Settings::Get('system.use_ssl') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.use_ssl') == 1 ? true : false),
|
||||
'fields' => array(
|
||||
'ssl' => array(
|
||||
'label' => $lng['admin']['ipsandports']['enable_ssl'],
|
||||
|
||||
@@ -30,20 +30,20 @@ return array(
|
||||
'maxlength' => 50
|
||||
),
|
||||
'binary' => array(
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['binary'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 255,
|
||||
'value' => '/usr/bin/php-cgi'
|
||||
),
|
||||
'fpmconfig' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['fpmdesc'],
|
||||
'type' => 'select',
|
||||
'select_var' => $fpmconfigs
|
||||
),
|
||||
'file_extensions' => array(
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['file_extensions'],
|
||||
'desc' => $lng['admin']['phpsettings']['file_extensions_note'],
|
||||
'type' => 'text',
|
||||
@@ -51,24 +51,24 @@ return array(
|
||||
'value' => 'php'
|
||||
),
|
||||
'mod_fcgid_starter' => array(
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_starter']['title'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'mod_fcgid_maxrequests' => array(
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'mod_fcgid_umask' => array(
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'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' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
@@ -77,21 +77,21 @@ return array(
|
||||
'value' => array()
|
||||
),
|
||||
'phpfpm_reqtermtimeout' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['request_terminate_timeout'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 10,
|
||||
'value' => '60s'
|
||||
),
|
||||
'phpfpm_reqslowtimeout' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['request_slowlog_timeout'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 10,
|
||||
'value' => '5s'
|
||||
),
|
||||
'phpfpm_pass_authorizationheader' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['pass_authorizationheader'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
@@ -100,7 +100,7 @@ return array(
|
||||
'value' => array()
|
||||
),
|
||||
'override_fpmconfig' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
@@ -109,56 +109,56 @@ return array(
|
||||
'value' => array()
|
||||
),
|
||||
'pm' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
|
||||
'type' => 'select',
|
||||
'select_var' => $pm_select
|
||||
),
|
||||
'max_children' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'int',
|
||||
'value' => 1
|
||||
),
|
||||
'start_servers' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'int',
|
||||
'value' => 20
|
||||
),
|
||||
'min_spare_servers' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'int',
|
||||
'value' => 5
|
||||
),
|
||||
'max_spare_servers' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'int',
|
||||
'value' => 35
|
||||
),
|
||||
'max_requests' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'int',
|
||||
'value' => 0
|
||||
),
|
||||
'idle_timeout' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'int',
|
||||
'value' => 30
|
||||
),
|
||||
'limit_extensions' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'text',
|
||||
|
||||
@@ -31,20 +31,20 @@ return array(
|
||||
'value' => $result['description']
|
||||
),
|
||||
'binary' => array(
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['binary'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 255,
|
||||
'value' => $result['binary']
|
||||
),
|
||||
'fpmconfig' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['fpmdesc'],
|
||||
'type' => 'select',
|
||||
'select_var' => $fpmconfigs
|
||||
),
|
||||
'file_extensions' => array(
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['file_extensions'],
|
||||
'desc' => $lng['admin']['phpsettings']['file_extensions_note'],
|
||||
'type' => 'text',
|
||||
@@ -52,26 +52,26 @@ return array(
|
||||
'value' => $result['file_extensions']
|
||||
),
|
||||
'mod_fcgid_starter' => array(
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'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'] : '')
|
||||
),
|
||||
'mod_fcgid_maxrequests' => array(
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'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'] : '')
|
||||
),
|
||||
'mod_fcgid_umask' => array(
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'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' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
@@ -80,21 +80,21 @@ return array(
|
||||
'value' => array($result['fpm_slowlog'])
|
||||
),
|
||||
'phpfpm_reqtermtimeout' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['request_terminate_timeout'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 10,
|
||||
'value' => $result['fpm_reqterm']
|
||||
),
|
||||
'phpfpm_reqslowtimeout' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['request_slowlog_timeout'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 10,
|
||||
'value' => $result['fpm_reqslow']
|
||||
),
|
||||
'phpfpm_pass_authorizationheader' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['pass_authorizationheader'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
@@ -111,56 +111,56 @@ return array(
|
||||
'value' => array($result['override_fpmconfig'])
|
||||
),
|
||||
'pm' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
|
||||
'type' => 'select',
|
||||
'select_var' => $pm_select
|
||||
),
|
||||
'max_children' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'int',
|
||||
'value' => $result['max_children']
|
||||
),
|
||||
'start_servers' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'int',
|
||||
'value' => $result['start_servers']
|
||||
),
|
||||
'min_spare_servers' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'int',
|
||||
'value' => $result['min_spare_servers']
|
||||
),
|
||||
'max_spare_servers' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'int',
|
||||
'value' => $result['max_spare_servers']
|
||||
),
|
||||
'max_requests' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'int',
|
||||
'value' => $result['max_requests']
|
||||
),
|
||||
'idle_timeout' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'int',
|
||||
'value' => $result['idle_timeout']
|
||||
),
|
||||
'limit_extensions' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'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'],
|
||||
'type' => 'text',
|
||||
|
||||
@@ -43,18 +43,18 @@ return array(
|
||||
),
|
||||
'path' => array(
|
||||
'label' => $lng['panel']['path'],
|
||||
'desc' => (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']
|
||||
),
|
||||
'url' => array(
|
||||
'visible' => (Settings::Get('panel.pathedit') == 'Dropdown' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('panel.pathedit') == 'Dropdown' ? true : false),
|
||||
'label' => $lng['panel']['urloverridespath'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'redirectcode' => array(
|
||||
'visible' => (Settings::Get('customredirect.enabled') == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('customredirect.enabled') == '1' ? true : false),
|
||||
'label' => $lng['domains']['redirectifpathisurl'],
|
||||
'desc' => $lng['domains']['redirectifpathisurlinfo'],
|
||||
'type' => 'select',
|
||||
@@ -72,7 +72,7 @@ return array(
|
||||
'select_var' => $openbasedir
|
||||
),
|
||||
'phpsettingid' => array(
|
||||
'visible' => (((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) && $has_phpconfigs ? true : false),
|
||||
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) && $has_phpconfigs ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs
|
||||
@@ -82,7 +82,7 @@ return array(
|
||||
'section_bssl' => array(
|
||||
'title' => $lng['admin']['webserversettings_ssl'],
|
||||
'image' => 'icons/domain_add.png',
|
||||
'visible' => Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? true : false) : false,
|
||||
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? true : false) : false,
|
||||
'fields' => array(
|
||||
'ssl_redirect' => array(
|
||||
'label' => $lng['domains']['ssl_redirect']['title'],
|
||||
@@ -94,7 +94,7 @@ return array(
|
||||
'value' => array()
|
||||
),
|
||||
'letsencrypt' => array(
|
||||
'visible' => (Settings::Get('system.leenabled') == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.leenabled') == '1' ? true : false),
|
||||
'label' => $lng['customer']['letsencrypt']['title'],
|
||||
'desc' => $lng['customer']['letsencrypt']['description'],
|
||||
'type' => 'checkbox',
|
||||
|
||||
@@ -42,19 +42,19 @@ return array(
|
||||
),
|
||||
'path' => array(
|
||||
'label' => $lng['panel']['path'],
|
||||
'desc' => (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']
|
||||
),
|
||||
'url' => array(
|
||||
'visible' => (Settings::Get('panel.pathedit') == 'Dropdown' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('panel.pathedit') == 'Dropdown' ? true : false),
|
||||
'label' => $lng['panel']['urloverridespath'],
|
||||
'type' => 'text',
|
||||
'value' => $urlvalue
|
||||
),
|
||||
'redirectcode' => array(
|
||||
'visible' => (Settings::Get('customredirect.enabled') == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('customredirect.enabled') == '1' ? true : false),
|
||||
'label' => $lng['domains']['redirectifpathisurl'],
|
||||
'desc' => $lng['domains']['redirectifpathisurlinfo'],
|
||||
'type' => 'select',
|
||||
@@ -83,7 +83,7 @@ return array(
|
||||
'select_var' => $openbasedir
|
||||
),
|
||||
'phpsettingid' => array(
|
||||
'visible' => (((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) && $has_phpconfigs ? true : false),
|
||||
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) && $has_phpconfigs ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs
|
||||
@@ -93,7 +93,7 @@ return array(
|
||||
'section_bssl' => array(
|
||||
'title' => $lng['admin']['webserversettings_ssl'],
|
||||
'image' => 'icons/domain_edit.png',
|
||||
'visible' => Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? (domainHasSslIpPort($result['id']) ? true : false) : false) : false,
|
||||
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? (domainHasSslIpPort($result['id']) ? true : false) : false) : false,
|
||||
'fields' => array(
|
||||
'ssl_redirect' => array(
|
||||
'label' => $lng['domains']['ssl_redirect']['title'],
|
||||
@@ -105,7 +105,7 @@ return array(
|
||||
'value' => array($result['ssl_redirect'])
|
||||
),
|
||||
'letsencrypt' => array(
|
||||
'visible' => Settings::Get('system.leenabled') == '1' ? true : false,
|
||||
'visible' => \Froxlor\Settings::Get('system.leenabled') == '1' ? true : false,
|
||||
'label' => $lng['customer']['letsencrypt']['title'],
|
||||
'desc' => $lng['customer']['letsencrypt']['description'],
|
||||
'type' => 'checkbox',
|
||||
|
||||
@@ -37,8 +37,8 @@ return array(
|
||||
'email_password_suggestion' => array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System::generatePassword(),
|
||||
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System\Crypt::generatePassword(),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -37,18 +37,18 @@ return array(
|
||||
'email_password_suggestion' => array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System::generatePassword(),
|
||||
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System\Crypt::generatePassword(),
|
||||
),
|
||||
'email_quota' => array(
|
||||
'visible' => (Settings::Get('system.mail_quota_enabled') == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false),
|
||||
'label' => $lng['emails']['quota'],
|
||||
'desc' => "MiB",
|
||||
'type' => 'text',
|
||||
'value' => $quota
|
||||
),
|
||||
'alternative_email' => array(
|
||||
'visible' => (Settings::Get('panel.sendalternativemail') == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('panel.sendalternativemail') == '1' ? true : false),
|
||||
'label' => $lng['emails']['alternative_emailaddress'],
|
||||
'type' => 'text'
|
||||
)
|
||||
|
||||
@@ -43,7 +43,7 @@ return array(
|
||||
'value' => $lng['panel']['no'].' [<a href="'.$filename.'?page=accounts&action=add&id='.$result['id'].'&s='.$s.'">'.$lng['emails']['account_add'].'</a>]'
|
||||
),
|
||||
'mail_quota' => array(
|
||||
'visible' => ($result['popaccountid'] != 0 && Settings::Get('system.mail_quota_enabled')),
|
||||
'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&action=changequota&id='.$result['id'].'&s='.$s.'">'.$lng['emails']['quota_edit'].'</a>]'
|
||||
|
||||
@@ -25,7 +25,7 @@ return array(
|
||||
'fields' => array(
|
||||
'path' => array(
|
||||
'label' => $lng['panel']['backuppath']['title'],
|
||||
'desc' => $lng['panel']['backuppath']['description'].'<br>'.(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']
|
||||
|
||||
@@ -26,7 +26,7 @@ return array(
|
||||
'fields' => array(
|
||||
'path' => array(
|
||||
'label' => $lng['panel']['path'],
|
||||
'desc' => (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']
|
||||
@@ -45,13 +45,13 @@ return array(
|
||||
'type' => 'text'
|
||||
),
|
||||
'error403path' => array(
|
||||
'visible' => (Settings::Get('system.webserver') == 'apache2'),
|
||||
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'apache2'),
|
||||
'label' => $lng['extras']['errordocument403path'],
|
||||
'desc' => $lng['panel']['descriptionerrordocument'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'error500path' => array(
|
||||
'visible' => (Settings::Get('system.webserver') == 'apache2'),
|
||||
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'apache2'),
|
||||
'label' => $lng['extras']['errordocument500path'],
|
||||
'desc' => $lng['panel']['descriptionerrordocument'],
|
||||
'type' => 'text'
|
||||
|
||||
@@ -44,14 +44,14 @@ return array(
|
||||
'value' => $result['error404path']
|
||||
),
|
||||
'error403path' => array(
|
||||
'visible' => (Settings::Get('system.webserver') == 'apache2'),
|
||||
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'apache2'),
|
||||
'label' => $lng['extras']['errordocument403path'],
|
||||
'desc' => $lng['panel']['descriptionerrordocument'],
|
||||
'type' => 'text',
|
||||
'value' => $result['error403path']
|
||||
),
|
||||
'error500path' => array(
|
||||
'visible' => (Settings::Get('system.webserver') == 'apache2'),
|
||||
'visible' => (\Froxlor\Settings::Get('system.webserver') == 'apache2'),
|
||||
'label' => $lng['extras']['errordocument500path'],
|
||||
'desc' => $lng['panel']['descriptionerrordocument'],
|
||||
'type' => 'text',
|
||||
|
||||
@@ -26,7 +26,7 @@ return array(
|
||||
'fields' => array(
|
||||
'path' => array(
|
||||
'label' => $lng['panel']['path'],
|
||||
'desc' => (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']
|
||||
@@ -43,8 +43,8 @@ return array(
|
||||
'directory_password_suggestion' => array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System::generatePassword(),
|
||||
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System\Crypt::generatePassword(),
|
||||
),
|
||||
'directory_authname' => array(
|
||||
'label' => $lng['extras']['htpasswdauthname'],
|
||||
|
||||
@@ -42,8 +42,8 @@ return array(
|
||||
'directory_password_suggestion' => array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System::generatePassword(),
|
||||
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System\Crypt::generatePassword(),
|
||||
),
|
||||
'directory_authname' => array(
|
||||
'label' => $lng['extras']['htpasswdauthname'],
|
||||
|
||||
@@ -24,12 +24,12 @@ return array(
|
||||
'image' => 'icons/user_add.png',
|
||||
'fields' => array(
|
||||
'ftp_username' => array(
|
||||
'visible' => (Settings::Get('customer.ftpatdomain') == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('customer.ftpatdomain') == '1' ? true : false),
|
||||
'label' => $lng['login']['username'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'ftp_domain' => array(
|
||||
'visible' => (Settings::Get('customer.ftpatdomain') == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('customer.ftpatdomain') == '1' ? true : false),
|
||||
'label' => $lng['domains']['domainname'],
|
||||
'type' => 'select',
|
||||
'select_var' => (isset($domains) ? $domains : ""),
|
||||
@@ -40,7 +40,7 @@ return array(
|
||||
),
|
||||
'path' => array(
|
||||
'label' => $lng['panel']['path'],
|
||||
'desc' => (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']
|
||||
@@ -53,8 +53,8 @@ return array(
|
||||
'ftp_password_suggestion' => array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System::generatePassword(),
|
||||
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System\Crypt::generatePassword(),
|
||||
),
|
||||
'sendinfomail' => array(
|
||||
'label' => $lng['customer']['sendinfomail'],
|
||||
@@ -65,7 +65,7 @@ return array(
|
||||
'value' => array()
|
||||
),
|
||||
'shell' => array(
|
||||
'visible' => (Settings::Get('system.allow_customer_shell') == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.allow_customer_shell') == '1' ? true : false),
|
||||
'label' => $lng['panel']['shell'],
|
||||
'type' => 'select',
|
||||
'select_var' => (isset($shells) ? $shells : ""),
|
||||
|
||||
@@ -35,7 +35,7 @@ return array(
|
||||
),
|
||||
'path' => array(
|
||||
'label' => $lng['panel']['path'],
|
||||
'desc' => (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']
|
||||
@@ -49,11 +49,11 @@ return array(
|
||||
'ftp_password_suggestion' => array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System::generatePassword(),
|
||||
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System\Crypt::generatePassword(),
|
||||
),
|
||||
'shell' => array(
|
||||
'visible' => (Settings::Get('system.allow_customer_shell') == '1' ? true : false),
|
||||
'visible' => (\Froxlor\Settings::Get('system.allow_customer_shell') == '1' ? true : false),
|
||||
'label' => $lng['panel']['shell'],
|
||||
'type' => 'select',
|
||||
'select_var' => (isset($shells) ? $shells : ""),
|
||||
|
||||
@@ -40,8 +40,8 @@ return array(
|
||||
'mysql_password_suggestion' => array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System::generatePassword()
|
||||
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System\Crypt::generatePassword()
|
||||
),
|
||||
'sendinfomail' => array(
|
||||
'label' => $lng['customer']['sendinfomail'],
|
||||
|
||||
@@ -46,8 +46,8 @@ return array(
|
||||
'mysql_password_suggestion' => array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System::generatePassword()
|
||||
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
|
||||
'value' => \Froxlor\System\Crypt::generatePassword()
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Functions
|
||||
*
|
||||
*/
|
||||
|
||||
function getCronjobsLastRun() {
|
||||
|
||||
global $lng;
|
||||
|
||||
$query = "SELECT `lastrun`, `desc_lng_key` FROM `".TABLE_PANEL_CRONRUNS."` WHERE `isactive` = '1' ORDER BY `cronfile` ASC";
|
||||
$result = Database::query($query);
|
||||
|
||||
$cronjobs_last_run = '';
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$lastrun = $lng['cronjobs']['notyetrun'];
|
||||
if ($row['lastrun'] > 0) {
|
||||
$lastrun = date('d.m.Y H:i:s', $row['lastrun']);
|
||||
}
|
||||
|
||||
$text = $lng['crondesc'][$row['desc_lng_key']];
|
||||
$value = $lastrun;
|
||||
|
||||
eval("\$cronjobs_last_run .= \"" . getTemplate("index/overview_item") . "\";");
|
||||
}
|
||||
|
||||
return $cronjobs_last_run;
|
||||
}
|
||||
|
||||
function toggleCronStatus($module = null, $isactive = 0) {
|
||||
|
||||
if($isactive != 1) {
|
||||
$isactive = 0;
|
||||
}
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `".TABLE_PANEL_CRONRUNS."` SET `isactive` = :active WHERE `module` = :module"
|
||||
);
|
||||
Database::pexecute($upd_stmt, array('active' => $isactive, 'module' => $module));
|
||||
}
|
||||
|
||||
function getOutstandingTasks() {
|
||||
|
||||
global $lng;
|
||||
|
||||
$query = "SELECT * FROM `".TABLE_PANEL_TASKS."` ORDER BY `type` ASC";
|
||||
$result = Database::query($query);
|
||||
|
||||
$value = '<ul class="cronjobtask">';
|
||||
$tasks = '';
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
if ($row['data'] != '') {
|
||||
$row['data'] = json_decode($row['data'], true);
|
||||
}
|
||||
|
||||
// rebuilding webserver-configuration
|
||||
if ($row['type'] == '1') {
|
||||
$task_desc = $lng['tasks']['rebuild_webserverconfig'];
|
||||
}
|
||||
// adding new user/
|
||||
elseif ($row['type'] == '2') {
|
||||
$loginname = '';
|
||||
if (is_array($row['data'])) {
|
||||
$loginname = $row['data']['loginname'];
|
||||
}
|
||||
$task_desc = $lng['tasks']['adding_customer'];
|
||||
$task_desc = str_replace('%loginname%', $loginname, $task_desc);
|
||||
}
|
||||
// rebuilding bind-configuration
|
||||
elseif ($row['type'] == '4') {
|
||||
$task_desc = $lng['tasks']['rebuild_bindconfig'];
|
||||
}
|
||||
// creating ftp-user directory
|
||||
elseif ($row['type'] == '5') {
|
||||
$task_desc = $lng['tasks']['creating_ftpdir'];
|
||||
}
|
||||
// deleting user-files
|
||||
elseif ($row['type'] == '6') {
|
||||
$loginname = '';
|
||||
if (is_array($row['data'])) {
|
||||
$loginname = $row['data']['loginname'];
|
||||
}
|
||||
$task_desc = $lng['tasks']['deleting_customerfiles'];
|
||||
$task_desc = str_replace('%loginname%', $loginname, $task_desc);
|
||||
}
|
||||
// deleting email-account
|
||||
elseif ($row['type'] == '7') {
|
||||
$task_desc = $lng['tasks']['remove_emailacc_files'];
|
||||
}
|
||||
// deleting ftp-account
|
||||
elseif ($row['type'] == '8') {
|
||||
$task_desc = $lng['tasks']['remove_ftpacc_files'];
|
||||
}
|
||||
// Set FS - quota
|
||||
elseif ($row['type'] == '10') {
|
||||
$task_desc = $lng['tasks']['diskspace_set_quota'];
|
||||
}
|
||||
// deleting user-files
|
||||
elseif ($row['type'] == '20') {
|
||||
$loginname = '';
|
||||
if (is_array($row['data'])) {
|
||||
$loginname = $row['data']['loginname'];
|
||||
}
|
||||
$task_desc = $lng['tasks']['backup_customerfiles'];
|
||||
$task_desc = str_replace('%loginname%', $loginname, $task_desc);
|
||||
}
|
||||
// re-generating of cron.d-file
|
||||
elseif ($row['type'] == '99') {
|
||||
$task_desc = $lng['tasks']['regenerating_crond'];
|
||||
}
|
||||
// unknown
|
||||
else {
|
||||
$task_desc = "ERROR: Unknown task type '".$row['type']."'";
|
||||
}
|
||||
|
||||
if($task_desc != '') {
|
||||
$tasks .= '<li>'.$task_desc.'</li>';
|
||||
}
|
||||
}
|
||||
|
||||
if (trim($tasks) == '') {
|
||||
$value .= '<li>'.$lng['tasks']['noneoutstanding'].'</li>';
|
||||
} else {
|
||||
$value .= $tasks;
|
||||
}
|
||||
|
||||
$value .= '</ul>';
|
||||
$text = $lng['tasks']['outstanding_tasks'];
|
||||
eval("\$outstanding_tasks = \"" . getTemplate("index/overview_item") . "\";");
|
||||
|
||||
return $outstanding_tasks;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ function validatePasswordLogin($userinfo = null, $password = null, $table = 'pan
|
||||
UPDATE " . $table . " SET `password` = :newpasswd WHERE `" . $uid . "` = :uid
|
||||
");
|
||||
$params = array (
|
||||
'newpasswd' => \Froxlor\System::makeCryptPassword($password),
|
||||
'newpasswd' => \Froxlor\System\Crypt::makeCryptPassword($password),
|
||||
'uid' => $userinfo[$uid]
|
||||
);
|
||||
Database::pexecute($upd_stmt, $params);
|
||||
|
||||
@@ -377,7 +377,7 @@ class MailsTest extends TestCase
|
||||
|
||||
$data = [
|
||||
'emailaddr' => 'info@test2.local',
|
||||
'email_password' => \Froxlor\System::generatePassword(),
|
||||
'email_password' => \Froxlor\System\Crypt::generatePassword(),
|
||||
'alternative_email' => 'noone@example.com',
|
||||
'email_quota' => 1337,
|
||||
'sendinfomail' => TRAVIS_CI == 1 ? 0 : 1
|
||||
@@ -399,7 +399,7 @@ class MailsTest extends TestCase
|
||||
|
||||
$data = [
|
||||
'emailaddr' => 'info@test2.local',
|
||||
'email_password' => \Froxlor\System::generatePassword(),
|
||||
'email_password' => \Froxlor\System\Crypt::generatePassword(),
|
||||
'alternative_email' => 'noone@example.com',
|
||||
'email_quota' => 1338
|
||||
];
|
||||
@@ -459,7 +459,7 @@ class MailsTest extends TestCase
|
||||
// add account
|
||||
$data = [
|
||||
'emailaddr' => 'info@test2.local',
|
||||
'email_password' => \Froxlor\System::generatePassword(),
|
||||
'email_password' => \Froxlor\System\Crypt::generatePassword(),
|
||||
'alternative_email' => 'noone@example.com',
|
||||
'sendinfomail' => TRAVIS_CI == 1 ? 0 : 1
|
||||
];
|
||||
|
||||
@@ -27,7 +27,7 @@ class DirProtectionsTest extends TestCase
|
||||
$data = [
|
||||
'path' => '/test',
|
||||
'username' => 'testing',
|
||||
'directory_password' => \Froxlor\System::generatePassword(),
|
||||
'directory_password' => \Froxlor\System\Crypt::generatePassword(),
|
||||
'directory_authname' => 'test1'
|
||||
];
|
||||
$json_result = DirProtections::getLocal($customer_userdata, $data)->add();
|
||||
@@ -49,7 +49,7 @@ class DirProtectionsTest extends TestCase
|
||||
$data = [
|
||||
'path' => '/test',
|
||||
'username' => 'testing',
|
||||
'directory_password' => \Froxlor\System::generatePassword(),
|
||||
'directory_password' => \Froxlor\System\Crypt::generatePassword(),
|
||||
'directory_authname' => 'test2'
|
||||
];
|
||||
$this->expectExceptionMessage("Combination of username and path already exists");
|
||||
@@ -65,7 +65,7 @@ class DirProtectionsTest extends TestCase
|
||||
'loginname' => 'test1'
|
||||
))->get();
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
$up = \Froxlor\System::generatePassword();
|
||||
$up = \Froxlor\System\Crypt::generatePassword();
|
||||
$data = [
|
||||
'path' => '/test',
|
||||
'username' => $up,
|
||||
@@ -146,7 +146,7 @@ class DirProtectionsTest extends TestCase
|
||||
|
||||
$data = [
|
||||
'id' => 1,
|
||||
'directory_password' => \Froxlor\System::generatePassword(),
|
||||
'directory_password' => \Froxlor\System\Crypt::generatePassword(),
|
||||
'directory_authname' => 'test1337'
|
||||
];
|
||||
$json_result = DirProtections::getLocal($customer_userdata, $data)->update();
|
||||
|
||||
@@ -27,7 +27,7 @@ class MysqlsTest extends TestCase
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
|
||||
$data = [
|
||||
'mysql_password' => \Froxlor\System::generatePassword(),
|
||||
'mysql_password' => \Froxlor\System\Crypt::generatePassword(),
|
||||
'description' => 'testdb',
|
||||
'sendinfomail' => TRAVIS_CI == 1 ? 0 : 1
|
||||
];
|
||||
@@ -103,7 +103,7 @@ class MysqlsTest extends TestCase
|
||||
|
||||
$data = [
|
||||
'dbname' => 'test1sql1',
|
||||
'mysql_password' => \Froxlor\System::generatePassword(),
|
||||
'mysql_password' => \Froxlor\System\Crypt::generatePassword(),
|
||||
'description' => 'testdb-upd',
|
||||
'loginname' => 'test1'
|
||||
];
|
||||
|
||||
@@ -69,7 +69,7 @@ Database::query("ALTER TABLE `" . TABLE_PANEL_FPMDAEMONS . "` AUTO_INCREMENT=2;"
|
||||
// add superadmin
|
||||
Database::query("INSERT INTO `" . TABLE_PANEL_ADMINS . "` SET
|
||||
`loginname` = 'admin',
|
||||
`password` = '" . makeCryptPassword('admin') . "',
|
||||
`password` = '" . \Froxlor\System\Crypt::makeCryptPassword('admin') . "',
|
||||
`name` = 'Froxlor-Administrator',
|
||||
`email` = 'admin@dev.froxlor.org',
|
||||
`def_language` = 'English',
|
||||
|
||||
Reference in New Issue
Block a user