Files
IPB/applications/nexus/hooks/register.php
T
2025-12-19 05:47:12 -08:00

29 lines
1.1 KiB
PHP

//<?php
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
exit;
}
class nexus_hook_register extends _HOOK_CLASS_
{
/**
* Register
*
* @return void
*/
protected function manage()
{
if ( \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'nexus', 'store' ) ) and ( \IPS\Settings::i()->nexus_reg_force or !isset( \IPS\Request::i()->noPurchase ) ) and \IPS\Db::i()->select( 'COUNT(*)', 'nexus_packages', 'p_reg=1' )->first() )
{
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=nexus&module=store&controller=store&do=register', 'front', 'store' ) );
}
else if ( \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'nexus', 'subscriptions' ) ) and ( \IPS\Settings::i()->nexus_subs_register ) )
{
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=nexus&module=subscriptions&controller=subscriptions&register=1', 'front', 'nexus_subscriptions' ) );
}
return call_user_func_array( 'parent::manage', func_get_args() );
}
}