mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-26 11:58:53 +00:00
Changes to word censors in the admin panel
- Deletions now require confirmation - A few miscellaneous bug fixes Note to translators: This adds a new language variable git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5493 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
8ba6a53e3a
commit
70722f5c45
2 changed files with 33 additions and 4 deletions
|
@ -20,8 +20,6 @@
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
define('IN_PHPBB', 1);
|
|
||||||
|
|
||||||
if( !empty($setmodules) )
|
if( !empty($setmodules) )
|
||||||
{
|
{
|
||||||
$file = basename(__FILE__);
|
$file = basename(__FILE__);
|
||||||
|
@ -29,6 +27,8 @@ if( !empty($setmodules) )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define('IN_PHPBB', 1);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Load default header
|
// Load default header
|
||||||
//
|
//
|
||||||
|
@ -38,7 +38,7 @@ require('./pagestart.' . $phpEx);
|
||||||
|
|
||||||
if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
|
if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
|
||||||
{
|
{
|
||||||
$mode = ($HTTP_GET_VARS['mode']) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
|
$mode = (isset($HTTP_GET_VARS['mode'])) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
|
||||||
$mode = htmlspecialchars($mode);
|
$mode = htmlspecialchars($mode);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -60,6 +60,9 @@ else
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restrict mode input to valid options
|
||||||
|
$mode = ( in_array($mode, array('add', 'edit', 'save', 'delete')) ) ? $mode : '';
|
||||||
|
|
||||||
if( $mode != "" )
|
if( $mode != "" )
|
||||||
{
|
{
|
||||||
if( $mode == "edit" || $mode == "add" )
|
if( $mode == "edit" || $mode == "add" )
|
||||||
|
@ -70,6 +73,7 @@ if( $mode != "" )
|
||||||
"body" => "admin/words_edit_body.tpl")
|
"body" => "admin/words_edit_body.tpl")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$word_info = array('word' => '', 'replacement' => '');
|
||||||
$s_hidden_fields = '';
|
$s_hidden_fields = '';
|
||||||
|
|
||||||
if( $mode == "edit" )
|
if( $mode == "edit" )
|
||||||
|
@ -158,7 +162,9 @@ if( $mode != "" )
|
||||||
$word_id = 0;
|
$word_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $word_id )
|
$confirm = isset($HTTP_POST_VARS['confirm']);
|
||||||
|
|
||||||
|
if( $word_id && $confirm )
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM " . WORDS_TABLE . "
|
$sql = "DELETE FROM " . WORDS_TABLE . "
|
||||||
WHERE word_id = $word_id";
|
WHERE word_id = $word_id";
|
||||||
|
@ -172,6 +178,26 @@ if( $mode != "" )
|
||||||
|
|
||||||
message_die(GENERAL_MESSAGE, $message);
|
message_die(GENERAL_MESSAGE, $message);
|
||||||
}
|
}
|
||||||
|
elseif( $word_id && !$confirm)
|
||||||
|
{
|
||||||
|
// Present the confirmation screen to the user
|
||||||
|
$template->set_filenames(array(
|
||||||
|
'body' => 'admin/confirm_body.tpl')
|
||||||
|
);
|
||||||
|
|
||||||
|
$hidden_fields = '<input type="hidden" name="mode" value="delete" /><input type="hidden" name="id" value="' . $word_id . '" />';
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
'MESSAGE_TITLE' => $lang['Confirm'],
|
||||||
|
'MESSAGE_TEXT' => $lang['Confirm_delete_word'],
|
||||||
|
|
||||||
|
'L_YES' => $lang['Yes'],
|
||||||
|
'L_NO' => $lang['No'],
|
||||||
|
|
||||||
|
'S_CONFIRM_ACTION' => append_sid("admin_words.$phpEx"),
|
||||||
|
'S_HIDDEN_FIELDS' => $hidden_fields)
|
||||||
|
);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
message_die(GENERAL_MESSAGE, $lang['No_word_selected']);
|
message_die(GENERAL_MESSAGE, $lang['No_word_selected']);
|
||||||
|
@ -193,6 +219,7 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
$word_rows = $db->sql_fetchrowset($result);
|
$word_rows = $db->sql_fetchrowset($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
$word_count = count($word_rows);
|
$word_count = count($word_rows);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
|
|
@ -518,6 +518,8 @@ $lang['Word_removed'] = 'The selected word censor has been successfully removed'
|
||||||
|
|
||||||
$lang['Click_return_wordadmin'] = 'Click %sHere%s to return to Word Censor Administration';
|
$lang['Click_return_wordadmin'] = 'Click %sHere%s to return to Word Censor Administration';
|
||||||
|
|
||||||
|
$lang['Confirm_delete_word'] = 'Are you sure you want to delete this word censor?';
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Mass Email
|
// Mass Email
|
||||||
|
|
Loading…
Add table
Reference in a new issue