diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2008-12-27 12:18:04 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2008-12-27 12:18:04 +0000 |
commit | 25725c98503c3a9ba8b5de4b91c2528b6c974a03 (patch) | |
tree | adf5470b0a4f90ef44b9be7a9761c4a6153072aa /phpBB/includes/classes/acl.php | |
parent | 297af28a40e5fa94de0cb2f57d807b39020f44f0 (diff) | |
download | forums-25725c98503c3a9ba8b5de4b91c2528b6c974a03.tar forums-25725c98503c3a9ba8b5de4b91c2528b6c974a03.tar.gz forums-25725c98503c3a9ba8b5de4b91c2528b6c974a03.tar.bz2 forums-25725c98503c3a9ba8b5de4b91c2528b6c974a03.tar.xz forums-25725c98503c3a9ba8b5de4b91c2528b6c974a03.zip |
replace constants with class constants.
ACL_YES, ACL_NO, ACL_NEVER, USER_NORMAL, USER_IGNORE, USER_INACTIVE, USER_FOUNDER
git-svn-id: file:///svn/phpbb/trunk@9233 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/classes/acl.php')
-rw-r--r-- | phpBB/includes/classes/acl.php | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/phpBB/includes/classes/acl.php b/phpBB/includes/classes/acl.php index e7fa0f2674..226bb8be23 100644 --- a/phpBB/includes/classes/acl.php +++ b/phpBB/includes/classes/acl.php @@ -382,13 +382,13 @@ class auth // Key 0 in $hold_ary are global options, all others are forum_ids // If this user is founder we're going to force fill the admin options ... - if ($userdata['user_type'] == USER_FOUNDER) + if ($userdata['user_type'] == phpbb::USER_FOUNDER) { foreach ($this->acl_options['global'] as $opt => $id) { if (strpos($opt, 'a_') === 0) { - $hold_ary[0][$this->acl_options['id'][$opt]] = ACL_YES; + $hold_ary[0][$this->acl_options['id'][$opt]] = phpbb::ACL_YES; } } } @@ -437,14 +437,14 @@ class auth // If one option is allowed, the global permission for this option has to be allowed too // example: if the user has the a_ permission this means he has one or more a_* permissions - if ($auth_ary[$this->acl_options['id'][$opt]] == ACL_YES && (!isset($bitstring[$this->acl_options[$ary_key][$option_key]]) || $bitstring[$this->acl_options[$ary_key][$option_key]] == ACL_NEVER)) + if ($auth_ary[$this->acl_options['id'][$opt]] == phpbb::ACL_YES && (!isset($bitstring[$this->acl_options[$ary_key][$option_key]]) || $bitstring[$this->acl_options[$ary_key][$option_key]] == phpbb::ACL_NEVER)) { - $bitstring[$this->acl_options[$ary_key][$option_key]] = ACL_YES; + $bitstring[$this->acl_options[$ary_key][$option_key]] = phpbb::ACL_YES; } } else { - $bitstring[$id] = ACL_NEVER; + $bitstring[$id] = phpbb::ACL_NEVER; } } @@ -637,22 +637,22 @@ class auth $option = ($sql_opts_select) ? $row['auth_option'] : $this->acl_options['option'][$row['auth_option_id']]; // @todo: use the ref technique to reduce opcode generation - if (!isset($hold_ary[$row['user_id']][$row['forum_id']][$option]) || (isset($hold_ary[$row['user_id']][$row['forum_id']][$option]) && $hold_ary[$row['user_id']][$row['forum_id']][$option] != ACL_NEVER)) + if (!isset($hold_ary[$row['user_id']][$row['forum_id']][$option]) || (isset($hold_ary[$row['user_id']][$row['forum_id']][$option]) && $hold_ary[$row['user_id']][$row['forum_id']][$option] != phpbb::ACL_NEVER)) { $hold_ary[$row['user_id']][$row['forum_id']][$option] = $row['auth_setting']; // If we detect ACL_NEVER, we will unset the flag option (within building the bitstring it is correctly set again) - if ($row['auth_setting'] == ACL_NEVER) + if ($row['auth_setting'] == phpbb::ACL_NEVER) { $flag = substr($option, 0, strpos($option, '_') + 1); - if (isset($hold_ary[$row['user_id']][$row['forum_id']][$flag]) && $hold_ary[$row['user_id']][$row['forum_id']][$flag] == ACL_YES) + if (isset($hold_ary[$row['user_id']][$row['forum_id']][$flag]) && $hold_ary[$row['user_id']][$row['forum_id']][$flag] == phpbb::ACL_YES) { unset($hold_ary[$row['user_id']][$row['forum_id']][$flag]); -/* if (in_array(ACL_YES, $hold_ary[$row['user_id']][$row['forum_id']])) +/* if (in_array(phpbb::ACL_YES, $hold_ary[$row['user_id']][$row['forum_id']])) { - $hold_ary[$row['user_id']][$row['forum_id']][$flag] = ACL_YES; + $hold_ary[$row['user_id']][$row['forum_id']][$flag] = phpbb::ACL_YES; } */ } @@ -856,24 +856,24 @@ class auth */ private function _set_group_hold_ary(&$hold_ary, $option_id, $setting) { - if (!isset($hold_ary[$option_id]) || (isset($hold_ary[$option_id]) && $hold_ary[$option_id] != ACL_NEVER)) + if (!isset($hold_ary[$option_id]) || (isset($hold_ary[$option_id]) && $hold_ary[$option_id] != phpbb::ACL_NEVER)) { $hold_ary[$option_id] = $setting; // If we detect ACL_NEVER, we will unset the flag option (within building the bitstring it is correctly set again) - if ($setting == ACL_NEVER) + if ($setting == phpbb::ACL_NEVER) { $flag = substr($this->acl_options['option'][$option_id], 0, strpos($this->acl_options['option'][$option_id], '_') + 1); $flag = (int) $this->acl_options['id'][$flag]; - if (isset($hold_ary[$flag]) && $hold_ary[$flag] == ACL_YES) + if (isset($hold_ary[$flag]) && $hold_ary[$flag] == phpbb::ACL_YES) { unset($hold_ary[$flag]); /* This is uncommented, because i suspect this being slightly wrong due to mixed permission classes being possible - if (in_array(ACL_YES, $hold_ary)) + if (in_array(phpbb::ACL_YES, $hold_ary)) { - $hold_ary[$flag] = ACL_YES; + $hold_ary[$flag] = phpbb::ACL_YES; }*/ } } |