1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Unused Code inside function update_forum_data [Bug #6606]

Copy permissions protection for groups [Bug #6594]
HTML issues in ACP [Bug #6580, #6578]
Always send the correct encoding [related to bug #6576]
Mass email fixes for first loop iteration [Bug #6570]
Extension groups to be allowed in PM's and/or Posts [Bug #6558]
Extension allowance checking clarified (no longer using forum id 0 for private messaging)
Using request_var() array method for some variables [Bug #6556]
Added confirmation for deletion of ranks/smilies/icons/word censores [Bug #6548, #6530, #6512, #6466]
Only show postable forums in dropdown list for moving posts on forum deletion as well as correct re-indexing [Bug #6510, #6476, #6384]
Jabber password being password field in jabber settings screen [Bug #6478]
user activity language variable if viewing not own profile [Bug #6432]
Show moderator group/user-name colour [Bug #6402]
Log rank creation/updating/removing [Bug #6398]
Update check permission changed from a_ to a_board [Bug #6392]


git-svn-id: file:///svn/phpbb/trunk@6816 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2006-12-27 17:43:55 +00:00
parent b9da985180
commit 945afbc5fa
41 changed files with 371 additions and 267 deletions

View File

@@ -56,8 +56,7 @@ class acp_attachments
$template->assign_vars(array(
'L_TITLE' => $user->lang[$l_title],
'L_TITLE_EXPLAIN' => $user->lang[$l_title . '_EXPLAIN'],
'U_ACTION' => $this->u_action,
)
'U_ACTION' => $this->u_action)
);
switch ($mode)
@@ -181,8 +180,7 @@ class acp_attachments
$template->assign_vars(array(
'U_SEARCH_IMAGICK' => $this->u_action . '&action=imgmagick',
'S_THUMBNAIL_SUPPORT' => (!$this->new_config['img_imagick'] && (!isset($supported_types['format']) || !sizeof($supported_types['format']))) ? false : true,
)
'S_THUMBNAIL_SUPPORT' => (!$this->new_config['img_imagick'] && (!isset($supported_types['format']) || !sizeof($supported_types['format']))) ? false : true)
);
// Secure Download Options - Same procedure as with banning
@@ -216,8 +214,7 @@ class acp_attachments
'L_SECURE_TITLE' => $user->lang['DEFINE_' . $allow_deny . '_IPS'],
'L_IP_EXCLUDE' => $user->lang['EXCLUDE_FROM_' . $allow_deny . '_IP'],
'L_REMOVE_IPS' => $user->lang['REMOVE_' . $allow_deny . '_IPS'],
)
'L_REMOVE_IPS' => $user->lang['REMOVE_' . $allow_deny . '_IPS'])
);
// Output relevant options
@@ -271,8 +268,8 @@ class acp_attachments
if ($submit)
{
// Change Extensions ?
$extension_change_list = (isset($_POST['extension_change_list'])) ? array_map('intval', $_POST['extension_change_list']) : array();
$group_select_list = (isset($_POST['group_select'])) ? array_map('intval', $_POST['group_select']) : array();
$extension_change_list = request_var('extension_change_list', array(0));
$group_select_list = request_var('group_select', array(0));
// Generate correct Change List
$extensions = array();
@@ -294,7 +291,7 @@ class acp_attachments
$sql = 'UPDATE ' . EXTENSIONS_TABLE . '
SET group_id = ' . (int) $extensions[$row['extension_id']]['group_id'] . '
WHERE extension_id = ' . $row['extension_id'];
$db->sql_query($sql);
$db->sql_query($sql);
add_log('admin', 'LOG_ATTACH_EXT_UPDATE', $row['extension']);
}
@@ -302,7 +299,7 @@ class acp_attachments
$db->sql_freeresult($result);
// Delete Extension?
$extension_id_list = (isset($_POST['extension_id_list'])) ? array_map('intval', $_POST['extension_id_list']) : array();
$extension_id_list = request_var('extension_id_list', array(0));
if (sizeof($extension_id_list))
{
@@ -332,7 +329,7 @@ class acp_attachments
$add_extension_group = request_var('add_group_select', 0);
$add = (isset($_POST['add_extension_check'])) ? true : false;
if ($add_extension != '' && $add)
if ($add_extension && $add)
{
if (!sizeof($error))
{
@@ -353,7 +350,7 @@ class acp_attachments
'group_id' => $add_extension_group,
'extension' => $add_extension
);
$db->sql_query('INSERT INTO ' . EXTENSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
add_log('admin', 'LOG_ATTACH_EXT_ADD', $add_extension);
}
@@ -364,7 +361,7 @@ class acp_attachments
{
$notify[] = $user->lang['EXTENSIONS_UPDATED'];
}
$cache->destroy('_extensions');
}
@@ -467,11 +464,11 @@ class acp_attachments
$upload_icon = request_var('upload_icon', 'no_image');
$size_select = request_var('size_select', 'b');
$forum_select = request_var('forum_select', false);
$allowed_forums = isset($_POST['allowed_forums']) ? array_map('intval', array_values($_POST['allowed_forums'])) : array();
$allow_in_pm = isset($_POST['allow_in_pm']) ? true : false;
$allowed_forums = request_var('allowed_forums', array(0));
$allow_in_pm = (isset($_POST['allow_in_pm'])) ? true : false;
$max_filesize = request_var('max_filesize', 0);
$max_filesize = ($size_select == 'kb') ? round($max_filesize * 1024) : (($size_select == 'mb') ? round($max_filesize * 1048576) : $max_filesize);
$allow_group = (isset($_POST['allow_group'])) ? 1 : 0;
$allow_group = (isset($_POST['allow_group'])) ? true : false;
if ($max_filesize == $config['max_filesize'])
{
@@ -486,12 +483,12 @@ class acp_attachments
$group_ary = array(
'group_name' => $group_name,
'cat_id' => request_var('special_category', ATTACHMENT_CATEGORY_NONE),
'allow_group' => $allow_group,
'allow_group' => ($allow_group) ? 1 : 0,
'download_mode' => request_var('download_mode', INLINE_LINK),
'upload_icon' => ($upload_icon == 'no_image') ? '' : $upload_icon,
'max_filesize' => $max_filesize,
'allowed_forums'=> ($forum_select) ? serialize($allowed_forums) : '',
'allow_in_pm' => ($allow_in_pm) ? 1 : 0
'allow_in_pm' => ($allow_in_pm) ? 1 : 0,
);
$sql = ($action == 'add') ? 'INSERT INTO ' . EXTENSION_GROUPS_TABLE . ' ' : 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET ';
@@ -508,7 +505,7 @@ class acp_attachments
add_log('admin', 'LOG_ATTACH_EXTGROUP_' . strtoupper($action), $group_name);
}
$extension_list = isset($_REQUEST['extensions']) ? array_map('intval', array_values($_REQUEST['extensions'])) : array();
$extension_list = request_var('extensions', array(0));
if ($action == 'edit' && sizeof($extension_list))
{
@@ -533,7 +530,7 @@ class acp_attachments
$notify[] = $user->lang['SUCCESS_EXTENSION_GROUP_' . strtoupper($action)];
}
}
$cat_lang = array(
ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
@@ -581,7 +578,6 @@ class acp_attachments
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
'action' => $action,
'group_id' => $group_id,
'action' => 'delete',
)));
@@ -590,7 +586,7 @@ class acp_attachments
break;
case 'edit':
if (!$group_id)
{
trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
@@ -608,7 +604,7 @@ class acp_attachments
// no break;
case 'add':
if ($action == 'add')
{
$ext_group_row = array(
@@ -620,7 +616,7 @@ class acp_attachments
'upload_icon' => '',
'max_filesize' => 0,
);
$forum_ids = array();
}
@@ -690,15 +686,15 @@ class acp_attachments
}
$template->assign_vars(array(
'PHPBB_ROOT_PATH' => $phpbb_root_path,
'IMG_PATH' => $img_path,
'ACTION' => $action,
'GROUP_ID' => $group_id,
'GROUP_NAME' => $ext_group_row['group_name'],
'ALLOW_GROUP' => $ext_group_row['allow_group'],
'ALLOW_IN_PM' => $ext_group_row['allow_in_pm'],
'UPLOAD_ICON_SRC' => $phpbb_root_path . $img_path . '/' . $ext_group_row['upload_icon'],
'EXTGROUP_FILESIZE' => $ext_group_row['max_filesize'],
'PHPBB_ROOT_PATH' => $phpbb_root_path,
'IMG_PATH' => $img_path,
'ACTION' => $action,
'GROUP_ID' => $group_id,
'GROUP_NAME' => $ext_group_row['group_name'],
'ALLOW_GROUP' => $ext_group_row['allow_group'],
'ALLOW_IN_PM' => $ext_group_row['allow_in_pm'],
'UPLOAD_ICON_SRC' => $phpbb_root_path . $img_path . '/' . $ext_group_row['upload_icon'],
'EXTGROUP_FILESIZE' => $ext_group_row['max_filesize'],
'ASSIGNED_EXTENSIONS' => $assigned_extensions,
'S_CATEGORY_SELECT' => $this->category_select('special_category', $group_id, 'category'),
@@ -711,9 +707,9 @@ class acp_attachments
'S_FORUM_IDS' => (sizeof($forum_ids)) ? true : false,
'U_EXTENSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=extensions"),
'U_BACK' => $this->u_action,
'L_LEGEND' => $user->lang[strtoupper($action) . '_EXTENSION_GROUP'],
)
'L_LEGEND' => $user->lang[strtoupper($action) . '_EXTENSION_GROUP'])
);
$s_forum_id_options = '';
@@ -721,11 +717,12 @@ class acp_attachments
$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
FROM ' . FORUMS_TABLE . '
ORDER BY left_id ASC';
$result = $db->sql_query($sql, 600);
$result = $db->sql_query($sql);
$right = $cat_right = $padding_inc = 0;
$padding = $forum_list = $holding = '';
$padding_store = array('0' => '');
while ($row = $db->sql_fetchrow($result))
{
if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id']))
@@ -777,38 +774,19 @@ class acp_attachments
$template->assign_vars(array(
'S_FORUM_ID_OPTIONS' => $s_forum_id_options)
);
break;
case 'deactivate':
case 'activate':
if (!$group_id)
{
trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
SET allow_group = ' . (($action == 'activate') ? '1' : '0') . "
WHERE group_id = $group_id";
$db->sql_query($sql);
$this->rewrite_extensions();
break;
}
$sql = 'SELECT *
FROM ' . EXTENSION_GROUPS_TABLE . '
ORDER BY allow_group DESC, group_name';
ORDER BY allow_group DESC, allow_in_pm DESC, group_name';
$result = $db->sql_query($sql);
$act_deact = 'activate';
$old_allow_group = $old_allow_pm = 1;
while ($row = $db->sql_fetchrow($result))
{
$s_add_spacer = ($row['allow_group'] == 0 && $act_deact == 'deactivate') ? true : false;
$act_deact = ($row['allow_group']) ? 'deactivate' : 'activate';
$s_add_spacer = ($old_allow_group != $row['allow_group'] || $old_allow_pm != $row['allow_in_pm']) ? true : false;
$template->assign_block_vars('groups', array(
'S_ADD_SPACER' => $s_add_spacer,
@@ -817,14 +795,14 @@ class acp_attachments
'U_EDIT' => $this->u_action . "&action=edit&g={$row['group_id']}",
'U_DELETE' => $this->u_action . "&action=delete&g={$row['group_id']}",
'U_ACT_DEACT' => $this->u_action . "&action=$act_deact&g={$row['group_id']}",
'L_ACT_DEACT' => $user->lang[strtoupper($act_deact)],
'GROUP_NAME' => $row['group_name'],
'CATEGORY' => $cat_lang[$row['cat_id']],
)
);
$old_allow_group = $row['allow_group'];
$old_allow_pm = $row['allow_in_pm'];
}
$db->sql_freeresult($result);
@@ -1369,7 +1347,7 @@ class acp_attachments
}
else if (isset($_POST['unsecuresubmit']))
{
$unip_sql = array_map('intval', $_POST['unip']);
$unip_sql = request_var('unip', array(0));
if (sizeof($unip_sql))
{

View File

@@ -278,7 +278,6 @@ class acp_board
'title' => 'ACP_SERVER_SETTINGS',
'vars' => array(
'legend1' => 'ACP_SERVER_SETTINGS',
'send_encoding' => array('lang' => 'SEND_ENCODING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'gzip_compress' => array('lang' => 'ENABLE_GZIP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'legend2' => 'PATH_SETTINGS',

View File

@@ -107,7 +107,12 @@ class acp_email
if ($i == $max_chunk_size || $row['user_lang'] != $old_lang || $row['user_notify_type'] != $old_notify_type)
{
$i = 0;
$j++;
if (sizeof($email_list))
{
$j++;
}
$old_lang = $row['user_lang'];
$old_notify_type = $row['user_notify_type'];
}

View File

@@ -668,7 +668,7 @@ class acp_forums
if ($db->sql_fetchrow($result))
{
$template->assign_vars(array(
'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $subforums_id)) // , false, true, false???
'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $subforums_id, false, true)) // , false, true, false???
);
}
$db->sql_freeresult($result);
@@ -989,7 +989,6 @@ class acp_forums
if ($action_subforums == 'delete')
{
$log_action_forums = 'FORUMS';
$rows = get_forum_branch($row['forum_id'], 'children', 'descending', false);
foreach ($rows as $_row)
@@ -1055,8 +1054,6 @@ class acp_forums
return array($user->lang['NO_DESTINATION_FORUM']);
}
$log_action_forums = 'MOVE_FORUMS';
$sql = 'SELECT forum_name
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $subforums_to_id;
@@ -1115,11 +1112,9 @@ class acp_forums
if ($row['forum_name'] != $forum_data_sql['forum_name'])
{
// the forum name has changed, clear the parents list of child forums
// the forum name has changed, clear the parents list of all forums (for safety)
$sql = 'UPDATE ' . FORUMS_TABLE . "
SET forum_parents = ''
WHERE left_id > " . $row['left_id'] . '
AND right_id < ' . $row['right_id'];
SET forum_parents = ''";
$db->sql_query($sql);
}
@@ -1374,6 +1369,9 @@ class acp_forums
}
$db->sql_freeresult($result);
// Grab new forum data for correct tree updating later
$forum_data = $this->get_forum_info($forum_id);
$sql = 'UPDATE ' . FORUMS_TABLE . "
SET parent_id = $subforums_to_id
WHERE parent_id = $forum_id";

View File

@@ -358,35 +358,49 @@ class acp_groups
$group_perm_from = request_var('group_perm_from', 0);
// Copy permissions?
if ($group_perm_from && $action == 'add')
// If the user has the a_authgroups permission and at least one additional permission ability set the permissions are fully transfered.
// We do not limit on one auth category because this can lead to incomplete permissions being tricky to fix for the admin, roles being assigned or added non-default permissions.
// Since the user only has the option to copy permissions from non leader managed groups this seems to be a good compromise.
if ($group_perm_from && $action == 'add' && $auth->acl_get('a_authgroups') && $auth->acl_gets('a_aauth', 'a_fauth', 'a_mauth', 'a_uauth'))
{
// From the mysql documentation:
// Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
// Due to this we stay on the safe side if we do the insertion "the manual way"
// Copy permisisons from/to the acl groups table (only group_id gets changed)
$sql = 'SELECT forum_id, auth_option_id, auth_role_id, auth_setting
FROM ' . ACL_GROUPS_TABLE . '
$sql = 'SELECT group_manage_founder
FROM ' . GROUPS_TABLE . '
WHERE group_id = ' . $group_perm_from;
$result = $db->sql_query($sql);
$groups_sql_ary = array();
while ($row = $db->sql_fetchrow($result))
{
$groups_sql_ary[] = array(
'group_id' => (int) $group_id,
'forum_id' => (int) $row['forum_id'],
'auth_option_id' => (int) $row['auth_option_id'],
'auth_role_id' => (int) $row['auth_role_id'],
'auth_setting' => (int) $row['auth_setting']
);
}
$check_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Now insert the data
$db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary);
// Check the group if non-founder
if ($check_row && ($user->data['user_type'] == USER_FOUNDER || $check_row['group_manage_founder'] == 0))
{
// From the mysql documentation:
// Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
// Due to this we stay on the safe side if we do the insertion "the manual way"
$auth->acl_clear_prefetch();
// Copy permisisons from/to the acl groups table (only group_id gets changed)
$sql = 'SELECT forum_id, auth_option_id, auth_role_id, auth_setting
FROM ' . ACL_GROUPS_TABLE . '
WHERE group_id = ' . $group_perm_from;
$result = $db->sql_query($sql);
$groups_sql_ary = array();
while ($row = $db->sql_fetchrow($result))
{
$groups_sql_ary[] = array(
'group_id' => (int) $group_id,
'forum_id' => (int) $row['forum_id'],
'auth_option_id' => (int) $row['auth_option_id'],
'auth_role_id' => (int) $row['auth_role_id'],
'auth_setting' => (int) $row['auth_setting']
);
}
$db->sql_freeresult($result);
// Now insert the data
$db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary);
$auth->acl_clear_prefetch();
}
}
$cache->destroy('sql', GROUPS_TABLE);
@@ -494,6 +508,7 @@ class acp_groups
$template->assign_vars(array(
'S_EDIT' => true,
'S_ADD_GROUP' => ($action == 'add') ? true : false,
'S_GROUP_PERM' => ($action == 'add' && $auth->acl_get('a_authgroups') && $auth->acl_gets('a_aauth', 'a_fauth', 'a_mauth', 'a_uauth')) ? true : false,
'S_INCLUDE_SWATCH' => true,
'S_CAN_UPLOAD' => $can_upload,
'S_ERROR' => (sizeof($error)) ? true : false,
@@ -518,7 +533,7 @@ class acp_groups
'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'],
'S_RANK_OPTIONS' => $rank_options,
'S_GROUP_OPTIONS' => group_select_options(0),
'S_GROUP_OPTIONS' => group_select_options(false, false, (($user->data['user_type'] == USER_FOUNDER) ? false : 0)),
'AVATAR_IMAGE' => $avatar_img,
'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'],
'GROUP_AVATAR_WIDTH' => (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '',

View File

@@ -203,14 +203,14 @@ class acp_icons
$images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array();
// Now really get the items
$image_id = (isset($_POST['id'])) ? array_map('intval', $_POST['id']) : array();
$image_order = (isset($_POST['order'])) ? array_map('intval', $_POST['order']) : array();
$image_width = (isset($_POST['width'])) ? array_map('intval', $_POST['width']) : array();
$image_height = (isset($_POST['height'])) ? array_map('intval', $_POST['height']) : array();
$image_add = (isset($_POST['add_img'])) ? array_map('intval', $_POST['add_img']) : array();
$image_id = (isset($_POST['id'])) ? request_var('id', array(0)) : array();
$image_order = (isset($_POST['order'])) ? request_var('order', array(0)) : array();
$image_width = (isset($_POST['width'])) ? request_var('width', array(0)) : array();
$image_height = (isset($_POST['height'])) ? request_var('height', array(0)) : array();
$image_add = (isset($_POST['add_img'])) ? request_var('add_img', array(0)) : array();
$image_emotion = request_var('emotion', array('' => ''));
$image_code = request_var('code', array('' => ''));
$image_display_on_posting = (isset($_POST['display_on_posting'])) ? array_map('intval', $_POST['display_on_posting']) : array();
$image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array(0)) : array();
foreach ($images as $image)
{
@@ -530,32 +530,43 @@ class acp_icons
case 'delete':
$sql = "DELETE FROM $table
WHERE {$fields}_id = $icon_id";
$db->sql_query($sql);
switch ($mode)
if (confirm_box(true))
{
case 'smilies':
break;
$sql = "DELETE FROM $table
WHERE {$fields}_id = $icon_id";
$db->sql_query($sql);
case 'icons':
// Reset appropriate icon_ids
$db->sql_query('UPDATE ' . TOPICS_TABLE . "
SET icon_id = 0
WHERE icon_id = $icon_id");
switch ($mode)
{
case 'smilies':
break;
$db->sql_query('UPDATE ' . POSTS_TABLE . "
SET icon_id = 0
WHERE icon_id = $icon_id");
case 'icons':
// Reset appropriate icon_ids
$db->sql_query('UPDATE ' . TOPICS_TABLE . "
SET icon_id = 0
WHERE icon_id = $icon_id");
break;
$db->sql_query('UPDATE ' . POSTS_TABLE . "
SET icon_id = 0
WHERE icon_id = $icon_id");
break;
}
$notice = $user->lang[$lang . '_DELETED'];
$cache->destroy('icons');
$cache->destroy('sql', $table);
}
else
{
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
'id' => $icon_id,
'action' => 'delete',
)));
}
$notice = $user->lang[$lang . '_DELETED'];
$cache->destroy('icons');
$cache->destroy('sql', $table);
break;

View File

@@ -347,7 +347,7 @@ class acp_permissions
$template->assign_vars(array(
'S_SELECT_GROUP' => true,
'S_GROUP_OPTIONS' => group_select_options(false))
'S_GROUP_OPTIONS' => group_select_options(false, false, (($user->data['user_type'] == USER_FOUNDER) ? false : 0)))
);
break;
@@ -393,7 +393,7 @@ class acp_permissions
'S_SELECT_USERGROUP_VIEW' => ($victim == 'usergroup_view') ? true : false,
'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'],
'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'],
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids']),
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids'], (($user->data['user_type'] == USER_FOUNDER) ? false : 0)),
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=add_user&amp;field=username'),
'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username', false))
);

View File

@@ -62,11 +62,15 @@ class acp_ranks
{
$sql = 'UPDATE ' . RANKS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE rank_id = $rank_id";
$message = $user->lang['RANK_UPDATED'];
add_log('admin', 'LOG_RANK_UPDATED', $rank_title);
}
else
{
$sql = 'INSERT INTO ' . RANKS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$message = $user->lang['RANK_ADDED'];
add_log('admin', 'LOG_RANK_ADDED', $rank_title);
}
$db->sql_query($sql);
@@ -78,9 +82,20 @@ class acp_ranks
case 'delete':
// Ok, they want to delete their rank
if ($rank_id)
if (!$rank_id)
{
trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
{
$sql = 'SELECT rank_title
FROM ' . RANKS_TABLE . '
WHERE rank_id = ' . $rank_id;
$result = $db->sql_query($sql);
$rank_title = (string) $db->sql_fetchfield('rank_title');
$db->sql_freeresult($result);
$sql = 'DELETE FROM ' . RANKS_TABLE . "
WHERE rank_id = $rank_id";
$db->sql_query($sql);
@@ -92,11 +107,16 @@ class acp_ranks
$cache->destroy('ranks');
trigger_error($user->lang['RANK_REMOVED'] . adm_back_link($this->u_action));
add_log('admin', 'LOG_RANK_REMOVED', $rank_title);
}
else
{
trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($this->u_action), E_USER_WARNING);
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
'rank_id' => $rank_id,
'action' => 'delete',
)));
}
break;

