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 Server Errors
* @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 12 Aug 2014
* @version SVN_VERSION_NUMBER
@@ -209,6 +209,9 @@ class _errors extends \IPS\Dispatcher\Controller
*/
public function delete()
{
/* Make sure the user confirmed the deletion */
\IPS\Request::i()->confirmedDelete();
\IPS\Db::i()->delete( 'nexus_hosting_errors', array( 'e_id=?', \IPS\Request::i()->id ) );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=hosting&controller=errors'), 'deleted' );
}
@@ -2,9 +2,9 @@
/**
* @brief Monitoring 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 07 Aug 2014
* @version SVN_VERSION_NUMBER
@@ -77,11 +77,11 @@ class _monitoring extends \IPS\Node\Controller
if ( !$values['monitoring_on'] )
{
$values['monitoring_script'] = '';
\IPS\DB::i()->update( 'core_tasks', array( 'enabled' => 0 ), "`key`='monitor'" );
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 0 ), "`key`='monitor'" );
}
else
{
\IPS\DB::i()->update( 'core_tasks', array( 'enabled' => 1 ), "`key`='monitor'" );
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), "`key`='monitor'" );
}
unset( $values['monitoring_on'] );
@@ -2,9 +2,9 @@
/**
* @brief Hosting Queues
* @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 06 Aug 2014
* @version SVN_VERSION_NUMBER
@@ -2,9 +2,9 @@
/**
* @brief Hosting Servers
* @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 06 Aug 2014
* @version SVN_VERSION_NUMBER
@@ -190,7 +190,7 @@ class _servers extends \IPS\Node\Controller
$months += ( $purchase->renewals->interval->m );
$months += ( $purchase->renewals->interval->d * ( 365 / 12 ) );
return new \IPS\nexus\Money( $purchase->renewals->cost->amount * $months, $purchase->renewals->cost->currency );
return new \IPS\nexus\Money( $purchase->renewals->cost->amount->multiply( new \IPS\Math\Number("{$months}" ) ), $purchase->renewals->cost->currency );
}
catch ( \OutOfRangeException $e )
{
@@ -295,7 +295,7 @@ class _servers extends \IPS\Node\Controller
\IPS\Http\Url::internal('app=nexus&module=hosting&controller=servers&do=audit'),
function( $data ) use ( $self )
{
if ( $data === 0 )
if ( !is_array( $data ) )
{
$_SESSION['serverAudit'] = array();
$data = array( 'offset' => 0, 'bad' => array() );
@@ -303,7 +303,7 @@ class _servers extends \IPS\Node\Controller
try
{
$select = \IPS\Db::i()->select( '*', 'nexus_hosting_servers', array(), 'server_hostname', array( $data['offset'], 1 ) );
$select = \IPS\Db::i()->select( '*', 'nexus_hosting_servers', array(), 'server_hostname', array( $data['offset'], 1 ), NULL, NULL, \IPS\Db::SELECT_SQL_CALC_FOUND_ROWS );
$server = \IPS\nexus\Hosting\Server::constructFromData( $select->first() );
$results = $self->_audit( $server );
@@ -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 */