aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2008-01-03 17:00:40 +0000
committerDavid M <davidmj@users.sourceforge.net>2008-01-03 17:00:40 +0000
commit85055ac97fa57ca339924cef719115d85bdf6c2e (patch)
tree1e19230af2689c3837356c0f7947719c0cdf67ef /phpBB/includes/acp
parent0f26ffbadea13d97b841dfe56b21da7a5479000a (diff)
downloadforums-85055ac97fa57ca339924cef719115d85bdf6c2e.tar
forums-85055ac97fa57ca339924cef719115d85bdf6c2e.tar.gz
forums-85055ac97fa57ca339924cef719115d85bdf6c2e.tar.bz2
forums-85055ac97fa57ca339924cef719115d85bdf6c2e.tar.xz
forums-85055ac97fa57ca339924cef719115d85bdf6c2e.zip
oh boy...
- Migrate code base to PHP 5.1+ git-svn-id: file:///svn/phpbb/trunk@8295 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_captcha.php7
-rw-r--r--phpBB/includes/acp/acp_database.php2
-rwxr-xr-xphpBB/includes/acp/acp_inactive.php2
-rw-r--r--phpBB/includes/acp/acp_profile.php12
-rw-r--r--phpBB/includes/acp/acp_styles.php2
-rw-r--r--phpBB/includes/acp/acp_users.php2
-rw-r--r--phpBB/includes/acp/auth.php37
7 files changed, 30 insertions, 34 deletions
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php
index 0d653c22d1..5b2b345ef8 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -44,6 +44,7 @@ class acp_captcha
{
$config[$captcha_var] = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
}
+
if ($config['captcha_gd'])
{
include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
@@ -52,9 +53,9 @@ class acp_captcha
{
include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
}
- $captcha = new captcha();
- $captcha->execute(gen_rand_string(mt_rand(5, 8)), time());
- exit_handler();
+
+ captcha::execute(gen_rand_string(mt_rand(5, 8)), time());
+ exit();
}
$config_vars = array(
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 62331fbca2..a54230039d 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -446,7 +446,7 @@ class base_extractor
var $format;
var $run_comp = false;
- function base_extractor($download = false, $store = false, $format, $filename, $time)
+ function __construct($download = false, $store = false, $format, $filename, $time)
{
$this->download = $download;
$this->store = $store;
diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php
index 5683ae5dab..90f326b099 100755
--- a/phpBB/includes/acp/acp_inactive.php
+++ b/phpBB/includes/acp/acp_inactive.php
@@ -24,7 +24,7 @@ class acp_inactive
var $u_action;
var $p_master;
- function acp_inactive(&$p_master)
+ function __construct(&$p_master)
{
$this->p_master = &$p_master;
}
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 309f5d5e74..d89d01fcbc 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -729,7 +729,7 @@ class acp_profile
'S_FIELD_NO_VIEW' => ($cp->vars['field_no_view']) ? true : false,
'L_LANG_SPECIFIC' => sprintf($user->lang['LANG_SPECIFIC_OPTIONS'], $config['default_lang']),
- 'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper($cp->profile_types[$field_type])],
+ 'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper(custom_profile::profile_types[$field_type])],
'FIELD_IDENT' => $cp->vars['field_ident'],
'LANG_NAME' => $cp->vars['lang_name'],
'LANG_EXPLAIN' => $cp->vars['lang_explain'])
@@ -742,7 +742,7 @@ class acp_profile
'S_TEXT' => ($field_type == FIELD_TEXT) ? true : false,
'S_STRING' => ($field_type == FIELD_STRING) ? true : false,
- 'L_DEFAULT_VALUE_EXPLAIN' => $user->lang[strtoupper($cp->profile_types[$field_type]) . '_DEFAULT_VALUE_EXPLAIN'],
+ 'L_DEFAULT_VALUE_EXPLAIN' => $user->lang[strtoupper(custom_profile::profile_types[$field_type]) . '_DEFAULT_VALUE_EXPLAIN'],
'LANG_DEFAULT_VALUE' => $cp->vars['lang_default_value'])
);
}
@@ -769,7 +769,7 @@ class acp_profile
'S_BOOL' => ($field_type == FIELD_BOOL) ? true : false,
'S_DROPDOWN' => ($field_type == FIELD_DROPDOWN) ? true : false,
- 'L_LANG_OPTIONS_EXPLAIN' => $user->lang[strtoupper($cp->profile_types[$field_type]) . '_ENTRIES_EXPLAIN'],
+ 'L_LANG_OPTIONS_EXPLAIN' => $user->lang[strtoupper(custom_profile::profile_types[$field_type]) . '_ENTRIES_EXPLAIN'],
'LANG_OPTIONS' => ($field_type == FIELD_DROPDOWN) ? implode("\n", $cp->vars['lang_options']) : '',
'FIRST_LANG_OPTION' => ($field_type == FIELD_BOOL) ? $cp->vars['lang_options'][0] : '',
'SECOND_LANG_OPTION' => ($field_type == FIELD_BOOL) ? $cp->vars['lang_options'][1] : '')
@@ -786,7 +786,7 @@ class acp_profile
);
// Build options based on profile type
- $function = 'get_' . $cp->profile_types[$field_type] . '_options';
+ $function = 'get_' . custom_profile::profile_types[$field_type] . '_options';
$options = $cp->$function();
foreach ($options as $num => $option_ary)
@@ -851,7 +851,7 @@ class acp_profile
$template->assign_block_vars('fields', array(
'FIELD_IDENT' => $row['field_ident'],
- 'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper($cp->profile_types[$row['field_type']])],
+ 'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper(custom_profile::profile_types[$row['field_type']])],
'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang],
'U_ACTIVATE_DEACTIVATE' => $this->u_action . "&amp;action=$active_value&amp;field_id=$id",
@@ -873,7 +873,7 @@ class acp_profile
}
$s_select_type = '';
- foreach ($cp->profile_types as $key => $value)
+ foreach (custom_profile::profile_types as $key => $value)
{
$s_select_type .= '<option value="' . $key . '">' . $user->lang['FIELD_' . strtoupper($value)] . '</option>';
}
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 31e99a6b0c..3fec4fc2ff 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -1782,7 +1782,7 @@ parse_css_file = {PARSE_CSS_FILE}
$theme_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['theme_name'], $style_row['theme_copyright'], $config['version']), $this->theme_cfg);
// Read old cfg file
- $items = $cache->obtain_cfg_items($style_row);
+ $items = cache::obtain_cfg_items($style_row);
$items = $items['theme'];
if (!isset($items['parse_css_file']))
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 310759d38c..252fb743cd 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -24,7 +24,7 @@ class acp_users
var $u_action;
var $p_master;
- function acp_users(&$p_master)
+ function __construct(&$p_master)
{
$this->p_master = &$p_master;
}
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index b4ea0e46d0..9eee5829a1 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -27,7 +27,7 @@ class auth_admin extends auth
/**
* Init auth settings
*/
- function auth_admin()
+ function __construct()
{
global $db, $cache;
@@ -84,7 +84,7 @@ class auth_admin extends auth
* @param local|global $scope the scope defines the permission scope. If local, a forum_id is additionally required
* @param ACL_NEVER|ACL_NO|ACL_YES $acl_fill defines the mode those permissions not set are getting filled with
*/
- function get_mask($mode, $user_id = false, $group_id = false, $forum_id = false, $auth_option = false, $scope = false, $acl_fill = ACL_NEVER)
+ public function get_mask($mode, $user_id = false, $group_id = false, $forum_id = false, $auth_option = false, $scope = false, $acl_fill = ACL_NEVER)
{
global $db, $user;
@@ -235,7 +235,7 @@ class auth_admin extends auth
* Get permission mask for roles
* This function only supports getting masks for one role
*/
- function get_role_mask($role_id)
+ public function get_role_mask($role_id)
{
global $db;
@@ -273,7 +273,7 @@ class auth_admin extends auth
/**
* Display permission mask (assign to template)
*/
- function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true)
+ public function display_mask($mode, $permission_type, array $hold_ary, $user_mode = 'user', $local = false, $group_display = true)
{
global $template, $user, $db, $phpbb_root_path, $phpEx;
@@ -451,7 +451,7 @@ class auth_admin extends auth
foreach ($hold_ary as $forum_id => $forum_array)
{
$content_array = $categories = array();
- $this->build_permission_array($hold_ary[$forum_id], $content_array, $categories, array_keys($ug_names_ary));
+ this::build_permission_array($hold_ary[$forum_id], $content_array, $categories, array_keys($ug_names_ary));
$template->assign_block_vars($tpl_pmask, array(
'NAME' => ($forum_id == 0) ? $forum_names_ary[0] : $forum_names_ary[$forum_id]['forum_name'],
@@ -519,7 +519,7 @@ class auth_admin extends auth
'FORUM_ID' => $forum_id)
);
- $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view'));
+ this::assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view'));
unset($content_array[$ug_id]);
}
@@ -537,7 +537,7 @@ class auth_admin extends auth
}
$content_array = $categories = array();
- $this->build_permission_array($hold_ary[$ug_id], $content_array, $categories, array_keys($forum_names_ary));
+ this::build_permission_array($hold_ary[$ug_id], $content_array, $categories, array_keys($forum_names_ary));
$template->assign_block_vars($tpl_pmask, array(
'NAME' => $ug_name,
@@ -606,7 +606,7 @@ class auth_admin extends auth
'FORUM_ID' => $forum_id)
);
- $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view'));
+ this::assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view'));
}
unset($hold_ary[$ug_id], $ug_names_ary[$ug_id]);
@@ -617,7 +617,7 @@ class auth_admin extends auth
/**
* Display permission mask for roles
*/
- function display_role_mask(&$hold_ary)
+ public function display_role_mask(array $hold_ary)
{
global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx;
@@ -698,15 +698,10 @@ class auth_admin extends auth
* 'global' => array('optionA', 'optionB', ...)
* );
*/
- function acl_add_option($options)
+ public function acl_add_option(array $options)
{
global $db, $cache;
- if (!is_array($options))
- {
- return false;
- }
-
$cur_options = array();
$sql = 'SELECT auth_option, is_global, is_local
@@ -784,7 +779,7 @@ class auth_admin extends auth
/**
* Set a user or group ACL record
*/
- function acl_set($ug_type, $forum_id, $ug_id, $auth, $role_id = 0, $clear_prefetch = true)
+ public function acl_set($ug_type, $forum_id, $ug_id, $auth, $role_id = 0, $clear_prefetch = true)
{
global $db;
@@ -917,7 +912,7 @@ class auth_admin extends auth
/**
* Set a role-specific ACL record
*/
- function acl_set_role($role_id, $auth)
+ public function acl_set_role($role_id, $auth)
{
global $db;
@@ -980,7 +975,7 @@ class auth_admin extends auth
/**
* Remove local permission
*/
- function acl_delete($mode, $ug_id = false, $forum_id = false, $permission_type = false)
+ public function acl_delete($mode, $ug_id = false, $forum_id = false, $permission_type = false)
{
global $db;
@@ -1088,7 +1083,7 @@ class auth_admin extends auth
* Assign category to template
* used by display_mask()
*/
- function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false, $s_view)
+ private static function assign_cat_array(array $category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false, $s_view)
{
global $template, $user, $phpbb_admin_path, $phpEx;
@@ -1164,7 +1159,7 @@ class auth_admin extends auth
* Building content array from permission rows with explicit key ordering
* used by display_mask()
*/
- function build_permission_array(&$permission_row, &$content_array, &$categories, $key_sort_array)
+ public static function build_permission_array(array $permission_row, array &$content_array, array &$categories, array $key_sort_array)
{
global $user;
@@ -1229,7 +1224,7 @@ class auth_admin extends auth
* "more" permissions by this.
* Admin permissions will not be copied.
*/
- function ghost_permissions($from_user_id, $to_user_id)
+ public function ghost_permissions($from_user_id, $to_user_id)
{
global $db;