diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2011-12-23 12:52:51 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-12-25 01:51:32 -0500 |
commit | 99c102344ebe3b4a6c18e36c8bea8f3bdd997f2e (patch) | |
tree | da0d7511b60c02f249ca4e436f1fcb10d9111526 /phpBB/includes/acp | |
parent | 16ae99eec8e34ec6d542c1e4d82bd288bc0d0026 (diff) | |
download | forums-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.php | 28 |
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); } } |