Version 4.7.6

This commit is contained in:
Neo committed 2025-12-19 16:05:19 -08:00
1 parent 8ba7d43898
commit 7b7404e741
1085 files changed
+30590 -7837

No files matched your search

@@ -145,6 +145,7 @@ class _gateways extends \IPS\Node\Controller
$obj->save();
\IPS\Lang::saveCustom( 'nexus', "nexus_paymethod_{$obj->id}", $name );
\IPS\Session::i()->log( 'acplogs__nexus_added_gateway', array( "nexus_paymethod_{$obj->id}" => TRUE ) );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=payments&controller=paymentsettings&tab=gateways') );
}
@@ -85,7 +85,7 @@ class _shippingrates extends \IPS\Node\Controller
$allAreZero = TRUE;
foreach ( $rate['min'] as $val )
{
if ( $val !== 0 )
if ( (int) $val !== 0 )
{
$allAreZero = FALSE;
}
@@ -96,7 +96,7 @@ class _shippingrates extends \IPS\Node\Controller
$haveNoLowerLimit = TRUE;
}
}
elseif ( $rate['min'] === 0 )
elseif ( (int) $rate['min'] === 0 )
{
$haveNoLowerLimit = TRUE;
}
@@ -113,13 +113,13 @@ class _shippingrates extends \IPS\Node\Controller
{
foreach ( $lastUpper as $k => $v )
{
if ( \strval( $rate['min'][ $k ] - $v ) > 0.01 ) # @note: We use strval() here to prevent PHP from applying a precision to the float, inadvertently causing this to return TRUE
if ( \strval( $rate['min'][ $k ] - $v ) >= 0.02 ) # @note: We use strval() here to prevent PHP from applying a precision to the float, inadvertently causing this to return TRUE
{
$consecutive = FALSE;
}
}
}
elseif ( \strval( $rate['min'] - $lastUpper ) > 0.01 ) # @note: We use strval() here to prevent PHP from applying a precision to the float, inadvertently causing this to return TRUE
elseif ( \strval( $rate['min'] - $lastUpper ) >= 0.02 ) # @note: We use strval() here to prevent PHP from applying a precision to the float, inadvertently causing this to return TRUE
{
$consecutive = FALSE;
}
@@ -27,7 +27,7 @@ class _transactions extends \IPS\Dispatcher\Controller
* @brief Has been CSRF-protected
*/
public static $csrfProtected = TRUE;
/**
* Execute
*
@@ -113,9 +113,9 @@ class _transactions extends \IPS\Dispatcher\Controller
\IPS\Output::i()->error( 'node_error', '2X186/9', 404, '' );
}
$method = $transaction->method;
/* Can we approve it? */
if ( !\in_array( $transaction->status, array( \IPS\nexus\Transaction::STATUS_WAITING, \IPS\nexus\Transaction::STATUS_HELD, \IPS\nexus\Transaction::STATUS_REVIEW, \IPS\nexus\Transaction::STATUS_GATEWAY_PENDING, \IPS\nexus\Transaction::STATUS_DISPUTED ) ) )
if ( !$method or !\in_array( $transaction->status, array( \IPS\nexus\Transaction::STATUS_WAITING, \IPS\nexus\Transaction::STATUS_HELD, \IPS\nexus\Transaction::STATUS_REVIEW, \IPS\nexus\Transaction::STATUS_GATEWAY_PENDING, \IPS\nexus\Transaction::STATUS_DISPUTED ) ) )
{
\IPS\Output::i()->error( 'transaction_status_err', '2X186/A', 403, '' );
}
@@ -561,7 +561,7 @@ class _transactions extends \IPS\Dispatcher\Controller
$transaction->member->log( 'transaction', array(
'type' => 'delete',
'id' => $transaction->id,
'method' => $transaction->method->id
'method' => $transaction->method ? $transaction->method->id : NULL,
) );
}
}
@@ -571,7 +571,7 @@ class _transactions extends \IPS\Dispatcher\Controller
}
/* Redirect */
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=payments&controller=transactions') );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=payments&controller=transactions')->getSafeUrlFromFilters());
}
@@ -588,27 +588,27 @@ class _transactions extends \IPS\Dispatcher\Controller
switch ( \IPS\Request::i()->r )
{
case 'v':
\IPS\Output::i()->redirect( $transaction->acpUrl() );
\IPS\Output::i()->redirect( $transaction->acpUrl()->getSafeUrlFromFilters() );
break;
case 'i':
\IPS\Output::i()->redirect( $transaction->invoice->acpUrl() );
\IPS\Output::i()->redirect( $transaction->invoice->acpUrl()->getSafeUrlFromFilters() );
break;
case 'c':
\IPS\Output::i()->redirect( $transaction->member->acpUrl() );
\IPS\Output::i()->redirect( $transaction->member->acpUrl()->getSafeUrlFromFilters());
break;
case 't':
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=payments&controller=transactions') );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=payments&controller=transactions')->getSafeUrlFromFilters() );
break;
case 'n':
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=core&module=overview&controller=notifications') );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=core&module=overview&controller=notifications')->getSafeUrlFromFilters());
break;
}
}
\IPS\Output::i()->redirect( $transaction->acpUrl() );
\IPS\Output::i()->redirect( $transaction->acpUrl()->getSafeUrlFromFilters());
}
}
@@ -249,6 +249,8 @@ class _packages extends \IPS\Node\Controller
$package->reg = FALSE;
$package->save();
\IPS\Session::i()->log( 'acplogs__nexus_package_hidden', array( 'nexus_package_' . $package->id => TRUE ) );
/* Redirect */
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=nexus&module=store&controller=packages" )->setQueryString( array( 'root' => ( $package->parent() ? $package->parent()->_id : '' ) ) ) );
}
@@ -120,6 +120,8 @@ class _settings extends \IPS\Dispatcher\Controller
$values['nexus_minimum_order'] = $values['nexus_minimum_order'] ? json_encode( $values['nexus_minimum_order'] ) : '';
$form->saveAsSettings( $values );
\IPS\Session::i()->log( 'acplogs__nexus_store_settings' );
/* Clear guest page caches */
\IPS\Data\Cache::i()->clearAll();
@@ -210,6 +210,8 @@ class _subscriptions extends \IPS\Node\Controller
$package->delete();
}
\IPS\Session::i()->log( 'acplogs__nexus_sub_converted', array( "nexus_subs_{$sub->id}" => TRUE ) );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=subscriptions&controller=subscriptions'), 'nexus_package_converted_lovely' );
}
@@ -253,6 +255,7 @@ class _subscriptions extends \IPS\Node\Controller
/* Are there any purchases of this product? */
if ( !isset( \IPS\Request::i()->confirmImplications ) and \IPS\Db::i()->select( 'COUNT(*)', 'nexus_purchases', array( 'ps_app=? AND ps_type=? AND ps_item_id=?', 'nexus', 'subscription', $package->id ) )->first() )
{
\IPS\Output::i()->bypassCsrfKeyCheck = TRUE;
$options = array(
'product_delete_confirm' => \IPS\Http\Url::internal( "app=nexus&module=subscriptions&controller=subscriptions&do=delete&wasConfirmed=1&id={$package->_id}&confirmImplications=1" )->csrf(),
);
@@ -293,6 +296,8 @@ class _subscriptions extends \IPS\Node\Controller
$package->enabled = FALSE;
$package->save();
\IPS\Settings::i()->log( 'aplogs__nexus_sub_hidden', array( "nexus_subs_{$sub->id}" => TRUE ) );
/* Redirect */
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=nexus&module=subscriptions&controller=subscriptions" ) );
}
@@ -1230,4 +1230,32 @@ class _request extends \IPS\nexus\modules\front\support\view
}
return $defaultAction;
}
/**
* Redirect to next/prev support request
*
* @return void
*/
public function nextRequest()
{
$type = \IPS\Request::i()->ty == 'next' ? 0 : 1;
try
{
$request = Support\Request::loadAndCheckPerms( \IPS\Request::i()->id );
$nextRequest = $request->nextPrevious( $type );
}
catch ( \OutOfRangeException $e )
{
\IPS\Output::i()->error( 'node_error', '2X208/N', 404, '' );
}
/* Nothing left? */
if( $nextRequest === NULL )
{
\IPS\Output::i()->error( 'next_request_not_found', '2X208/O', 404, '' );
}
\IPS\Output::i()->redirect( $nextRequest->acpUrl() );
}
}
@@ -95,7 +95,7 @@ class _credit extends \IPS\Dispatcher\Controller
/* Can we withdraw? */
$canWithdraw = FALSE;
$withdrawOptions = json_decode( \IPS\Settings::i()->nexus_payout, TRUE );
if ( \count( $withdrawOptions ) )
if( \is_countable( $withdrawOptions ) AND \count( $withdrawOptions ) )
{
foreach ( \IPS\nexus\Money::currencies() as $currency )
{
@@ -149,7 +149,7 @@ class _credit extends \IPS\Dispatcher\Controller
{
unset( $withdrawOptions['Stripe'] );
}
if ( \count( $withdrawOptions ) )
if ( \is_countable( $withdrawOptions ) AND \count( $withdrawOptions ) )
{
$withdrawForm = new \IPS\Helpers\Form( 'withdraw', 'withdraw_credit' );
@@ -254,7 +254,7 @@ class _credit extends \IPS\Dispatcher\Controller
}
}
if ( \count( $withdrawOptions ) > 1 )
if ( \is_countable( $withdrawOptions ) AND \count( $withdrawOptions ) > 1 )
{
$withdrawForm->add( new \IPS\Helpers\Form\Radio( 'withdraw_method', NULL, TRUE, array( 'options' => $options, 'toggles' => $toggles ) ) );
}
@@ -63,6 +63,10 @@ class _donations extends \IPS\Dispatcher\Controller
*/
public function donate()
{
if( !\IPS\Member::loggedIn()->member_id )
{
\IPS\Output::i()->error( 'no_module_permission_guest', '1X238/3', 403, '' );
}
try
{
$goal = \IPS\nexus\Donation\Goal::load( \IPS\Request::i()->id );
@@ -136,7 +136,7 @@ class _cart extends \IPS\Dispatcher\Controller
\IPS\Db::i()->delete( 'nexus_cart_uploads', \IPS\Db::i()->in( 'id', $ids ) );
}
}
if ( empty( $_SESSION['cart'] ) and \IPS\CACHE_PAGE_TIMEOUT and !\IPS\Member::loggedIn()->member_id )
{
\IPS\Request::i()->setCookie( 'noCache', 0, \IPS\DateTime::ts( time() - 86400 ) );
@@ -170,12 +170,12 @@ class _cart extends \IPS\Dispatcher\Controller
$ids[] = $id;
}
\IPS\Db::i()->delete( 'nexus_cart_uploads', \IPS\Db::i()->in( 'id', $ids ) );
if ( \IPS\CACHE_PAGE_TIMEOUT and !\IPS\Member::loggedIn()->member_id )
{
\IPS\Request::i()->setCookie( 'noCache', 0, \IPS\DateTime::ts( time() - 86400 ) );
}
if ( \IPS\Request::i()->isAjax() )
{
\IPS\Output::i()->json( $_SESSION['cart'] );
@@ -238,11 +238,12 @@ class _cart extends \IPS\Dispatcher\Controller
}
$_SESSION['cart'] = array();
if ( \IPS\CACHE_PAGE_TIMEOUT and !\IPS\Member::loggedIn()->member_id )
{
\IPS\Request::i()->setCookie( 'noCache', 0, \IPS\DateTime::ts( time() - 86400 ) );
}
$invoice->save();
\IPS\Db::i()->update( 'core_attachments_map', array( 'id3' => "invoice-{$invoice->id}" ), array( 'location_key=? AND id3=?', 'nexus_Purchases', "invoice-{$tempInvoiceKey}" ) );
@@ -212,6 +212,9 @@ class _product extends \IPS\Content\Controller
}
else
{
/* Set default search */
\IPS\Output::i()->defaultSearchOption = array( 'nexus_package_item', "nexus_package_item_el" );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('store')->package( $package, $item, $this->_getForm( $package, $inCart, TRUE ), array_sum( $inCart ), $shippingMethods, $itemDataForShipping, $locationType, $renewalTerm, $initialTerm );
}
@@ -268,6 +271,7 @@ class _product extends \IPS\Content\Controller
if( $package->image )
{
\IPS\Output::i()->jsonLd['package']['image'] = (string) $package->image;
\IPS\Output::i()->metaTags['og:image'] = (string)$package->image;
}
if( $package->reviewable AND $item->averageReviewRating() )
@@ -233,7 +233,11 @@ class _store extends \IPS\Dispatcher\Controller
}
\IPS\Output::i()->breadcrumb[] = array( $category->url(), $category->_title );
\IPS\Output::i()->title = $category->_title;
\IPS\Output::i()->sidebar['contextual'] = \IPS\Theme::i()->getTemplate('store')->categorySidebar( $category, $subcategories, $url, \count( $packages ), $this->currency, $havePackagesWhichAcceptReviews, $havePackagesWhichUseStockLevels );
\IPS\Output::i()->sidebar['contextual'] = \IPS\Theme::i()->getTemplate('store')->categorySidebar( $category, $subcategories, $url, \count( $packages ), $this->currency, $havePackagesWhichAcceptReviews, $havePackagesWhichUseStockLevels );
/* Set default search */
\IPS\Output::i()->defaultSearchOption = array( 'nexus_package_item', "nexus_package_item_el" );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('store')->category( $category, $subcategories, $packages, $pagination, $packagesWithCustomFields, $totalCount );
\IPS\Output::i()->globalControllers[] = 'nexus.front.store.category';
}