mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
I'll have half a pound of fudge please
git-svn-id: file:///svn/phpbb/trunk@4821 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
0ec2fa96ac
commit
78625ccf44
1 changed files with 21 additions and 10 deletions
|
@ -212,7 +212,7 @@ class session
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is user banned? Are they excluded?
|
// Is user banned? Are they excluded?
|
||||||
if (!$this->data['user_type'] != USER_FOUNDER && !$bot)
|
if ($this->data['user_type'] != USER_FOUNDER && !$bot)
|
||||||
{
|
{
|
||||||
$banned = false;
|
$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)
|
// 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]))
|
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];
|
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
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return ($data) ? $var : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
if (!$data)
|
||||||
|
{
|
||||||
|
$this->data['user_options'] = $var;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $var;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue