diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-02-12 19:21:00 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-02-12 19:21:00 +0000 |
commit | 81f78690dbcb0bb90304fb5e2b7343866d371615 (patch) | |
tree | 13e813246688812d944a406a351ee6c57134b82c /phpBB/includes/auth.php | |
parent | 3f323153b5f201dd7954c7f4ba6da53c98defcd0 (diff) | |
download | forums-81f78690dbcb0bb90304fb5e2b7343866d371615.tar forums-81f78690dbcb0bb90304fb5e2b7343866d371615.tar.gz forums-81f78690dbcb0bb90304fb5e2b7343866d371615.tar.bz2 forums-81f78690dbcb0bb90304fb5e2b7343866d371615.tar.xz forums-81f78690dbcb0bb90304fb5e2b7343866d371615.zip |
my turn to break things... harharhar
- checking in permission settings and permission masks
- permission presets and documentation not finished yet
- added backtrace function to determine file/line for sql errors
- fixed marlist for orphan attachments/groups/logs/users
- able to change anonymous user settings/permissions now
- re-arranged admin permissions a bit (added some and removed some)
- setting forum permissions after creating/editing forum now selects every default group (copy permisson/dropdown to be added for adding forums)
- finished user permissions in users acp
note: the layout for permissions might change
devs: please empty the user_permissions in phpbb_users. Also, first change your auth_options table, remove all cache files and then re-set admin permissions. After having set the admin permissions you can update your modules table (else you will not see the permission tabs) - or empty the auth setting within the modules table to be able to see the permission modules (they rely on newly added permission options)
git-svn-id: file:///svn/phpbb/trunk@5553 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/auth.php')
-rw-r--r-- | phpBB/includes/auth.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 9608909088..ad6de1d6a8 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -494,6 +494,52 @@ class auth } /** + * Get raw user based permission settings + */ + function acl_user_raw_data($user_id = false, $opts = false, $forum_id = false) + { + global $db; + + $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? "user_id = $user_id" : 'user_id IN (' . implode(', ', $user_id) . ')') : ''; + $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND a.forum_id IN (' . implode(', ', $forum_id) . ')') : ''; + + $sql_opts = ''; + + if ($opts !== false) + { + if (!is_array($opts)) + { + $sql_opts = (strpos($opts, '%') !== false) ? "AND ao.auth_option LIKE '" . $db->sql_escape($opts) . "'" : "AND ao.auth_option = '" . $db->sql_escape($opts) . "'"; + } + else + { + $sql_opts = 'AND ao.auth_option IN (' . implode(', ', preg_replace('#^\s*(.*)\s*$#e', "\"'\" . \$db->sql_escape('\\1') . \"'\"", $opts)) . ')'; + } + } + + $hold_ary = array(); + + // Grab user settings ... each user has only one setting for each + // option ... so we shouldn't need any ACL_NO checks ... he says ... + $sql = 'SELECT ao.auth_option, a.user_id, a.forum_id, a.auth_setting + FROM ' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_USERS_TABLE . ' a + WHERE ao.auth_option_id = a.auth_option_id + ' . (($sql_user) ? 'AND a.' . $sql_user : '') . " + $sql_forum + $sql_opts + ORDER BY a.forum_id, ao.auth_option_id"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + + return $hold_ary; + } + + /** * Get raw group based permission settings */ function acl_group_raw_data($group_id = false, $opts = false, $forum_id = false) |