/**
* core
*/
class _core extends \IPS\Dispatcher\Controller
{
/**
* Execute
*
* @return void
*/
public function execute()
{
$this->checkAccess();
parent::execute();
}
private function checkAccess()
{
if( !\IPS\Settings::i()->sd_register_turnon )
{
\IPS\Output::i()->error( 'sd_register_systemoffline', '2SDREGISTER/1', 403, '' );
}
if( !\IPS\Member::loggedIn()->inGroup( explode( ',', \IPS\Settings::i()->sd_register_groups ) ) )
{
\IPS\Output::i()->error( 'sd_register_no_permission', '2SDREGISTER/2', 403, '' );
}
if( intval( \IPS\Settings::i()->sd_register_posts ) )
{
if( intval( \IPS\Settings::i()->sd_register_posts ) > \IPS\Member::loggedIn()->member_posts )
{
\IPS\Output::i()->error( 'sd_register_error_req_posts', '2SDREGISTER/3', 403, '' );
}
}
if( intval( \IPS\Settings::i()->sd_register_joined ) )
{
if( ( \IPS\Member::loggedIn()->joined + ( intval( \IPS\Settings::i()->sd_register_joined ) * 86400 ) ) > time() )
{
\IPS\Output::i()->error( 'sd_register_error_req_joined', '2SDREGISTER/4', 403, '' );
}
}
$time = time() - ( intval( \IPS\Settings::i()->sd_register_exp_days ) * 86400 );
try
{
$check = \IPS\Db::i()->select( 'COUNT(*) as "amount"', 'sdregisterboard_request', array( 'request_member_id=? AND ( request_add_date > ? OR request_approve_date > ?)', \IPS\Member::loggedIn()->member_id, $time, $time ) )->first();
if( intval( $check ) )
{
$lang = \IPS\Member::loggedIn()->language()->addToStack( 'sd_register_error_access', FALSE, array( 'sprintf' => array( intval( \IPS\Settings::i()->sd_register_exp_days ) ) ) );
\IPS\Output::i()->error( $lang, '2SDREGISTER/5', 404, '' );
}
}
catch( \UnderflowException $e )
{
}
}
linia 38 zawiera:
$this->checkAccess();