mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-21 00:51:27 +02:00
More updates
git-svn-id: file:///svn/phpbb/trunk@2877 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -134,9 +134,29 @@ else if ( isset($HTTP_POST_VARS['delete']) )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$option_ids = false;
|
||||||
|
if ( !empty($HTTP_POST_VARS['option']) )
|
||||||
|
{
|
||||||
|
$sql = "SELECT auth_option_id
|
||||||
|
FROM " . ACL_OPTIONS_TABLE . "
|
||||||
|
WHERE auth_value LIKE '" . $HTTP_POST_VARS['option'] . "_%'";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
if ( $row = $db->sql_fetchrow($result) )
|
||||||
|
{
|
||||||
|
$option_ids = array();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
$option_ids[] = $row['auth_option_id'];
|
||||||
|
}
|
||||||
|
while( $row = $db->sql_fetchrow($result) );
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ( $HTTP_POST_VARS['entries'] as $id )
|
foreach ( $HTTP_POST_VARS['entries'] as $id )
|
||||||
{
|
{
|
||||||
$acl->$set($forum_id, $id, $HTTP_POST_VARS['option']);
|
$acl->$set($forum_id, $id, $option_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
message_die(MESSAGE, 'Permissions updated successfully');
|
message_die(MESSAGE, 'Permissions updated successfully');
|
||||||
@@ -253,7 +273,7 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
|
|||||||
<td class="row1" align="center"><select style="width:280px" name="entries[]" multiple="multiple" size="5"><?php echo $users; ?></select></td>
|
<td class="row1" align="center"><select style="width:280px" name="entries[]" multiple="multiple" size="5"><?php echo $users; ?></select></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $lang['Remove_selected']; ?>" /> <input class="liteoption" type="submit" name="advanced" value="<?php echo $lang['Advanced']; ?>" /><input type="hidden" name="type" value="user" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /></td>
|
<td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $lang['Remove_selected']; ?>" /> <input class="liteoption" type="submit" name="advanced" value="<?php echo $lang['Advanced']; ?>" /><input type="hidden" name="type" value="user" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="option" value="<?php echo $type_sql; ?>" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table></form></td>
|
</table></form></td>
|
||||||
|
|
||||||
@@ -284,7 +304,7 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
|
|||||||
<td class="row1" align="center"><select style="width:280px" name="entries[]" multiple="multiple" size="5"><?php echo $groups; ?></select></td>
|
<td class="row1" align="center"><select style="width:280px" name="entries[]" multiple="multiple" size="5"><?php echo $groups; ?></select></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $lang['Remove_selected']; ?>" /> <input class="liteoption" type="submit" name="advanced" value="<?php echo $lang['Advanced']; ?>" /><input type="hidden" name="type" value="group" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /></td>
|
<td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $lang['Remove_selected']; ?>" /> <input class="liteoption" type="submit" name="advanced" value="<?php echo $lang['Advanced']; ?>" /><input type="hidden" name="type" value="group" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="option" value="<?php echo $type_sql; ?>" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table></form></td>
|
</table></form></td>
|
||||||
|
|
||||||
|
@@ -475,30 +475,22 @@ class acl
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Store max result for type ... used later ... saves time
|
||||||
|
//
|
||||||
|
$this->acl[$forum_id][$type][0] = max($this->acl[$forum_id][$type]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// print_r($this->acl);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_acl($forum_id, $auth_main, $auth_type = false)
|
function get_acl($forum_id, $auth_main, $auth_type = false)
|
||||||
{
|
{
|
||||||
if ( $this->founder )
|
return ( $auth_main && $auth_type ) ? ( ( $this->founder || $this->acl[0]['admin'][0] ) ? true : $this->acl[$forum_id][$auth_main][$auth_type] ) : $this->acl[$forum_id][$auth_main][0];
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if ( $auth_main && $auth_type )
|
|
||||||
{
|
|
||||||
return $this->acl[$forum_id][$auth_main][$auth_type];
|
|
||||||
}
|
|
||||||
else if ( !$auth_type && is_array($this->acl[$forum_id][$auth_main]) )
|
|
||||||
{
|
|
||||||
return array_sum($this->acl[$forum_id][$auth_main]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_acl_admin($auth_type = false)
|
function get_acl_admin($auth_type = false)
|
||||||
@@ -506,7 +498,7 @@ class acl
|
|||||||
return ( $this->founder ) ? true : $this->get_acl(0, 'admin', $auth_type);
|
return ( $this->founder ) ? true : $this->get_acl(0, 'admin', $auth_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_acl_user(&$forum_id, &$user_id, &$auth, $dependencies = array())
|
function set_acl_user(&$forum_id, &$user_id, &$auth, $dependencies = false)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
@@ -550,11 +542,11 @@ class acl
|
|||||||
unset($sql_ary);
|
unset($sql_ary);
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_acl_group(&$forum_id, &$group_id, &$auth, $dependencies = array())
|
function set_acl_group(&$forum_id, &$group_id, &$auth, $dependencies = false)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$forum_sql = ( $forum_id ) ? "AND a.forum_id IN ($forum_id, 0)" : '';
|
$forum_sql = "AND a.forum_id IN ($forum_id, 0)";
|
||||||
|
|
||||||
$sql = "SELECT o.auth_option_id, a.auth_allow_deny FROM " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE a.auth_option_id = o.auth_option_id $forum_sql AND a.group_id = $group_id";
|
$sql = "SELECT o.auth_option_id, a.auth_allow_deny FROM " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE a.auth_option_id = o.auth_option_id $forum_sql AND a.group_id = $group_id";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
@@ -594,15 +586,24 @@ class acl
|
|||||||
unset($sql_ary);
|
unset($sql_ary);
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_acl_user($forum_id, $user_id, $auth_type = false)
|
function delete_acl_user($forum_id, $user_id, $auth_ids = false)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$auth_sql = ( $auth_type != '' ) ? " AND auth_option_id IN ()" : "";
|
$auth_sql = '';
|
||||||
|
if ( $auth_ids )
|
||||||
|
{
|
||||||
|
for($i = 0; $i < count($auth_ids); $i++)
|
||||||
|
{
|
||||||
|
$auth_sql .= ( ( $auth_sql != '' ) ? ', ' : '' ) . $auth_ids[$i];
|
||||||
|
}
|
||||||
|
$auth_sql = " AND auth_option_id IN ($auth_sql)";
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "DELETE FROM " . ACL_USERS_TABLE . "
|
$sql = "DELETE FROM " . ACL_USERS_TABLE . "
|
||||||
WHERE user_id = $user_id
|
WHERE user_id = $user_id
|
||||||
AND forum_id = $forum_id";
|
AND forum_id = $forum_id
|
||||||
|
$auth_sql";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -610,11 +611,20 @@ class acl
|
|||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$auth_sql = ( $auth_type != '' ) ? " AND auth_option_id IN ()" : "";
|
$auth_sql = '';
|
||||||
|
if ( $auth_ids )
|
||||||
|
{
|
||||||
|
for($i = 0; $i < count($auth_ids); $i++)
|
||||||
|
{
|
||||||
|
$auth_sql .= ( ( $auth_sql != '' ) ? ', ' : '' ) . $auth_ids[$i];
|
||||||
|
}
|
||||||
|
$auth_sql = " AND auth_option_id IN ($auth_sql)";
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "DELETE FROM " . ACL_GROUPS_TABLE . "
|
$sql = "DELETE FROM " . ACL_GROUPS_TABLE . "
|
||||||
WHERE group_id = $group_id
|
WHERE group_id = $group_id
|
||||||
AND forum_id = $forum_id";
|
AND forum_id = $forum_id
|
||||||
|
$auth_sql";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user