Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

@@ -12,7 +12,7 @@
namespace IPS\nexus\modules\admin\hosting;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -23,6 +23,11 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
*/
class _settings extends \IPS\Dispatcher\Controller
{
/**
* @brief Has been CSRF-protected
*/
public static $csrfProtected = TRUE;
/**
* Execute
*
@@ -46,7 +51,7 @@ class _settings extends \IPS\Dispatcher\Controller
/* Account Management */
$form->addTab('hosting_account_management');
$form->add( new \IPS\Helpers\Form\Number( 'nexus_hosting_terminate', \IPS\Settings::i()->nexus_hosting_terminate, TRUE, array( 'unlimited' => -1, 'unlimitedLang' => 'forever' ), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('days') ) );
$form->add( new \IPS\Helpers\Form\Interval( 'nexus_hosting_terminate', \IPS\Settings::i()->nexus_hosting_terminate, TRUE, array( 'valueAs' => \IPS\Helpers\Form\Interval::DAYS, 'unlimited' => -1, 'unlimitedLang' => 'forever' ), NULL, NULL, NULL ) );
/* Domains */
$form->addTab('hosting_settings_domains');
@@ -54,7 +59,7 @@ class _settings extends \IPS\Dispatcher\Controller
$optionsVal = array();
$domainPrices = array();
if ( \IPS\Settings::i()->nexus_enom_un and $domainPrices = json_decode( \IPS\Settings::i()->nexus_domain_prices, TRUE ) and count( $domainPrices ) )
if ( \IPS\Settings::i()->nexus_enom_un and $domainPrices = json_decode( \IPS\Settings::i()->nexus_domain_prices, TRUE ) and \count( $domainPrices ) )
{
$optionsVal[] = 'enom';
}
@@ -113,7 +118,7 @@ class _settings extends \IPS\Dispatcher\Controller
return new \IPS\nexus\Form\Money( $key, $value, FALSE, array() );
},
);
if ( count( $domainPrices ) )
if ( \count( $domainPrices ) )
{
foreach ( $domainPrices as $tld => $prices )
{
@@ -140,7 +145,7 @@ class _settings extends \IPS\Dispatcher\Controller
},
);
$bandwidthPrices = json_decode( \IPS\Settings::i()->nexus_hosting_bandwidth, TRUE );
if ( count( $bandwidthPrices ) )
if ( \count( $bandwidthPrices ) )
{
foreach ( $bandwidthPrices as $amount => $prices )
{
@@ -157,7 +162,7 @@ class _settings extends \IPS\Dispatcher\Controller
if ( $values = $form->values() )
{
$domainPrices = array();
if ( in_array( 'enom', $values['domain_options'] ) )
if ( \in_array( 'enom', $values['domain_options'] ) )
{
foreach ( $values['nexus_domain_prices'] as $option )
{
@@ -168,11 +173,11 @@ class _settings extends \IPS\Dispatcher\Controller
}
}
$values['nexus_domain_prices'] = json_encode( $domainPrices );
$values['nexus_hosting_allow_own_domain'] = in_array( 'own', $values['domain_options'] );
$values['nexus_hosting_allow_own_domain'] = \in_array( 'own', $values['domain_options'] );
$values['nexus_hosting_nameservers'] = implode( ',', $values['nexus_hosting_nameservers'] );
$values['nexus_hosting_subdomains'] = in_array( 'sub', $values['domain_options'] ) ? implode( ',', $values['nexus_hosting_subdomains'] ) : '';
$values['nexus_hosting_own_domains'] = in_array( 'own', $values['domain_options'] ) ? implode( ',', $values['nexus_hosting_own_domains'] ) : '';
$values['nexus_hosting_subdomains'] = \in_array( 'sub', $values['domain_options'] ) ? implode( ',', $values['nexus_hosting_subdomains'] ) : '';
$values['nexus_hosting_own_domains'] = \in_array( 'own', $values['domain_options'] ) ? implode( ',', $values['nexus_hosting_own_domains'] ) : '';
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => (bool) $values['nexus_hosting_terminate'] ), "`key`='terminateHosting'" );