mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
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
This commit is contained in:
@@ -493,6 +493,52 @@ class auth
|
||||
return $hold_ary;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user