Some emergency updates ...

git-svn-id: file:///svn/phpbb/trunk@422 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-06-03 23:48:57 +00:00
parent 10fa55f5a0
commit 764ec889a9

View file

@ -60,8 +60,8 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
switch($type) switch($type)
{ {
case AUTH_ALL: case AUTH_ALL:
$a_sql = "aa.auth_view, aa.auth_read, aa.auth_post, aa.auth_reply, aa.auth_edit, aa.auth_delete, aa.auth_votecreate, aa.auth_vote"; $a_sql = "aa.auth_view, aa.auth_read, aa.auth_post, aa.auth_reply, aa.auth_edit, aa.auth_delete, aa.auth_votecreate, aa.auth_vote, aa.auth_attachments";
$auth_fields = array("auth_view", "auth_read", "auth_post", "auth_reply", "auth_edit", "auth_delete", "auth_votecreate", "auth_vote"); $auth_fields = array("auth_view", "auth_read", "auth_post", "auth_reply", "auth_edit", "auth_delete", "auth_votecreate", "auth_vote", "auth_attachments");
break; break;
case AUTH_VIEW: case AUTH_VIEW:
$a_sql = "aa.auth_view"; $a_sql = "aa.auth_view";
@ -95,6 +95,10 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
$a_sql = "aa.auth_vote"; $a_sql = "aa.auth_vote";
$auth_fields = array("auth_vote"); $auth_fields = array("auth_vote");
break; break;
case AUTH_ATTACH:
$a_sql = "aa.auth_attachments";
$auth_fields = array("auth_attachments");
break;
default: default:
break; break;
} }
@ -125,7 +129,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
} }
else else
{ {
$f_access = $db->sql_fetchrowset($af_result); $f_access = ($forum_id != AUTH_LIST_ALL) ? $db->sql_fetchrow($af_result) : $db->sql_fetchrowset($af_result);
} }
} }
} }
@ -190,7 +194,6 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
for($i = 0; $i < count($auth_fields); $i++) for($i = 0; $i < count($auth_fields); $i++)
{ {
$key = $auth_fields[$i]; $key = $auth_fields[$i];
$value = ($forum_id != AUTH_LIST_ALL) ? $f_access[$key] : $f_access[$k][$key];
if(!$num_u_access) if(!$num_u_access)
{ {
@ -201,14 +204,14 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
// //
if($forum_id != AUTH_LIST_ALL) if($forum_id != AUTH_LIST_ALL)
{ {
$auth_user[$key] = ($value == AUTH_ALL || $value == AUTH_REG) ? 1 : 0; $auth_user[$key] = ($f_access[$key] == AUTH_ALL || $f_access[$key] == AUTH_REG) ? 1 : 0;
} }
else else
{ {
for($k = 0; $k < count($f_access); $k++) for($k = 0; $k < count($f_access); $k++)
{ {
$f_forum_id = $f_access[$k]['forum_id']; $f_forum_id = $f_access[$k]['forum_id'];
$auth_user[$f_forum_id][$key] = ($value == AUTH_ALL || $value == AUTH_REG) ? 1 : 0; $auth_user[$f_forum_id][$key] = ($f_access[$k][$key] == AUTH_ALL || $f_access[$k][$key] == AUTH_REG) ? 1 : 0;
} }
} }
} }
@ -245,97 +248,69 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
// contents of the access levels are. // contents of the access levels are.
// //
if($forum_id != AUTH_LIST_ALL)
{
switch($value) switch($value)
{ {
case AUTH_ALL: case AUTH_ALL:
if($forum_id != AUTH_LIST_ALL)
{
$auth_user[$key] = 1; $auth_user[$key] = 1;
}
else
{
for($k = 0; $k < count($f_access); $k++)
{
$f_forum_id = $f_access[$k]['forum_id'];
$auth_user[$f_forum_id][$key] = 1;
}
}
break; break;
case AUTH_REG: case AUTH_REG:
if($forum_id != AUTH_LIST_ALL)
{
$auth_user[$key] = 1; $auth_user[$key] = 1;
}
else
{
for($k = 0; $k < count($f_access); $k++)
{
$f_forum_id = $f_access[$k]['forum_id'];
$auth_user[$f_forum_id][$key] = 1;
}
}
break; break;
case AUTH_ACL: case AUTH_ACL:
if($forum_id != AUTH_LIST_ALL)
{
$auth_user[$key] = auth_check_user(AUTH_ACL, $key, $u_access, $is_admin); $auth_user[$key] = auth_check_user(AUTH_ACL, $key, $u_access, $is_admin);
}
else
{
for($k = 0; $k < count($f_access); $k++)
{
$f_forum_id = $f_access[$k]['forum_id'];
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_ACL, $key, $u_access, $is_admin);
}
}
break; break;
case AUTH_MOD: case AUTH_MOD:
if($forum_id != AUTH_LIST_ALL) $auth_user[$key] = auth_check_user(AUTH_MOD, $key, $u_access, $is_admin);
{
$auth_user[$key] = auth_check_user(AUTH_ACL, $key, $u_access, $is_admin);
}
else
{
for($k = 0; $k < count($f_access); $k++)
{
$f_forum_id = $f_access[$k]['forum_id'];
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_ACL, $key, $u_access, $is_admin);
}
}
break; break;
case AUTH_ADMIN: case AUTH_ADMIN:
if($forum_id != AUTH_LIST_ALL)
{
$auth_user[$key] = $is_admin; $auth_user[$key] = $is_admin;
}
else
{
for($k = 0; $k < count($f_access); $k++)
{
$f_forum_id = $f_access[$k]['forum_id'];
$auth_user[$f_forum_id][$key] = $is_admin;
}
}
break; break;
default: default:
if($forum_id != AUTH_LIST_ALL)
{
$auth_user[$key] = 0; $auth_user[$key] = 0;
break;
}
} }
else else
{ {
for($k = 0; $k < count($f_access); $k++) for($k = 0; $k < count($f_access); $k++)
{ {
$value = $f_access[$k][$key];
$f_forum_id = $f_access[$k]['forum_id']; $f_forum_id = $f_access[$k]['forum_id'];
$auth_user[$f_forum_id][$key] = 0;
} switch($value)
} {
case AUTH_ALL:
$auth_user[$f_forum_id][$key] = 1;
break; break;
case AUTH_REG:
$auth_user[$f_forum_id][$key] = 1;
break;
case AUTH_ACL:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_ACL, $key, $u_access, $is_admin);
break;
case AUTH_MOD:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_MOD, $key, $u_access, $is_admin);
break;
case AUTH_ADMIN:
$auth_user[$f_forum_id][$key] = $is_admin;
break;
default:
$auth_user[$f_forum_id][$key] = 0;
break;
}
}
} }
} }
} }