Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

@@ -2,9 +2,9 @@
/**
* @brief Hosting Settings
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @subpackage Nexus
* @since 08 Aug 2014
* @version SVN_VERSION_NUMBER
@@ -54,6 +54,7 @@ class _settings extends \IPS\Dispatcher\Controller
$form->addHeader('domain_options');
$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 ) )
{
$optionsVal[] = 'enom';
@@ -75,14 +76,37 @@ class _settings extends \IPS\Dispatcher\Controller
'toggles' => array(
'enom' => array( 'form_header_nexus_domain_prices', 'nexus_domain_prices', 'nexus_domain_tax' ),
'sub' => array( 'form_header_nexus_hosting_sub', 'nexus_hosting_subdomains' ),
'own' => array()
'own' => array( 'nexus_hosting_own_domains' )
),
'disabled' => \IPS\Settings::i()->nexus_enom_un ? array() : array( 'enom' )
) ) );
$form->add( new \IPS\Helpers\Form\Stack( 'nexus_hosting_nameservers', explode( ',', \IPS\Settings::i()->nexus_hosting_nameservers ), FALSE, array(), NULL, NULL, NULL, 'nexus_hosting_nameservers' ) );
$form->add( new \IPS\Helpers\Form\Stack( 'nexus_hosting_nameservers', explode( ',', \IPS\Settings::i()->nexus_hosting_nameservers ), FALSE, array(), function( $val ) {
if ( empty( $val ) and ( array_key_exists( 'enom', \IPS\Request::i()->domain_options ) or ( array_key_exists( 'own', \IPS\Request::i()->domain_options ) and array_key_exists( 'nameservers', \IPS\Request::i()->nexus_hosting_own_domains ) ) ) )
{
throw new \DomainException('nexus_hosting_nameservers_err');
}
}, NULL, NULL, 'nexus_hosting_nameservers' ) );
$form->add( new \IPS\Helpers\Form\Stack( 'nexus_hosting_subdomains', explode( ',', \IPS\Settings::i()->nexus_hosting_subdomains ), FALSE, array(), NULL, NULL, NULL, 'nexus_hosting_subdomains' ) );
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'nexus_hosting_own_domains', explode( ',', \IPS\Settings::i()->nexus_hosting_own_domains ), FALSE, array(
'options' => array(
'nameservers' => 'nexus_hosting_own_domains_nameservers',
'aname' => 'nexus_hosting_own_domains_aname',
'cname' => 'nexus_hosting_own_domains_cname',
),
'toggles' => array(
'cname' => array( 'nexus_hosting_own_domain_sub' )
)
), NULL, NULL, NULL, 'nexus_hosting_own_domains' ) );
$form->add( new \IPS\Helpers\Form\Text( 'nexus_hosting_own_domain_sub', \IPS\Settings::i()->nexus_hosting_own_domain_sub, FALSE, array(), function( $val ) {
if ( !$val and array_key_exists( 'own', \IPS\Request::i()->domain_options ) and array_key_exists( 'cname', \IPS\Request::i()->nexus_hosting_own_domains ) )
{
throw new \DomainException('nexus_hosting_own_domain_sub_err');
}
}, NULL, NULL, 'nexus_hosting_own_domain_sub' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'nexus_hosting_allow_change_domain', \IPS\Settings::i()->nexus_hosting_allow_change_domain, FALSE, array(), NULL, NULL, NULL ) );
$form->addHeader('nexus_domain_prices');
$matrix = new \IPS\Helpers\Form\Matrix;
$matrix = new \IPS\Helpers\Form\Matrix( 'prices' );
$matrix->squashFields = FALSE;
$matrix->columns = array(
'domain_tld' => array( 'Text' ),
'domain_price' => function( $key, $value, $data )
@@ -104,10 +128,11 @@ class _settings extends \IPS\Dispatcher\Controller
$form->addMatrix( 'nexus_domain_prices', $matrix );
$form->add( new \IPS\Helpers\Form\Node( 'nexus_domain_tax', \IPS\Settings::i()->nexus_domain_tax, FALSE, array( 'class' => 'IPS\nexus\Tax', 'zeroVal' => 'do_not_tax' ), NULL, NULL, NULL, 'nexus_domain_tax' ) );
/* Badwidth */
/* Bandwidth */
$form->addTab('nexus_hosting_bandwidth');
$form->addMessage( 'nexus_hosting_bandwidth_blurb' );
$bandwidthMatrix = new \IPS\Helpers\Form\Matrix;
$bandwidthMatrix = new \IPS\Helpers\Form\Matrix( 'bandwidth' );
$bandwidthMatrix->squashFields = FALSE;
$bandwidthMatrix->columns = array(
'bandwidth_amount' => array( 'Number' ),
'bandwidth_price' => function( $key, $value, $data )
@@ -148,11 +173,13 @@ class _settings extends \IPS\Dispatcher\Controller
$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'] ) : '';
\IPS\DB::i()->update( 'core_tasks', array( 'enabled' => (bool) $values['nexus_hosting_terminate'] ), "`key`='terminateHosting'" );
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => (bool) $values['nexus_hosting_terminate'] ), "`key`='terminateHosting'" );
$bandwidthPrices = array();
foreach ( $values['nexus_hosting_bandwidth'] as $option )
foreach ( $values['nexus_hosting_bandwidth'] as $key => $option )
{
if ( $option['bandwidth_amount'] )
{
@@ -165,6 +192,7 @@ class _settings extends \IPS\Dispatcher\Controller
$form->saveAsSettings( $values );
\IPS\Session::i()->log( 'acplogs__hosting_settings' );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=nexus&module=hosting&controller=settings" ) );
}
/* Display */