aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-12-23 12:52:51 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2011-12-25 01:51:32 -0500
commit99c102344ebe3b4a6c18e36c8bea8f3bdd997f2e (patch)
treeda0d7511b60c02f249ca4e436f1fcb10d9111526 /phpBB/includes/acp
parent16ae99eec8e34ec6d542c1e4d82bd288bc0d0026 (diff)
downloadforums-99c102344ebe3b4a6c18e36c8bea8f3bdd997f2e.tar
forums-99c102344ebe3b4a6c18e36c8bea8f3bdd997f2e.tar.gz
forums-99c102344ebe3b4a6c18e36c8bea8f3bdd997f2e.tar.bz2
forums-99c102344ebe3b4a6c18e36c8bea8f3bdd997f2e.tar.xz
forums-99c102344ebe3b4a6c18e36c8bea8f3bdd997f2e.zip
[ticket/10428] Use phpbb_optionget/set in optionget/set for DRYness.
PHPBB3-10428
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_users.php28
1 files changed, 12 insertions, 16 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 724d450c99..e433c46db3 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -2347,27 +2347,23 @@ class acp_users
$var = ($data !== false) ? $data : $user_row['user_options'];
- if ($value && !($var & 1 << $user->keyoptions[$key]))
- {
- $var += 1 << $user->keyoptions[$key];
- }
- else if (!$value && ($var & 1 << $user->keyoptions[$key]))
- {
- $var -= 1 << $user->keyoptions[$key];
- }
- else
- {
- return ($data !== false) ? $var : false;
- }
+ $new_var = phpbb_optionset($user->keyoptions[$key], $value, $var);
if ($data === false)
{
- $user_row['user_options'] = $var;
- return true;
+ if ($new_var != $var)
+ {
+ $user_row['user_options'] = $new_var;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
else
{
- return $var;
+ return $new_var;
}
}
@@ -2379,7 +2375,7 @@ class acp_users
global $user;
$var = ($data !== false) ? $data : $user_row['user_options'];
- return ($var & 1 << $user->keyoptions[$key]) ? true : false;
+ return phpbb_optionget($user->keyoptions[$key], $var);
}
}