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
@@ -10,27 +10,34 @@
|
||||
|
||||
namespace IPS\core\modules\front\system;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
|
||||
use IPS\Helpers\Form\YesNo;
|
||||
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' ) )
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cookie Information Page
|
||||
*/
|
||||
class _cookies extends \IPS\Dispatcher\Controller
|
||||
class cookies extends Controller
|
||||
{
|
||||
public function execute()
|
||||
public function execute(): void
|
||||
{
|
||||
parent::execute();
|
||||
|
||||
\IPS\Output::setCacheTime( false );
|
||||
Output::i()->pageCaching = FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,17 +45,18 @@ class _cookies extends \IPS\Dispatcher\Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
protected function manage(): void
|
||||
{
|
||||
/* Set Session Location */
|
||||
\IPS\Session::i()->setLocation( \IPS\Http\Url::internal( 'app=core&module=system&controller=cookies', NULL, 'cookies' ), array(), 'loc_viewing_cookie_policy' );
|
||||
|
||||
\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Member::loggedIn()->language()->addToStack('cookies_about') );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('cookies_about');
|
||||
\IPS\Output::i()->sidebar['enabled'] = FALSE;
|
||||
\IPS\Output::i()->metaTags['robots'] = 'noindex';
|
||||
\IPS\Output::i()->bodyClasses[] = 'ipsLayout_minimal';
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'system' )->cookies();
|
||||
Session::i()->setLocation( Url::internal( 'app=core&module=system&controller=cookies', NULL, 'cookies' ), array(), 'loc_viewing_cookie_policy' );
|
||||
|
||||
Output::i()->breadcrumb[] = array( NULL, Member::loggedIn()->language()->addToStack('cookies_about') );
|
||||
Output::i()->title = Member::loggedIn()->language()->addToStack('cookies_about');
|
||||
Output::i()->sidebar['enabled'] = FALSE;
|
||||
Output::i()->metaTags['robots'] = 'noindex';
|
||||
Output::i()->bodyClasses[] = 'ipsLayout_minimal';
|
||||
Output::i()->output = Theme::i()->getTemplate( 'system' )->cookies();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,26 +64,26 @@ class _cookies extends \IPS\Dispatcher\Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function cookieConsentToggle()
|
||||
protected function cookieConsentToggle(): void
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
\IPS\Member::loggedIn()->setAllowOptionalCookies( (bool) \IPS\Request::i()->status );
|
||||
if ( isset( \IPS\Request::i()->ref ) )
|
||||
Session::i()->csrfCheck();
|
||||
Member::loggedIn()->setAllowOptionalCookies( (bool) Request::i()->status );
|
||||
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 );
|
||||
Output::i()->redirect( $url );
|
||||
}
|
||||
}
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal(''));
|
||||
Output::i()->redirect( Url::internal('') );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user