aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/auth.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-06-06 17:50:24 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-06-06 17:50:24 +0000
commit43bc7ac78f64dd081046d2f146765315ef45c339 (patch)
tree45e29b1db2033d2796b1590e4df4683941ae8907 /phpBB/includes/auth.php
parent6ac0e7b4b343559659837b150e99cf3ff5bcf47f (diff)
downloadforums-43bc7ac78f64dd081046d2f146765315ef45c339.tar
forums-43bc7ac78f64dd081046d2f146765315ef45c339.tar.gz
forums-43bc7ac78f64dd081046d2f146765315ef45c339.tar.bz2
forums-43bc7ac78f64dd081046d2f146765315ef45c339.tar.xz
forums-43bc7ac78f64dd081046d2f146765315ef45c339.zip
Auth now returns a type allowing for more meaningful failure messa ges
git-svn-id: file:///svn/phpbb/trunk@434 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/auth.php')
-rw-r--r--phpBB/includes/auth.php104
1 files changed, 103 insertions, 1 deletions
diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php
index 043b776e40..03df1236af 100644
--- a/phpBB/includes/auth.php
+++ b/phpBB/includes/auth.php
@@ -113,7 +113,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
{
$forum_match_sql = ($forum_id != AUTH_LIST_ALL) ? "WHERE aa.forum_id = $forum_id" : "";
$sql = "SELECT aa.forum_id, $a_sql
- FROM ".AUTH_FORUMS_TABLE." aa
+ FROM ".FORUMS_TABLE." aa
$forum_match_sql";
$af_result = $db->sql_query($sql);
@@ -156,6 +156,29 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
if($forum_id != AUTH_LIST_ALL)
{
$auth_user[$key] = ($f_access[$key] == AUTH_ALL) ? 1 : 0;
+
+ switch($f_access[$key])
+ {
+ case AUTH_ALL:
+ $auth_user[$key . '_type'] = "Anonymous Users";
+ break;
+
+ case AUTH_REG:
+ $auth_user[$key . '_type'] = "Registered Users";
+ break;
+
+ case AUTH_ACL:
+ $auth_user[$key . '_type'] = "Users granted Special Access";
+ break;
+
+ case AUTH_MOD:
+ $auth_user[$key . '_type'] = "Moderators";
+ break;
+
+ case AUTH_ADMIN:
+ $auth_user[$key . '_type'] = "Administrators";
+ break;
+ }
}
else
{
@@ -163,6 +186,29 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
{
$forum_id = $f_access[$i]['forum_id'];
$auth_user[$forum_id][$key] = ($f_access[$i][$key] == AUTH_ALL) ? 1 : 0;
+
+ switch($f_access[$i][$key])
+ {
+ case AUTH_ALL:
+ $auth_user[$forum_id][$key . '_type'] = "Anonymous Users";
+ break;
+
+ case AUTH_REG:
+ $auth_user[$forum_id][$key . '_type'] = "Registered Users";
+ break;
+
+ case AUTH_ACL:
+ $auth_user[$forum_id][$key . '_type'] = "Users granted special access";
+ break;
+
+ case AUTH_MOD:
+ $auth_user[$forum_id][$key . '_type'] = "Moderators";
+ break;
+
+ case AUTH_ADMIN:
+ $auth_user[$forum_id][$key . '_type'] = "Administrators";
+ break;
+ }
}
}
}
@@ -205,6 +251,29 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
if($forum_id != AUTH_LIST_ALL)
{
$auth_user[$key] = ($f_access[$key] == AUTH_ALL || $f_access[$key] == AUTH_REG) ? 1 : 0;
+
+ switch($f_access[$key])
+ {
+ case AUTH_ALL:
+ $auth_user[$key . '_type'] = "Anonymous Users";
+ break;
+
+ case AUTH_REG:
+ $auth_user[$key . '_type'] = "Registered Users";
+ break;
+
+ case AUTH_ACL:
+ $auth_user[$key . '_type'] = "Users granted special access";
+ break;
+
+ case AUTH_MOD:
+ $auth_user[$key . '_type'] = "Moderators";
+ break;
+
+ case AUTH_ADMIN:
+ $auth_user[$key . '_type'] = "Administrators";
+ break;
+ }
}
else
{
@@ -212,6 +281,29 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
{
$f_forum_id = $f_access[$k]['forum_id'];
$auth_user[$f_forum_id][$key] = ($f_access[$k][$key] == AUTH_ALL || $f_access[$k][$key] == AUTH_REG) ? 1 : 0;
+
+ switch($f_access[$k][$key])
+ {
+ case AUTH_ALL:
+ $auth_user[$forum_id][$key . '_type'] = "Anonymous Users";
+ break;
+
+ case AUTH_REG:
+ $auth_user[$forum_id][$key . '_type'] = "Registered Users";
+ break;
+
+ case AUTH_ACL:
+ $auth_user[$forum_id][$key . '_type'] = "Users granted special access";
+ break;
+
+ case AUTH_MOD:
+ $auth_user[$forum_id][$key . '_type'] = "Moderators";
+ break;
+
+ case AUTH_ADMIN:
+ $auth_user[$forum_id][$key . '_type'] = "Administrators";
+ break;
+ }
}
}
}
@@ -254,22 +346,27 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
{
case AUTH_ALL:
$auth_user[$key] = 1;
+ $auth_user[$key . '_type'] = "Anonymous Users";
break;
case AUTH_REG:
$auth_user[$key] = 1;
+ $auth_user[$key . '_type'] = "Registered Users";
break;
case AUTH_ACL:
$auth_user[$key] = auth_check_user(AUTH_ACL, $key, $u_access, $is_admin);
+ $auth_user[$key . '_type'] = "Users granted special access";
break;
case AUTH_MOD:
$auth_user[$key] = auth_check_user(AUTH_MOD, $key, $u_access, $is_admin);
+ $auth_user[$key . '_type'] = "Moderators";
break;
case AUTH_ADMIN:
$auth_user[$key] = $is_admin;
+ $auth_user[$key . '_type'] = "Administrators";
break;
default:
@@ -288,22 +385,27 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
{
case AUTH_ALL:
$auth_user[$f_forum_id][$key] = 1;
+ $auth_user[$f_forum_id][$key . '_type'] = "Anonymous Users";
break;
case AUTH_REG:
$auth_user[$f_forum_id][$key] = 1;
+ $auth_user[$f_forum_id][$key . '_type'] = "Registered Users";
break;
case AUTH_ACL:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_ACL, $key, $u_access, $is_admin);
+ $auth_user[$f_forum_id][$key . '_type'] = "Users granted special access";
break;
case AUTH_MOD:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_MOD, $key, $u_access, $is_admin);
+ $auth_user[$f_forum_id][$key . '_type'] = "Moderators";
break;
case AUTH_ADMIN:
$auth_user[$f_forum_id][$key] = $is_admin;
+ $auth_user[$f_forum_id][$key . '_type'] = "Administrators";
break;
default: