mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-08 17:56:52 +02:00
Various updates
git-svn-id: file:///svn/phpbb/trunk@1432 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -34,98 +34,105 @@ if($setmodules == 1)
|
||||
$phpbb_root_dir = "./../";
|
||||
require('pagestart.inc');
|
||||
|
||||
//
|
||||
// Check to see what mode we shold operate in.
|
||||
//
|
||||
if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
|
||||
if( isset($HTTP_POST_VARS['add_name']) )
|
||||
{
|
||||
$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
|
||||
$disallowed_user = ( isset($HTTP_POST_VARS['disallowed_user']) ) ? $HTTP_POST_VARS['disallowed_user'] : $HTTP_GET_VARS['disallowed_user'];
|
||||
$disallowed_user = preg_replace( '/\*/', '%', $disallowed_user );
|
||||
|
||||
if( !validate_username($disallowed_user) )
|
||||
{
|
||||
$message = $lang['Disallowed_already'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "INSERT INTO " . DISALLOW_TABLE . " (disallow_username)
|
||||
VALUES('" . $disallowed_user . "')";
|
||||
$result = $db->sql_query( $sql );
|
||||
if ( !$result )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not add disallowed user.", "",__LINE__, __FILE__, $sql);
|
||||
}
|
||||
$message = $lang['Disallow_successful'];
|
||||
}
|
||||
|
||||
$message .= "<br /><br />" . sprintf($lang['Click_return_disallowadmin'], "<a href=\"" . append_sid("admin_disallow.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
|
||||
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
}
|
||||
else
|
||||
else if( isset($HTTP_POST_VARS['delete_name']) )
|
||||
{
|
||||
$mode = "";
|
||||
}
|
||||
$output_info = '';
|
||||
switch( $mode )
|
||||
{
|
||||
case $lang['Delete']:
|
||||
$disallowed_id = ( isset($HTTP_POST_VARS['disallowed_id']) ) ? intval( $HTTP_POST_VARS['disallowed_id'] ) : intval( $HTTP_GET_VARS['disallowed_id'] );
|
||||
|
||||
$sql = 'DELETE FROM '.DISALLOW_TABLE.' WHERE disallow_id = '.$disallowed_id;
|
||||
$result = $db->sql_query($sql);
|
||||
if( !$result )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't removed disallowed user.", "",__LINE__, __FILE__, $sql);
|
||||
}
|
||||
$output_info = $lang['disallowed_deleted'];
|
||||
break;
|
||||
case $lang['Add']:
|
||||
$disallowed_user = ( isset($HTTP_POST_VARS['disallowed_user']) ) ? $HTTP_POST_VARS['disallowed_user'] : $HTTP_GET_VARS['disallowed_user'];
|
||||
$disallowed_user = preg_replace( '/\*/', '%', $disallowed_user );
|
||||
if( !validate_username( $disallowed_user ) )
|
||||
{
|
||||
$output_info = $lang['disallowed_already'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'INSERT INTO '.DISALLOW_TABLE."(disallow_username) VALUES('".$disallowed_user."')";
|
||||
$result = $db->sql_query( $sql );
|
||||
if ( !$result )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not add disallowed user.", "",__LINE__, __FILE__, $sql);
|
||||
}
|
||||
$output_info = $lang['disallow_successful'];
|
||||
}
|
||||
break;
|
||||
$disallowed_id = ( isset($HTTP_POST_VARS['disallowed_id']) ) ? intval( $HTTP_POST_VARS['disallowed_id'] ) : intval( $HTTP_GET_VARS['disallowed_id'] );
|
||||
|
||||
$sql = "DELETE FROM " . DISALLOW_TABLE . "
|
||||
WHERE disallow_id = $disallowed_id";
|
||||
$result = $db->sql_query($sql);
|
||||
if( !$result )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't removed disallowed user.", "",__LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
$message .= $lang['Disallowed_deleted'] . "<br /><br />" . sprintf($lang['Click_return_disallowadmin'], "<a href=\"" . append_sid("admin_disallow.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
|
||||
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Grab the current list of disallowed usernames...
|
||||
//
|
||||
$sql = 'SELECT * FROM '.DISALLOW_TABLE;
|
||||
$sql = "SELECT *
|
||||
FROM " . DISALLOW_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
if( !$result )
|
||||
{
|
||||
message_die( GENERAL_ERROR, "Couldn't get disallowed users.", "", __LINE__, __FILE__, $sql );
|
||||
message_die(GENERAL_ERROR, "Couldn't get disallowed users.", "", __LINE__, __FILE__, $sql );
|
||||
}
|
||||
|
||||
$disallowed = $db->sql_fetchrowset($result);
|
||||
|
||||
//
|
||||
// Ok now generate the info for the template, which will be put out no matter
|
||||
// what mode we are in.
|
||||
//
|
||||
$disallow_select = "<SELECT NAME=\"disallowed_id\">";
|
||||
if ( trim($disallowed) == '' )
|
||||
$disallow_select = '<select name="disallowed_id">';
|
||||
|
||||
if( trim($disallowed) == "" )
|
||||
{
|
||||
$disallow_select .= '<option value="">'.$lang['no_disallowed'].'</option>';
|
||||
$disallow_select .= '<option value="">' . $lang['no_disallowed'] . '</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$disallow_select .= "<OPTION value=\"\">".$lang['Select'].' '.$lang['Username']."</OPTION>";
|
||||
$user = array();
|
||||
for( $i = 0; $i < count($disallowed); $i++ )
|
||||
{
|
||||
$disallowed[$i]['disallow_username'] = preg_replace( '/%/', '*', $disallowed[$i]['disallow_username']);
|
||||
$disallow_select .= '<option value="'.$disallowed[$i]['disallow_id'].'">'.$disallowed[$i]['disallow_username'].'</option>';
|
||||
$disallowed[$i]['disallow_username'] = preg_replace('/%/', '*', $disallowed[$i]['disallow_username']);
|
||||
|
||||
$disallow_select .= '<option value="' . $disallowed[$i]['disallow_id'] . '">' . $disallowed[$i]['disallow_username'] . '</option>';
|
||||
}
|
||||
}
|
||||
$disallow_select .= '</SELECT>';
|
||||
|
||||
$disallow_select .= '</select>';
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "admin/disallow_body.tpl")
|
||||
);
|
||||
|
||||
$template->assign_vars(array(
|
||||
"S_DISALLOW_SELECT" => $disallow_select,
|
||||
"S_FORM_ACTION" => append_sid('admin_disallow.php'),
|
||||
|
||||
"L_INFO" => $output_info,
|
||||
"L_DISALLOW_TITLE" => $lang['Disallow_control'],
|
||||
"L_DELETE" => $lang['Delete'],
|
||||
"L_ADD" => $lang['Add'],
|
||||
"L_RESET" => $lang['Reset'],
|
||||
"S_FORM_ACTION" => append_sid('admin_disallow.php'),
|
||||
"L_EXPLAIN" => $lang['disallow_instructs'],
|
||||
"L_DEL_DISALLOW" => $lang['del_disallow'],
|
||||
"L_DEL_EXPLAIN" => $lang['del_disallow_explain'],
|
||||
"L_ADD_DISALLOW" => $lang['add_disallow'],
|
||||
"L_ADD_EXPLAIN" => $lang['add_disallow_explain'],
|
||||
"L_DISALLOW_EXPLAIN" => $lang['Disallow_explain'],
|
||||
"L_DELETE" => $lang['Delete_disallow'],
|
||||
"L_DELETE_DISALLOW" => $lang['Delete_disallow_title'],
|
||||
"L_DELETE_EXPLAIN" => $lang['Delete_disallow_explain'],
|
||||
"L_ADD" => $lang['Add_disallow'],
|
||||
"L_ADD_DISALLOW" => $lang['Add_disallow_title'],
|
||||
"L_ADD_EXPLAIN" => $lang['Add_disallow_explain'],
|
||||
"L_USERNAME" => $lang['Username'])
|
||||
);
|
||||
|
||||
$template->pparse("body");
|
||||
?>
|
||||
|
||||
?>
|
@@ -31,7 +31,7 @@ if($setmodules == 1)
|
||||
// Let's set the root dir for phpBB
|
||||
//
|
||||
$phpbb_root_dir = "./../";
|
||||
$no_page_header = TRUE;
|
||||
|
||||
require('pagestart.inc');
|
||||
|
||||
|
||||
@@ -66,8 +66,6 @@ if( $mode != "" )
|
||||
//
|
||||
// They want to add a new rank, show the form.
|
||||
//
|
||||
include('page_header_admin.' . $phpEx);
|
||||
|
||||
$rank_id = ( isset($HTTP_GET_VARS['id']) ) ? intval($HTTP_GET_VARS['id']) : 0;
|
||||
|
||||
$s_hidden_fields = "";
|
||||
@@ -142,7 +140,7 @@ if( $mode != "" )
|
||||
$special_rank = ( $HTTP_POST_VARS['special_rank'] == 1 ) ? TRUE : 0;
|
||||
$max_posts = ( isset($HTTP_POST_VARS['max_posts']) ) ? intval($HTTP_POST_VARS['max_posts']) : -1;
|
||||
$min_posts = ( isset($HTTP_POST_VARS['min_posts']) ) ? intval($HTTP_POST_VARS['min_posts']) : -1;
|
||||
$rank_image = ( (isset($HTTP_POST_VARS['rank_image'])) || $HTTP_POST_VARS['rank_image'] != "http://" ) ? $HTTP_POST_VARS['rank_image'] : "";
|
||||
$rank_image = ( (isset($HTTP_POST_VARS['rank_image'])) ) ? $HTTP_POST_VARS['rank_image'] : "";
|
||||
|
||||
if( $rank_title == "" )
|
||||
{
|
||||
@@ -176,6 +174,7 @@ if( $mode != "" )
|
||||
rank_min = '$min_posts',
|
||||
rank_image = '$rank_image'
|
||||
WHERE rank_id = $rank_id";
|
||||
|
||||
$message = $lang['Rank_updated'];
|
||||
}
|
||||
else
|
||||
@@ -184,6 +183,7 @@ if( $mode != "" )
|
||||
(rank_title, rank_special, rank_max, rank_min, rank_image)
|
||||
VALUES
|
||||
('$rank_title', '$special_rank', '$max_posts', '$min_posts', '$rank_image')";
|
||||
|
||||
$message = $lang['Rank_added'];
|
||||
}
|
||||
|
||||
@@ -192,10 +192,8 @@ if( $mode != "" )
|
||||
message_die(GENERAL_ERROR, "Couldn't update/insert into ranks table", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
"META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("admin_ranks.$phpEx") . '">')
|
||||
);
|
||||
$message .= "<br />" . sprintf($lang['return_rank_admin'], "<a href=\"" . append_sid("admin_ranks.$phpEx") . "\">", "</a>");
|
||||
$message .= "<br /><br />" . sprintf($lang['Click_return_rankadmin'], "<a href=\"" . append_sid("admin_ranks.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
|
||||
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
|
||||
}
|
||||
@@ -224,19 +222,13 @@ if( $mode != "" )
|
||||
message_die(GENERAL_ERROR, "Couldn't delete rank data", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
"META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("admin_ranks.$phpEx") . '">')
|
||||
);
|
||||
$message = $lang['Rank_removed'];
|
||||
$message .= "<br />" . sprintf($lang['return_rank_admin'], "<a href=\"" . append_sid("admin_ranks.$phpEx") . "\">", "</a>");
|
||||
$message .= "<br /><br />" . sprintf($lang['Click_return_rankadmin'], "<a href=\"" . append_sid("admin_ranks.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
|
||||
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
"META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("admin_ranks.$phpEx") . '">')
|
||||
);
|
||||
message_die(GENERAL_MESSAGE, $lang['Must_select_rank']);
|
||||
}
|
||||
}
|
||||
@@ -245,8 +237,7 @@ if( $mode != "" )
|
||||
//
|
||||
// They didn't feel like giving us any information. Oh, too bad, we'll just display the
|
||||
// list then...
|
||||
include('page_header_admin.' . $phpEx);
|
||||
|
||||
//
|
||||
$template->set_filenames(array(
|
||||
"body" => "admin/ranks_list_body.tpl")
|
||||
);
|
||||
@@ -288,7 +279,6 @@ if( $mode != "" )
|
||||
{
|
||||
$rank_min = $rank_max = "-";
|
||||
}
|
||||
|
||||
|
||||
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
|
||||
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
|
||||
@@ -313,8 +303,6 @@ else
|
||||
//
|
||||
// Show the default page
|
||||
//
|
||||
include('page_header_admin.' . $phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "admin/ranks_list_body.tpl")
|
||||
);
|
||||
@@ -359,7 +347,8 @@ else
|
||||
|
||||
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
|
||||
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
|
||||
$rank_is_special = ( $special_rank == 1 ) ? $lang['Yes'] : $lang['No'];
|
||||
|
||||
$rank_is_special = ( $special_rank ) ? $lang['Yes'] : $lang['No'];
|
||||
|
||||
$template->assign_block_vars("ranks", array(
|
||||
"ROW_COLOR" => "#" . $row_color,
|
||||
@@ -379,4 +368,4 @@ $template->pparse("body");
|
||||
|
||||
include('page_footer_admin.'.$phpEx);
|
||||
|
||||
?>
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@
|
||||
if($setmodules == 1)
|
||||
{
|
||||
$file = basename(__FILE__);
|
||||
$module['General']['Word Censor'] = "$file";
|
||||
$module['General']['Word_Censor'] = "$file";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ if( $mode != "" )
|
||||
|
||||
"L_WORDS_TITLE" => $lang['Words_title'],
|
||||
"L_WORDS_TEXT" => $lang['Words_explain'],
|
||||
"L_WORD_CENSOR" => $lang['Word_censor'],
|
||||
"L_WORD_CENSOR" => $lang['Edit_word_censor'],
|
||||
"L_WORD" => $lang['Word'],
|
||||
"L_REPLACEMENT" => $lang['Replacement'],
|
||||
"L_SUBMIT" => $lang['Submit'],
|
||||
@@ -124,23 +124,23 @@ if( $mode != "" )
|
||||
$sql = "UPDATE " . WORDS_TABLE . "
|
||||
SET word = '$word', replacement = '$replacement'
|
||||
WHERE word_id = $word_id";
|
||||
$message_success = $lang['Word_updated'];
|
||||
$message = $lang['Word_updated'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "INSERT INTO " . WORDS_TABLE . " (word, replacement)
|
||||
VALUES ('$word', '$replacement')";
|
||||
$message_success = $lang['Word_added'];
|
||||
$message = $lang['Word_added'];
|
||||
}
|
||||
|
||||
if(!$result = $db->sql_query($sql))
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not insert data into words table", $lang['Error'], __LINE__, __FILE__, $sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $message_success);
|
||||
}
|
||||
|
||||
$message .= "<br /><br />" . sprintf($lang['Click_return_wordadmin'], "<a href=\"" . append_sid("admin_words.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
|
||||
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
}
|
||||
else if( $mode == "delete" )
|
||||
{
|
||||
@@ -162,10 +162,10 @@ if( $mode != "" )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not remove data from words table", $lang['Error'], __LINE__, __FILE__, $sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['Word_removed']);
|
||||
}
|
||||
|
||||
$message = $lang['Word_removed'] . "<br /><br />" . sprintf($lang['Click_return_wordadmin'], "<a href=\"" . append_sid("admin_words.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
|
||||
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -218,8 +218,9 @@ else
|
||||
"ROW_CLASS" => $row_class,
|
||||
"WORD" => $word,
|
||||
"REPLACEMENT" => $replacement,
|
||||
"U_WORD_EDIT" => append_sid("admin_words.$phpEx?mode=edit&id=$word_id"),
|
||||
"U_WORD_DELETE" => append_sid("admin_words.$phpEx?mode=delete&id=$word_id"))
|
||||
|
||||
"U_WORD_EDIT" => append_sid("admin_words.$phpEx?mode=edit&id=$word_id"),
|
||||
"U_WORD_DELETE" => append_sid("admin_words.$phpEx?mode=delete&id=$word_id"))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user