Version 2.0.0

This commit is contained in:
Neo committed 2025-12-19 00:19:56 -08:00
1 parent 5699abfc0e
commit 0eecc172d9
696 files changed
+120723 -77160

No files matched your search

+113 -143
View File
@@ -2,16 +2,15 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board v1.3.1 Final
| ========================================
| Invision Power Board v2.0.0
| =============================================
| by Matthew Mecham
| (c) 2001 - 2003 Invision Power Services
| (c) 2001 - 2004 Invision Power Services, Inc.
| http://www.invisionpower.com
| ========================================
| =============================================
| Web: http://www.invisionboard.com
| Time: Thu, 23 Sep 2004 23:05:01 GMT
| Release: 3cb325c445e1909182084806ae7f8226
| Email: matt@invisionpower.com
| Time: Tue, 21 Sep 2004 16:34:28 GMT
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
@@ -20,11 +19,16 @@
| > Date started: 16th May 2003
|
| > Module Version Number: 1.0.0
| > DBA Checked: Mon 24th May 2004
+--------------------------------------------------------------------------
*/
$idx = new warn;
if ( ! defined( 'IN_IPB' ) )
{
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 {
@@ -46,17 +50,17 @@ class warn {
var $warn_member = "";
//------------------------------------------------------
//-----------------------------------------
// @constructor (no, not bob the builder)
//------------------------------------------------------
//-----------------------------------------
function warn()
function auto_run()
{
global $ibforums, $DB, $std, $print;
global $ibforums, $DB, $std, $print;
//-------------------------------------
//-----------------------------------------
// Load modules...
//-------------------------------------
//-----------------------------------------
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_mod', $ibforums->lang_id);
@@ -64,11 +68,11 @@ class warn {
require( ROOT_PATH.'sources/lib/post_parser.php');
$this->parser = new post_parser(1);
$this->parser = new post_parser();
//-------------------------------------
//-----------------------------------------
// Make sure we're a moderator...
//-------------------------------------
//-----------------------------------------
$pass = 0;
@@ -94,16 +98,24 @@ class warn {
}
else if ($ibforums->member['is_mod'])
{
$DB->query("SELECT * FROM ibf_moderators WHERE (member_id='".$ibforums->member['id']."' OR (is_group=1 AND group_id='".$ibforums->member['mgroup']."'))");
$DB->simple_construct( array( 'select' => '*',
'from' => 'moderators',
'where' => "(member_id='".$ibforums->member['id']."' OR (is_group=1 AND group_id='".$ibforums->member['mgroup']."'))" ) );
$DB->simple_exec();
if ( $this->moderator = $DB->fetch_row() )
{
$pass = 1;
$this->can_ban = $ibforums->vars['warn_mod_ban'];
$this->can_mod_q = $ibforums->vars['warn_mod_modq'];
$this->can_rem_post = $ibforums->vars['warn_mod_post'];
$this->times_a_day = intval($ibforums->vars['warn_mod_day']);
$this->type = 'mod';
if ( $this->moderator['allow_warn'] )
{
$pass = 1;
$this->can_ban = $ibforums->vars['warn_mod_ban'];
$this->can_mod_q = $ibforums->vars['warn_mod_modq'];
$this->can_rem_post = $ibforums->vars['warn_mod_post'];
$this->times_a_day = intval($ibforums->vars['warn_mod_day']);
$this->type = 'mod';
}
}
}
else if ( $ibforums->vars['warn_show_own'] and $ibforums->member['id'] == $ibforums->input['mid'] )
@@ -131,9 +143,9 @@ class warn {
$std->Error( array( LEVEL => 1, MSG => 'no_permission') );
}
//-------------------------------------
//-----------------------------------------
// Ensure we have a valid member id
//-------------------------------------
//-----------------------------------------
$mid = intval($ibforums->input['mid']);
@@ -142,10 +154,9 @@ class warn {
$std->Error( array( LEVEL => 1, MSG => 'no_such_user') );
}
$DB->query("SELECT m.*, g.* FROM ibf_members m
LEFT JOIN ibf_groups g on (m.mgroup=g.g_id)
WHERE id=$mid");
$DB->cache_add_query( 'generic_get_all_member', array( 'mid' => $mid ) );
$DB->cache_exec_query();
$this->warn_member = $DB->fetch_row();
if ( ! $this->warn_member['id'] )
@@ -153,27 +164,27 @@ class warn {
$std->Error( array( LEVEL => 1, MSG => 'no_such_user') );
}
if ( $ibforums->input['CODE'] == "" OR $ibforums->input['CODE'] == "dowarn" )
{
//-------------------------------------
//-----------------------------------------
// Protected member? Really? o_O
//-------------------------------------
//-----------------------------------------
if ( stristr( $ibforums->vars['warn_protected'], ','.$this->warn_member['mgroup'].',' ) )
if ( strstr( ','.$ibforums->vars['warn_protected'].',', ','.$this->warn_member['mgroup'].',' ) )
{
$std->Error( array( LEVEL => 1, MSG => 'protected_user') );
}
//-------------------------------------
//-----------------------------------------
// I've already warned you!!
//-------------------------------------
//-----------------------------------------
if ( $this->times_a_day > 0 )
{
$time_to_check = time() - 86400;
$DB->query("SELECT * FROM ibf_warn_logs WHERE wlog_mid={$this->warn_member['id']} AND wlog_date > $time_to_check");
$DB->simple_construct( array( 'select' => '*', 'from' => 'warn_logs', 'where' => "wlog_mid={$this->warn_member['id']} AND wlog_date > $time_to_check" ) );
$DB->simple_exec();
if ( $DB->get_num_rows() >= $this->times_a_day )
{
@@ -182,12 +193,12 @@ class warn {
}
}
//-------------------------------------
//-----------------------------------------
// Bouncy, bouncy!
//-------------------------------------
//-----------------------------------------
switch ($ibforums->input['CODE']) {
switch ($ibforums->input['CODE'])
{
case 'dowarn':
$this->do_warn();
break;
@@ -218,17 +229,17 @@ class warn {
//-------------------------------------------------
//-----------------------------------------
// Show logs
//-------------------------------------------------
//-----------------------------------------
function view_log()
{
global $std, $ibforums, $DB, $print;
//-------------------------------------
//-----------------------------------------
// Protected member? Really? o_O
//-------------------------------------
//-----------------------------------------
if ( stristr( $ibforums->vars['warn_protected'], ','.$this->warn_member['mgroup'].',' ) )
{
@@ -239,7 +250,8 @@ class warn {
$start = intval($ibforums->input['st']);
$DB->query("SELECT count(*) as cnt FROM ibf_warn_logs WHERE wlog_mid={$this->warn_member['id']}");
$DB->simple_construct( array( 'select' => 'count(*) as cnt', 'from' => 'warn_logs', 'where' => "wlog_mid={$this->warn_member['id']}" ) );
$DB->simple_exec();
$row = $DB->fetch_row();
@@ -260,11 +272,9 @@ class warn {
}
else
{
$DB->query("SELECT l.*, p.id as punisher_id, p.name as punisher_name
FROM ibf_warn_logs l
LEFT JOIN ibf_members p ON ( p.id=l.wlog_addedby )
WHERE l.wlog_mid={$this->warn_member['id']} ORDER BY l.wlog_date DESC LIMIT $start, $perpage");
$DB->cache_add_query( 'warn_get_data', array( 'mid' => $this->warn_member['id'], 'limit_a' => $start, 'limit_b' => $perpage ) );
$DB->cache_exec_query();
while ( $r = $DB->fetch_row() )
{
$date = $std->get_date( $r['wlog_date'], 'LONG' );
@@ -301,15 +311,15 @@ class warn {
//-------------------------------------------------
//-----------------------------------------
// Do the actual warny-e-poos
//-------------------------------------------------
//-----------------------------------------
function do_warn()
{
global $std, $ibforums, $DB, $print;
require "./sources/lib/emailer.php";
require "./sources/classes/class_email.php";
$this->email = new emailer();
$save = array();
@@ -349,18 +359,18 @@ class warn {
}
}
//-------------------------------------------------
//-----------------------------------------
// Check security fang
//-------------------------------------------------
//-----------------------------------------
if ( $ibforums->input['key'] != $std->return_md5_check() )
{
$std->Error( array( LEVEL => '1', MSG => 'del_post') );
}
//-------------------------------------------------
//-----------------------------------------
// As Celine Dion once squawked, "Show me the reason"
//-------------------------------------------------
//-----------------------------------------
if ( trim($ibforums->input['reason']) == "" )
{
@@ -368,16 +378,16 @@ class warn {
return;
}
//-------------------------------------------------
//-----------------------------------------
// Plussy - minussy?
//-------------------------------------------------
//-----------------------------------------
$save['wlog_type'] = ( $ibforums->input['level'] == 'add' ) ? 'neg' : 'pos';
$save['wlog_date'] = time();
//-------------------------------------------------
//-----------------------------------------
// Contacting the member?
//-------------------------------------------------
//-----------------------------------------
if ( $ibforums->input['contact'] != "" )
{
@@ -392,9 +402,9 @@ class warn {
if ( $ibforums->input['contactmethod'] == 'email' )
{
//----------------------------------
//-----------------------------------------
// Send the email
//----------------------------------
//-----------------------------------------
$this->email->get_template("email_member");
@@ -412,71 +422,34 @@ class warn {
}
else
{
//----------------------------------
//-----------------------------------------
// PM :o
//----------------------------------
//-----------------------------------------
$show_popup = $this->warn_member['view_pop'];
require_once( ROOT_PATH.'sources/lib/msg_functions.php' );
$this->lib = new msg_functions();
$this->lib->init();
$this->lib->to_by_id = $this->warn_member['id'];
$this->lib->from_member = $ibforums->member;
$this->lib->msg_title = $ibforums->input['subject'];
$this->lib->msg_post = $std->remove_tags($ibforums->input['contact']);
$this->lib->force_pm = 1;
//--------------------------------------
// Enter the info into the DB
// Target user side.
//--------------------------------------
$this->lib->send_pm();
$db_string = $std->compile_db_string( array(
'member_id' => $this->warn_member['id'],
'msg_date' => time(),
'read_state' => '0',
'title' => $ibforums->input['subject'],
'message' => $std->remove_tags($ibforums->input['contact']),
'from_id' => $ibforums->member['id'],
'vid' => 'in',
'recipient_id' => $this->warn_member['id'],
'tracking' => 0,
) );
$DB->query("INSERT INTO ibf_messages (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")");
$new_id = $DB->get_insert_id();
unset($db_string);
//-----------------------------------------------------
$DB->query("UPDATE ibf_members SET ".
"msg_total = msg_total + 1, " .
"new_msg = new_msg + 1, " .
"msg_from_id='" . $ibforums->member['id'] . "', ".
"msg_msg_id='" . $new_id . "', ".
"show_popup='" . $show_popup . "' ".
"WHERE id='" . $this->warn_member['id'] . "'");
//-----------------------------------------------------
// Has this member requested a PM email nofity?
//-----------------------------------------------------
if ($this->warn_member['email_pm'] == 1)
if ( $this->lib->error )
{
$this->warn_member['language'] = $this->warn_member['language'] == "" ? 'en' : $this->warn_member['language'];
$this->email->get_template("pm_notify", $this->warn_member['language']);
$this->email->build_message( array(
'NAME' => $this->warn_member['name'],
'POSTER' => $ibforums->member['name'],
'TITLE' => $ibforums->input['subject'],
'LINK' => "?act=Msg&CODE=03&VID=in&MSID=$new_id",
)
);
$this->email->subject = $ibforums->lang['pm_email_subject'];
$this->email->to = $this->warn_member['email'];
$this->email->send_mail();
print $this->error;
exit();
}
}
}
//-------------------------------------------------
//-----------------------------------------
// Right - is we banned or wha?
//-------------------------------------------------
//-----------------------------------------
$restrict_post = '';
$mod_queue = '';
@@ -514,17 +487,15 @@ class warn {
$save['wlog_mid'] = $this->warn_member['id'];
$save['wlog_addedby'] = $ibforums->member['id'];
//-------------------------------------------------
//-----------------------------------------
// Enter into warn loggy poos (eeew - poo)
//-------------------------------------------------
//-----------------------------------------
$dbs = $DB->compile_db_insert_string( $save );
$DB->do_insert( 'warn_logs', $save );
$DB->query("INSERT INTO ibf_warn_logs ({$dbs['FIELD_NAMES']}) VALUES({$dbs['FIELD_VALUES']})");
//-------------------------------------------------
//-----------------------------------------
// Update member
//-------------------------------------------------
//-----------------------------------------
$warn_level = intval($this->warn_member['warn_level']);
@@ -544,22 +515,20 @@ class warn {
if ( $warn_level < 1 )
{
$warn_level == 0;
$warn_level = 0;
}
$dbs = $DB->compile_db_update_string( array (
'mod_posts' => $mod_queue,
'restrict_post' => $restrict_post,
'temp_ban' => $susp,
'warn_level' => $warn_level,
'warn_lastwarn' => time(),
) );
$DB->do_update( 'members', array (
'mod_posts' => $mod_queue,
'restrict_post' => $restrict_post,
'temp_ban' => $susp,
'warn_level' => $warn_level,
'warn_lastwarn' => time(),
) , "id={$this->warn_member['id']}" );
$DB->query("UPDATE ibf_members SET $dbs WHERE id={$this->warn_member['id']}");
//-------------------------------------------------
//-----------------------------------------
// Now what? Show success screen, that's what!!
//-------------------------------------------------
//-----------------------------------------
$ibforums->lang['w_done_te'] = sprintf( $ibforums->lang['w_done_te'], $this->warn_member['name'] );
@@ -571,17 +540,18 @@ class warn {
if ( $tid > 0 )
{
$DB->query("SELECT t.tid, t.title, f.id, f.name FROM ibf_topics t, ibf_forums f WHERE tid=$tid AND t.forum_id=f.id");
$DB->cache_add_query( 'warn_get_forum', array( 'tid' => $tid ) );
$DB->cache_exec_query();
$topic = $DB->fetch_row();
$this->output = str_replace( "<!--IBF.FORUM_TOPIC-->", $this->html->warn_success_forum( $topic['id'], $topic['name'], $topic['tid'], $topic['title'], intval($ibforums->input['st']) ), $this->output );
}
}
//-------------------------------------------------
//-----------------------------------------
// Show form
//-------------------------------------------------
//-----------------------------------------
function show_form($errors="")
{