|
From: Paul S. O. <ps...@us...> - 2002-03-21 01:56:23
|
Update of /cvsroot/phpbb/phpBB2/admin
In directory usw-pr-cvs1:/tmp/cvs-serv20083/admin
Modified Files:
admin_ug_auth.php
Log Message:
Hopefully fix bug #532648
Index: admin_ug_auth.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_ug_auth.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** admin_ug_auth.php 19 Mar 2002 12:35:13 -0000 1.7
--- admin_ug_auth.php 21 Mar 2002 01:56:19 -0000 1.8
***************
*** 35,39 ****
// Load default header
//
! $phpbb_root_dir = "./../";
$no_page_header = TRUE;
require('pagestart.inc');
--- 35,39 ----
// Load default header
//
! $phpbb_root_dir = './../';
$no_page_header = TRUE;
require('pagestart.inc');
***************
*** 56,84 ****
// Start program - define vars
//
! $forum_auth_fields = array("auth_view", "auth_read", "auth_post", "auth_reply", "auth_edit", "auth_delete", "auth_sticky", "auth_announce", "auth_vote", "auth_pollcreate");
$auth_field_match = array(
! "auth_view" => AUTH_VIEW,
! "auth_read" => AUTH_READ,
! "auth_post" => AUTH_POST,
! "auth_reply" => AUTH_REPLY,
! "auth_edit" => AUTH_EDIT,
! "auth_delete" => AUTH_DELETE,
! "auth_sticky" => AUTH_STICKY,
! "auth_announce" => AUTH_ANNOUNCE,
! "auth_vote" => AUTH_VOTE,
! "auth_pollcreate" => AUTH_POLLCREATE);
$field_names = array(
! "auth_view" => $lang['View'],
! "auth_read" => $lang['Read'],
! "auth_post" => $lang['Post'],
! "auth_reply" => $lang['Reply'],
! "auth_edit" => $lang['Edit'],
! "auth_delete" => $lang['Delete'],
! "auth_sticky" => $lang['Sticky'],
! "auth_announce" => $lang['Announce'],
! "auth_vote" => $lang['Vote'],
! "auth_pollcreate" => $lang['Pollcreate']);
// ---------------
--- 56,84 ----
// Start program - define vars
//
! $forum_auth_fields = array('auth_view', 'auth_read', 'auth_post', 'auth_reply', 'auth_edit', 'auth_delete', 'auth_sticky', 'auth_announce', 'auth_vote', 'auth_pollcreate');
$auth_field_match = array(
! 'auth_view' => AUTH_VIEW,
! 'auth_read' => AUTH_READ,
! 'auth_post' => AUTH_POST,
! 'auth_reply' => AUTH_REPLY,
! 'auth_edit' => AUTH_EDIT,
! 'auth_delete' => AUTH_DELETE,
! 'auth_sticky' => AUTH_STICKY,
! 'auth_announce' => AUTH_ANNOUNCE,
! 'auth_vote' => AUTH_VOTE,
! 'auth_pollcreate' => AUTH_POLLCREATE);
$field_names = array(
! 'auth_view' => $lang['View'],
! 'auth_read' => $lang['Read'],
! 'auth_post' => $lang['Post'],
! 'auth_reply' => $lang['Reply'],
! 'auth_edit' => $lang['Edit'],
! 'auth_delete' => $lang['Delete'],
! 'auth_sticky' => $lang['Sticky'],
! 'auth_announce' => $lang['Announce'],
! 'auth_vote' => $lang['Vote'],
! 'auth_pollcreate' => $lang['Pollcreate']);
// ---------------
***************
*** 121,128 ****
// -------------
! if ( isset($HTTP_POST_VARS['submit']) && ( ( $mode == "user" && $user_id ) || ( $mode == "group" && $group_id ) ) )
{
! $user_level = "";
! if ( $mode == "user" )
{
//
--- 121,128 ----
// -------------
! if ( isset($HTTP_POST_VARS['submit']) && ( ( $mode == 'user' && $user_id ) || ( $mode == 'group' && $group_id ) ) )
{
! $user_level = '';
! if ( $mode == 'user' )
{
//
***************
*** 137,141 ****
if ( !($result = $db->sql_query($sql)) )
{
! message_die(GENERAL_ERROR, "Couldn't select info from user/user_group table", "", __LINE__, __FILE__, $sql);
}
--- 137,141 ----
if ( !($result = $db->sql_query($sql)) )
{
! message_die(GENERAL_ERROR, 'Could not select info from user/user_group table', '', __LINE__, __FILE__, $sql);
}
***************
*** 151,155 ****
// Carry out requests
//
! if ( $mode == "user" && $HTTP_POST_VARS['userlevel'] == "user" && $user_level == ADMIN )
{
//
--- 151,155 ----
// Carry out requests
//
! if ( $mode == 'user' && $HTTP_POST_VARS['userlevel'] == 'user' && $user_level == ADMIN )
{
//
***************
*** 164,168 ****
if ( !($result = $db->sql_query($sql)) )
{
! message_die(GENERAL_ERROR, "Couldn't update auth access", "", __LINE__, __FILE__, $sql);
}
--- 164,168 ----
if ( !($result = $db->sql_query($sql)) )
{
! message_die(GENERAL_ERROR, 'Could not update auth access', '', __LINE__, __FILE__, $sql);
}
***************
*** 175,179 ****
if ( !($result = $db->sql_query($sql)) )
{
! message_die(GENERAL_ERROR, "Couldn't update user level", "", __LINE__, __FILE__, $sql);
}
}
--- 175,179 ----
if ( !($result = $db->sql_query($sql)) )
{
! message_die(GENERAL_ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
}
}
***************
*** 182,186 ****
exit;
}
! else if ( $mode == "user" && $HTTP_POST_VARS['userlevel'] == "admin" && $user_level != ADMIN )
{
//
--- 182,186 ----
exit;
}
! else if ( $mode == 'user' && $HTTP_POST_VARS['userlevel'] == 'admin' && $user_level != ADMIN )
{
//
***************
*** 194,198 ****
if ( !($result = $db->sql_query($sql)) )
{
! message_die(GENERAL_ERROR, "Couldn't update user level", "", __LINE__, __FILE__, $sql);
}
--- 194,198 ----
if ( !($result = $db->sql_query($sql)) )
{
! message_die(GENERAL_ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
}
***************
*** 339,348 ****
// Checks complete, make updates to DB
//
! $delete_sql = "";
while( list($forum_id, $action) = @each($forum_auth_action) )
{
if ( $action == 'delete' )
{
! $delete_sql .= ( ( $delete_sql != "" ) ? ", " : "" ) . $forum_id;
}
else
--- 339,348 ----
// Checks complete, make updates to DB
//
! $delete_sql = '';
while( list($forum_id, $action) = @each($forum_auth_action) )
{
if ( $action == 'delete' )
{
! $delete_sql .= ( ( $delete_sql != '' ) ? ', ' : '' ) . $forum_id;
}
else
***************
*** 350,362 ****
if ( $action == 'insert' )
{
! $sql_field = "";
! $sql_value = "";
while ( list($auth_type, $value) = @each($update_acl_status[$forum_id]) )
{
! $sql_field .= ( ( $sql_field != "" ) ? ", " : "" ) . $auth_type;
! $sql_value .= ( ( $sql_value != "" ) ? ", " : "" ) . $value;
}
! $sql_field .= ( ( $sql_field != "" ) ? ", " : "" ) . 'auth_mod';
! $sql_value .= ( ( $sql_value != "" ) ? ", " : "" ) . ( ( !isset($update_mod_status[$forum_id]) ) ? 0 : $update_mod_status[$forum_id]);
$sql = "INSERT INTO " . AUTH_ACCESS_TABLE . " (forum_id, group_id, $sql_field)
--- 350,362 ----
if ( $action == 'insert' )
{
! $sql_field = '';
! $sql_value = '';
while ( list($auth_type, $value) = @each($update_acl_status[$forum_id]) )
{
! $sql_field .= ( ( $sql_field != '' ) ? ', ' : '' ) . $auth_type;
! $sql_value .= ( ( $sql_value != '' ) ? ', ' : '' ) . $value;
}
! $sql_field .= ( ( $sql_field != '' ) ? ', ' : '' ) . 'auth_mod';
! $sql_value .= ( ( $sql_value != '' ) ? ', ' : '' ) . ( ( !isset($update_mod_status[$forum_id]) ) ? 0 : $update_mod_status[$forum_id]);
$sql = "INSERT INTO " . AUTH_ACCESS_TABLE . " (forum_id, group_id, $sql_field)
***************
*** 365,374 ****
else
{
! $sql_values = "";
while ( list($auth_type, $value) = @each($update_acl_status[$forum_id]) )
{
! $sql_values .= ( ( $sql_values != "" ) ? ", " : "" ) . $auth_type . " = " . $value;
}
! $sql_values .= ( ( $sql_values != "" ) ? ", " : "" ) . "auth_mod = " . ( ( !isset($update_mod_status[$forum_id]) ) ? 0 : $update_mod_status[$forum_id]);
$sql = "UPDATE " . AUTH_ACCESS_TABLE . "
--- 365,374 ----
else
{
! $sql_values = '';
while ( list($auth_type, $value) = @each($update_acl_status[$forum_id]) )
{
! $sql_values .= ( ( $sql_values != '' ) ? ', ' : '' ) . $auth_type . ' = ' . $value;
}
! $sql_values .= ( ( $sql_values != '' ) ? ', ' : '' ) . 'auth_mod = ' . ( ( !isset($update_mod_status[$forum_id]) ) ? 0 : $update_mod_status[$forum_id]);
$sql = "UPDATE " . AUTH_ACCESS_TABLE . "
***************
*** 384,388 ****
}
! if ( $delete_sql != "" )
{
$sql = "DELETE FROM " . AUTH_ACCESS_TABLE . "
--- 384,388 ----
}
! if ( $delete_sql != '' )
{
$sql = "DELETE FROM " . AUTH_ACCESS_TABLE . "
***************
*** 410,417 ****
}
! $set_mod = "";
while( $row = $db->sql_fetchrow($result) )
{
! $set_mod .= ( ( $set_mod != "" ) ? ", " : "" ) . $row['user_id'];
}
$db->sql_freeresult($result);
--- 410,417 ----
}
! $set_mod = '';
while( $row = $db->sql_fetchrow($result) )
{
! $set_mod .= ( ( $set_mod != '' ) ? ', ' : '' ) . $row['user_id'];
}
$db->sql_freeresult($result);
***************
*** 470,478 ****
while( $row = $db->sql_fetchrow($result) )
{
! $unset_mod .= ( ( $unset_mod != "" ) ? ", " : "" ) . $row['user_id'];
}
$db->sql_freeresult($result);
! if ( $set_mod != "" )
{
$sql = "UPDATE " . USERS_TABLE . "
--- 470,478 ----
while( $row = $db->sql_fetchrow($result) )
{
! $unset_mod .= ( ( $unset_mod != '' ) ? ', ' : '' ) . $row['user_id'];
}
$db->sql_freeresult($result);
! if ( $set_mod != '' )
{
$sql = "UPDATE " . USERS_TABLE . "
***************
*** 485,489 ****
}
! if ( $unset_mod != "" )
{
$sql = "UPDATE " . USERS_TABLE . "
--- 485,489 ----
}
! if ( $unset_mod != '' )
{
$sql = "UPDATE " . USERS_TABLE . "
***************
*** 541,545 ****
for($j = 0; $j < count($forum_auth_fields); $j++)
{
! $forum_access[$i][$forum_auth_fields[$j]] . " :: ";
if ( $forum_access[$i][$forum_auth_fields[$j]] == AUTH_ACL )
{
--- 541,545 ----
for($j = 0; $j < count($forum_auth_fields); $j++)
{
! $forum_access[$i][$forum_auth_fields[$j]] . ' :: ';
if ( $forum_access[$i][$forum_auth_fields[$j]] == AUTH_ACL )
{
***************
*** 723,743 ****
$optionlist_mod .= '</select>';
! $row_class = ( !( $i % 2 ) ) ? "row2" : "row1";
$row_color = ( !( $i % 2 ) ) ? $theme['td_color1'] : $theme['td_color2'];
! $template->assign_block_vars("forums", array(
! "ROW_COLOR" => "#" . $row_color,
! "ROW_CLASS" => $row_class,
! "FORUM_NAME" => $forum_access[$i]['forum_name'],
! "U_FORUM_AUTH" => append_sid("admin_forumauth.$phpEx?f=" . $forum_access[$i]['forum_id']),
! "S_MOD_SELECT" => $optionlist_mod)
);
if( !$adv )
{
! $template->assign_block_vars("forums.aclvalues", array(
! "S_ACL_SELECT" => $optionlist_acl)
);
}
--- 723,743 ----
$optionlist_mod .= '</select>';
! $row_class = ( !( $i % 2 ) ) ? 'row2' : 'row1';
$row_color = ( !( $i % 2 ) ) ? $theme['td_color1'] : $theme['td_color2'];
! $template->assign_block_vars('forums', array(
! 'ROW_COLOR' => '#' . $row_color,
! 'ROW_CLASS' => $row_class,
! 'FORUM_NAME' => $forum_access[$i]['forum_name'],
! 'U_FORUM_AUTH' => append_sid("admin_forumauth.$phpEx?f=" . $forum_access[$i]['forum_id']),
! 'S_MOD_SELECT' => $optionlist_mod)
);
if( !$adv )
{
! $template->assign_block_vars('forums.aclvalues', array(
! 'S_ACL_SELECT' => $optionlist_acl)
);
}
***************
*** 746,751 ****
for($j = 0; $j < count($forum_auth_fields); $j++)
{
! $template->assign_block_vars("forums.aclvalues", array(
! "S_ACL_SELECT" => $optionlist_acl_adv[$forum_id][$j])
);
}
--- 746,751 ----
for($j = 0; $j < count($forum_auth_fields); $j++)
{
! $template->assign_block_vars('forums.aclvalues', array(
! 'S_ACL_SELECT' => $optionlist_acl_adv[$forum_id][$j])
);
}
***************
*** 762,765 ****
--- 762,767 ----
}
+ $name = array();
+ $id = array();
for($i = 0; $i < count($ug_info); $i++)
{
***************
*** 767,771 ****
{
$name[] = ( $mode == 'user' ) ? $ug_info[$i]['group_name'] : $ug_info[$i]['username'];
! $id[] = ( $mode == 'user' ) ? $ug_info[$i]['group_id'] : $ug_info[$i]['user_id'];
}
}
--- 769,773 ----
{
$name[] = ( $mode == 'user' ) ? $ug_info[$i]['group_name'] : $ug_info[$i]['username'];
! $id[] = ( $mode == 'user' ) ? intval($ug_info[$i]['group_id']) : intval($ug_info[$i]['user_id']);
}
}
***************
*** 773,777 ****
if( count($name) )
{
! $t_usergroup_list = "";
for($i = 0; $i < count($ug_info); $i++)
{
--- 775,779 ----
if( count($name) )
{
! $t_usergroup_list = '';
for($i = 0; $i < count($ug_info); $i++)
{
***************
*** 787,792 ****
if( !$adv )
{
! $template->assign_block_vars("acltype", array(
! "L_UG_ACL_TYPE" => $lang['Simple_Permission'])
);
$s_column_span++;
--- 789,794 ----
if( !$adv )
{
! $template->assign_block_vars('acltype', array(
! 'L_UG_ACL_TYPE' => $lang['Simple_Permission'])
);
$s_column_span++;
***************
*** 798,803 ****
$cell_title = $field_names[$forum_auth_fields[$i]];
! $template->assign_block_vars("acltype", array(
! "L_UG_ACL_TYPE" => $cell_title)
);
$s_column_span++;
--- 800,805 ----
$cell_title = $field_names[$forum_auth_fields[$i]];
! $template->assign_block_vars('acltype', array(
! 'L_UG_ACL_TYPE' => $cell_title)
);
$s_column_span++;
***************
*** 811,815 ****
$template->set_filenames(array(
! "body" => "admin/auth_ug_body.tpl")
);
--- 813,817 ----
$template->set_filenames(array(
! "body" => 'admin/auth_ug_body.tpl')
);
***************
*** 825,834 ****
if ( $mode == 'user' )
{
! $template->assign_block_vars("switch_user_auth", array());
$template->assign_vars(array(
! "USERNAME" => $t_username,
! "USER_LEVEL" => $lang['User_Level'] . " : " . $s_user_type,
! "USER_GROUP_MEMBERSHIPS" => $lang['Group_memberships'] . " : " . $t_usergroup_list)
);
}
--- 827,836 ----
if ( $mode == 'user' )
{
! $template->assign_block_vars('switch_user_auth', array());
$template->assign_vars(array(
! 'USERNAME' => $t_username,
! 'USER_LEVEL' => $lang['User_Level'] . " : " . $s_user_type,
! 'USER_GROUP_MEMBERSHIPS' => $lang['Group_memberships'] . ' : ' . $t_usergroup_list)
);
}
***************
*** 838,863 ****
$template->assign_vars(array(
! "USERNAME" => $t_groupname,
! "GROUP_MEMBERSHIP" => $lang['Usergroup_members'] . ": " . $t_usergroup_list)
);
}
$template->assign_vars(array(
! "L_USER_OR_GROUPNAME" => ( $mode == 'user' ) ? $lang['Username'] : $lang['Group_name'],
! "L_USER_OR_GROUP" => ( $mode == 'user' ) ? $lang['User'] : $lang['Group'],
! "L_AUTH_TITLE" => ( $mode == 'user' ) ? $lang['Auth_Control_User'] : $lang['Auth_Control_Group'],
! "L_AUTH_EXPLAIN" => ( $mode == 'user' ) ? $lang['User_auth_explain'] : $lang['Group_auth_explain'],
! "L_MODERATOR_STATUS" => $lang['Moderator_status'],
! "L_PERMISSIONS" => $lang['Permissions'],
! "L_SUBMIT" => $lang['Submit'],
! "L_RESET" => $lang['Reset'],
!
! "U_USER_OR_GROUP" => append_sid("admin_ug_auth.$phpEx"),
! "U_SWITCH_MODE" => $u_switch_mode,
!
! "S_COLUMN_SPAN" => $s_column_span,
! "S_AUTH_ACTION" => append_sid("admin_ug_auth.$phpEx"),
! "S_HIDDEN_FIELDS" => $s_hidden_fields)
);
}
--- 840,865 ----
$template->assign_vars(array(
! 'USERNAME' => $t_groupname,
! 'GROUP_MEMBERSHIP' => $lang['Usergroup_members'] . ' : ' . $t_usergroup_list)
);
}
$template->assign_vars(array(
! 'L_USER_OR_GROUPNAME' => ( $mode == 'user' ) ? $lang['Username'] : $lang['Group_name'],
! 'L_USER_OR_GROUP' => ( $mode == 'user' ) ? $lang['User'] : $lang['Group'],
! 'L_AUTH_TITLE' => ( $mode == 'user' ) ? $lang['Auth_Control_User'] : $lang['Auth_Control_Group'],
! 'L_AUTH_EXPLAIN' => ( $mode == 'user' ) ? $lang['User_auth_explain'] : $lang['Group_auth_explain'],
! 'L_MODERATOR_STATUS' => $lang['Moderator_status'],
! 'L_PERMISSIONS' => $lang['Permissions'],
! 'L_SUBMIT' => $lang['Submit'],
! 'L_RESET' => $lang['Reset'],
!
! 'U_USER_OR_GROUP' => append_sid("admin_ug_auth.$phpEx"),
! 'U_SWITCH_MODE' => $u_switch_mode,
!
! 'S_COLUMN_SPAN' => $s_column_span,
! 'S_AUTH_ACTION' => append_sid("admin_ug_auth.$phpEx"),
! 'S_HIDDEN_FIELDS' => $s_hidden_fields)
);
}
***************
*** 870,874 ****
$template->set_filenames(array(
! "body" => ( $mode == 'user' ) ? "admin/user_select_body.tpl" : "admin/auth_select_body.tpl")
);
--- 872,876 ----
$template->set_filenames(array(
! 'body' => ( $mode == 'user' ) ? 'admin/user_select_body.tpl' : 'admin/auth_select_body.tpl')
);
***************
*** 876,882 ****
{
$template->assign_vars(array(
! "L_FIND_USERNAME" => $lang['Find_username'],
! "U_SEARCH_USER" => append_sid("../search.$phpEx?mode=searchuser"))
);
}
--- 878,884 ----
{
$template->assign_vars(array(
! 'L_FIND_USERNAME' => $lang['Find_username'],
! 'U_SEARCH_USER' => append_sid("../search.$phpEx?mode=searchuser"))
);
}
***************
*** 903,907 ****
$template->assign_vars(array(
! "S_AUTH_SELECT" => $select_list)
);
}
--- 905,909 ----
$template->assign_vars(array(
! 'S_AUTH_SELECT' => $select_list)
);
}
***************
*** 912,927 ****
$template->assign_vars(array(
! "L_" . $l_type . "_TITLE" => ( $mode == 'user' ) ? $lang['Auth_Control_User'] : $lang['Auth_Control_Group'],
! "L_" . $l_type . "_EXPLAIN" => ( $mode == 'user' ) ? $lang['User_auth_explain'] : $lang['Group_auth_explain'],
! "L_" . $l_type . "_SELECT" => ( $mode == 'user' ) ? $lang['Select_a_User'] : $lang['Select_a_Group'],
! "L_LOOK_UP" => ( $mode == 'user' ) ? $lang['Look_up_User'] : $lang['Look_up_Group'],
! "S_HIDDEN_FIELDS" => $s_hidden_fields,
! "S_" . $l_type . "_ACTION" => append_sid("admin_ug_auth.$phpEx"))
);
}
! $template->pparse("body");
include('page_footer_admin.'.$phpEx);
--- 914,929 ----
$template->assign_vars(array(
! 'L_' . $l_type . '_TITLE' => ( $mode == 'user' ) ? $lang['Auth_Control_User'] : $lang['Auth_Control_Group'],
! 'L_' . $l_type . '_EXPLAIN' => ( $mode == 'user' ) ? $lang['User_auth_explain'] : $lang['Group_auth_explain'],
! 'L_' . $l_type . '_SELECT' => ( $mode == 'user' ) ? $lang['Select_a_User'] : $lang['Select_a_Group'],
! 'L_LOOK_UP' => ( $mode == 'user' ) ? $lang['Look_up_User'] : $lang['Look_up_Group'],
! 'S_HIDDEN_FIELDS' => $s_hidden_fields,
! 'S_' . $l_type . '_ACTION' => append_sid("admin_ug_auth.$phpEx"))
);
}
! $template->pparse('body');
include('page_footer_admin.'.$phpEx);
|