Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -11,30 +11,42 @@
|
||||
namespace IPS\core\modules\front\system;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Dispatcher\Controller;
|
||||
use IPS\Http\Url;
|
||||
use IPS\Http\Url\Exception;
|
||||
use IPS\Http\Url\Internal;
|
||||
use IPS\Member;
|
||||
use IPS\Output;
|
||||
use IPS\Request;
|
||||
use IPS\Session;
|
||||
use IPS\Theme;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Terms of Use
|
||||
*/
|
||||
class _terms extends \IPS\Dispatcher\Controller
|
||||
class terms extends Controller
|
||||
{
|
||||
/**
|
||||
* Terms of Use
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
protected function manage() : void
|
||||
{
|
||||
\IPS\Session::i()->setLocation( \IPS\Http\Url::internal( 'app=core&module=system&controller=terms', NULL, 'terms' ), array(), 'loc_viewing_reg_terms' );
|
||||
Session::i()->setLocation( Url::internal( 'app=core&module=system&controller=terms', NULL, 'terms' ), array(), 'loc_viewing_reg_terms' );
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('reg_terms');
|
||||
\IPS\Output::i()->sidebar['enabled'] = FALSE;
|
||||
\IPS\Output::i()->bodyClasses[] = 'ipsLayout_minimal';
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'system' )->terms();
|
||||
Output::i()->title = Member::loggedIn()->language()->addToStack('reg_terms');
|
||||
Output::i()->sidebar['enabled'] = FALSE;
|
||||
Output::i()->bodyClasses[] = 'ipsLayout_minimal';
|
||||
Output::i()->output = Theme::i()->getTemplate( 'system' )->terms();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -42,37 +54,37 @@ class _terms extends \IPS\Dispatcher\Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function dismiss()
|
||||
protected function dismiss() : void
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
Session::i()->csrfCheck();
|
||||
|
||||
\IPS\Request::i()->setCookie( 'guestTermsDismissed', 1, NULL, FALSE );
|
||||
Request::i()->setCookie( 'guestTermsDismissed', 1, NULL, FALSE );
|
||||
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
if ( Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->json( array( 'message' => \IPS\Member::loggedIn()->language()->addToStack( 'terms_dismissed' ) ) );
|
||||
Output::i()->json( array( 'message' => Member::loggedIn()->language()->addToStack( 'terms_dismissed' ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isset( \IPS\Request::i()->ref ) )
|
||||
if ( isset( Request::i()->ref ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$url = \IPS\Http\Url::createFromString( base64_decode( \IPS\Request::i()->ref ) );
|
||||
$url = Url::createFromString( base64_decode( Request::i()->ref ) );
|
||||
}
|
||||
catch( \IPS\Http\Url\Exception $e )
|
||||
catch( Exception $e )
|
||||
{
|
||||
$url = NULL;
|
||||
}
|
||||
|
||||
if ( $url instanceof \IPS\Http\Url\Internal and !$url->openRedirect() )
|
||||
if ( $url instanceof Internal and !$url->openRedirect() )
|
||||
{
|
||||
\IPS\Output::i()->redirect( $url, 'terms_dismissed' );
|
||||
Output::i()->redirect( $url, 'terms_dismissed' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Still here? Just redirect to the index */
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( '' ), 'terms_dismissed' );
|
||||
Output::i()->redirect( Url::internal( '' ), 'terms_dismissed' );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user