Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

+8 -5
View File
@@ -141,19 +141,19 @@ class _Admin extends \IPS\Dispatcher\Standard
if( !\IPS\Request::i()->isAjax() )
{
$url = $url->setQueryString( 'ref', preg_replace( '!adsess=((\w){32}|&)!', "", $_SERVER['QUERY_STRING'] ) );
$url = $url->setQueryString( 'ref', base64_encode( preg_replace( '!adsess=((\w){32}|&)!', "", $_SERVER['QUERY_STRING'] ) ) );
}
else if( isset( $_SERVER['HTTP_REFERER'] ) )
{
$previous = preg_replace( "/^(.+?)\/\?/", "", $_SERVER['HTTP_REFERER'] );
$url = $url->setQueryString( 'ref', preg_replace( '!adsess=.*?(&|$)!', "", $previous ) );
$url = $url->setQueryString( 'ref', base64_encode( preg_replace( '!adsess=.*?(&|$)!', "", $previous ) ) );
}
\IPS\Output::i()->redirect( $url );
}
/* Permission Check */
if ( ( $this->module->key !== 'system' or !in_array( $this->controller, array( 'login', 'language', 'theme', 'livesearch' ) ) ) and !\IPS\Member::loggedIn()->hasAcpRestriction( $this->application, $this->module ) )
if ( ( $this->module->key !== 'system' or !in_array( $this->controller, array( 'login', 'language', 'theme', 'livesearch', 'editor', 'ajax' ) ) ) and ( $this->module->key !== 'members' or $this->controller !== 'members' or !in_array( \IPS\Request::i()->do, array( 'adminDetails', 'adminEmail', 'adminPassword' ) ) ) and !\IPS\Member::loggedIn()->hasAcpRestriction( $this->application, $this->module ) )
{
\IPS\Output::i()->error( 'no_module_permission', '2S107/1', 403, '' );
}
@@ -230,8 +230,11 @@ class _Admin extends \IPS\Dispatcher\Standard
/* Display */
if( $this->controller !== 'login' )
{
\IPS\Output::i()->sidebar['sidebar'] = \IPS\Theme::i()->getTemplate( 'global', 'core' )->sidebar( $menu['tabs'][ $currentTab ], $this->application->directory . '_' . $this->module->key );
{
if ( isset( $menu['tabs'][ $currentTab ] ) )
{
\IPS\Output::i()->sidebar['sidebar'] = \IPS\Theme::i()->getTemplate( 'global', 'core' )->sidebar( $menu['tabs'][ $currentTab ], $this->application->directory . '_' . $this->module->key );
}
\IPS\Output::i()->sidebar['appmenu'] = \IPS\Theme::i()->getTemplate( 'global', 'core' )->appmenu( $menu, $currentTab );
\IPS\Output::i()->sidebar['mobilenav'] = \IPS\Theme::i()->getTemplate( 'global', 'core' )->mobileNavigation( $menu, $currentTab );
}
+74 -17
View File
@@ -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' ) )
{
+3 -2
View File
@@ -196,9 +196,10 @@ class _Setup extends \IPS\Dispatcher
TRUE
);
if( !session_start() )
if( !@session_start() )
{
\IPS\Output::i()->error( "We were unable to start a PHP session. You will need to contact your host to adjust your PHP configuration before you can continue.", '4S109/5', 500, '' );
$lastError = error_get_last();
\IPS\Output::i()->error( "We were unable to start a PHP session. You will need to contact your host to adjust your PHP configuration before you can continue. The error reported was: " . $lastError['message'], '4S109/5', 500, '' );
}
if( $this->classname != 'IPS\core\modules\setup\upgrade\done' and $this->setupLocation != 'install' and $this->step > 1 AND ( !isset( $_SESSION['uniqueKey'] ) OR $_SESSION['uniqueKey'] != \IPS\Request::i()->key ) )
+17 -8
View File
@@ -53,6 +53,11 @@ abstract class _Standard extends \IPS\Dispatcher
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'responsive.css', 'core', 'global' ) );
}
}
if ( count( \IPS\Lang::languages() ) > 1 )
{
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'flags.css', 'core', 'global' ) );
}
}
/**
@@ -73,6 +78,7 @@ abstract class _Standard extends \IPS\Dispatcher
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'plugins.js', 'core', 'plugins' ) );
\IPS\Output::i()->jsVars['date_format'] = \IPS\Member::loggedIn()->language()->preferredDateFormat();
\IPS\Output::i()->jsVars['date_first_day'] = 0;
\IPS\Output::i()->jsVars['remote_image_proxy'] = intval( \IPS\Settings::i()->remote_image_proxy );
}
}
@@ -219,16 +225,19 @@ abstract class _Standard extends \IPS\Dispatcher
if ( !\IPS\Request::i()->isAjax() )
{
/* Templates */
\IPS\Data\Store::i()->templateLoad[] = array( 'core', $this->controllerLocation, 'global' );
\IPS\Data\Store::i()->templateLoad[] = array( 'core', 'global', 'global' );
\IPS\Data\Store::i()->templateLoad[] = array( 'core', 'global', 'forms' );
\IPS\Data\Store::i()->templateLoad[] = array( 'core', $this->controllerLocation, 'forms' );
$templateLoad = array();
foreach ( \IPS\Data\Store::i()->templateLoad as $data )
if ( \IPS\CACHE_METHOD === 'None' )
{
$templateLoad[] = 'template_' . \IPS\Theme::i()->id . '_' . \IPS\Theme::makeBuiltTemplateLookupHash( $data[0], $data[1], $data[2] ) . '_' . $data[2];
\IPS\Data\Store::i()->templateLoad[] = array( 'core', $this->controllerLocation, 'global' );
\IPS\Data\Store::i()->templateLoad[] = array( 'core', 'global', 'global' );
\IPS\Data\Store::i()->templateLoad[] = array( 'core', 'global', 'forms' );
\IPS\Data\Store::i()->templateLoad[] = array( 'core', $this->controllerLocation, 'forms' );
$templateLoad = array();
foreach ( \IPS\Data\Store::i()->templateLoad as $data )
{
$templateLoad[] = 'template_' . \IPS\Theme::i()->id . '_' . \IPS\Theme::makeBuiltTemplateLookupHash( $data[0], $data[1], $data[2] ) . '_' . $data[2];
}
\IPS\Data\Store::i()->loadIntoMemory( $templateLoad );
}
\IPS\Data\Store::i()->loadIntoMemory( $templateLoad );
/* App JS */
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'app.js' ) );