remove unnecessary ternaries (#1027)

* remove unnecessary ternaries

* fix: !($id <= 0);

* remove ternary
This commit is contained in:
Dennis Dudek
2022-04-14 09:02:10 +02:00
committed by GitHub
parent d90676a793
commit 25d9c52c58
44 changed files with 310 additions and 304 deletions

View File

@@ -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(

View File

@@ -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
*/

View File

@@ -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(

View File

@@ -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')) {

View File

@@ -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

View File

@@ -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
*/

View File

@@ -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);

View File

@@ -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');

View File

@@ -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(

View File

@@ -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);

View File

@@ -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

View File

@@ -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();

View File

@@ -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')) {

View File

@@ -18,9 +18,9 @@ use Froxlor\FroxlorLogger;
* @author Froxlor team <team@froxlor.org> (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');

View File

@@ -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');

View File

@@ -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;

View File

@@ -14,9 +14,9 @@ namespace Froxlor\Http;
* @author Froxlor team <team@froxlor.org> (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) <d00p@froxlor.org>
*
*
*/
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)

View File

@@ -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;
}
}

View File

@@ -62,18 +62,18 @@ class Crypt
* @author Michal Wojcik <m.wojcik@sonet3.pl>
* @author Michael Kaufmann <mkaufmann@nutime.de>
* @author Froxlor team <team@froxlor.org> (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

View File

@@ -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')) {

View File

@@ -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)
];

View File

@@ -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(

View File

@@ -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'] . '&nbsp;(' . $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(

View File

@@ -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'] . '?',

View File

@@ -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'] . '?',

View File

@@ -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',

View File

@@ -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',

View File

@@ -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'],

View File

@@ -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'],

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -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'
)

View File

@@ -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'],

View File

@@ -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,

View File

@@ -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,

View File

@@ -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

View File

@@ -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']