diff --git a/actions/admin/settings/210.security.php b/actions/admin/settings/210.security.php index dfc55981..868a1525 100644 --- a/actions/admin/settings/210.security.php +++ b/actions/admin/settings/210.security.php @@ -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( diff --git a/admin_index.php b/admin_index.php index 652c2a90..47f4fcbe 100644 --- a/admin_index.php +++ b/admin_index.php @@ -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")); diff --git a/customer_index.php b/customer_index.php index 8ad1b638..0d3c01bf 100644 --- a/customer_index.php +++ b/customer_index.php @@ -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 diff --git a/index.php b/index.php index 6e2220cb..7c3917c0 100644 --- a/index.php +++ b/index.php @@ -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'] )); diff --git a/lib/Froxlor/Api/Commands/Admins.php b/lib/Froxlor/Api/Commands/Admins.php index 899a5e8c..9b84904f 100644 --- a/lib/Froxlor/Api/Commands/Admins.php +++ b/lib/Froxlor/Api/Commands/Admins.php @@ -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']; } diff --git a/lib/Froxlor/Api/Commands/Customers.php b/lib/Froxlor/Api/Commands/Customers.php index 09bb968c..540fa194 100644 --- a/lib/Froxlor/Api/Commands/Customers.php +++ b/lib/Froxlor/Api/Commands/Customers.php @@ -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']; } diff --git a/lib/Froxlor/Api/Commands/EmailAccounts.php b/lib/Froxlor/Api/Commands/EmailAccounts.php index b675c3e3..89535007 100644 --- a/lib/Froxlor/Api/Commands/EmailAccounts.php +++ b/lib/Froxlor/Api/Commands/EmailAccounts.php @@ -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') { diff --git a/lib/Froxlor/Api/Commands/Ftps.php b/lib/Froxlor/Api/Commands/Ftps.php index 1cdb1064..67262314 100644 --- a/lib/Froxlor/Api/Commands/Ftps.php +++ b/lib/Froxlor/Api/Commands/Ftps.php @@ -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 diff --git a/lib/Froxlor/Settings/Store.php b/lib/Froxlor/Settings/Store.php index ee5e0741..bd8854ac 100644 --- a/lib/Froxlor/Settings/Store.php +++ b/lib/Froxlor/Settings/Store.php @@ -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); } /* diff --git a/lib/Froxlor/System/Cronjob.php b/lib/Froxlor/System/Cronjob.php new file mode 100644 index 00000000..2e7d73f1 --- /dev/null +++ b/lib/Froxlor/System/Cronjob.php @@ -0,0 +1,194 @@ +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 = ''; + $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); + } +} \ No newline at end of file diff --git a/lib/Froxlor/System.php b/lib/Froxlor/System/Crypt.php similarity index 64% rename from lib/Froxlor/System.php rename to lib/Froxlor/System/Crypt.php index 188a585f..0bb3646c 100644 --- a/lib/Froxlor/System.php +++ b/lib/Froxlor/System/Crypt.php @@ -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); - } } \ No newline at end of file diff --git a/lib/formfields/admin/admin/formfield.admin_add.php b/lib/formfields/admin/admin/formfield.admin_add.php index 7cad9872..82eb9939 100644 --- a/lib/formfields/admin/admin/formfield.admin_add.php +++ b/lib/formfields/admin/admin/formfield.admin_add.php @@ -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'], diff --git a/lib/formfields/admin/admin/formfield.admin_edit.php b/lib/formfields/admin/admin/formfield.admin_edit.php index d14e3699..f081d0a2 100644 --- a/lib/formfields/admin/admin/formfield.admin_edit.php +++ b/lib/formfields/admin/admin/formfield.admin_edit.php @@ -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( diff --git a/lib/formfields/admin/customer/formfield.customer_add.php b/lib/formfields/admin/customer/formfield.customer_add.php index 7533d82a..c67f32c8 100644 --- a/lib/formfields/admin/customer/formfield.customer_add.php +++ b/lib/formfields/admin/customer/formfield.customer_add.php @@ -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'], diff --git a/lib/formfields/admin/customer/formfield.customer_edit.php b/lib/formfields/admin/customer/formfield.customer_edit.php index 0a9a7d11..2202a1de 100644 --- a/lib/formfields/admin/customer/formfield.customer_edit.php +++ b/lib/formfields/admin/customer/formfield.customer_edit.php @@ -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'], diff --git a/lib/formfields/admin/domains/formfield.domains_add.php b/lib/formfields/admin/domains/formfield.domains_add.php index dfaa8c0d..0fe4bbe8 100644 --- a/lib/formfields/admin/domains/formfield.domains_add.php +++ b/lib/formfields/admin/domains/formfield.domains_add.php @@ -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( diff --git a/lib/formfields/admin/domains/formfield.domains_edit.php b/lib/formfields/admin/domains/formfield.domains_edit.php index 73f1fdf5..c80cc7e1 100644 --- a/lib/formfields/admin/domains/formfield.domains_edit.php +++ b/lib/formfields/admin/domains/formfield.domains_edit.php @@ -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( diff --git a/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php b/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php index 9dd24326..0f9074a6 100644 --- a/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php +++ b/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php @@ -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'], diff --git a/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php b/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php index f52a8230..1fc75d0f 100644 --- a/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php +++ b/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php @@ -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'], diff --git a/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php b/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php index b458e104..9c977bac 100644 --- a/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php +++ b/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php @@ -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', diff --git a/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php b/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php index 080a80d7..a96eaa35 100644 --- a/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php +++ b/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php @@ -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', diff --git a/lib/formfields/customer/domains/formfield.domains_add.php b/lib/formfields/customer/domains/formfield.domains_add.php index ad660098..f516baf1 100644 --- a/lib/formfields/customer/domains/formfield.domains_add.php +++ b/lib/formfields/customer/domains/formfield.domains_add.php @@ -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'].'
'.$pathSelect['value'] : ''), + 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null).(isset($pathSelect['note']) ? $pathSelect['note'].'
'.$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', diff --git a/lib/formfields/customer/domains/formfield.domains_edit.php b/lib/formfields/customer/domains/formfield.domains_edit.php index 31910123..85e4b4b2 100644 --- a/lib/formfields/customer/domains/formfield.domains_edit.php +++ b/lib/formfields/customer/domains/formfield.domains_edit.php @@ -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']) ? '
'.$pathSelect['value'] : ''), + 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null).(isset($pathSelect['note']) ? '
'.$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', diff --git a/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php b/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php index ae0f3176..e92c8bf1 100644 --- a/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php +++ b/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php @@ -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(), ) ) ) diff --git a/lib/formfields/customer/email/formfield.emails_addaccount.php b/lib/formfields/customer/email/formfield.emails_addaccount.php index ed40dd93..61751850 100644 --- a/lib/formfields/customer/email/formfield.emails_addaccount.php +++ b/lib/formfields/customer/email/formfield.emails_addaccount.php @@ -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' ) diff --git a/lib/formfields/customer/email/formfield.emails_edit.php b/lib/formfields/customer/email/formfield.emails_edit.php index f87af846..b0befd21 100644 --- a/lib/formfields/customer/email/formfield.emails_edit.php +++ b/lib/formfields/customer/email/formfield.emails_edit.php @@ -43,7 +43,7 @@ return array( 'value' => $lng['panel']['no'].' ['.$lng['emails']['account_add'].']' ), '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 ['.$lng['emails']['quota_edit'].']' diff --git a/lib/formfields/customer/extras/formfield.backup.php b/lib/formfields/customer/extras/formfield.backup.php index 1cc11b87..99bcdf0f 100644 --- a/lib/formfields/customer/extras/formfield.backup.php +++ b/lib/formfields/customer/extras/formfield.backup.php @@ -25,7 +25,7 @@ return array( 'fields' => array( 'path' => array( 'label' => $lng['panel']['backuppath']['title'], - 'desc' => $lng['panel']['backuppath']['description'].'
'.(Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$pathSelect['value'] : ''), + 'desc' => $lng['panel']['backuppath']['description'].'
'.(\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$pathSelect['value'] : ''), 'type' => $pathSelect['type'], 'select_var' => $pathSelect['value'], 'value' => $pathSelect['value'] diff --git a/lib/formfields/customer/extras/formfield.htaccess_add.php b/lib/formfields/customer/extras/formfield.htaccess_add.php index ab53337c..8c736353 100644 --- a/lib/formfields/customer/extras/formfield.htaccess_add.php +++ b/lib/formfields/customer/extras/formfield.htaccess_add.php @@ -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']) ? '
'.$pathSelect['value'] : ''), + 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$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' diff --git a/lib/formfields/customer/extras/formfield.htaccess_edit.php b/lib/formfields/customer/extras/formfield.htaccess_edit.php index e2364813..ffc84787 100644 --- a/lib/formfields/customer/extras/formfield.htaccess_edit.php +++ b/lib/formfields/customer/extras/formfield.htaccess_edit.php @@ -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', diff --git a/lib/formfields/customer/extras/formfield.htpasswd_add.php b/lib/formfields/customer/extras/formfield.htpasswd_add.php index 53236ac6..82b6d325 100644 --- a/lib/formfields/customer/extras/formfield.htpasswd_add.php +++ b/lib/formfields/customer/extras/formfield.htpasswd_add.php @@ -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']) ? '
'.$pathSelect['value'] : ''), + 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$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'], diff --git a/lib/formfields/customer/extras/formfield.htpasswd_edit.php b/lib/formfields/customer/extras/formfield.htpasswd_edit.php index 924bc8e4..2458a00e 100644 --- a/lib/formfields/customer/extras/formfield.htpasswd_edit.php +++ b/lib/formfields/customer/extras/formfield.htpasswd_edit.php @@ -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'], diff --git a/lib/formfields/customer/ftp/formfield.ftp_add.php b/lib/formfields/customer/ftp/formfield.ftp_add.php index 9b554dcb..56ccb97f 100644 --- a/lib/formfields/customer/ftp/formfield.ftp_add.php +++ b/lib/formfields/customer/ftp/formfield.ftp_add.php @@ -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']) ? '
'.$pathSelect['value'] : ''), + 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$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 : ""), diff --git a/lib/formfields/customer/ftp/formfield.ftp_edit.php b/lib/formfields/customer/ftp/formfield.ftp_edit.php index 837e4aba..c403bce6 100644 --- a/lib/formfields/customer/ftp/formfield.ftp_edit.php +++ b/lib/formfields/customer/ftp/formfield.ftp_edit.php @@ -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']) ? '
'.$pathSelect['value'] : ''), + 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$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 : ""), diff --git a/lib/formfields/customer/mysql/formfield.mysql_add.php b/lib/formfields/customer/mysql/formfield.mysql_add.php index 440b1b2b..e6fe207c 100644 --- a/lib/formfields/customer/mysql/formfield.mysql_add.php +++ b/lib/formfields/customer/mysql/formfield.mysql_add.php @@ -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'], diff --git a/lib/formfields/customer/mysql/formfield.mysql_edit.php b/lib/formfields/customer/mysql/formfield.mysql_edit.php index 6fcca062..44443ea6 100644 --- a/lib/formfields/customer/mysql/formfield.mysql_edit.php +++ b/lib/formfields/customer/mysql/formfield.mysql_edit.php @@ -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() ) ) ) diff --git a/lib/functions/froxlor/function.CronjobFunctions.php b/lib/functions/froxlor/function.CronjobFunctions.php deleted file mode 100644 index 0b5f80ff..00000000 --- a/lib/functions/froxlor/function.CronjobFunctions.php +++ /dev/null @@ -1,145 +0,0 @@ - (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 = ''; - $text = $lng['tasks']['outstanding_tasks']; - eval("\$outstanding_tasks = \"" . getTemplate("index/overview_item") . "\";"); - - return $outstanding_tasks; -} diff --git a/lib/functions/validate/function.validatePasswordLogin.php b/lib/functions/validate/function.validatePasswordLogin.php index e42a5753..3a601e66 100644 --- a/lib/functions/validate/function.validatePasswordLogin.php +++ b/lib/functions/validate/function.validatePasswordLogin.php @@ -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); diff --git a/tests/Emails/EmailsTest.php b/tests/Emails/EmailsTest.php index 8c840ba0..a7b64306 100644 --- a/tests/Emails/EmailsTest.php +++ b/tests/Emails/EmailsTest.php @@ -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 ]; diff --git a/tests/Extras/DirProtectionsTest.php b/tests/Extras/DirProtectionsTest.php index 06d3810f..053d3f38 100644 --- a/tests/Extras/DirProtectionsTest.php +++ b/tests/Extras/DirProtectionsTest.php @@ -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(); diff --git a/tests/Mysqls/MysqlsTest.php b/tests/Mysqls/MysqlsTest.php index ad5e387a..08117055 100644 --- a/tests/Mysqls/MysqlsTest.php +++ b/tests/Mysqls/MysqlsTest.php @@ -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' ]; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index f89ec4a5..c72120b7 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -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',