Version 3.1.4

This commit is contained in:
Neo committed 2025-12-19 00:32:22 -08:00
1 parent 1d4720f3e2
commit ae5c01cc78
2563 files changed
+283048 -240689

No files matched your search

@@ -1,19 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Member warn functions
* Last Updated: $Date: 2009-06-24 23:14:22 -0400 (Wed, 24 Jun 2009) $
* Last Updated: $Date: 2010-10-08 10:15:14 -0400 (Fri, 08 Oct 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: mark $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 4818 $
* @version $Revision: 6956 $
*
* @todo [Future] Ability to require confirmation of a warning (feature)?
*/
@@ -37,90 +39,90 @@ class public_members_warn_warn extends ipsCommand
/**
* Forum information
*
* @access private
* @access protected
* @var array Array of forum details
*/
private $forum = array();
protected $forum = array();
/**
* Topic information
*
* @access private
* @access protected
* @var array Array of topic details
*/
private $topic = array();
protected $topic = array();
/**
* Topic ID
*
* @access private
* @access protected
* @var integer Topic id
*/
private $topic_id = 0;
protected $topic_id = 0;
/**
* Forum ID
*
* @access private
* @access protected
* @var integer Forum id
*/
private $forum_id = 0;
protected $forum_id = 0;
/**
* Moderator information
*
* @access private
* @access protected
* @var array Array of moderator details
*/
private $moderator = array();
protected $moderator = array();
/**
* Can ban member from warn panel
*
* @access private
* @access protected
* @var bool Can ban member
*/
private $canSuspend = 0;
protected $canSuspend = 0;
/**
* Can mod queue member from warn panel
*
* @access private
* @access protected
* @var bool Can mod queue member
*/
private $canModQueue = 0;
protected $canModQueue = 0;
/**
* Can remove posting rights from member from warn panel
*
* @access private
* @access protected
* @var bool Can remove posting for member
*/
private $canRemovePostAbility = 0;
protected $canRemovePostAbility = 0;
/**
* Number of times per day member can be warned
*
* @access private
* @access protected
* @var integer Number of times per day member can be warned
*/
private $restrictWarnsPerDay = 0;
protected $restrictWarnsPerDay = 0;
/**
* Type of member
*
* @access private
* @access protected
* @var string mod, supmod, or member
*/
private $type = 'mod';
protected $type = 'mod';
/**
* Data for the member being warned
*
* @access private
* @access protected
* @var array Member being warned
*/
private $warn_member = array();
protected $warn_member = array();
/**
* Class entry point
@@ -144,17 +146,14 @@ class public_members_warn_warn extends ipsCommand
break;
case 'add_note':
$this->_checkAccess();
$this->_addNoteform();
break;
case 'save_note':
$this->_checkAccess();
$this->_saveNote();
break;
case 'view':
$this->_checkAccess();
$this->viewLog();
break;
@@ -210,8 +209,8 @@ class public_members_warn_warn extends ipsCommand
}
/* Need app_class_forums to setup moderator stuff */
require_once( IPS_ROOT_PATH . 'applications/forums/app_class_forums.php' );
$app_class_forums = new app_class_forums( $this->registry );
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'applications/forums/app_class_forums.php', 'app_class_forums', 'forums' );
$app_class_forums = new $classToLoad( $this->registry );
//-----------------------------------------
// Make sure we're a moderator...
@@ -236,11 +235,12 @@ class public_members_warn_warn extends ipsCommand
}
else if( $this->memberData['is_mod'] )
{
$other_mgroups = array();
$other_mgroups = array();
$_other_mgroups = IPSText::cleanPermString( $this->memberData['mgroup_others'] );
if( $this->memberData['mgroup_others'] )
if( $_other_mgroups )
{
$other_mgroups = explode( ",", IPSText::cleanPermString( $this->memberData['mgroup_others'] ) );
$other_mgroups = explode( ",", $_other_mgroups );
}
$other_mgroups[] = $this->memberData['member_group_id'];
@@ -292,7 +292,7 @@ class public_members_warn_warn extends ipsCommand
return false;
}
$this->registry->output->showError( 'warn_no_access', 2025 );
$this->registry->output->showError( 'warn_no_access', 2025, null, null, 403 );
}
//-----------------------------------------
@@ -308,7 +308,7 @@ class public_members_warn_warn extends ipsCommand
return false;
}
$this->registry->output->showError( 'warn_no_user', 10249 );
$this->registry->output->showError( 'warn_no_user', 10249, null, null, 404 );
}
$this->warn_member = IPSMember::load( $mid, 'all' );
@@ -320,23 +320,29 @@ class public_members_warn_warn extends ipsCommand
return false;
}
$this->registry->output->showError( 'warn_no_user', 10250 );
$this->registry->output->showError( 'warn_no_user', 10250, null, null, 404 );
}
$this->registry->output->setTitle( $this->page_title ? $this->page_title : $this->lang->words['w_title'] );
$this->registry->output->setTitle( $this->page_title ? $this->page_title : $this->lang->words['w_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
}
/**
* Save a new note
*
* @access private
* @access protected
* @return void [Outputs to screen/redirects]
*/
private function _saveNote()
protected function _saveNote()
{
if ( $this->type == 'member' )
{
$this->registry->output->showError( 'warn_member_notes', 2026 );
$this->registry->output->showError( 'warn_member_notes', 2026, null, null, 403 );
}
/* Security Check */
if ( $this->request['auth_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'no_permission', 3021, null, null, 403 );
}
//-----------------------------------------
@@ -382,14 +388,14 @@ class public_members_warn_warn extends ipsCommand
/**
* Form to add a new note
*
* @access private
* @access protected
* @return void [Outputs to screen/redirects]
*/
private function _addNoteForm()
protected function _addNoteForm()
{
if ( $this->type == 'member' )
{
$this->registry->output->showError( 'warn_member_notes', 2027 );
$this->registry->output->showError( 'warn_member_notes', 2027, null, null, 403 );
}
//-----------------------------------------
@@ -400,7 +406,7 @@ class public_members_warn_warn extends ipsCommand
$this->output .= $this->registry->getClass('output')->getTemplate('mod')->warn_add_note_form( $this->warn_member['member_id'], $this->warn_member['members_display_name'], $this->warn_member['members_seo_name'] );
$this->registry->getClass('output')->setTitle( $this->lang->words['warn_popup_title'] );
$this->registry->getClass('output')->setTitle( $this->lang->words['warn_popup_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->getClass('output')->popUpWindow( $this->output );
}
@@ -474,7 +480,7 @@ class public_members_warn_warn extends ipsCommand
$this->output .= $this->registry->getClass('output')->getTemplate('mod')->warn_view_log( $this->warn_member, $rows, $links );
$this->registry->getClass('output')->setTitle( $this->lang->words['warn_popup_title'] );
$this->registry->getClass('output')->setTitle( $this->lang->words['warn_popup_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
return $this->output;
}
@@ -482,10 +488,10 @@ class public_members_warn_warn extends ipsCommand
/**
* Add a new arn entry
*
* @access private
* @access protected
* @return void [Outputs to screen/redirects]
*/
private function _doWarn()
protected function _doWarn()
{
//-----------------------------------------
// INIT
@@ -503,12 +509,21 @@ class public_members_warn_warn extends ipsCommand
$member_banned = intval( $this->warn_member['member_banned'] );
$warn_level = intval( $this->warn_member['warn_level']) ;
//--------------------------------------
// Are we allowed to do this?
//--------------------------------------
if ( $this->request['level'] == 'add' or ( $this->request['level'] == 'custom' and $level_custom > $warn_level ) )
{
$this->_checkAccess();
}
//-----------------------------------------
// Load Mod Squad
//-----------------------------------------
require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php' );
$moderatorLibrary = new moderatorLibrary( $this->registry );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' );
$moderatorLibrary = new $classToLoad( $this->registry );
//-----------------------------------------
// Security checks
@@ -516,7 +531,7 @@ class public_members_warn_warn extends ipsCommand
if ( $this->type == 'member' )
{
$this->registry->output->showError( 'warn_member_notes', 2028 );
$this->registry->output->showError( 'warn_member_notes', 2028, null, null, 403 );
}
//-----------------------------------------
@@ -525,7 +540,7 @@ class public_members_warn_warn extends ipsCommand
if ( $this->request['key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'warn_bad_key', 3020 );
$this->registry->output->showError( 'warn_bad_key', 3020, null, null, 403 );
}
//-----------------------------------------
@@ -655,8 +670,8 @@ class public_members_warn_warn extends ipsCommand
// Grab PM class
//-----------------------------------------
require_once( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php' );
$messengerFunctions = new messengerFunctions( $this->registry );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
$messengerFunctions = new $classToLoad( $this->registry );
try
{
@@ -892,15 +907,15 @@ class public_members_warn_warn extends ipsCommand
/**
* Show the add new warn form
*
* @access private
* @access protected
* @param mixed Empty | Error message language key
* @return void [Outputs to screen/redirects]
*/
private function _showForm( $errors="" )
protected function _showForm( $errors="" )
{
if ( $this->type == 'member' )
{
$this->registry->output->showError( 'warn_member_notes', 10255 );
$this->registry->output->showError( 'warn_member_notes', 10255, null, null, 403 );
}
$this->warn_member['warn_level'] = intval($this->warn_member['warn_level']);
@@ -920,10 +935,10 @@ class public_members_warn_warn extends ipsCommand
/**
* Checking method access
*
* @access private
* @access protected
* @return void [Displays error if appropriate]
*/
private function _checkAccess()
protected function _checkAccess()
{
//-----------------------------------------
// Protected member? Really? o_O
@@ -931,7 +946,7 @@ class public_members_warn_warn extends ipsCommand
if ( strstr( ',' . $this->settings['warn_protected'] . ',', ',' . $this->warn_member['member_group_id'] . ',' ) )
{
$this->registry->output->showError( 'warn_protected_member', 10256 );
$this->registry->output->showError( 'warn_protected_member', 10256, null, null, 403 );
}
//-----------------------------------------
@@ -946,7 +961,7 @@ class public_members_warn_warn extends ipsCommand
if ( $check['warn_times'] >= $this->restrictWarnsPerDay )
{
$this->registry->output->showError( 'warned_already', 10257 );
$this->registry->output->showError( 'warned_already', 10257, null, null, 403 );
}
}
}