Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Primary controller
|
||||
* Last Updated: $LastChangedDate: 2009-09-14 08:10:06 -0400 (Mon, 14 Sep 2009) $
|
||||
* Last Updated: $LastChangedDate: 2010-10-22 16:22:45 -0400 (Fri, 22 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 14th May 2003
|
||||
* @version $Rev: 5108 $
|
||||
* @version $Rev: 7019 $
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -22,7 +24,7 @@
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @since Wednesday 14th May 2008
|
||||
* @package Invision Power Board
|
||||
* @package IP.Board
|
||||
*/
|
||||
class ipsController
|
||||
{
|
||||
@@ -83,9 +85,28 @@ class ipsController
|
||||
*/
|
||||
protected function handleRequest()
|
||||
{
|
||||
$cmd_r = new ipsController_CommandResolver();
|
||||
self::$cmd = $cmd_r->getCommand( $this->registry );
|
||||
$cmd_r = new ipsController_CommandResolver();
|
||||
|
||||
try
|
||||
{
|
||||
self::$cmd = $cmd_r->getCommand( $this->registry );
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
$msg = $e->getMessage();
|
||||
|
||||
/* An error occured, so throw a 404 */
|
||||
try
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'incorrect_furl', 404, null, null, 404 );
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
print $msg;
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
IPSDebug::setMemoryDebugFlag( "Everything up until execute call", 0 );
|
||||
|
||||
self::$cmd->execute( $this->registry );
|
||||
@@ -98,7 +119,7 @@ class ipsController
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @since Wednesday 14th May 2008
|
||||
* @package Invision Power Board
|
||||
* @package IP.Board
|
||||
*/
|
||||
class ipsController_CommandResolver
|
||||
{
|
||||
@@ -147,6 +168,12 @@ class ipsController_CommandResolver
|
||||
$section = ipsRegistry::$current_section;
|
||||
$filepath = IPSLib::getAppDir( IPS_APP_COMPONENT ) . '/' . self::$modules_dir . '/' . $module . '/';
|
||||
|
||||
/* Bug Fix #21009 */
|
||||
if ( ! ipsRegistry::$applications[ IPS_APP_COMPONENT ]['app_enabled'] )
|
||||
{
|
||||
throw new Exception( "The specified application has been disabled" );
|
||||
}
|
||||
|
||||
/* Got a section? */
|
||||
if ( ! $section )
|
||||
{
|
||||
@@ -162,50 +189,17 @@ class ipsController_CommandResolver
|
||||
}
|
||||
}
|
||||
|
||||
$classname = self::$class_dir . '_' . IPS_APP_COMPONENT . '_' . $module . '_' . $section;
|
||||
|
||||
$_classname = self::$class_dir . '_' . IPS_APP_COMPONENT . '_' . $module . '_';
|
||||
|
||||
if ( file_exists( $filepath . 'manualResolver.php' ) )
|
||||
{
|
||||
require_once( $filepath . 'manualResolver.php' );
|
||||
$classname = self::$class_dir . '_' . IPS_APP_COMPONENT . '_' . $module . '_manualResolver';
|
||||
$classname = IPSLib::loadActionOverloader( $filepath . 'manualResolver.php' , $_classname . 'manualResolver' );
|
||||
}
|
||||
else if ( file_exists( $filepath . $section . '.php' ) )
|
||||
{
|
||||
require_once( $filepath . $section . '.php' );
|
||||
$classname = IPSLib::loadActionOverloader( $filepath . $section . '.php' , $_classname . $section );
|
||||
}
|
||||
|
||||
/* Hooks: Are we overloading this class? */
|
||||
|
||||
$hooksCache = ipsRegistry::cache()->getCache('hooks');
|
||||
|
||||
if( isset( $hooksCache['commandHooks'] ) AND is_array( $hooksCache['commandHooks'] ) AND count( $hooksCache['commandHooks'] ) )
|
||||
{
|
||||
foreach( $hooksCache['commandHooks'] as $hook )
|
||||
{
|
||||
foreach( $hook as $classOverloader )
|
||||
{
|
||||
/* Hooks: Do we have a hook that extends this class? */
|
||||
|
||||
if( $classOverloader['classToOverload'] == $classname )
|
||||
{
|
||||
if( file_exists( DOC_IPS_ROOT_PATH . 'hooks/' . $classOverloader['filename'] ) )
|
||||
{
|
||||
/* Hooks: Do we have the hook file? */
|
||||
|
||||
require_once( DOC_IPS_ROOT_PATH . 'hooks/' . $classOverloader['filename'] );
|
||||
|
||||
if( class_exists( $classOverloader['className'] ) )
|
||||
{
|
||||
/* Hooks: We have the hook file and the class exists - reset the classname to load */
|
||||
|
||||
$classname = $classOverloader['className'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IPSDebug::setMemoryDebugFlag( "Controller getCommand executed" );
|
||||
|
||||
if ( class_exists( $classname ) )
|
||||
@@ -351,7 +345,7 @@ abstract class ipsAjaxCommand
|
||||
if( is_string( $v ) )
|
||||
{
|
||||
/* Remove unused hook comments */
|
||||
$arguments[$k] = preg_replace( "#<!--hook\.([^\>]+?)-->#", '', $arguments[$k] );
|
||||
// $arguments[$k] = preg_replace( "#<!--hook\.([^\>]+?)-->#", '', $arguments[$k] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,9 +372,9 @@ abstract class ipsAjaxCommand
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classAjax.php' );
|
||||
$this->ajax = new classAjax();
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
|
||||
$this->ajax = new $classToLoad();
|
||||
|
||||
IPSDebug::fireBug( 'registerExceptionHandler' );
|
||||
IPSDebug::fireBug( 'registerErrorHandler' );
|
||||
@@ -460,11 +454,11 @@ class ipsCommand_default extends ipsCommand
|
||||
|
||||
if ( ! file_exists( $filepath ) )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( array( 'command_file_missing', $filepath ), 401100 );
|
||||
$this->registry->getClass('output')->showError( array( 'command_file_missing', $filepath ), 401100, null, null, 404 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('output')->showError( array( 'command_class_incorrect', $filepath ), 401200 );
|
||||
$this->registry->getClass('output')->showError( array( 'command_class_incorrect', $filepath ), 401200, null, null, 404 );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user