diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2004-02-10 01:16:48 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2004-02-10 01:16:48 +0000 |
| commit | 78625ccf4479d388bc4144c3e538dc8a9af16e71 (patch) | |
| tree | 4b91a194db0e4d64fbbb20ec3a8c59d5a575db59 | |
| parent | 0ec2fa96ac2e7e84eac4b9db082a1fb0ba2159d7 (diff) | |
| download | forums-78625ccf4479d388bc4144c3e538dc8a9af16e71.tar forums-78625ccf4479d388bc4144c3e538dc8a9af16e71.tar.gz forums-78625ccf4479d388bc4144c3e538dc8a9af16e71.tar.bz2 forums-78625ccf4479d388bc4144c3e538dc8a9af16e71.tar.xz forums-78625ccf4479d388bc4144c3e538dc8a9af16e71.zip | |
I'll have half a pound of fudge please
git-svn-id: file:///svn/phpbb/trunk@4821 89ea8834-ac86-4346-8a33-228a782c2dd0
| -rw-r--r-- | phpBB/includes/session.php | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index a2577cc417..0d28ed810e 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -212,7 +212,7 @@ class session } // Is user banned? Are they excluded? - if (!$this->data['user_type'] != USER_FOUNDER && !$bot) + if ($this->data['user_type'] != USER_FOUNDER && !$bot) { $banned = false; @@ -680,31 +680,42 @@ class user extends session } // Start code for checking/setting option bit field for user table (if we go that way) - function optionget($key) + function optionget($key, $data = false) { if (!isset($this->keyvalues[$key])) { - $this->keyvalues[$key] = ($this->data['user_options'] & 1 << $this->keyoptions[$key]) ? true : false; + $var = ($data) ? $data : $this->data['user_options']; + $this->keyvalues[$key] = ($var & 1 << $this->keyoptions[$key]) ? true : false; } return $this->keyvalues[$key]; } - function optionset($key, $value) + function optionset($key, $value, $data = false) { - if ($value && !($this->data['user_options'] & 1 << $this->keyoptions[$key])) + $var = ($data) ? $data : $this->data['user_options']; + + if ($value && !($var & 1 << $this->keyoptions[$key])) { - $this->data['user_options'] += 1 << $this->keyoptions[$key]; + $var += 1 << $this->keyoptions[$key]; } - else if (!$value && ($this->data['user_options'] & 1 << $this->keyoptions[$key])) + else if (!$value && ($var & 1 << $this->keyoptions[$key])) { - $this->data['user_options'] -= 1 << $this->keyoptions[$key]; + $var -= 1 << $this->keyoptions[$key]; } else { - return false; + return ($data) ? $var : false; } - return true; + if (!$data) + { + $this->data['user_options'] = $var; + return true; + } + else + { + return $var; + } } } |
