Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

@@ -55,10 +55,9 @@ class _Nexus
* Member has logged on
*
* @param \IPS\Member $member Member that logged in
* @param \IPS\Http\Url $redirectUrl The URL to send the user back to
* @return void
*/
public function onLogin( $member, $returnUrl )
public function onLogin( $member )
{
if ( isset( \IPS\Request::i()->cookie['cm_reg'] ) and \IPS\Request::i()->cookie['cm_reg'] )
{
@@ -107,6 +106,31 @@ class _Nexus
\IPS\Db::i()->update( 'nexus_alternate_contacts', array( 'alt_id' => $member->member_id ), array( 'alt_id=?', $member2->member_id ) );
\IPS\Db::i()->update( 'nexus_support_streams', array( 'stream_owner' => $member->member_id ), array( 'stream_owner=?', $member2->member_id ) );
\IPS\Db::i()->update( 'nexus_billing_agreements', array( 'ba_member' => $member->member_id ), array( 'ba_member=?', $member2->member_id ) );
\IPS\Db::i()->update( 'nexus_support_requests', array( 'r_member' => $member->member_id ), array( 'r_member=?', $member2->member_id ) );
\IPS\Db::i()->update( 'nexus_support_requests', array( 'r_last_reply_by' => $member->member_id ), array( 'r_last_reply_by=?', $member2->member_id ) );
\IPS\Db::i()->update( 'nexus_support_replies', array( 'reply_member' => $member->member_id ), array( 'reply_member=?', $member2->member_id ) );
/* Account Credit */
$customerToKeep = \IPS\nexus\Customer::load( $member->member_id );
$creditToKeep = $customerToKeep->cm_credits;
$creditToMerge = \IPS\nexus\Customer::load( $member2->member_id )->cm_credits;
foreach( \IPS\nexus\Money::currencies() as $currency )
{
if( isset( $creditToMerge[$currency] ) )
{
if( isset( $creditToKeep[$currency] ) )
{
$creditToKeep[$currency]->amount = $creditToKeep[$currency]->amount->add( $creditToMerge[$currency]->amount );
}
else
{
$creditToKeep[$currency] = $creditToMerge[$currency];
}
}
}
$customerToKeep->cm_credits = $creditToKeep;
$customerToKeep->save();
}
/**
@@ -181,7 +205,7 @@ class _Nexus
}
}
if ( $refresh === TRUE )
if ( $refresh === TRUE and isset( \IPS\Data\Store::i()->supportStaff ) )
{
unset( \IPS\Data\Store::i()->supportStaff );
}