Merge pull request #455 from marc1706/ticket/454
[ticket/454] Check for IN_PHPBB in functions files
This commit is contained in:
@@ -26,6 +26,9 @@ class portal_module
|
||||
/** @var \board3\portal\portal\modules\constraints_handler */
|
||||
protected $modules_constraints;
|
||||
|
||||
/** @var int Board3 module enabled */
|
||||
const B3_MODULE_ENABLED = 1;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
global $db, $user, $cache, $request, $template, $table_prefix;
|
||||
@@ -35,8 +38,6 @@ class portal_module
|
||||
|
||||
$this->root_path = $phpbb_root_path . 'ext/board3/portal/';
|
||||
|
||||
include($this->root_path . 'includes/constants.' . $phpEx);
|
||||
|
||||
$this->db = $db;
|
||||
$this->user = $user;
|
||||
$this->cache = $cache;
|
||||
@@ -268,7 +269,7 @@ class portal_module
|
||||
'module_image_width' => $this->request->variable('module_img_width', 0),
|
||||
'module_image_height' => $this->request->variable('module_img_height', 0),
|
||||
'module_group_ids' => $module_permission,
|
||||
'module_status' => $this->request->variable('module_status', B3_MODULE_ENABLED),
|
||||
'module_status' => $this->request->variable('module_status', self::B3_MODULE_ENABLED),
|
||||
);
|
||||
|
||||
if(!(isset($this->c_class->hide_name) && $this->c_class->hide_name == true))
|
||||
@@ -473,7 +474,7 @@ class portal_module
|
||||
'module_group_ids' => '',
|
||||
'module_image_height' => 16,
|
||||
'module_image_width' => 16,
|
||||
'module_status' => B3_MODULE_ENABLED,
|
||||
'module_status' => self::B3_MODULE_ENABLED,
|
||||
);
|
||||
$sql = 'INSERT INTO ' . PORTAL_MODULES_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
|
||||
$this->db->sql_query($sql);
|
||||
|
||||
@@ -74,6 +74,9 @@ class helper
|
||||
*/
|
||||
protected $portal_modules;
|
||||
|
||||
/** @var int Board3 module disabled */
|
||||
const B3_MODULE_DISABLED = 0;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* NOTE: The parameters of this method must match in order and type with
|
||||
@@ -139,7 +142,7 @@ class helper
|
||||
public function get_portal_module($row)
|
||||
{
|
||||
// Do not try to load non-existent or disabled modules
|
||||
if ($row['module_status'] == B3_MODULE_DISABLED || !is_object($module = $this->portal_helper->get_module($row['module_classname'])))
|
||||
if ($row['module_status'] == self::B3_MODULE_DISABLED || !is_object($module = $this->portal_helper->get_module($row['module_classname'])))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,6 @@ class main
|
||||
|
||||
if (!function_exists('obtain_portal_config'))
|
||||
{
|
||||
include($this->includes_path . 'constants' . $this->php_ext);
|
||||
include($this->includes_path . 'functions_modules' . $this->php_ext);
|
||||
include($this->includes_path . 'functions' . $this->php_ext);
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package Board3 Portal v2.1
|
||||
* @copyright (c) 2013 Board3 Group ( www.board3.de )
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
// Config constants
|
||||
define('B3_MODULE_DISABLED', 0);
|
||||
define('B3_MODULE_ENABLED', 1);
|
||||
|
||||
// Tables and paths
|
||||
define('PORTAL_ROOT_PATH', 'portal/');
|
||||
@@ -7,6 +7,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// @codingStandardsIgnoreStart
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
// @codingStandardsIgnoreEnd
|
||||
|
||||
// Get portal config
|
||||
function obtain_portal_config()
|
||||
{
|
||||
|
||||
@@ -7,6 +7,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// @codingStandardsIgnoreStart
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
// @codingStandardsIgnoreEnd
|
||||
|
||||
/**
|
||||
* Convert column number to string equivalent
|
||||
*
|
||||
|
||||
@@ -25,6 +25,9 @@ class database_handler
|
||||
/** @var int Move direction left */
|
||||
const MOVE_DIRECTION_LEFT = -1;
|
||||
|
||||
/** @var int Board3 module enabled */
|
||||
const B3_MODULE_ENABLED = 1;
|
||||
|
||||
/** @var \phpbb\db\driver\driver_interface */
|
||||
protected $db;
|
||||
|
||||
@@ -72,7 +75,7 @@ class database_handler
|
||||
'module_group_ids' => '',
|
||||
'module_image_height' => 16,
|
||||
'module_image_width' => 16,
|
||||
'module_status' => B3_MODULE_ENABLED,
|
||||
'module_status' => self::B3_MODULE_ENABLED,
|
||||
);
|
||||
$sql = 'UPDATE ' . PORTAL_MODULES_TABLE . '
|
||||
SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
|
||||
@@ -23,9 +23,6 @@ class helper_test extends \board3\portal\tests\testframework\test_case
|
||||
|
||||
parent::setUp();
|
||||
|
||||
define(B3_MODULE_DISABLED, 0);
|
||||
define(B3_MODULE_ENABLED, 1);
|
||||
|
||||
$cache = $this->getMock('\phpbb\cache\driver', array('get', 'put'));
|
||||
$this->auth = $this->getMock('\phpbb\auth\auth', array('acl_get'));
|
||||
$this->auth->expects($this->any())
|
||||
|
||||
Reference in New Issue
Block a user