From 25d9c52c5834f82a33b65b473d531f03a8a21896 Mon Sep 17 00:00:00 2001 From: Dennis Dudek Date: Thu, 14 Apr 2022 09:02:10 +0200 Subject: [PATCH] remove unnecessary ternaries (#1027) * remove unnecessary ternaries * fix: !($id <= 0); * remove ternary --- admin_settings.php | 2 +- admin_templates.php | 2 +- .../updates/froxlor/0.9/update_0.9.inc.php | 4 +- install/updates/preconfig.php | 2 +- lib/Froxlor/Api/Commands/Admins.php | 22 +++--- lib/Froxlor/Api/Commands/Certificates.php | 18 ++--- lib/Froxlor/Api/Commands/Customers.php | 30 ++++---- lib/Froxlor/Api/Commands/DirProtections.php | 18 ++--- lib/Froxlor/Api/Commands/DomainZones.php | 20 ++--- lib/Froxlor/Api/Commands/Domains.php | 20 ++--- lib/Froxlor/Api/Commands/EmailAccounts.php | 18 ++--- lib/Froxlor/Api/Commands/EmailForwarders.php | 18 ++--- lib/Froxlor/Api/Commands/Emails.php | 20 ++--- lib/Froxlor/Api/Commands/Ftps.php | 18 ++--- lib/Froxlor/Api/Commands/HostingPlans.php | 18 ++--- lib/Froxlor/Api/Commands/Mysqls.php | 6 +- lib/Froxlor/Api/Commands/SubDomains.php | 18 ++--- lib/Froxlor/Cron/System/BackupCron.php | 6 +- lib/Froxlor/Cron/Traffic/TrafficCron.php | 2 +- lib/Froxlor/Customer/Customer.php | 6 +- lib/Froxlor/Http/Directory.php | 12 +-- lib/Froxlor/Settings/FroxlorVhostSettings.php | 2 +- lib/Froxlor/System/Crypt.php | 12 +-- lib/Froxlor/System/Mailer.php | 4 +- lib/Froxlor/UI/Listing.php | 2 +- .../admin/admin/formfield.admin_add.php | 11 ++- .../admin/admin/formfield.admin_edit.php | 14 ++-- .../admin/customer/formfield.customer_add.php | 12 +-- .../customer/formfield.customer_edit.php | 8 +- .../admin/domains/formfield.domains_add.php | 73 ++++++++++--------- .../admin/domains/formfield.domains_edit.php | 58 +++++++-------- .../ipsandports/formfield.ipsandports_add.php | 6 +- .../formfield.ipsandports_edit.php | 4 +- .../phpconfig/formfield.phpconfig_add.php | 38 +++++----- .../phpconfig/formfield.phpconfig_edit.php | 36 ++++----- .../domains/formfield.domains_add.php | 12 +-- .../domains/formfield.domains_edit.php | 20 ++--- .../email/formfield.emails_addaccount.php | 4 +- .../customer/email/formfield.emails_edit.php | 4 +- .../customer/ftp/formfield.ftp_add.php | 4 +- .../customer/ftp/formfield.ftp_edit.php | 2 +- .../customer/mysql/formfield.mysql_add.php | 4 +- .../customer/mysql/formfield.mysql_edit.php | 2 +- ssl_editor.php | 2 +- 44 files changed, 310 insertions(+), 304 deletions(-) diff --git a/admin_settings.php b/admin_settings.php index 7995d7eb..903cd81b 100644 --- a/admin_settings.php +++ b/admin_settings.php @@ -330,7 +330,7 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') { if (Settings::Get('system.mail_use_smtp')) { $testmail->isSMTP(); $testmail->Host = Settings::Get('system.mail_smtp_host'); - $testmail->SMTPAuth = Settings::Get('system.mail_smtp_auth') == '1' ? true : false; + $testmail->SMTPAuth = Settings::Get('system.mail_smtp_auth') == '1'; $testmail->Username = Settings::Get('system.mail_smtp_user'); $testmail->Password = Settings::Get('system.mail_smtp_passwd'); if (Settings::Get('system.mail_smtp_usetls')) { diff --git a/admin_templates.php b/admin_templates.php index a395f5ca..664da5db 100644 --- a/admin_templates.php +++ b/admin_templates.php @@ -283,7 +283,7 @@ if ($action == '') { } $templates = array_diff($available_templates, $templates); - if (array_search($template, $templates) === false) { + if (!in_array($template, $templates)) { \Froxlor\UI\Response::standard_error('templatenotfound'); } else { $ins_stmt = Database::prepare(" diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 5a8d8f92..bda05fc7 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -14,7 +14,7 @@ use Froxlor\Settings; * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Install - * + * */ if (! defined('_CRON_UPDATE')) { if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) { @@ -506,7 +506,7 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.9.6-svn2')) { showUpdateStep("Updating from 0.9.6-svn2 to 0.9.6-svn3", false); - $update_deferr_enable = isset($_POST['update_deferr_enable']) ? true : false; + $update_deferr_enable = isset($_POST['update_deferr_enable']); $err500 = false; $err401 = false; diff --git a/install/updates/preconfig.php b/install/updates/preconfig.php index 688983fc..970e1384 100644 --- a/install/updates/preconfig.php +++ b/install/updates/preconfig.php @@ -85,5 +85,5 @@ function versionInUpdate($current_version, $version_to_check) return true; } - return (\Froxlor\Froxlor::versionCompare2($current_version, $version_to_check) == -1 ? true : false); + return \Froxlor\Froxlor::versionCompare2($current_version, $version_to_check) == -1; } diff --git a/lib/Froxlor/Api/Commands/Admins.php b/lib/Froxlor/Api/Commands/Admins.php index 96311b06..d48765c1 100644 --- a/lib/Froxlor/Api/Commands/Admins.php +++ b/lib/Froxlor/Api/Commands/Admins.php @@ -17,7 +17,7 @@ use Froxlor\Settings; * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package API * @since 0.10.0 - * + * */ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity { @@ -33,7 +33,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt * optional specify offset for resultset * @param array $sql_orderby * optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields - * + * * @access admin * @throws \Exception * @return string json-encoded array count|list @@ -88,7 +88,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt * optional, the admin-id * @param string $loginname * optional, the loginname - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -96,7 +96,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt public function get() { $id = $this->getParam('id', true, 0); - $ln_optional = ($id <= 0 ? false : true); + $ln_optional = $id > 0; $loginname = $this->getParam('loginname', $ln_optional, ''); if ($this->isAdmin() && ($this->getUserDetail('change_serversettings') == 1 || ($this->getUserDetail('adminid') == $id || $this->getUserDetail('loginname') == $loginname))) { @@ -187,7 +187,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt * optional, default false * @param array $ipaddress * optional, list of ip-address id's; default -1 (all IP's) - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -449,7 +449,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt * optional, default false * @param array $ipaddress * optional, list of ip-address id's; default -1 (all IP's) - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -459,7 +459,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt if ($this->isAdmin()) { $id = $this->getParam('id', true, 0); - $ln_optional = ($id <= 0 ? false : true); + $ln_optional = $id > 0; $loginname = $this->getParam('loginname', $ln_optional, ''); $result = $this->apiCall('Admins.get', array( @@ -691,7 +691,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt * optional, the admin-id * @param string $loginname * optional, the loginname - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -700,7 +700,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt { if ($this->isAdmin() && $this->getUserDetail('change_serversettings') == 1) { $id = $this->getParam('id', true, 0); - $ln_optional = ($id <= 0 ? false : true); + $ln_optional = $id > 0; $loginname = $this->getParam('loginname', $ln_optional, ''); $result = $this->apiCall('Admins.get', array( @@ -787,7 +787,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt * optional, the admin-id * @param string $loginname * optional, the loginname - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -796,7 +796,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt { if ($this->isAdmin() && $this->getUserDetail('change_serversettings') == 1) { $id = $this->getParam('id', true, 0); - $ln_optional = ($id <= 0 ? false : true); + $ln_optional = $id > 0; $loginname = $this->getParam('loginname', $ln_optional, ''); $result = $this->apiCall('Admins.get', array( diff --git a/lib/Froxlor/Api/Commands/Certificates.php b/lib/Froxlor/Api/Commands/Certificates.php index c3052343..5e983faa 100644 --- a/lib/Froxlor/Api/Commands/Certificates.php +++ b/lib/Froxlor/Api/Commands/Certificates.php @@ -17,7 +17,7 @@ use Froxlor\Settings; * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package API * @since 0.10.0 - * + * */ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity { @@ -35,7 +35,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou * optional * @param string $ssl_cert_chainfile * optional - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -43,7 +43,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou public function add() { $domainid = $this->getParam('domainid', true, 0); - $dn_optional = ($domainid <= 0 ? false : true); + $dn_optional = $domainid > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); if ($this->isAdmin() == false && Settings::IsInList('panel.customer_hide_options', 'domains')) { @@ -93,7 +93,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou * optional, the domain-id * @param string $domainname * optional, the domainname - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -101,7 +101,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou public function get() { $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); if ($this->isAdmin() == false && Settings::IsInList('panel.customer_hide_options', 'domains')) { @@ -138,7 +138,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou * optional * @param string $ssl_cert_chainfile * optional - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -146,7 +146,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou public function update() { $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); if ($this->isAdmin() == false && Settings::IsInList('panel.customer_hide_options', 'domains')) { @@ -182,7 +182,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou * optional specify offset for resultset * @param array $sql_orderby * optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array count|list @@ -364,7 +364,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou * @param string $ssl_cert_chainfile * @param boolean $do_insert * optional default false - * + * * @return boolean * @throws \Exception */ diff --git a/lib/Froxlor/Api/Commands/Customers.php b/lib/Froxlor/Api/Commands/Customers.php index 0b31e56f..1348b348 100644 --- a/lib/Froxlor/Api/Commands/Customers.php +++ b/lib/Froxlor/Api/Commands/Customers.php @@ -17,7 +17,7 @@ use Froxlor\Settings; * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package API * @since 0.10.0 - * + * */ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity { @@ -35,7 +35,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource * optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields * @param bool $show_usages * optional, default false - * + * * @access admin * @throws \Exception * @return string json-encoded array count|list @@ -148,7 +148,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource * optional, the loginname * @param bool $show_usages * optional, default false - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -156,7 +156,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource public function get() { $id = $this->getParam('id', true, 0); - $ln_optional = ($id <= 0 ? false : true); + $ln_optional = $id > 0; $loginname = $this->getParam('loginname', $ln_optional, ''); $show_usages = $this->getBoolParam('show_usages', true, false); @@ -323,7 +323,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource * optional, whether to store the default index file to customers homedir * @param int $hosting_plan_id * optional, specify a hosting-plan to set certain resource-values from the plan instead of specifying them - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -340,7 +340,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource $name = $this->getParam('name', true, ''); $firstname = $this->getParam('firstname', true, ''); $company_required = (! empty($name) && empty($firstname)) || (empty($name) && ! empty($firstname)) || (empty($name) && empty($firstname)); - $company = $this->getParam('company', ($company_required ? false : true), ''); + $company = $this->getParam('company', !$company_required, ''); $street = $this->getParam('street', true, ''); $zipcode = $this->getParam('zipcode', true, ''); $city = $this->getParam('city', true, ''); @@ -928,7 +928,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource * optional, whether to allow access to webserver access/error-logs, default 0 (false) * @param string $theme * optional, change theme - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -936,7 +936,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource public function update() { $id = $this->getParam('id', true, 0); - $ln_optional = ($id <= 0 ? false : true); + $ln_optional = $id > 0; $loginname = $this->getParam('loginname', $ln_optional, ''); $result = $this->apiCall('Customers.get', array( @@ -954,7 +954,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource $name = $this->getParam('name', true, $result['name']); $firstname = $this->getParam('firstname', true, $result['firstname']); $company_required = empty($result['company']) && ((! empty($name) && empty($firstname)) || (empty($name) && ! empty($firstname)) || (empty($name) && empty($firstname))); - $company = $this->getParam('company', ($company_required ? false : true), $result['company']); + $company = $this->getParam('company', !$company_required, $result['company']); $street = $this->getParam('street', true, $result['street']); $zipcode = $this->getParam('zipcode', true, $result['zipcode']); $city = $this->getParam('city', true, $result['city']); @@ -1432,7 +1432,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource * optional, the loginname * @param bool $delete_userfiles * optional, default false - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -1441,7 +1441,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource { if ($this->isAdmin()) { $id = $this->getParam('id', true, 0); - $ln_optional = ($id <= 0 ? false : true); + $ln_optional = $id > 0; $loginname = $this->getParam('loginname', $ln_optional, ''); $delete_userfiles = $this->getParam('delete_userfiles', true, 0); @@ -1663,7 +1663,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource * optional, the customer-id * @param string $loginname * optional, the loginname - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -1672,7 +1672,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource { if ($this->isAdmin()) { $id = $this->getParam('id', true, 0); - $ln_optional = ($id <= 0 ? false : true); + $ln_optional = $id > 0; $loginname = $this->getParam('loginname', $ln_optional, ''); $result = $this->apiCall('Customers.get', array( @@ -1708,7 +1708,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource * optional, the loginname * @param int $adminid * target-admin-id - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -1718,7 +1718,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource if ($this->isAdmin() && $this->getUserDetail('change_serversettings') == 1) { $adminid = $this->getParam('adminid'); $id = $this->getParam('id', true, 0); - $ln_optional = ($id <= 0 ? false : true); + $ln_optional = $id > 0; $loginname = $this->getParam('loginname', $ln_optional, ''); $c_result = $this->apiCall('Customers.get', array( diff --git a/lib/Froxlor/Api/Commands/DirProtections.php b/lib/Froxlor/Api/Commands/DirProtections.php index 38491f14..466abaff 100644 --- a/lib/Froxlor/Api/Commands/DirProtections.php +++ b/lib/Froxlor/Api/Commands/DirProtections.php @@ -17,7 +17,7 @@ use Froxlor\Settings; * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package API * @since 0.10.0 - * + * */ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity { @@ -34,7 +34,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res * @param string $directory_password * @param string $directory_authname * optional name/description for the protection - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -121,7 +121,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res * optional, the directory-protection-id * @param string $username * optional, the username - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -133,7 +133,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res } $id = $this->getParam('id', true, 0); - $un_optional = ($id <= 0 ? false : true); + $un_optional = $id > 0; $username = $this->getParam('username', $un_optional, ''); $params = array(); @@ -194,7 +194,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res * optional, leave empty for no change * @param string $directory_authname * optional name/description for the protection - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -202,7 +202,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res public function update() { $id = $this->getParam('id', true, 0); - $un_optional = ($id <= 0 ? false : true); + $un_optional = $id > 0; $username = $this->getParam('username', $un_optional, ''); // validation @@ -311,7 +311,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res * optional, admin-only, select directory-protections of a specific customer by id * @param string $loginname * optional, admin-only, select directory-protections of a specific customer by loginname - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array count|list @@ -341,7 +341,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res * optional, the directory-protection-id * @param string $username * optional, the username - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -353,7 +353,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res } $id = $this->getParam('id', true, 0); - $un_optional = ($id <= 0 ? false : true); + $un_optional = $id > 0; $username = $this->getParam('username', $un_optional, ''); if ($this->isAdmin() == false && Settings::IsInList('panel.customer_hide_options', 'extras.directoryprotection')) { diff --git a/lib/Froxlor/Api/Commands/DomainZones.php b/lib/Froxlor/Api/Commands/DomainZones.php index 32748c20..0c93ff40 100644 --- a/lib/Froxlor/Api/Commands/DomainZones.php +++ b/lib/Froxlor/Api/Commands/DomainZones.php @@ -17,7 +17,7 @@ use Froxlor\Settings; * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package API * @since 0.10.0 - * + * */ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity { @@ -39,7 +39,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour * optional, default empty * @param int $ttl * optional, default 18000 - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -55,7 +55,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour } $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); // get requested domain @@ -354,7 +354,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour * optional, the domain id * @param string $domainname * optional, the domain name - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -370,7 +370,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour } $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); // get requested domain @@ -435,7 +435,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour } $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); // get requested domain @@ -465,7 +465,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour * optional, the domain id * @param string $domainname * optional, the domain name - * + * * @access admin, customer * @throws \Exception * @return bool @@ -481,7 +481,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour } $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); // get requested domain @@ -508,7 +508,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour * optional, the domain id * @param string $domainname * optional, the domain name - * + * * @access admin, customer * @throws \Exception * @return bool @@ -525,7 +525,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour $entry_id = $this->getParam('entry_id'); $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); // get requested domain diff --git a/lib/Froxlor/Api/Commands/Domains.php b/lib/Froxlor/Api/Commands/Domains.php index 3511e393..8898d31e 100644 --- a/lib/Froxlor/Api/Commands/Domains.php +++ b/lib/Froxlor/Api/Commands/Domains.php @@ -17,7 +17,7 @@ use Froxlor\Settings; * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package API * @since 0.10.0 - * + * */ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity { @@ -35,7 +35,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn * optional specify offset for resultset * @param array $sql_orderby * optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields - * + * * @access admin * @throws \Exception * @return string json-encoded array count|list @@ -117,7 +117,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn * optional, default true * @param bool $no_std_subdomain * optional, default false - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -126,7 +126,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn { if ($this->isAdmin()) { $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); $with_ips = $this->getParam('with_ips', true, true); $no_std_subdomain = $this->getParam('no_std_subdomain', true, false); @@ -311,7 +311,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn * optional list of allowed/used tls-1.3 specific ciphers, see system.tlsv13_cipher_list setting, only used/required if $override_tls is true, default empty or system.tlsv13_cipher_list setting if $override_tls is true * @param string $description * optional custom description (currently not used/shown in the frontend), default empty - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -971,7 +971,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn * optional whether to enable or disable TLS sessiontickets (RFC 5077) for this domain. default 1 (true), requires SSL * @param string $description * optional custom description (currently not used/shown in the frontend), default empty - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -982,7 +982,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn // parameters $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); // get requested domain @@ -1849,7 +1849,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn * optional, remove also domains that are subdomains of this domain but added as main domains; default false * @param bool $is_stdsubdomain * optional, default false, specify whether it's a std-subdomain you are deleting as it does not count as subdomain-resource - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -1858,7 +1858,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn { if ($this->isAdmin()) { $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); $is_stdsubdomain = $this->getParam('is_stdsubdomain', true, 0); $remove_subbutmain_domains = $this->getParam('delete_mainsubdomains', true, 0); @@ -2007,7 +2007,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn * default false * @param int $edit_id * default 0 - * + * * @throws \Exception * @return array */ diff --git a/lib/Froxlor/Api/Commands/EmailAccounts.php b/lib/Froxlor/Api/Commands/EmailAccounts.php index 414e81ab..8836bbc9 100644 --- a/lib/Froxlor/Api/Commands/EmailAccounts.php +++ b/lib/Froxlor/Api/Commands/EmailAccounts.php @@ -17,7 +17,7 @@ use Froxlor\Settings; * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package API * @since 0.10.0 - * + * */ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity { @@ -41,7 +41,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso * optional quota if enabled in MB, default 0 * @param bool $sendinfomail * optional, sends the welcome message to the new account (needed for creation, without the user won't be able to login before any mail is received), default 1 (true) - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -56,7 +56,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso // parameter $id = $this->getParam('id', true, 0); - $ea_optional = ($id <= 0 ? false : true); + $ea_optional = $id > 0; $emailaddr = $this->getParam('emailaddr', $ea_optional, ''); $email_password = $this->getParam('email_password'); $alternative_email = $this->getParam('alternative_email', true, ''); @@ -137,7 +137,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso $stmt = Database::prepare("INSERT INTO `" . TABLE_MAIL_USERS . "` SET `customerid` = :cid, `email` = :email, - `username` = :username," . (Settings::Get('system.mailpwcleartext') == '1' ? '`password` = :password, ' : '') . " + `username` = :username," . (Settings::Get('system.mailpwcleartext') == '1' ? '`password` = :password, ' : '') . " `password_enc` = :password_enc, `homedir` = :homedir, `maildir` = :maildir, @@ -304,7 +304,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso * optional, update password * @param bool $deactivated * optional, admin-only - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -317,7 +317,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso // parameter $id = $this->getParam('id', true, 0); - $ea_optional = ($id <= 0 ? false : true); + $ea_optional = $id > 0; $emailaddr = $this->getParam('emailaddr', $ea_optional, ''); // validation @@ -333,7 +333,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso $password = $this->getParam('email_password', true, ''); $quota = $this->getParam('email_quota', true, $result['quota']); - $deactivated = $this->getBoolParam('deactivated', true, (strtolower($result['postfix']) == 'n' ? true : false)); + $deactivated = $this->getBoolParam('deactivated', true, strtolower($result['postfix']) == 'n'); // get needed customer info to reduce the email-account-counter by one $customer = $this->getCustomerData(); @@ -438,7 +438,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso * optional, required when called as admin (if $customerid is not specified) * @param bool $delete_userfiles * optional, default false - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -451,7 +451,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso // parameter $id = $this->getParam('id', true, 0); - $ea_optional = ($id <= 0 ? false : true); + $ea_optional = $id > 0; $emailaddr = $this->getParam('emailaddr', $ea_optional, ''); $delete_userfiles = $this->getBoolParam('delete_userfiles', true, 0); diff --git a/lib/Froxlor/Api/Commands/EmailForwarders.php b/lib/Froxlor/Api/Commands/EmailForwarders.php index 54542b2f..1239e89e 100644 --- a/lib/Froxlor/Api/Commands/EmailForwarders.php +++ b/lib/Froxlor/Api/Commands/EmailForwarders.php @@ -17,7 +17,7 @@ use Froxlor\Settings; * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package API * @since 0.10.0 - * + * */ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity { @@ -35,7 +35,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re * optional, required when called as admin (if $customerid is not specified) * @param string $destination * email-address to add as forwarder - * + * * @access admin,customer * @throws \Exception * @return string json-encoded array @@ -50,7 +50,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re // parameter $id = $this->getParam('id', true, 0); - $ea_optional = ($id <= 0 ? false : true); + $ea_optional = $id > 0; $emailaddr = $this->getParam('emailaddr', $ea_optional, ''); $destination = $this->getParam('destination'); @@ -136,7 +136,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re * optional, admin-only, the customer-id * @param string $loginname * optional, admin-only, the loginname - * + * * @access admin,customer * @throws \Exception * @return string json-encoded array count|list @@ -149,7 +149,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re // parameter $id = $this->getParam('id', true, 0); - $ea_optional = ($id <= 0 ? false : true); + $ea_optional = $id > 0; $emailaddr = $this->getParam('emailaddr', $ea_optional, ''); // validation @@ -185,7 +185,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re * optional, admin-only, the customer-id * @param string $loginname * optional, admin-only, the loginname - * + * * @access admin,customer * @throws \Exception * @return string json-encoded array @@ -198,7 +198,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re // parameter $id = $this->getParam('id', true, 0); - $ea_optional = ($id <= 0 ? false : true); + $ea_optional = $id > 0; $emailaddr = $this->getParam('emailaddr', $ea_optional, ''); // validation @@ -226,7 +226,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re * optional, required when called as admin (if $customerid is not specified) * @param int $forwarderid * id of the forwarder to delete - * + * * @access admin,customer * @throws \Exception * @return string json-encoded array @@ -239,7 +239,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re // parameter $id = $this->getParam('id', true, 0); - $ea_optional = ($id <= 0 ? false : true); + $ea_optional = $id > 0; $emailaddr = $this->getParam('emailaddr', $ea_optional, ''); $forwarderid = $this->getParam('forwarderid'); diff --git a/lib/Froxlor/Api/Commands/Emails.php b/lib/Froxlor/Api/Commands/Emails.php index d3850ae9..d48a4610 100644 --- a/lib/Froxlor/Api/Commands/Emails.php +++ b/lib/Froxlor/Api/Commands/Emails.php @@ -17,7 +17,7 @@ use Froxlor\Settings; * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package API * @since 0.10.0 - * + * */ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity { @@ -37,7 +37,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt * optional, required when called as admin (if $customerid is not specified) * @param string $description * optional custom description (currently not used/shown in the frontend), default empty - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -157,7 +157,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt * optional, the email-address-id * @param string $emailaddr * optional, the email-address - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -165,7 +165,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt public function get() { $id = $this->getParam('id', true, 0); - $ea_optional = ($id <= 0 ? false : true); + $ea_optional = $id > 0; $emailaddr = $this->getParam('emailaddr', $ea_optional, ''); $params = array(); @@ -202,7 +202,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt * optional * @param string $description * optional custom description (currently not used/shown in the frontend), default empty - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -223,7 +223,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt } $id = $this->getParam('id', true, 0); - $ea_optional = ($id <= 0 ? false : true); + $ea_optional = $id > 0; $emailaddr = $this->getParam('emailaddr', $ea_optional, ''); $result = $this->apiCall('Emails.get', array( @@ -298,7 +298,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt * optional specify offset for resultset * @param array $sql_orderby * optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array count|list @@ -332,7 +332,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt * optional, admin-only, select email addresses of a specific customer by id * @param string $loginname * optional, admin-only, select email addresses of a specific customer by loginname - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -366,7 +366,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt * optional, required when called as admin (if $customerid is not specified) * @param boolean $delete_userfiles * optional, delete email data from filesystem, default: 0 (false) - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -378,7 +378,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt } $id = $this->getParam('id', true, 0); - $ea_optional = ($id <= 0 ? false : true); + $ea_optional = $id > 0; $emailaddr = $this->getParam('emailaddr', $ea_optional, ''); $result = $this->apiCall('Emails.get', array( diff --git a/lib/Froxlor/Api/Commands/Ftps.php b/lib/Froxlor/Api/Commands/Ftps.php index 748a62a9..88319785 100644 --- a/lib/Froxlor/Api/Commands/Ftps.php +++ b/lib/Froxlor/Api/Commands/Ftps.php @@ -17,7 +17,7 @@ use Froxlor\Settings; * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package API * @since 0.10.0 - * + * */ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity { @@ -47,7 +47,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit * optional whether to add additional usernames to the group * @param bool $is_defaultuser * optional whether this is the standard default ftp user which is being added so no usage is decreased - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -294,7 +294,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit * optional, the customer-id * @param string $username * optional, the username - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -302,7 +302,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit public function get() { $id = $this->getParam('id', true, 0); - $un_optional = ($id <= 0 ? false : true); + $un_optional = $id > 0; $username = $this->getParam('username', $un_optional, ''); $params = array(); @@ -367,7 +367,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit * optional, required when called as admin (if $loginname is not specified) * @param string $loginname * optional, required when called as admin (if $customerid is not specified) - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -379,7 +379,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit } $id = $this->getParam('id', true, 0); - $un_optional = ($id <= 0 ? false : true); + $un_optional = $id > 0; $username = $this->getParam('username', $un_optional, ''); $result = $this->apiCall('Ftps.get', array( @@ -518,7 +518,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit * optional, admin-only, select ftp-users of a specific customer by id * @param string $loginname * optional, admin-only, select ftp-users of a specific customer by loginname - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -546,7 +546,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit * optional, the username * @param bool $delete_userfiles * optional, default false - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -554,7 +554,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit public function delete() { $id = $this->getParam('id', true, 0); - $un_optional = ($id <= 0 ? false : true); + $un_optional = $id > 0; $username = $this->getParam('username', $un_optional, ''); $delete_userfiles = $this->getBoolParam('delete_userfiles', true, 0); diff --git a/lib/Froxlor/Api/Commands/HostingPlans.php b/lib/Froxlor/Api/Commands/HostingPlans.php index 6a23ad39..75da64e9 100644 --- a/lib/Froxlor/Api/Commands/HostingPlans.php +++ b/lib/Froxlor/Api/Commands/HostingPlans.php @@ -17,7 +17,7 @@ use Froxlor\Database\Database; * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package API * @since 0.10.0 - * + * */ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity { @@ -33,7 +33,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou * optional specify offset for resultset * @param array $sql_orderby * optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields - * + * * @access admin * @throws \Exception * @return string json-encoded array count|list @@ -98,7 +98,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou * optional, the hosting-plan-id * @param string $planname * optional, the hosting-plan-name - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -107,7 +107,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou { if ($this->isAdmin()) { $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $planname = $this->getParam('planname', $dn_optional, ''); $result_stmt = Database::prepare(" SELECT * FROM `" . TABLE_PANEL_PLANS . "` WHERE " . ($id > 0 ? "`id` = :iddn" : "`name` = :iddn") . ($this->getUserDetail('customers_see_all') ? '' : " AND `adminid` = :adminid")); @@ -185,7 +185,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou * optional, whether to allow usage of the DNS editor (requires activated nameserver in settings), default 0 (false) * @param bool $logviewenabled * optional, whether to allow access to webserver access/error-logs, default 0 (false) - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -312,7 +312,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou * optional, either to allow usage of the DNS editor (requires activated nameserver in settings), default 0 (false) * @param bool $logviewenabled * optional, either to allow access to webserver access/error-logs, default 0 (false) - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -323,7 +323,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou // parameters $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $planname = $this->getParam('planname', $dn_optional, ''); // get requested hosting-plan @@ -405,7 +405,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou * optional the hosting-plan-id * @param string $planname * optional the hosting-plan-name - * + * * @access admin * @throws \Exception * @return string json-encoded array @@ -414,7 +414,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou { if ($this->isAdmin()) { $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $planname = $this->getParam('planname', $dn_optional, ''); // get requested hosting-plan diff --git a/lib/Froxlor/Api/Commands/Mysqls.php b/lib/Froxlor/Api/Commands/Mysqls.php index a8ee343e..13304fdd 100644 --- a/lib/Froxlor/Api/Commands/Mysqls.php +++ b/lib/Froxlor/Api/Commands/Mysqls.php @@ -204,7 +204,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt public function get() { $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $dbname = $this->getParam('dbname', $dn_optional, ''); $dbserver = $this->getParam('mysql_server', true, -1); @@ -304,7 +304,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt public function update() { $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $dbname = $this->getParam('dbname', $dn_optional, ''); $dbserver = $this->getParam('mysql_server', true, -1); $customer = $this->getCustomerData(); @@ -488,7 +488,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt public function delete() { $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $dbname = $this->getParam('dbname', $dn_optional, ''); $dbserver = $this->getParam('mysql_server', true, -1); $customer = $this->getCustomerData(); diff --git a/lib/Froxlor/Api/Commands/SubDomains.php b/lib/Froxlor/Api/Commands/SubDomains.php index 7aa2ed5d..afd68573 100644 --- a/lib/Froxlor/Api/Commands/SubDomains.php +++ b/lib/Froxlor/Api/Commands/SubDomains.php @@ -18,7 +18,7 @@ use Froxlor\Settings; * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package API * @since 0.10.0 - * + * */ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity { @@ -60,7 +60,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc * optional, required when called as admin (if $loginname is not specified) * @param string $loginname * optional, required when called as admin (if $customerid is not specified) - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -382,7 +382,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc * optional, the domain-id * @param string $domainname * optional, the domainname - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -390,7 +390,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc public function get() { $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); // convert possible idn domain to punycode @@ -498,7 +498,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc * optional, required when called as admin (if $loginname is not specified) * @param string $loginname * optional, required when called as admin (if $customerid is not specified) - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -506,7 +506,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc public function update() { $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); if ($this->isAdmin() == false && Settings::IsInList('panel.customer_hide_options', 'domains')) { @@ -762,7 +762,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc * optional specify offset for resultset * @param array $sql_orderby * optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array count|list @@ -861,7 +861,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc * optional, admin-only, select (sub)domains of a specific customer by id * @param string $loginname * optional, admin-only, select (sub)domains of a specific customer by loginname - * + * * @access admin, customer * @throws \Exception * @return string json-encoded array @@ -936,7 +936,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc public function delete() { $id = $this->getParam('id', true, 0); - $dn_optional = ($id <= 0 ? false : true); + $dn_optional = $id > 0; $domainname = $this->getParam('domainname', $dn_optional, ''); if ($this->isAdmin() == false && Settings::IsInList('panel.customer_hide_options', 'domains')) { diff --git a/lib/Froxlor/Cron/System/BackupCron.php b/lib/Froxlor/Cron/System/BackupCron.php index 899e7717..d6e4e68e 100644 --- a/lib/Froxlor/Cron/System/BackupCron.php +++ b/lib/Froxlor/Cron/System/BackupCron.php @@ -18,9 +18,9 @@ use Froxlor\FroxlorLogger; * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Cron - * + * * @since 0.9.35.1 - * + * */ class BackupCron extends \Froxlor\Cron\FroxlorCron { @@ -35,7 +35,7 @@ class BackupCron extends \Froxlor\Cron\FroxlorCron $BackupPidStatus = @posix_kill($BackupPid, 0); } else { system("kill -CHLD " . $BackupPid . " 1> /dev/null 2> /dev/null", $BackupPidStatus); - $BackupPidStatus = $BackupPidStatus ? false : true; + $BackupPidStatus = !$BackupPidStatus; } if ($BackupPidStatus) { FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_INFO, 'Backup run already in progress'); diff --git a/lib/Froxlor/Cron/Traffic/TrafficCron.php b/lib/Froxlor/Cron/Traffic/TrafficCron.php index cd08cd98..f3bcd385 100644 --- a/lib/Froxlor/Cron/Traffic/TrafficCron.php +++ b/lib/Froxlor/Cron/Traffic/TrafficCron.php @@ -34,7 +34,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron $TrafficPidStatus = @posix_kill($TrafficPid, 0); } else { system("kill -CHLD " . $TrafficPid . " 1> /dev/null 2> /dev/null", $TrafficPidStatus); - $TrafficPidStatus = $TrafficPidStatus ? false : true; + $TrafficPidStatus = !$TrafficPidStatus; } if ($TrafficPidStatus) { \Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_INFO, 'Traffic Run already in progress'); diff --git a/lib/Froxlor/Customer/Customer.php b/lib/Froxlor/Customer/Customer.php index 2b04d6dd..4f9fa078 100644 --- a/lib/Froxlor/Customer/Customer.php +++ b/lib/Froxlor/Customer/Customer.php @@ -27,7 +27,7 @@ class Customer * * @param int $uid * uid of customer - * + * * @return string customers loginname */ public static function getLoginNameByUid($uid = null) @@ -53,7 +53,7 @@ class Customer * * @param * int customer-id - * + * * @return boolean */ public static function customerHasPerlEnabled($cid = 0) @@ -67,7 +67,7 @@ class Customer $result = $result_stmt->fetch(\PDO::FETCH_ASSOC); if (is_array($result) && isset($result['perlenabled'])) { - return ($result['perlenabled'] == '1') ? true : false; + return $result['perlenabled'] == '1'; } } return false; diff --git a/lib/Froxlor/Http/Directory.php b/lib/Froxlor/Http/Directory.php index ce7327c8..a27d2854 100644 --- a/lib/Froxlor/Http/Directory.php +++ b/lib/Froxlor/Http/Directory.php @@ -14,9 +14,9 @@ namespace Froxlor\Http; * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Cron - * + * * @since 0.9.33 - * + * */ use Froxlor\Database\Database; use Froxlor\FileDir; @@ -26,7 +26,7 @@ use Froxlor\FileDir; * about a given directory in connections with its usage in froxlor * * @author Michael Kaufmann (d00p) - * + * */ class Directory { @@ -60,7 +60,7 @@ class Directory 'dir' => FileDir::makeCorrectDir($this->dir) )); if ($uo_res != false && isset($uo_res['usropts'])) { - return ($uo_res['usropts'] > 0 ? true : false); + return $uo_res['usropts'] > 0; } return false; } @@ -77,7 +77,7 @@ class Directory 'dir' => FileDir::makeCorrectDir($this->dir) )); if ($up_res != false && isset($up_res['usrprot'])) { - return ($up_res['usrprot'] > 0 ? true : false); + return $up_res['usrprot'] > 0; } return false; } @@ -88,7 +88,7 @@ class Directory * * @param bool $ifexists * also check whether file/dir exists - * + * * @return bool true if usable as dir, false otherwise */ public function isConfigDir($ifexists = false) diff --git a/lib/Froxlor/Settings/FroxlorVhostSettings.php b/lib/Froxlor/Settings/FroxlorVhostSettings.php index 6c4068ec..bb360c5f 100644 --- a/lib/Froxlor/Settings/FroxlorVhostSettings.php +++ b/lib/Froxlor/Settings/FroxlorVhostSettings.php @@ -10,6 +10,6 @@ class FroxlorVhostSettings { $sel_stmt = Database::prepare("SELECT COUNT(*) as vcentries FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `vhostcontainer`= '1'" . ($need_ssl ? " AND `ssl` = '1'" : "")); $result = Database::pexecute_first($sel_stmt); - return $result['vcentries'] > 0 ? true : false; + return $result['vcentries'] > 0; } } diff --git a/lib/Froxlor/System/Crypt.php b/lib/Froxlor/System/Crypt.php index c5b15f20..8ad518cf 100644 --- a/lib/Froxlor/System/Crypt.php +++ b/lib/Froxlor/System/Crypt.php @@ -62,18 +62,18 @@ class Crypt * @author Michal Wojcik * @author Michael Kaufmann * @author Froxlor team (2010-) - * + * * 0 - default crypt (depends on system configuration) * 1 - MD5 $1$ * 2 - BLOWFISH $2y$07$ * 3 - SHA-256 $5$ (default) * 4 - SHA-512 $6$ - * + * * @param string $password * Password to be encrypted * @param bool $htpasswd * optional whether to generate a SHA1 password for directory protection - * + * * @return string encrypted password */ public static function makeCryptPassword($password, $htpasswd = false) @@ -120,7 +120,7 @@ class Crypt * * @param string $password * the password to validate - * + * * @return string either the password or an errormessage+exit */ public static function validatePassword($password = null, $json_response = false) @@ -165,7 +165,7 @@ class Crypt * either panel_customers or panel_admins * @param string $uid * user-id-field in $table - * + * * @return boolean */ public static function validatePasswordLogin($userinfo = null, $password = null, $table = 'panel_customers', $uid = 'customerid') @@ -189,7 +189,7 @@ class Crypt if ($pwd_hash == $pwd_check || password_verify($password, $pwd_hash)) { // check for update of hash (only if our database is ready to handle the bigger string) - $is_ready = (\Froxlor\Froxlor::versionCompare2("0.9.33", \Froxlor\Froxlor::getVersion()) <= 0 ? true : false); + $is_ready = \Froxlor\Froxlor::versionCompare2("0.9.33", \Froxlor\Froxlor::getVersion()) <= 0 ; if ((password_needs_rehash($pwd_hash, $algo) || $update_hash) && $is_ready) { $upd_stmt = \Froxlor\Database\Database::prepare(" UPDATE " . $table . " SET `password` = :newpasswd WHERE `" . $uid . "` = :uid diff --git a/lib/Froxlor/System/Mailer.php b/lib/Froxlor/System/Mailer.php index e9d08c6c..12594a98 100644 --- a/lib/Froxlor/System/Mailer.php +++ b/lib/Froxlor/System/Mailer.php @@ -11,7 +11,7 @@ class Mailer extends \PHPMailer\PHPMailer\PHPMailer * * @param string $exceptions * whether to throw exceptions or not - * + * */ public function __construct($exceptions = false) { @@ -21,7 +21,7 @@ class Mailer extends \PHPMailer\PHPMailer\PHPMailer if (Settings::Get('system.mail_use_smtp')) { $this->isSMTP(); $this->Host = Settings::Get('system.mail_smtp_host'); - $this->SMTPAuth = Settings::Get('system.mail_smtp_auth') == '1' ? true : false; + $this->SMTPAuth = Settings::Get('system.mail_smtp_auth') == '1'; $this->Username = Settings::Get('system.mail_smtp_user'); $this->Password = Settings::Get('system.mail_smtp_passwd'); if (Settings::Get('system.mail_smtp_usetls')) { diff --git a/lib/Froxlor/UI/Listing.php b/lib/Froxlor/UI/Listing.php index 4d55dc3f..0d88c4ad 100644 --- a/lib/Froxlor/UI/Listing.php +++ b/lib/Froxlor/UI/Listing.php @@ -39,7 +39,7 @@ class Listing 'pagination' => $collection_data['pagination'], 'empty_msg' => $tabellisting['empty_msg'] ?? null, 'total_entries' => ($collection->getPagination() instanceof Pagination) ? $collection->getPagination()->getEntries() : 0, - 'is_search' => ($collection->getPagination() instanceof Pagination) ? $collection->getPagination()->isSearchResult() : false, + 'is_search' => $collection->getPagination() instanceof Pagination && $collection->getPagination()->isSearchResult(), 'self_overview' => $tabellisting['self_overview'] ?? [], 'available_columns' => self::getAvailableColumnsForListing($tabellisting) ]; diff --git a/lib/formfields/admin/admin/formfield.admin_add.php b/lib/formfields/admin/admin/formfield.admin_add.php index f1914737..0fbaa4fd 100644 --- a/lib/formfields/admin/admin/formfield.admin_add.php +++ b/lib/formfields/admin/admin/formfield.admin_add.php @@ -14,6 +14,9 @@ * @package Formfields * */ + +use Froxlor\Settings; + return array( 'admin_add' => array( 'title' => $lng['admin']['admin_add'], @@ -37,7 +40,7 @@ return array( 'admin_password_suggestion' => array( 'next_to_prefix' => $lng['customer']['generated_pwd'].':', 'type' => 'text', - 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), + 'visible' => (Settings::Get('panel.password_regex') == ''), 'value' => \Froxlor\System\Crypt::generatePassword(), 'readonly' => true ) @@ -55,8 +58,8 @@ return array( 'desc' => $lng['usersettings']['api_allowed']['description'], 'type' => 'checkbox', 'value' => '1', - 'checked' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false), - 'visible' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false) + 'checked' => Settings::Get('api.enabled') == '1', + 'visible' => Settings::Get('api.enabled') == '1' ) ) ), @@ -183,7 +186,7 @@ return array( 'type' => 'textul', 'value' => 0, 'maxlength' => 9, - 'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false), + 'visible' => Settings::Get('system.mail_quota_enabled') == '1', 'mandatory' => true ), 'ftps' => array( diff --git a/lib/formfields/admin/admin/formfield.admin_edit.php b/lib/formfields/admin/admin/formfield.admin_edit.php index 74759483..2d56d132 100644 --- a/lib/formfields/admin/admin/formfield.admin_edit.php +++ b/lib/formfields/admin/admin/formfield.admin_edit.php @@ -33,18 +33,18 @@ return array( 'type' => 'checkbox', 'value' => '1', 'checked' => $result['deactivated'], - 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true) + 'visible' => $result['adminid'] != $userinfo['userid'] ), 'admin_password' => array( 'label' => $lng['login']['password'] . ' (' . $lng['panel']['emptyfornochanges'] . ')', 'type' => 'password', 'autocomplete' => 'off', - 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true), + 'visible' => $result['adminid'] != $userinfo['userid'], 'next_to' => [ 'admin_password_suggestion' => array( 'next_to_prefix' => $lng['customer']['generated_pwd'].':', 'type' => 'text', - 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == '' && ($result['adminid'] == $userinfo['userid'] ? false : true)), + 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == '' && !($result['adminid'] == $userinfo['userid'])), 'value' => \Froxlor\System\Crypt::generatePassword(), 'readonly' => true ) @@ -55,7 +55,7 @@ return array( 'type' => 'select', 'select_var' => $languages, 'selected' => $result['def_language'], - 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true) + 'visible' => $result['adminid'] != $userinfo['userid'] ), 'api_allowed' => array( 'label' => $lng['usersettings']['api_allowed']['title'], @@ -63,7 +63,7 @@ return array( 'type' => 'checkbox', 'value' => '1', 'checked' => $result['api_allowed'], - 'visible' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false) + 'visible' => \Froxlor\Settings::Get('api.enabled') == '1' ) ) ), @@ -102,7 +102,7 @@ return array( 'section_c' => array( 'title' => $lng['admin']['servicedata'], 'image' => 'icons/user_add.png', - 'visible' => ($result['adminid'] != $userinfo['userid'] ? true : false), + 'visible' => $result['adminid'] != $userinfo['userid'], 'fields' => array( 'ipaddress' => array( 'label' => $lng['serversettings']['ipaddress']['title'], @@ -195,7 +195,7 @@ return array( 'type' => 'textul', 'value' => $result['email_quota'], 'maxlength' => 9, - 'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mail_quota_enabled') == '1', 'mandatory' => true ), 'ftps' => array( diff --git a/lib/formfields/admin/customer/formfield.customer_add.php b/lib/formfields/admin/customer/formfield.customer_add.php index 8d7d641e..5e7a75f6 100644 --- a/lib/formfields/admin/customer/formfield.customer_add.php +++ b/lib/formfields/admin/customer/formfield.customer_add.php @@ -71,8 +71,8 @@ return array( 'desc' => $lng['usersettings']['api_allowed']['description'], 'type' => 'checkbox', 'value' => '1', - 'checked' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false), - 'visible' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false) + 'checked' => \Froxlor\Settings::Get('api.enabled') == '1', + 'visible' => \Froxlor\Settings::Get('api.enabled') == '1' ) ) ), @@ -213,7 +213,7 @@ return array( 'type' => 'textul', 'value' => 0, 'maxlength' => 9, - 'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mail_quota_enabled') == '1', 'mandatory' => true ), 'email_imap' => array( @@ -250,7 +250,7 @@ return array( 'checked' => true ), 'allowed_phpconfigs' => array( - 'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false), + 'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1)), 'label' => $lng['admin']['phpsettings']['title'], 'type' => 'checkbox', 'values' => $phpconfigs, @@ -271,8 +271,8 @@ return array( 'label' => $lng['admin']['dnsenabled'] . '?', 'type' => 'checkbox', 'value' => '1', - 'checked' => (\Froxlor\Settings::Get('system.dnsenabled') == '1' ? true : false), - 'visible' => (\Froxlor\Settings::Get('system.dnsenabled') == '1' ? true : false) + 'checked' => \Froxlor\Settings::Get('system.dnsenabled') == '1', + 'visible' => \Froxlor\Settings::Get('system.dnsenabled') == '1' ), 'logviewenabled' => array( 'label' => $lng['admin']['logviewenabled'] . '?', diff --git a/lib/formfields/admin/customer/formfield.customer_edit.php b/lib/formfields/admin/customer/formfield.customer_edit.php index efd1cb4b..25cece99 100644 --- a/lib/formfields/admin/customer/formfield.customer_edit.php +++ b/lib/formfields/admin/customer/formfield.customer_edit.php @@ -71,7 +71,7 @@ return array( 'type' => 'checkbox', 'value' => '1', 'checked' => $result['api_allowed'], - 'visible' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false) + 'visible' => \Froxlor\Settings::Get('api.enabled') == '1' ) ) ), @@ -225,7 +225,7 @@ return array( 'type' => 'textul', 'value' => $result['email_quota'], 'maxlength' => 9, - 'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mail_quota_enabled') == '1', 'mandatory' => true ), 'email_imap' => array( @@ -262,7 +262,7 @@ return array( 'checked' => $result['phpenabled'] ), 'allowed_phpconfigs' => array( - 'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false), + 'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1)), 'label' => $lng['admin']['phpsettings']['title'], 'type' => 'checkbox', 'values' => $phpconfigs, @@ -280,7 +280,7 @@ return array( 'type' => 'checkbox', 'value' => '1', 'checked' => $result['dnsenabled'], - 'visible' => (\Froxlor\Settings::Get('system.dnsenabled') == '1' ? true : false) + 'visible' => \Froxlor\Settings::Get('system.dnsenabled') == '1' ), 'logviewenabled' => array( 'label' => $lng['admin']['logviewenabled'] . '?', diff --git a/lib/formfields/admin/domains/formfield.domains_add.php b/lib/formfields/admin/domains/formfield.domains_add.php index c38b8dd8..266cf1f1 100644 --- a/lib/formfields/admin/domains/formfield.domains_add.php +++ b/lib/formfields/admin/domains/formfield.domains_add.php @@ -14,6 +14,9 @@ * @package Formfields * */ + +use Froxlor\Settings; + return array( 'domain_add' => array( 'title' => $lng['admin']['domain_add'], @@ -35,7 +38,7 @@ return array( 'mandatory' => true ), 'adminid' => array( - 'visible' => ($userinfo['customers_see_all'] == '1' ? true : false), + 'visible' => $userinfo['customers_see_all'] == '1', 'label' => $lng['admin']['admin'], 'type' => 'select', 'select_var' => $admins, @@ -103,7 +106,7 @@ return array( 'selected' => 0 ), 'dkim' => array( - 'visible' => (\Froxlor\Settings::Get('dkim.use_dkim') == '1' ? true : false), + 'visible' => Settings::Get('dkim.use_dkim') == '1', 'label' => 'DomainKeys', 'type' => 'checkbox', 'value' => '1', @@ -116,7 +119,7 @@ return array( 'image' => 'icons/domain_add.png', 'fields' => array( 'documentroot' => array( - 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => $userinfo['change_serversettings'] == '1', 'label' => 'DocumentRoot', 'desc' => $lng['panel']['emptyfordefault'], 'type' => 'text' @@ -126,7 +129,7 @@ return array( 'desc' => $lng['domains']['ipandport_multi']['description'], 'type' => 'checkbox', 'values' => $ipsandports, - 'value' => explode(',', \Froxlor\Settings::Get('system.defaultip')), + 'value' => explode(',', Settings::Get('system.defaultip')), 'is_array' => 1, 'mandatory' => true ), @@ -135,7 +138,7 @@ return array( 'desc' => $lng['admin']['selectserveralias_desc'], 'type' => 'select', 'select_var' => $serveraliasoptions, - 'selected' => \Froxlor\Settings::Get('system.domaindefaultalias') + 'selected' => Settings::Get('system.domaindefaultalias') ), 'speciallogfile' => array( 'label' => $lng['admin']['speciallogfile']['title'], @@ -145,7 +148,7 @@ return array( 'checked' => false ), 'specialsettings' => array( - 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => $userinfo['change_serversettings'] == '1', 'label' => $lng['admin']['ownvhostsettings'], 'desc' => $lng['serversettings']['default_vhostconf']['description'], 'type' => 'textarea', @@ -153,7 +156,7 @@ return array( 'rows' => 12 ), 'notryfiles' => array( - 'visible' => (\Froxlor\Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'), + 'visible' => (Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'), 'label' => $lng['admin']['notryfiles']['title'], 'desc' => $lng['admin']['notryfiles']['description'], 'type' => 'checkbox', @@ -179,17 +182,17 @@ return array( 'section_bssl' => array( 'title' => $lng['admin']['webserversettings_ssl'], 'image' => 'icons/domain_add.png', - 'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? true : false, + 'visible' => Settings::Get('system.use_ssl') == '1', 'fields' => array( 'sslenabled' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false), + 'visible' => !empty($ssl_ipsandports), 'label' => $lng['admin']['domain_sslenabled'], 'type' => 'checkbox', 'value' => '1', 'checked' => true ), 'no_ssl_available_info' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false), + 'visible' => !empty($ssl_ipsandports), 'label' => 'SSL', 'type' => 'label', 'value' => $lng['panel']['nosslipsavailable'] @@ -199,11 +202,11 @@ return array( 'desc' => $lng['domains']['ipandport_ssl_multi']['description'], 'type' => 'checkbox', 'values' => $ssl_ipsandports, - 'value' => explode(',', \Froxlor\Settings::Get('system.defaultsslip')), + 'value' => explode(',', Settings::Get('system.defaultsslip')), 'is_array' => 1 ), 'ssl_redirect' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false), + 'visible' => !empty($ssl_ipsandports), 'label' => $lng['domains']['ssl_redirect']['title'], 'desc' => $lng['domains']['ssl_redirect']['description'], 'type' => 'checkbox', @@ -211,7 +214,7 @@ return array( 'checked' => false ), 'letsencrypt' => array( - 'visible' => (\Froxlor\Settings::Get('system.leenabled') == '1' ? (!empty($ssl_ipsandports) ? true : false) : false), + 'visible' => (Settings::Get('system.leenabled') == '1' && !empty($ssl_ipsandports)), 'label' => $lng['admin']['letsencrypt']['title'], 'desc' => $lng['admin']['letsencrypt']['description'], 'type' => 'checkbox', @@ -219,7 +222,7 @@ return array( 'checked' => false ), 'http2' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1', + 'visible' => !empty($ssl_ipsandports) && Settings::Get('system.webserver') != 'lighttpd' && Settings::Get('system.http2_support') == '1', 'label' => $lng['admin']['domain_http2']['title'], 'desc' => $lng['admin']['domain_http2']['description'], 'type' => 'checkbox', @@ -227,14 +230,14 @@ return array( 'checked' => false ), 'override_tls' => array( - 'visible' => ((!empty($ssl_ipsandports) ? true : false) && $userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1', 'label' => $lng['admin']['domain_override_tls'], 'type' => 'checkbox', 'value' => '1', 'checked' => false ), 'ssl_protocols' => array( - 'visible' => ((!empty($ssl_ipsandports) ? true : false) && $userinfo['change_serversettings'] == '1' && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' ? true : false), + 'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1' && Settings::Get('system.webserver') != 'lighttpd', 'label' => $lng['serversettings']['ssl']['ssl_protocols']['title'], 'desc' => $lng['serversettings']['ssl']['ssl_protocols']['description'], 'type' => 'checkbox', @@ -262,21 +265,21 @@ return array( 'is_array' => 1 ), 'ssl_cipher_list' => array( - 'visible' => ((!empty($ssl_ipsandports) ? true : false) && $userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1', 'label' => $lng['serversettings']['ssl']['ssl_cipher_list']['title'], 'desc' => $lng['serversettings']['ssl']['ssl_cipher_list']['description'], 'type' => 'text', - 'value' => \Froxlor\Settings::Get('system.ssl_cipher_list') + 'value' => Settings::Get('system.ssl_cipher_list') ), 'tlsv13_cipher_list' => array( - 'visible' => ((!empty($ssl_ipsandports) ? true : false) && $userinfo['change_serversettings'] == '1' && \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1 ? true : false), + 'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1' && Settings::Get('system.webserver') == "apache2" && Settings::Get('system.apache24') == 1, 'label' => $lng['serversettings']['ssl']['tlsv13_cipher_list']['title'], 'desc' => $lng['serversettings']['ssl']['tlsv13_cipher_list']['description'], 'type' => 'text', - 'value' => \Froxlor\Settings::Get('system.tlsv13_cipher_list') + 'value' => Settings::Get('system.tlsv13_cipher_list') ), 'ssl_specialsettings' => array( - 'visible' => ((!empty($ssl_ipsandports) ? true : false) && $userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1', 'label' => $lng['admin']['ownsslvhostsettings'], 'desc' => $lng['serversettings']['default_vhostconf']['description'], 'type' => 'textarea', @@ -284,14 +287,14 @@ return array( 'rows' => 12 ), 'include_specialsettings' => array( - 'visible' => ((!empty($ssl_ipsandports) ? true : false) && $userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1', 'label' => $lng['admin']['include_ownvhostsettings'], 'type' => 'checkbox', 'value' => '1', 'checked' => false ), 'hsts_maxage' => array( - 'visible' => ($ssl_ipsandports != '' ? true : false), + 'visible' => $ssl_ipsandports != '', 'label' => $lng['admin']['domain_hsts_maxage']['title'], 'desc' => $lng['admin']['domain_hsts_maxage']['description'], 'type' => 'number', @@ -300,7 +303,7 @@ return array( 'value' => 0 ), 'hsts_sub' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false), + 'visible' => !empty($ssl_ipsandports), 'label' => $lng['admin']['domain_hsts_incsub']['title'], 'desc' => $lng['admin']['domain_hsts_incsub']['description'], 'type' => 'checkbox', @@ -308,7 +311,7 @@ return array( 'checked' => false ), 'hsts_preload' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false), + 'visible' => !empty($ssl_ipsandports), 'label' => $lng['admin']['domain_hsts_preload']['title'], 'desc' => $lng['admin']['domain_hsts_preload']['description'], 'type' => 'checkbox', @@ -316,22 +319,22 @@ return array( 'checked' => false ), 'ocsp_stapling' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd', + 'visible' => !empty($ssl_ipsandports) && Settings::Get('system.webserver') != 'lighttpd', 'label' => $lng['admin']['domain_ocsp_stapling']['title'], - 'desc' => $lng['admin']['domain_ocsp_stapling']['description'] . (\Froxlor\Settings::Get('system.webserver') == 'nginx' ? $lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] : ""), + 'desc' => $lng['admin']['domain_ocsp_stapling']['description'] . (Settings::Get('system.webserver') == 'nginx' ? $lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] : ""), 'type' => 'checkbox', 'value' => '1', 'checked' => false ), 'honorcipherorder' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false), + 'visible' => !empty($ssl_ipsandports), 'label' => $lng['admin']['domain_honorcipherorder'], 'type' => 'checkbox', 'value' => '1', 'checked' => false ), 'sessiontickets' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.sessionticketsenabled' != '1'), + 'visible' => !empty($ssl_ipsandports) && Settings::Get('system.webserver') != 'lighttpd' && Settings::Get('system.sessionticketsenabled' != '1'), 'label' => $lng['admin']['domain_sessiontickets'], 'type' => 'checkbox', 'value' => '1', @@ -342,7 +345,7 @@ return array( 'section_c' => array( 'title' => $lng['admin']['phpserversettings'], 'image' => 'icons/domain_add.png', - 'visible' => (($userinfo['change_serversettings'] == '1' || $userinfo['caneditphpsettings'] == '1') ? true : false), + 'visible' => $userinfo['change_serversettings'] == '1' || $userinfo['caneditphpsettings'] == '1', 'fields' => array( 'openbasedir' => array( 'label' => 'OpenBasedir', @@ -357,19 +360,19 @@ return array( 'checked' => true ), 'phpsettingid' => array( - 'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false), + 'visible' => (int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['admin']['phpsettings']['title'], 'type' => 'select', 'select_var' => $phpconfigs, - 'selected' => (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1 ? \Froxlor\Settings::Get('phpfpm.defaultini') : \Froxlor\Settings::Get('system.mod_fcgid_defaultini') + 'selected' => (int) Settings::Get('phpfpm.enabled') == 1 ? Settings::Get('phpfpm.defaultini') : Settings::Get('system.mod_fcgid_defaultini') ), 'mod_fcgid_starter' => array( - 'visible' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => (int) Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['mod_fcgid_starter']['title'], 'type' => 'number' ), 'mod_fcgid_maxrequests' => array( - 'visible' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => (int) Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['mod_fcgid_maxrequests']['title'], 'type' => 'number' ) @@ -378,7 +381,7 @@ return array( 'section_d' => array( 'title' => $lng['admin']['nameserversettings'], 'image' => 'icons/domain_add.png', - 'visible' => (\Froxlor\Settings::Get('system.bind_enable') == '1' && $userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => Settings::Get('system.bind_enable') == '1' && $userinfo['change_serversettings'] == '1', 'fields' => array( 'isbinddomain' => array( 'label' => 'Nameserver', diff --git a/lib/formfields/admin/domains/formfield.domains_edit.php b/lib/formfields/admin/domains/formfield.domains_edit.php index f8a4f9b6..e88a9681 100644 --- a/lib/formfields/admin/domains/formfield.domains_edit.php +++ b/lib/formfields/admin/domains/formfield.domains_edit.php @@ -37,7 +37,7 @@ return array( 'mandatory' => true ), 'adminid' => array( - 'visible' => ($userinfo['customers_see_all'] == '1' ? true : false), + 'visible' => $userinfo['customers_see_all'] == '1', 'label' => $lng['admin']['admin'], 'type' => (\Froxlor\Settings::Get('panel.allow_domain_change_admin') == '1' ? 'select' : 'infotext'), 'select_var' => (!empty($admins) ? $admins : null), @@ -46,7 +46,7 @@ return array( 'mandatory' => true ), 'alias' => array( - 'visible' => ($alias_check == '0' ? true : false), + 'visible' => $alias_check == '0', 'label' => $lng['domains']['aliasdomain'], 'type' => 'select', 'select_var' => $domains, @@ -116,7 +116,7 @@ return array( 'selected' => $result['subcanemaildomain'] ), 'dkim' => array( - 'visible' => (\Froxlor\Settings::Get('dkim.use_dkim') == '1' ? true : false), + 'visible' => \Froxlor\Settings::Get('dkim.use_dkim') == '1', 'label' => 'DomainKeys', 'type' => 'checkbox', 'value' => '1', @@ -129,7 +129,7 @@ return array( 'image' => 'icons/domain_edit.png', 'fields' => array( 'documentroot' => array( - 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => $userinfo['change_serversettings'] == '1', 'label' => 'DocumentRoot', 'desc' => $lng['panel']['emptyfordefault'], 'type' => 'text', @@ -163,7 +163,7 @@ return array( 'value' => '0' ), 'specialsettings' => array( - 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => $userinfo['change_serversettings'] == '1', 'label' => $lng['admin']['ownvhostsettings'], 'desc' => $lng['serversettings']['default_vhostconf']['description'], 'type' => 'textarea', @@ -172,7 +172,7 @@ return array( 'rows' => 12 ), 'specialsettingsforsubdomains' => array( - 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => $userinfo['change_serversettings'] == '1', 'label' => $lng['admin']['specialsettingsforsubdomains'], 'desc' => $lng['serversettings']['specialsettingsforsubdomains']['description'], 'type' => 'checkbox', @@ -206,17 +206,17 @@ return array( 'section_bssl' => array( 'title' => $lng['admin']['webserversettings_ssl'], 'image' => 'icons/domain_edit.png', - 'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? true : false, + 'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1', 'fields' => array( 'sslenabled' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false), + 'visible' => !empty($ssl_ipsandports), 'label' => $lng['admin']['domain_sslenabled'], 'type' => 'checkbox', 'value' => '1', 'checked' => $result['ssl_enabled'] ), 'no_ssl_available_info' => array( - 'visible' => (empty($ssl_ipsandports) ? true : false), + 'visible' => empty($ssl_ipsandports), 'label' => 'SSL', 'type' => 'label', 'value' => $lng['panel']['nosslipsavailable'] @@ -230,7 +230,7 @@ return array( 'is_array' => 1 ), 'ssl_redirect' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false), + 'visible' => !empty($ssl_ipsandports), 'label' => $lng['domains']['ssl_redirect']['title'], 'desc' => $lng['domains']['ssl_redirect']['description'] . ($result['temporary_ssl_redirect'] > 1 ? $lng['domains']['ssl_redirect_temporarilydisabled'] : ''), 'type' => 'checkbox', @@ -238,7 +238,7 @@ return array( 'checked' => $result['ssl_redirect'] ), 'letsencrypt' => array( - 'visible' => (\Froxlor\Settings::Get('system.leenabled') == '1' ? (!empty($ssl_ipsandports) ? true : false) : false), + 'visible' => (\Froxlor\Settings::Get('system.leenabled') == '1' && !empty($ssl_ipsandports)), 'label' => $lng['admin']['letsencrypt']['title'], 'desc' => $lng['admin']['letsencrypt']['description'], 'type' => 'checkbox', @@ -246,7 +246,7 @@ return array( 'checked' => $result['letsencrypt'] ), 'http2' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1', + 'visible' => !empty($ssl_ipsandports) && \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', @@ -254,14 +254,14 @@ return array( 'checked' => $result['http2'] ), 'override_tls' => array( - 'visible' => ((!empty($ssl_ipsandports) ? true : false) && $userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1', 'label' => $lng['admin']['domain_override_tls'], 'type' => 'checkbox', 'value' => '1', 'checked' => $result['override_tls'] ), 'ssl_protocols' => array( - 'visible' => ((!empty($ssl_ipsandports) ? true : false) && $userinfo['change_serversettings'] == '1' && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' ? true : false), + 'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1' && \Froxlor\Settings::Get('system.webserver') != 'lighttpd', 'label' => $lng['serversettings']['ssl']['ssl_protocols']['title'], 'desc' => $lng['serversettings']['ssl']['ssl_protocols']['description'], 'type' => 'checkbox', @@ -287,21 +287,21 @@ return array( 'is_array' => 1 ), 'ssl_cipher_list' => array( - 'visible' => ((!empty($ssl_ipsandports) ? true : false) && $userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1', 'label' => $lng['serversettings']['ssl']['ssl_cipher_list']['title'], 'desc' => $lng['serversettings']['ssl']['ssl_cipher_list']['description'], 'type' => 'text', 'value' => !empty($result['ssl_cipher_list']) ? $result['ssl_cipher_list'] : \Froxlor\Settings::Get('system.ssl_cipher_list') ), 'tlsv13_cipher_list' => array( - 'visible' => ((!empty($ssl_ipsandports) ? true : false) && $userinfo['change_serversettings'] == '1' && \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1 ? true : false), + 'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1' && \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1, 'label' => $lng['serversettings']['ssl']['tlsv13_cipher_list']['title'], 'desc' => $lng['serversettings']['ssl']['tlsv13_cipher_list']['description'], 'type' => 'text', 'value' => !empty($result['tlsv13_cipher_list']) ? $result['tlsv13_cipher_list'] : \Froxlor\Settings::Get('system.tlsv13_cipher_list') ), 'ssl_specialsettings' => array( - 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => $userinfo['change_serversettings'] == '1', 'label' => $lng['admin']['ownsslvhostsettings'], 'desc' => $lng['serversettings']['default_vhostconf']['description'], 'type' => 'textarea', @@ -316,7 +316,7 @@ return array( 'checked' => $result['include_specialsettings'] ), 'hsts_maxage' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false), + 'visible' => !empty($ssl_ipsandports), 'label' => $lng['admin']['domain_hsts_maxage']['title'], 'desc' => $lng['admin']['domain_hsts_maxage']['description'], 'type' => 'number', @@ -325,7 +325,7 @@ return array( 'value' => $result['hsts'] ), 'hsts_sub' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false), + 'visible' => !empty($ssl_ipsandports), 'label' => $lng['admin']['domain_hsts_incsub']['title'], 'desc' => $lng['admin']['domain_hsts_incsub']['description'], 'type' => 'checkbox', @@ -333,7 +333,7 @@ return array( 'checked' => $result['hsts_sub'] ), 'hsts_preload' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false), + 'visible' => !empty($ssl_ipsandports), 'label' => $lng['admin']['domain_hsts_preload']['title'], 'desc' => $lng['admin']['domain_hsts_preload']['description'], 'type' => 'checkbox', @@ -341,7 +341,7 @@ return array( 'checked' => $result['hsts_preload'] ), 'ocsp_stapling' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd', + 'visible' => !empty($ssl_ipsandports) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd', 'label' => $lng['admin']['domain_ocsp_stapling']['title'], 'desc' => $lng['admin']['domain_ocsp_stapling']['description'] . (\Froxlor\Settings::Get('system.webserver') == 'nginx' ? $lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] : ""), 'type' => 'checkbox', @@ -349,14 +349,14 @@ return array( 'checked' => $result['ocsp_stapling'] ), 'honorcipherorder' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false), + 'visible' => !empty($ssl_ipsandports), 'label' => $lng['admin']['domain_honorcipherorder'], 'type' => 'checkbox', 'value' => '1', 'checked' => $result['ssl_honorcipherorder'] ), 'sessiontickets' => array( - 'visible' => (!empty($ssl_ipsandports) ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.sessionticketsenabled' != '1'), + 'visible' => !empty($ssl_ipsandports) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.sessionticketsenabled' != '1'), 'label' => $lng['admin']['domain_sessiontickets'], 'type' => 'checkbox', 'value' => '1', @@ -367,7 +367,7 @@ return array( 'section_c' => array( 'title' => $lng['admin']['phpserversettings'], 'image' => 'icons/domain_edit.png', - 'visible' => (($userinfo['change_serversettings'] == '1' || $userinfo['caneditphpsettings'] == '1') ? true : false), + 'visible' => $userinfo['change_serversettings'] == '1' || $userinfo['caneditphpsettings'] == '1', 'fields' => array( 'openbasedir' => array( 'label' => 'OpenBasedir', @@ -382,14 +382,14 @@ return array( 'checked' => $result['phpenabled'] ), 'phpsettingid' => array( - 'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false), + 'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1)), 'label' => $lng['admin']['phpsettings']['title'], 'type' => 'select', 'select_var' => $phpconfigs, 'selected' => $result['phpsettingid'] ), 'phpsettingsforsubdomains' => array( - 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => $userinfo['change_serversettings'] == '1', 'label' => $lng['admin']['phpsettingsforsubdomains'], 'desc' => $lng['serversettings']['phpsettingsforsubdomains']['description'], 'type' => 'checkbox', @@ -397,13 +397,13 @@ return array( 'checked' => \Froxlor\Settings::Get('system.apply_phpconfigs_default') == 1 ? '1' : '0' ), 'mod_fcgid_starter' => array( - 'visible' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => (int) \Froxlor\Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['mod_fcgid_starter']['title'], 'type' => 'number', 'value' => ((int) $result['mod_fcgid_starter'] != -1 ? $result['mod_fcgid_starter'] : '') ), 'mod_fcgid_maxrequests' => array( - 'visible' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => (int) \Froxlor\Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['mod_fcgid_maxrequests']['title'], 'type' => 'number', 'value' => ((int) $result['mod_fcgid_maxrequests'] != -1 ? $result['mod_fcgid_maxrequests'] : '') @@ -413,7 +413,7 @@ return array( 'section_d' => array( 'title' => $lng['admin']['nameserversettings'], 'image' => 'icons/domain_edit.png', - 'visible' => (\Froxlor\Settings::Get('system.bind_enable') == '1' && $userinfo['change_serversettings'] == '1' ? true : false), + 'visible' => \Froxlor\Settings::Get('system.bind_enable') == '1' && $userinfo['change_serversettings'] == '1', 'fields' => array( 'isbinddomain' => array( 'label' => 'Nameserver', diff --git a/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php b/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php index ea6ea19e..6e8bbf2f 100644 --- a/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php +++ b/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php @@ -54,7 +54,7 @@ return array( 'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'], 'type' => 'checkbox', 'value' => '1', - 'checked' => \Froxlor\Settings::Get('system.webserver') == 'apache2' && (int) \Froxlor\Settings::Get('system.apache24') == 0 ? true : false + 'checked' => \Froxlor\Settings::Get('system.webserver') == 'apache2' && (int) \Froxlor\Settings::Get('system.apache24') == 0 ), 'vhostcontainer' => array( 'label' => $lng['admin']['ipsandports']['create_vhostcontainer'], @@ -95,7 +95,7 @@ return array( 'rows' => 12 ), 'ssl_default_vhostconf_domain' => array( - 'visible' => (\Froxlor\Settings::Get('system.use_ssl') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.use_ssl') == 1, 'label' => $lng['admin']['ipsandports']['ssl_default_vhostconf_domain'], 'desc' => $lng['serversettings']['default_vhostconf_domain']['description'], 'type' => 'textarea', @@ -113,7 +113,7 @@ return array( 'section_d' => array( 'title' => $lng['admin']['ipsandports']['webserverssldomainconfig'], 'image' => 'icons/ipsports_add.png', - 'visible' => (\Froxlor\Settings::Get('system.use_ssl') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.use_ssl') == 1, '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 52a4caf8..2495af1b 100644 --- a/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php +++ b/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php @@ -99,7 +99,7 @@ return array( 'value' => $result['default_vhostconf_domain'] ), 'ssl_default_vhostconf_domain' => array( - 'visible' => (\Froxlor\Settings::Get('system.use_ssl') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.use_ssl') == 1, 'label' => $lng['admin']['ipsandports']['ssl_default_vhostconf_domain'], 'desc' => $lng['serversettings']['default_vhostconf_domain']['description'], 'type' => 'textarea', @@ -118,7 +118,7 @@ return array( 'section_d' => array( 'title' => $lng['admin']['ipsandports']['webserverssldomainconfig'], 'image' => 'icons/ipsports_edit.png', - 'visible' => (\Froxlor\Settings::Get('system.use_ssl') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.use_ssl') == 1, '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 de94656d..b02c711a 100644 --- a/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php +++ b/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php @@ -29,21 +29,21 @@ return array( 'maxlength' => 50 ), 'binary' => array( - 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['phpsettings']['binary'], 'type' => 'text', 'maxlength' => 255, 'value' => '/usr/bin/php-cgi' ), 'fpmconfig' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['admin']['phpsettings']['fpmdesc'], 'type' => 'select', 'select_var' => $fpmconfigs, 'selected' => 1 ), 'file_extensions' => array( - 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['phpsettings']['file_extensions'], 'desc' => $lng['admin']['phpsettings']['file_extensions_note'], 'type' => 'text', @@ -51,59 +51,59 @@ return array( 'value' => 'php' ), 'mod_fcgid_starter' => array( - 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['mod_fcgid_starter']['title'], 'type' => 'number' ), 'mod_fcgid_maxrequests' => array( - 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['mod_fcgid_maxrequests']['title'], 'type' => 'number' ), 'mod_fcgid_umask' => array( - 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['mod_fcgid_umask']['title'], 'type' => 'text', 'maxlength' => 3, 'value' => '022' ), 'phpfpm_enable_slowlog' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['admin']['phpsettings']['enable_slowlog'], 'type' => 'checkbox', 'value' => '1', 'checked' => false ), 'phpfpm_reqtermtimeout' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['admin']['phpsettings']['request_terminate_timeout'], 'type' => 'text', 'maxlength' => 10, 'value' => '60s' ), 'phpfpm_reqslowtimeout' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['admin']['phpsettings']['request_slowlog_timeout'], 'type' => 'text', 'maxlength' => 10, 'value' => '5s' ), 'phpfpm_pass_authorizationheader' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['admin']['phpsettings']['pass_authorizationheader'], 'type' => 'checkbox', 'value' => '1', 'checked' => false ), 'override_fpmconfig' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'], 'type' => 'checkbox', 'value' => '1', 'checked' => false ), 'pm' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['serversettings']['phpfpm_settings']['pm'], 'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'type' => 'select', @@ -114,49 +114,49 @@ return array( ] ), 'max_children' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'type' => 'number', 'value' => 1 ), 'start_servers' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'type' => 'number', 'value' => 20 ), 'min_spare_servers' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, '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' => 'number', 'value' => 5 ), 'max_spare_servers' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, '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' => 'number', 'value' => 35 ), 'max_requests' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'type' => 'number', 'value' => 0 ), 'idle_timeout' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'type' => 'number', 'value' => 10 ), 'limit_extensions' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, '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 b2c5f339..9e31a283 100644 --- a/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php +++ b/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php @@ -30,21 +30,21 @@ return array( 'value' => $result['description'] ), 'binary' => array( - 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['phpsettings']['binary'], 'type' => 'text', 'maxlength' => 255, 'value' => $result['binary'] ), 'fpmconfig' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['admin']['phpsettings']['fpmdesc'], 'type' => 'select', 'select_var' => $fpmconfigs, 'selected' => $result['fpmsettingid'] ), 'file_extensions' => array( - 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['phpsettings']['file_extensions'], 'desc' => $lng['admin']['phpsettings']['file_extensions_note'], 'type' => 'text', @@ -52,47 +52,47 @@ return array( 'value' => $result['file_extensions'] ), 'mod_fcgid_starter' => array( - 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['mod_fcgid_starter']['title'], 'type' => 'number', 'value' => ((int) $result['mod_fcgid_starter'] != -1 ? $result['mod_fcgid_starter'] : '') ), 'mod_fcgid_maxrequests' => array( - 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['mod_fcgid_maxrequests']['title'], 'type' => 'number', 'value' => ((int) $result['mod_fcgid_maxrequests'] != -1 ? $result['mod_fcgid_maxrequests'] : '') ), 'mod_fcgid_umask' => array( - 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1, 'label' => $lng['admin']['mod_fcgid_umask']['title'], 'type' => 'text', 'maxlength' => 3, 'value' => $result['mod_fcgid_umask'] ), 'phpfpm_enable_slowlog' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['admin']['phpsettings']['enable_slowlog'], 'type' => 'checkbox', 'value' => '1', 'checked' => $result['fpm_slowlog'] ), 'phpfpm_reqtermtimeout' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['admin']['phpsettings']['request_terminate_timeout'], 'type' => 'text', 'maxlength' => 10, 'value' => $result['fpm_reqterm'] ), 'phpfpm_reqslowtimeout' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['admin']['phpsettings']['request_slowlog_timeout'], 'type' => 'text', 'maxlength' => 10, 'value' => $result['fpm_reqslow'] ), 'phpfpm_pass_authorizationheader' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['admin']['phpsettings']['pass_authorizationheader'], 'type' => 'checkbox', 'value' => '1', @@ -105,7 +105,7 @@ return array( 'checked' => $result['override_fpmconfig'] ), 'pm' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['serversettings']['phpfpm_settings']['pm'], 'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'type' => 'select', @@ -117,49 +117,49 @@ return array( 'selected' => $result['pm'] ), 'max_children' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'type' => 'number', 'value' => $result['max_children'] ), 'start_servers' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'type' => 'number', 'value' => $result['start_servers'] ), 'min_spare_servers' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, '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' => 'number', 'value' => $result['min_spare_servers'] ), 'max_spare_servers' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, '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' => 'number', 'value' => $result['max_spare_servers'] ), 'max_requests' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'type' => 'number', 'value' => $result['max_requests'] ), 'idle_timeout' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'type' => 'number', 'value' => $result['idle_timeout'] ), 'limit_extensions' => array( - 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1, '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 914848f0..046e8559 100644 --- a/lib/formfields/customer/domains/formfield.domains_add.php +++ b/lib/formfields/customer/domains/formfield.domains_add.php @@ -51,12 +51,12 @@ return array( 'note' => $pathSelect['note'] ?? '', ), 'url' => array( - 'visible' => (Settings::Get('panel.pathedit') == 'Dropdown' ? true : false), + 'visible' => Settings::Get('panel.pathedit') == 'Dropdown', 'label' => $lng['panel']['urloverridespath'], 'type' => 'text' ), 'redirectcode' => array( - 'visible' => (Settings::Get('customredirect.enabled') == '1' ? true : false), + 'visible' => Settings::Get('customredirect.enabled') == '1', 'label' => $lng['domains']['redirectifpathisurl'], 'desc' => $lng['domains']['redirectifpathisurlinfo'], 'type' => 'select', @@ -74,7 +74,7 @@ return array( 'select_var' => $openbasedir ), 'phpsettingid' => array( - 'visible' => (((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0 ? true : false), + 'visible' => ((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0, 'label' => $lng['admin']['phpsettings']['title'], 'type' => 'select', 'select_var' => $phpconfigs, @@ -85,7 +85,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' => Settings::Get('system.use_ssl') == '1' && $ssl_ipsandports, 'fields' => array( 'sslenabled' => array( 'label' => $lng['admin']['domain_sslenabled'], @@ -101,7 +101,7 @@ return array( 'checked' => false ), 'letsencrypt' => array( - 'visible' => (Settings::Get('system.leenabled') == '1' ? true : false), + 'visible' => Settings::Get('system.leenabled') == '1', 'label' => $lng['customer']['letsencrypt']['title'], 'desc' => $lng['customer']['letsencrypt']['description'], 'type' => 'checkbox', @@ -109,7 +109,7 @@ return array( 'checked' => false ), 'http2' => array( - 'visible' => ($ssl_ipsandports ? true : false) && Settings::Get('system.webserver') != 'lighttpd' && Settings::Get('system.http2_support') == '1', + 'visible' => $ssl_ipsandports && Settings::Get('system.webserver') != 'lighttpd' && Settings::Get('system.http2_support') == '1', 'label' => $lng['admin']['domain_http2']['title'], 'desc' => $lng['admin']['domain_http2']['description'], 'type' => 'checkbox', diff --git a/lib/formfields/customer/domains/formfield.domains_edit.php b/lib/formfields/customer/domains/formfield.domains_edit.php index 7b0085b0..e182c95c 100644 --- a/lib/formfields/customer/domains/formfield.domains_edit.php +++ b/lib/formfields/customer/domains/formfield.domains_edit.php @@ -34,7 +34,7 @@ return array( 'values' => $domainips ), 'alias' => array( - 'visible' => ($alias_check == '0' ? true : false), + 'visible' => $alias_check == '0', 'label' => $lng['domains']['aliasdomain'], 'type' => 'select', 'select_var' => $domains, @@ -48,13 +48,13 @@ return array( 'selected' => $pathSelect['value'] ), 'url' => array( - 'visible' => (\Froxlor\Settings::Get('panel.pathedit') == 'Dropdown' ? true : false), + 'visible' => \Froxlor\Settings::Get('panel.pathedit') == 'Dropdown', 'label' => $lng['panel']['urloverridespath'], 'type' => 'text', 'value' => $urlvalue ), 'redirectcode' => array( - 'visible' => (\Froxlor\Settings::Get('customredirect.enabled') == '1' ? true : false), + 'visible' => \Froxlor\Settings::Get('customredirect.enabled') == '1', 'label' => $lng['domains']['redirectifpathisurl'], 'desc' => $lng['domains']['redirectifpathisurlinfo'], 'type' => 'select', @@ -62,7 +62,7 @@ return array( 'selected' => $def_code ), 'selectserveralias' => array( - 'visible' => ((($result['parentdomainid'] == '0' && $userinfo['subdomains'] != '0') || $result['parentdomainid'] != '0') ? true : false), + 'visible' => ($result['parentdomainid'] == '0' && $userinfo['subdomains'] != '0') || $result['parentdomainid'] != '0', 'label' => $lng['admin']['selectserveralias'], 'desc' => $lng['admin']['selectserveralias_desc'], 'type' => 'select', @@ -70,21 +70,21 @@ return array( 'selected' => $serveraliasoptions_selected ), 'isemaildomain' => array( - 'visible' => ((($result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2') && $result['parentdomainid'] != '0') ? true : false), + 'visible' => ($result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2') && $result['parentdomainid'] != '0', 'label' => 'Emaildomain', 'type' => 'checkbox', 'value' => '1', 'checked' => $result['isemaildomain'] ), 'openbasedir_path' => array( - 'visible' => ($result['openbasedir'] == '1') ? true : false, + 'visible' => $result['openbasedir'] == '1', 'label' => $lng['domain']['openbasedirpath'], 'type' => 'select', 'select_var' => $openbasedir, 'selected' => $result['openbasedir_path'] ), 'phpsettingid' => array( - 'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0 ? true : false), + 'visible' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0, 'label' => $lng['admin']['phpsettings']['title'], 'type' => 'select', 'select_var' => $phpconfigs, @@ -95,7 +95,7 @@ return array( 'section_bssl' => array( 'title' => $lng['admin']['webserversettings_ssl'], 'image' => 'icons/domain_edit.png', - 'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports ? (\Froxlor\Domain\Domain::domainHasSslIpPort($result['id']) ? true : false) : false) : false, + 'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' && $ssl_ipsandports && \Froxlor\Domain\Domain::domainHasSslIpPort($result['id']), 'fields' => array( 'sslenabled' => array( 'label' => $lng['admin']['domain_sslenabled'], @@ -111,7 +111,7 @@ return array( 'checked' => $result['ssl_redirect'] ), 'letsencrypt' => array( - 'visible' => \Froxlor\Settings::Get('system.leenabled') == '1' ? true : false, + 'visible' => \Froxlor\Settings::Get('system.leenabled') == '1', 'label' => $lng['customer']['letsencrypt']['title'], 'desc' => $lng['customer']['letsencrypt']['description'], 'type' => 'checkbox', @@ -119,7 +119,7 @@ return array( 'checked' => $result['letsencrypt'] ), 'http2' => array( - 'visible' => ($ssl_ipsandports ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1', + 'visible' => $ssl_ipsandports && \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', diff --git a/lib/formfields/customer/email/formfield.emails_addaccount.php b/lib/formfields/customer/email/formfield.emails_addaccount.php index 08e3827c..4309877b 100644 --- a/lib/formfields/customer/email/formfield.emails_addaccount.php +++ b/lib/formfields/customer/email/formfield.emails_addaccount.php @@ -43,14 +43,14 @@ return array( ] ), 'email_quota' => array( - 'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false), + 'visible' => \Froxlor\Settings::Get('system.mail_quota_enabled') == '1', 'label' => $lng['emails']['quota'], 'desc' => "MiB", 'type' => 'number', 'value' => $quota ), 'alternative_email' => array( - 'visible' => (\Froxlor\Settings::Get('panel.sendalternativemail') == '1' ? true : false), + 'visible' => \Froxlor\Settings::Get('panel.sendalternativemail') == '1', '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 da46a3a7..257b9320 100644 --- a/lib/formfields/customer/email/formfield.emails_edit.php +++ b/lib/formfields/customer/email/formfield.emails_edit.php @@ -30,7 +30,7 @@ return array( 'value' => $result['email_full'] ), 'account_yes' => array( - 'visible' => ((int) $result['popaccountid'] != 0 ? true : false), + 'visible' => (int) $result['popaccountid'] != 0, 'label' => $lng['emails']['account'], 'type' => 'label', 'value' => $lng['panel']['yes'], @@ -50,7 +50,7 @@ return array( ] ), 'account_no' => array( - 'visible' => ((int) $result['popaccountid'] == 0 ? true : false), + 'visible' => (int) $result['popaccountid'] == 0, 'label' => $lng['emails']['account'], 'type' => 'label', 'value' => $lng['panel']['no'], diff --git a/lib/formfields/customer/ftp/formfield.ftp_add.php b/lib/formfields/customer/ftp/formfield.ftp_add.php index 78b7ce4e..0590236c 100644 --- a/lib/formfields/customer/ftp/formfield.ftp_add.php +++ b/lib/formfields/customer/ftp/formfield.ftp_add.php @@ -23,7 +23,7 @@ return array( 'image' => 'icons/user_add.png', 'fields' => array( 'ftp_username' => array( - 'visible' => (\Froxlor\Settings::Get('customer.ftpatdomain') == '1' ? true : false), + 'visible' => \Froxlor\Settings::Get('customer.ftpatdomain') == '1', 'label' => $lng['login']['username'], 'type' => 'text', 'next_to' => (\Froxlor\Settings::Get('customer.ftpatdomain') == '1' && count($domainlist) > 0 ? [ @@ -66,7 +66,7 @@ return array( 'checked' => false ), 'shell' => array( - 'visible' => (\Froxlor\Settings::Get('system.allow_customer_shell') == '1' ? true : false), + 'visible' => \Froxlor\Settings::Get('system.allow_customer_shell') == '1', 'label' => $lng['panel']['shell'], 'type' => 'select', 'select_var' => $shells_avail, diff --git a/lib/formfields/customer/ftp/formfield.ftp_edit.php b/lib/formfields/customer/ftp/formfield.ftp_edit.php index 411e9cb5..6898a376 100644 --- a/lib/formfields/customer/ftp/formfield.ftp_edit.php +++ b/lib/formfields/customer/ftp/formfield.ftp_edit.php @@ -53,7 +53,7 @@ return array( 'value' => \Froxlor\System\Crypt::generatePassword() ), 'shell' => array( - 'visible' => (\Froxlor\Settings::Get('system.allow_customer_shell') == '1' ? true : false), + 'visible' => \Froxlor\Settings::Get('system.allow_customer_shell') == '1', 'label' => $lng['panel']['shell'], 'type' => 'select', 'select_var' => $shells_avail, diff --git a/lib/formfields/customer/mysql/formfield.mysql_add.php b/lib/formfields/customer/mysql/formfield.mysql_add.php index 3975bf92..352a908b 100644 --- a/lib/formfields/customer/mysql/formfield.mysql_add.php +++ b/lib/formfields/customer/mysql/formfield.mysql_add.php @@ -25,7 +25,7 @@ return array( 'image' => 'icons/mysql_add.png', 'fields' => array( 'custom_suffix' => array( - 'visible' => (strtoupper(Settings::Get('customer.mysqlprefix')) == 'DBNAME') ? true : false, + 'visible' => strtoupper(Settings::Get('customer.mysqlprefix')) == 'DBNAME', 'label' => $lng['mysql']['databasename'], 'type' => 'text' ), @@ -34,7 +34,7 @@ return array( 'type' => 'text' ), 'mysql_server' => array( - 'visible' => (count($mysql_servers) > 1 ? true : false), + 'visible' => count($mysql_servers) > 1, 'label' => $lng['mysql']['mysql_server'], 'type' => 'select', 'select_var' => $mysql_servers diff --git a/lib/formfields/customer/mysql/formfield.mysql_edit.php b/lib/formfields/customer/mysql/formfield.mysql_edit.php index b79dbc62..2587964c 100644 --- a/lib/formfields/customer/mysql/formfield.mysql_edit.php +++ b/lib/formfields/customer/mysql/formfield.mysql_edit.php @@ -33,7 +33,7 @@ return array( 'value' => $result['description'] ), 'mysql_server' => array( - 'visible' => ($count_mysql_servers > 1 ? true : false), + 'visible' => $count_mysql_servers > 1, 'label' => $lng['mysql']['mysql_server'], 'type' => 'label', 'value' => $sql_root['caption'] diff --git a/ssl_editor.php b/ssl_editor.php index 53a28068..b2093133 100644 --- a/ssl_editor.php +++ b/ssl_editor.php @@ -40,7 +40,7 @@ if ($action == '' || $action == 'view') { $result_domain = json_decode($json_result, true)['data']; if (isset($_POST['send']) && $_POST['send'] == 'send') { - $do_insert = isset($_POST['do_insert']) ? (($_POST['do_insert'] == 1) ? true : false) : false; + $do_insert = isset($_POST['do_insert']) && ((($_POST['do_insert'] == 1) ? true : false)); try { if ($do_insert) { Certificates::getLocal($userinfo, $_POST)->add();