Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
+74
-17
@@ -224,14 +224,23 @@ class _Front extends \IPS\Dispatcher\Standard
|
||||
/* Do we need more info from the member or do they need to validate? */
|
||||
if( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
/* Need their name or email... */
|
||||
if( ( !\IPS\Member::loggedIn()->real_name or !\IPS\Member::loggedIn()->email ) and $this->controller !== 'register' )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=register&do=complete' ) );
|
||||
}
|
||||
|
||||
/* Need them to validate... */
|
||||
elseif( \IPS\Member::loggedIn()->members_bitoptions['validating'] and $this->controller !== 'register' and $this->controller !== 'login' and $this->controller != 'redirect' and $this->controller !== 'contact' )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=register&do=validating', 'front', 'register' ) );
|
||||
}
|
||||
|
||||
/* Need them to reconfirm terms/privacy policy */
|
||||
elseif ( ( \IPS\Member::loggedIn()->members_bitoptions['must_reaccept_privacy'] or \IPS\Member::loggedIn()->members_bitoptions['must_reaccept_terms'] ) and $this->controller !== 'register' )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=register&do=reconfirm', 'front', 'register' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/* Permission Check */
|
||||
@@ -262,6 +271,27 @@ class _Front extends \IPS\Dispatcher\Standard
|
||||
{
|
||||
\IPS\Output::i()->breadcrumb['module'] = array( \IPS\Http\Url::internal( 'app=' . $this->application->directory . '&module=' . $this->module->key . '&controller=' . $this->module->default_controller, 'front', $this->module->key ), $this->module->_title );
|
||||
}
|
||||
|
||||
/* Figure out what the global search is */
|
||||
if ( !$this->application->default )
|
||||
{
|
||||
foreach ( $this->application->extensions( 'core', 'ContentRouter' ) as $object )
|
||||
{
|
||||
if ( count( $object->classes ) === 1 )
|
||||
{
|
||||
$classes = $object->classes;
|
||||
foreach ( $classes as $class )
|
||||
{
|
||||
if ( is_subclass_of( $class, 'IPS\Content\Searchable' ) and $class::$includeInSiteSearch )
|
||||
{
|
||||
$type = mb_strtolower( str_replace( '\\', '_', mb_substr( array_pop( $classes ), 4 ) ) );
|
||||
\IPS\Output::i()->defaultSearchOption = array( $type, "{$type}_pl" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +302,7 @@ class _Front extends \IPS\Dispatcher\Standard
|
||||
*/
|
||||
protected function notAllowedBannedPage()
|
||||
{
|
||||
return ( !\IPS\Member::loggedIn()->group['g_view_board'] and !( $this->application->directory == 'core' and ( ( $this->module->key == 'system' and in_array( $this->controller, array( 'login', 'register', 'lostpass', 'terms', 'ajax', 'privacy', 'editor', 'language', 'theme' ) ) ) or ( $this->module->key == 'contact' AND $this->controller == 'contact' ) ) ) );
|
||||
return !\IPS\Member::loggedIn()->group['g_view_board'] and !$this->application->allowGuestAccess( $this->module, $this->controller, \IPS\Request::i()->do );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -307,8 +337,7 @@ class _Front extends \IPS\Dispatcher\Standard
|
||||
/* Get cache */
|
||||
try
|
||||
{
|
||||
$cache = \IPS\Data\Cache::i()->getWithExpire( 'page_' . md5( $_SERVER['REQUEST_URI'] ) . "_{$language}_{$theme}", TRUE );
|
||||
|
||||
$cache = \IPS\Data\Cache::i()->getWithExpire( 'page_' . md5( ( !empty( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'] ) . '/' . $_SERVER['REQUEST_URI'] ) . "_{$language}_{$theme}", TRUE );
|
||||
$sessionId = isset( \IPS\Request::i()->cookie['IPSSessionFront'] ) ? \IPS\Request::i()->cookie['IPSSessionFront'] : \IPS\Session::i()->id;
|
||||
|
||||
\IPS\Output::i()->sendOutput( str_replace( '{{csrfKey}}', md5( '&& 0&' . $sessionId ), $cache['output'] ), $cache['code'], $cache['contentType'], $cache['httpHeaders'], FALSE, TRUE );
|
||||
@@ -333,7 +362,16 @@ class _Front extends \IPS\Dispatcher\Standard
|
||||
/* Convert &showtopic= */
|
||||
if ( isset( \IPS\Request::i()->showtopic ) )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=forums&module=forums&controller=topic&id=' . \IPS\Request::i()->showtopic ) );
|
||||
$url = \IPS\Http\Url::internal( 'app=forums&module=forums&controller=topic&id=' . \IPS\Request::i()->showtopic );
|
||||
if ( isset( \IPS\Request::i()->p ) or isset( \IPS\Request::i()->findpost ) )
|
||||
{
|
||||
$url = $url->setQueryString( array( 'do' => 'findComment', 'comment' => \IPS\Request::i()->p ?: \IPS\Request::i()->findpost ) );
|
||||
}
|
||||
elseif ( isset( \IPS\Request::i()->page ) )
|
||||
{
|
||||
$url = $url->setQueryString( array( 'page' => \IPS\Request::i()->page ) );
|
||||
}
|
||||
\IPS\Output::i()->redirect( $url );
|
||||
}
|
||||
|
||||
/* Convert &showforum= */
|
||||
@@ -347,6 +385,18 @@ class _Front extends \IPS\Dispatcher\Standard
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=members&controller=profile&id=' . \IPS\Request::i()->showuser ) );
|
||||
}
|
||||
|
||||
/* Support legacy subscriptions */
|
||||
if( isset( \IPS\Request::i()->app ) AND \IPS\Request::i()->app == 'subscriptions' )
|
||||
{
|
||||
/* Redirecting isn't necessary, we just need to route the payment to the appropriate area.
|
||||
@see \IPS\nexus\Application */
|
||||
\IPS\Request::i()->app = 'nexus';
|
||||
\IPS\Request::i()->module = 'payments';
|
||||
\IPS\Request::i()->section = 'receive'; /* It actually looks for section=receive, so make sure we set that */
|
||||
\IPS\Request::i()->controller = 'receive'; /* We set this just to be complete in case anywhere else only looks at controller */
|
||||
\IPS\Request::i()->validate = 'paypal';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -394,19 +444,26 @@ class _Front extends \IPS\Dispatcher\Standard
|
||||
|
||||
if( count( $widgets ) )
|
||||
{
|
||||
$templateLoad = array();
|
||||
foreach ( $widgets as $areaKey => $area )
|
||||
if ( \IPS\CACHE_METHOD === 'None' )
|
||||
{
|
||||
foreach ( $area as $widget )
|
||||
$templateLoad = array();
|
||||
foreach ( $widgets as $areaKey => $area )
|
||||
{
|
||||
if ( isset( $widget['app'] ) and $widget['app'] )
|
||||
foreach ( $area as $widget )
|
||||
{
|
||||
$templateLoad[] = array( $widget['app'], 'front', 'widgets' );
|
||||
$templateLoad[] = 'template_' . \IPS\Theme::i()->id . '_' . \IPS\Theme::makeBuiltTemplateLookupHash( $widget['app'], 'front', 'widgets' ) . '_widgets';
|
||||
if ( isset( $widget['app'] ) and $widget['app'] )
|
||||
{
|
||||
$templateLoad[] = array( $widget['app'], 'front', 'widgets' );
|
||||
$templateLoad[] = 'template_' . \IPS\Theme::i()->id . '_' . \IPS\Theme::makeBuiltTemplateLookupHash( $widget['app'], 'front', 'widgets' ) . '_widgets';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( count( $templateLoad ) )
|
||||
{
|
||||
\IPS\Data\Store::i()->loadIntoMemory( $templateLoad );
|
||||
}
|
||||
}
|
||||
\IPS\Data\Store::i()->loadIntoMemory( $templateLoad );
|
||||
|
||||
$widgetObjects = array();
|
||||
$storeLoad = array();
|
||||
@@ -424,7 +481,7 @@ class _Front extends \IPS\Dispatcher\Standard
|
||||
}
|
||||
|
||||
$_widget = \IPS\Widget::load( $appOrPlugin, $widget['key'], ( ! empty($widget['unique'] ) ? $widget['unique'] : uniqid() ), ( isset( $widget['configuration'] ) ) ? $widget['configuration'] : array(), ( isset( $widget['restrict'] ) ? $widget['restrict'] : null ), ( $areaKey == 'sidebar' ) ? 'vertical' : 'horizontal' );
|
||||
if ( isset( $_widget->cacheKey ) )
|
||||
if ( \IPS\CACHE_METHOD === 'None' and isset( $_widget->cacheKey ) )
|
||||
{
|
||||
$storeLoad[] = $_widget->cacheKey;
|
||||
}
|
||||
@@ -436,7 +493,11 @@ class _Front extends \IPS\Dispatcher\Standard
|
||||
}
|
||||
}
|
||||
}
|
||||
\IPS\Data\Store::i()->loadIntoMemory( $storeLoad );
|
||||
|
||||
if( \IPS\CACHE_METHOD === 'None' and count( $storeLoad ) )
|
||||
{
|
||||
\IPS\Data\Store::i()->loadIntoMemory( $storeLoad );
|
||||
}
|
||||
|
||||
foreach ( $widgetObjects as $areaKey => $_widgets )
|
||||
{
|
||||
@@ -509,10 +570,6 @@ class _Front extends \IPS\Dispatcher\Standard
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'core_responsive.css', 'core', 'front' ) );
|
||||
}
|
||||
if ( count( \IPS\Lang::languages() ) > 1 )
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'flags.css', 'core', 'global' ) );
|
||||
}
|
||||
|
||||
if ( \IPS\Member::loggedIn()->members_bitoptions['bw_using_skin_gen'] AND ( isset( \IPS\Request::i()->cookie['vseThemeId'] ) AND \IPS\Request::i()->cookie['vseThemeId'] ) and \IPS\Member::loggedIn()->isAdmin() and \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'customization', 'theme_easy_editor' ) )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user