Version 2.2.0 RC-1

This commit is contained in:
Neo committed 2025-12-19 00:22:37 -08:00
1 parent f73f8bff6d
commit 22f1b963ee
1034 files changed
+178610 -70897

No files matched your search

+204 -52
View File
@@ -2,28 +2,18 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-10-28 15:18:16 +0100 (Fri, 28 Oct 2005) $
| > $Revision: 67 $
| > $Author: bfarber $
| > $Date: 2006-09-28 16:17:26 +0100 (Thu, 28 Sep 2006) $
| > $Revision: 586 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Warning Module
@@ -38,13 +28,15 @@
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class warn {
var $output = "";
var $nav;
var $page_title = "";
var $topic = array();
var $forum = array();
var $topic_id = "";
@@ -52,7 +44,10 @@ class warn {
var $moderator = "";
var $modfunc = "";
var $mm_data = "";
var $parser = "";
var $parser;
var $han_editor;
var $email;
var $can_ban = 0;
var $can_mod_q = 0;
@@ -86,15 +81,6 @@ class warn {
$this->parser->bypass_badwords = intval($this->ipsclass->member['g_bypass_badwords']);
//-----------------------------------------
// Load emailer
//-----------------------------------------
require ROOT_PATH."sources/classes/class_email.php";
$this->email = new emailer();
$this->email->ipsclass =& $this->ipsclass;
$this->email->email_init();
//-----------------------------------------
// Make sure we're a moderator...
//-----------------------------------------
@@ -132,9 +118,20 @@ class warn {
}
else if ($this->ipsclass->member['is_mod'])
{
$other_mgroups = array();
if( $this->ipsclass->member['mgroup_others'] )
{
$other_mgroups = explode( ",", $this->ipsclass->clean_perm_string( $this->ipsclass->member['mgroup_others'] ) );
}
$other_mgroups[] = $this->ipsclass->member['mgroup'];
$mgroups = implode( ",", $other_mgroups );
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'moderators',
'where' => "(member_id='".$this->ipsclass->member['id']."' OR (is_group=1 AND group_id='".$this->ipsclass->member['mgroup']."'))" ) );
'where' => "(member_id='".$this->ipsclass->member['id']."' OR (is_group=1 AND group_id IN(".$mgroups.") ))" ) );
$this->ipsclass->DB->simple_exec();
@@ -159,12 +156,12 @@ class warn {
if ($pass == 0)
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_permission') );
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
}
if ( ! $this->ipsclass->vars['warn_on'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_permission') );
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
}
//-----------------------------------------
@@ -175,7 +172,7 @@ class warn {
if ( $mid < 1 )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_such_user') );
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user') );
}
$this->ipsclass->DB->cache_add_query( 'generic_get_all_member', array( 'mid' => $mid ) );
@@ -185,7 +182,7 @@ class warn {
if ( ! $this->warn_member['id'] )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_such_user') );
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user') );
}
if ( $this->ipsclass->input['CODE'] == "" OR $this->ipsclass->input['CODE'] == "dowarn" )
@@ -196,7 +193,7 @@ class warn {
if ( strstr( ','.$this->ipsclass->vars['warn_protected'].',', ','.$this->warn_member['mgroup'].',' ) )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'protected_user') );
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'protected_user') );
}
//-----------------------------------------
@@ -212,7 +209,7 @@ class warn {
if ( $this->ipsclass->DB->get_num_rows() >= $this->times_a_day )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'warned_already') );
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'warned_already') );
}
}
}
@@ -226,7 +223,15 @@ class warn {
case 'dowarn':
$this->do_warn();
break;
case 'add_note':
$this->add_note_form();
break;
case 'save_note':
$this->save_note();
break;
case 'view':
$this->view_log();
break;
@@ -250,6 +255,85 @@ class warn {
$this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 1, 'NAV' => $this->nav ) );
}
/*-------------------------------------------------------------------------*/
// Save Note Form
/*-------------------------------------------------------------------------*/
function save_note()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$content = '';
$note = trim( $this->ipsclass->input['note'] );
$save = array();
//-----------------------------------------
// Protected member?
//-----------------------------------------
if ( stristr( $this->ipsclass->vars['warn_protected'], ','.$this->warn_member['mgroup'].',' ) )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'protected_user') );
}
if ( $note )
{
//-----------------------------------------
// Ready to save?
//-----------------------------------------
$save['wlog_notes'] = "<content>{$note}</content>";
$save['wlog_notes'] .= "<mod></mod>";
$save['wlog_notes'] .= "<post></post>";
$save['wlog_notes'] .= "<susp></susp>";
$save['wlog_mid'] = $this->warn_member['id'];
$save['wlog_addedby'] = $this->ipsclass->member['id'];
$save['wlog_type'] = 'note';
$save['wlog_date'] = time();
//-----------------------------------------
// Enter into warn loggy poos (eeew - poo)
//-----------------------------------------
$this->ipsclass->DB->do_insert( 'warn_logs', $save );
}
//-----------------------------------------
// Done...
//-----------------------------------------
$this->view_log();
}
/*-------------------------------------------------------------------------*/
// Add Note Form
/*-------------------------------------------------------------------------*/
function add_note_form()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$content = '';
//-----------------------------------------
// Protected member?
//-----------------------------------------
if ( stristr( $this->ipsclass->vars['warn_protected'], ','.$this->warn_member['mgroup'].',' ) )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'protected_user') );
}
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_add_note_form( $this->warn_member['id'], $this->warn_member['members_display_name'] );
$this->ipsclass->print->pop_up_window( $this->ipsclass->lang['warn_popup_title'], $this->output );
}
/*-------------------------------------------------------------------------*/
// Show logs
/*-------------------------------------------------------------------------*/
@@ -262,12 +346,11 @@ class warn {
if ( stristr( $this->ipsclass->vars['warn_protected'], ','.$this->warn_member['mgroup'].',' ) )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'protected_user') );
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'protected_user') );
}
$perpage = 50;
$start = intval($this->ipsclass->input['st']);
$start = intval($this->ipsclass->input['st']) >=0 ? intval($this->ipsclass->input['st']) : 0;
$this->ipsclass->DB->simple_construct( array( 'select' => 'count(*) as cnt', 'from' => 'warn_logs', 'where' => "wlog_mid={$this->warn_member['id']}" ) );
$this->ipsclass->DB->simple_exec();
@@ -283,7 +366,7 @@ class warn {
'BASE_URL' => $this->ipsclass->base_url."act=warn&amp;CODE=view&amp;mid={$this->warn_member['id']}",
) );
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_view_header($this->warn_member['id'], $this->warn_member['members_display_name'], $links);
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_view_header($this->warn_member['id'], $this->warn_member['members_display_name']);
if ( $row['cnt'] < 1 )
{
@@ -308,7 +391,11 @@ class warn {
$puni_name = $this->ipsclass->make_profile_link( $r['punisher_name'], $r['punisher_id'] );
if ( $r['wlog_type'] == 'pos' )
if ( $r['wlog_type'] == 'note' )
{
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_view_note_row($date, $content, $puni_name);
}
else if ( $r['wlog_type'] == 'pos' )
{
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_view_positive_row($date, $content, $puni_name);
}
@@ -319,7 +406,7 @@ class warn {
}
}
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_view_footer();
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_view_footer($links);
$this->ipsclass->print->pop_up_window( $this->ipsclass->lang['warn_popup_title'], $this->output );
}
@@ -334,7 +421,7 @@ class warn {
if ( $this->type == 'member' )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_permission') );
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
}
$err = "";
@@ -363,7 +450,7 @@ class warn {
if ( $err == 1 )
{
$this->ipsclass->Error( array( LEVEL => '1', MSG => 'no_warn_max' ) );
$this->ipsclass->Error( array( 'LEVEL' => '1', 'MSG' => 'no_warn_max' ) );
}
}
@@ -373,7 +460,7 @@ class warn {
if ( $this->ipsclass->input['key'] != $this->ipsclass->return_md5_check() )
{
$this->ipsclass->Error( array( LEVEL => '1', MSG => 'del_post') );
$this->ipsclass->Error( array( 'LEVEL' => '1', 'MSG' => 'del_post') );
}
//-----------------------------------------
@@ -386,6 +473,24 @@ class warn {
return;
}
//-----------------------------------------
// Load emailer
//-----------------------------------------
require ROOT_PATH."sources/classes/class_email.php";
$this->email = new emailer();
$this->email->ipsclass =& $this->ipsclass;
$this->email->email_init();
//-----------------------------------------
// Load and config the std/rte editors
//-----------------------------------------
require_once( ROOT_PATH."sources/handlers/han_editor.php" );
$this->han_editor = new han_editor();
$this->han_editor->ipsclass =& $this->ipsclass;
$this->han_editor->init();
//-----------------------------------------
// Plussy - minussy?
//-----------------------------------------
@@ -399,8 +504,14 @@ class warn {
if ( $this->ipsclass->input['contact'] != "" )
{
if ( $this->han_editor->method == 'rte' )
{
$this->ipsclass->input['contact'] = $this->han_editor->process_raw_post( 'contact' );
}
$save['wlog_contact'] = $this->ipsclass->input['contactmethod'];
$save['wlog_contact_content'] = "<subject>{$this->ipsclass->input['subject']}</subject><content>{$this->ipsclass->input['contact']}</content>";
$save['wlog_contact_content'] = $this->parser->pre_db_parse( $save['wlog_contact_content'] );
if ( trim($this->ipsclass->input['subject']) == "" )
{
@@ -410,6 +521,11 @@ class warn {
if ( $this->ipsclass->input['contactmethod'] == 'email' )
{
$this->parser->parse_smilies = 0;
$this->parser->parse_html = 1;
$this->parser->parse_bbcode = 1;
$this->ipsclass->input['contact'] = $this->parser->pre_db_parse( $this->ipsclass->input['contact'] );
//-----------------------------------------
// Send the email
//-----------------------------------------
@@ -425,7 +541,7 @@ class warn {
$this->email->subject = $this->ipsclass->input['subject'];
$this->email->to = $this->warn_member['email'];
$this->email->from = $this->ipsclass->member['email'];
$this->email->from = $this->ipsclass->vars['email_out'];
$this->email->send_mail();
}
else
@@ -567,8 +683,18 @@ class warn {
{
if ( $this->type == 'member' )
{
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_permission') );
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
}
//-----------------------------------------
// Load and config the std/rte editors
//-----------------------------------------
require_once( ROOT_PATH."sources/handlers/han_editor.php" );
$this->han_editor = new han_editor();
$this->han_editor->ipsclass =& $this->ipsclass;
$this->han_editor->init();
$this->han_editor->remove_side_panel = 1;
$key = $this->ipsclass->return_md5_check();
@@ -602,8 +728,9 @@ class warn {
if ( $this->can_mod_q )
{
$mod_tick = 0;
$mod_arr = array();
$mod_tick = 0;
$mod_arr = array( 'timespan' => 0, 'days' => 0, 'hours' => 0 );
$mod_extra = "";
if ( $this->warn_member['mod_posts'] == 1 )
{
@@ -635,8 +762,9 @@ class warn {
if ( $this->can_rem_post )
{
$post_tick = 0;
$post_arr = array();
$post_tick = 0;
$post_arr = array( 'timespan' => 0, 'hours' => 0, 'days' => 0 );
$post_extra = "";
if ( $this->warn_member['restrict_post'] == 1 )
{
@@ -667,7 +795,8 @@ class warn {
if ( $this->can_ban )
{
$ban_arr = array();
$ban_arr = array( 'timespan' => 0, 'days' => 0, 'hours' => 0 );
$ban_extra = "";
if ( $this->warn_member['temp_ban'] )
{
@@ -686,13 +815,36 @@ class warn {
$ban_arr['timespan'] = $hours;
}
$post_extra = $this->ipsclass->compiled_templates['skin_mod']->warn_restricition_in_place();
$ban_extra = $this->ipsclass->compiled_templates['skin_mod']->warn_restricition_in_place();
}
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_suspend($ban_arr, $ban_extra);
}
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_footer( $this->warn_member['members_disable_pm'] );
$this->ipsclass->input['reason'] = isset($this->ipsclass->input['reason']) ? $this->ipsclass->my_br2nl( $this->ipsclass->input['reason'] ) : '';
if( isset($this->ipsclass->input['contact']) AND $this->ipsclass->input['contact'] )
{
if ( $this->han_editor->method == 'rte' )
{
$this->ipsclass->input['contact'] = $this->han_editor->process_raw_post( 'contact' );
$this->ipsclass->input['contact'] = $this->parser->pre_display_parse( $this->parser->pre_db_parse( $this->ipsclass->input['contact'] ) );
$this->ipsclass->input['contact'] = $this->parser->convert_ipb_html_to_html( $this->ipsclass->input['contact'] );
}
else
{
$this->parser->parse_html = 1;
$this->parser->parse_nl2br = 1;
$this->parser->parse_smilies = 1;
$this->parser->parse_bbcode = 1;
$this->ipsclass->input['contact'] = $this->parser->pre_edit_parse( $this->ipsclass->input['contact'] );
}
}
$this->ipsclass->input['subject'] = isset($this->ipsclass->input['subject']) ? $this->ipsclass->input['subject'] : '';
$this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_footer( $this->warn_member['members_disable_pm'], $this->han_editor->show_editor( isset($this->ipsclass->input['contact']) ? $this->ipsclass->input['contact'] : '', 'contact' ) );
}