View File

@@ -110,23 +110,35 @@ class acp_words
trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT word
FROM ' . WORDS_TABLE . "
WHERE word_id = $word_id";
$result = $db->sql_query($sql);
$deleted_word = $db->sql_fetchfield('word');
$db->sql_freeresult($result);
if (confirm_box(true))
{
$sql = 'SELECT word
FROM ' . WORDS_TABLE . "
WHERE word_id = $word_id";
$result = $db->sql_query($sql);
$deleted_word = $db->sql_fetchfield('word');
$db->sql_freeresult($result);
$sql = 'DELETE FROM ' . WORDS_TABLE . "
WHERE word_id = $word_id";
$db->sql_query($sql);
$sql = 'DELETE FROM ' . WORDS_TABLE . "
WHERE word_id = $word_id";
$db->sql_query($sql);
$cache->destroy('word_censors');
$cache->destroy('word_censors');
add_log('admin', 'LOG_WORD_DELETE', $deleted_word);
add_log('admin', 'LOG_WORD_DELETE', $deleted_word);
trigger_error($user->lang['WORD_REMOVED'] . adm_back_link($this->u_action));
}
else
{
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
'id' => $word_id,
'action' => 'delete',
)));
}
trigger_error($user->lang['WORD_REMOVED'] . adm_back_link($this->u_action));
break;
}

View File

@@ -20,7 +20,7 @@ class acp_update_info
'title' => 'ACP_UPDATE',
'version' => '1.0.0',
'modes' => array(
'version_check' => array('title' => 'ACP_VERSION_CHECK', 'auth' => 'acl_a_', 'cat' => array('ACP_AUTOMATION')),
'version_check' => array('title' => 'ACP_VERSION_CHECK', 'auth' => 'acl_a_board', 'cat' => array('ACP_AUTOMATION')),
),
);
}