Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Define the default ajax section
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @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 $Rev: 4948 $
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Define the default bulkmail section
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @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 $Rev: 4948 $
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Define the default groups section
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @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 $Rev: 4948 $
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,278 +1,280 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Ban Filters
|
||||
* Last Updated: $Date: 2009-10-01 10:02:08 -0400 (Thu, 01 Oct 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 5190 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_members_members_banfilters extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_banfilters' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=members&section=banfilters';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=members§ion=banfilters';
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'ban_add':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ban_manage' );
|
||||
$this->banAdd();
|
||||
break;
|
||||
|
||||
case 'ban_delete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ban_remove' );
|
||||
$this->banDelete();
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'ban':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ban_manage' );
|
||||
$this->banOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Pass to CP output hander
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new ban filter
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function banAdd()
|
||||
{
|
||||
/* Error checking */
|
||||
if( ! $this->request['bantext'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ban_entersomething'];
|
||||
$this->banOverview();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check for duplicate */
|
||||
$result = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'banfilters',
|
||||
'where' => "ban_content='{$this->request['bantext']}' and ban_type='{$this->request['bantype']}'"
|
||||
) );
|
||||
|
||||
if ( $result['ban_id'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ban_dupe'];
|
||||
$this->banOverview();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Insert the new ban filter */
|
||||
$this->DB->insert( 'banfilters', array( 'ban_type' => $this->request['bantype'], 'ban_content' => trim( $this->request['bantext'] ), 'ban_date' => time() ) );
|
||||
|
||||
/* Rebuild cacne and bounce */
|
||||
$this->rebuildBanCache();
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['ban_added'];
|
||||
$this->banOverview();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a ban filter
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function banDelete()
|
||||
{
|
||||
/* INI */
|
||||
$ids = array();
|
||||
|
||||
/* Loop through the request fields and find checked ban filters */
|
||||
foreach( $this->request as $key => $value )
|
||||
{
|
||||
if( preg_match( "/^id_(\d+)$/", $key, $match ) )
|
||||
{
|
||||
if( $this->request[ $match[0] ] )
|
||||
{
|
||||
$ids[] = $match[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Clean the array */
|
||||
$ids = IPSLib::cleanIntArray( $ids );
|
||||
|
||||
/* Delete any checked ban filters */
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
$this->DB->delete( 'banfilters', 'ban_id IN(' . implode( ",", $ids ) . ')' );
|
||||
$this->DB->execute();
|
||||
}
|
||||
|
||||
/* Rebuild the cache */
|
||||
$this->rebuildBanCache();
|
||||
|
||||
/* Bounce */
|
||||
$this->registry->output->global_message = $this->lang->words['ban_removed'];
|
||||
$this->banOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the ban overview screen
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function banOverview()
|
||||
{
|
||||
/* INI */
|
||||
$ban = array();
|
||||
|
||||
/* Get ban filters */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'banfilters', 'order' => 'ban_date desc' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$ban[ $r['ban_type'] ][ $r['ban_id'] ] = $r;
|
||||
}
|
||||
|
||||
/* IPs */
|
||||
$ips = array();
|
||||
|
||||
if( isset( $ban['ip'] ) AND is_array( $ban['ip'] ) AND count( $ban['ip'] ) )
|
||||
{
|
||||
foreach( $ban['ip'] as $entry )
|
||||
{
|
||||
$entry['_checkbox'] = "<input type='checkbox' name='id_{$entry['ban_id']}' value='1' />";
|
||||
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
|
||||
$ips[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/* Emails */
|
||||
$emails = array();
|
||||
|
||||
if( isset( $ban['email'] ) AND is_array( $ban['email'] ) AND count( $ban['email'] ) )
|
||||
{
|
||||
foreach( $ban['email'] as $entry )
|
||||
{
|
||||
$entry['_checkbox'] = "<input type='checkbox' name='id_{$entry['ban_id']}' value='1' />";
|
||||
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
|
||||
$emails[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/* Banned Names */
|
||||
$names = array();
|
||||
|
||||
if( isset( $ban['name'] ) AND is_array( $ban['name'] ) AND count( $ban['name'] ) )
|
||||
{
|
||||
foreach( $ban['name'] as $entry )
|
||||
{
|
||||
$entry['_checkbox'] = "<input type='checkbox' name='id_{$entry['ban_id']}' value='1' />";
|
||||
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
|
||||
$names[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->banOverview( $ips, $emails, $names );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuilds the ban cache
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function rebuildBanCache()
|
||||
{
|
||||
/* INI */
|
||||
$cache = array();
|
||||
|
||||
/* Get the ban filters */
|
||||
$this->DB->build( array( 'select' => 'ban_content', 'from' => 'banfilters', 'where' => "ban_type='ip' AND ban_nocache=0" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$cache[] = $r['ban_content'];
|
||||
}
|
||||
|
||||
/* Update the cache */
|
||||
$this->cache->setCache( 'banfilters', $cache, array( 'array' => 1 ) );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Ban Filters
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_members_members_banfilters extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_banfilters' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=members&section=banfilters';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=members§ion=banfilters';
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'ban_add':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ban_manage' );
|
||||
$this->banAdd();
|
||||
break;
|
||||
|
||||
case 'ban_delete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ban_remove' );
|
||||
$this->banDelete();
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'ban':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ban_manage' );
|
||||
$this->banOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Pass to CP output hander
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new ban filter
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function banAdd()
|
||||
{
|
||||
/* Error checking */
|
||||
if( ! $this->request['bantext'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ban_entersomething'];
|
||||
$this->banOverview();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check for duplicate */
|
||||
$result = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'banfilters',
|
||||
'where' => "ban_content='{$this->request['bantext']}' and ban_type='{$this->request['bantype']}'"
|
||||
) );
|
||||
|
||||
if ( $result['ban_id'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ban_dupe'];
|
||||
$this->banOverview();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Insert the new ban filter */
|
||||
$this->DB->insert( 'banfilters', array( 'ban_type' => $this->request['bantype'], 'ban_content' => trim( $this->request['bantext'] ), 'ban_date' => time() ) );
|
||||
|
||||
/* Rebuild cacne and bounce */
|
||||
$this->rebuildBanCache();
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['ban_added'];
|
||||
$this->banOverview();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a ban filter
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function banDelete()
|
||||
{
|
||||
/* INI */
|
||||
$ids = array();
|
||||
|
||||
/* Loop through the request fields and find checked ban filters */
|
||||
foreach( $this->request as $key => $value )
|
||||
{
|
||||
if( preg_match( "/^id_(\d+)$/", $key, $match ) )
|
||||
{
|
||||
if( $this->request[ $match[0] ] )
|
||||
{
|
||||
$ids[] = $match[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Clean the array */
|
||||
$ids = IPSLib::cleanIntArray( $ids );
|
||||
|
||||
/* Delete any checked ban filters */
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
$this->DB->delete( 'banfilters', 'ban_id IN(' . implode( ",", $ids ) . ')' );
|
||||
$this->DB->execute();
|
||||
}
|
||||
|
||||
/* Rebuild the cache */
|
||||
$this->rebuildBanCache();
|
||||
|
||||
/* Bounce */
|
||||
$this->registry->output->global_message = $this->lang->words['ban_removed'];
|
||||
$this->banOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the ban overview screen
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function banOverview()
|
||||
{
|
||||
/* INI */
|
||||
$ban = array();
|
||||
|
||||
/* Get ban filters */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'banfilters', 'order' => 'ban_date desc' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$ban[ $r['ban_type'] ][ $r['ban_id'] ] = $r;
|
||||
}
|
||||
|
||||
/* IPs */
|
||||
$ips = array();
|
||||
|
||||
if( isset( $ban['ip'] ) AND is_array( $ban['ip'] ) AND count( $ban['ip'] ) )
|
||||
{
|
||||
foreach( $ban['ip'] as $entry )
|
||||
{
|
||||
$entry['_checkbox'] = "<input type='checkbox' name='id_{$entry['ban_id']}' value='1' />";
|
||||
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
|
||||
$ips[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/* Emails */
|
||||
$emails = array();
|
||||
|
||||
if( isset( $ban['email'] ) AND is_array( $ban['email'] ) AND count( $ban['email'] ) )
|
||||
{
|
||||
foreach( $ban['email'] as $entry )
|
||||
{
|
||||
$entry['_checkbox'] = "<input type='checkbox' name='id_{$entry['ban_id']}' value='1' />";
|
||||
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
|
||||
$emails[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/* Banned Names */
|
||||
$names = array();
|
||||
|
||||
if( isset( $ban['name'] ) AND is_array( $ban['name'] ) AND count( $ban['name'] ) )
|
||||
{
|
||||
foreach( $ban['name'] as $entry )
|
||||
{
|
||||
$entry['_checkbox'] = "<input type='checkbox' name='id_{$entry['ban_id']}' value='1' />";
|
||||
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
|
||||
$names[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->banOverview( $ips, $emails, $names );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuilds the ban cache
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function rebuildBanCache()
|
||||
{
|
||||
/* INI */
|
||||
$cache = array();
|
||||
|
||||
/* Get the ban filters */
|
||||
$this->DB->build( array( 'select' => 'ban_content', 'from' => 'banfilters', 'where' => "ban_type='ip' AND ban_nocache=0" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$cache[] = $r['ban_content'];
|
||||
}
|
||||
|
||||
/* Update the cache */
|
||||
$this->cache->setCache( 'banfilters', $cache, array( 'array' => 1 ) );
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Define the default members section
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @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 $Rev: 4948 $
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Configure default notification options
|
||||
* Last Updated: $Date: 2010-06-17 21:29:47 -0400 (Thu, 17 Jun 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6553 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_members_members_notifications extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
|
||||
/**
|
||||
* Notifications library
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $notifyLibrary;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_notifications' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=members&section=notifications';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=members§ion=notifications';
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Permissions config
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'configure_notifications' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Notifications library
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
|
||||
$this->notifyLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
//-----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'save':
|
||||
$this->saveDefaults();
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'show':
|
||||
$this->showDefaults();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Pass to CP output hander
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show form to configure notification default options
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function showDefaults()
|
||||
{
|
||||
$_configOptions = $this->notifyLibrary->getNotificationData();
|
||||
$_notifyConfig = $this->notifyLibrary->getDefaultNotificationConfig();
|
||||
|
||||
$this->registry->output->html .= $this->html->showConfigurationOptions( $_configOptions, $_notifyConfig );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save default notification configuration
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function saveDefaults()
|
||||
{
|
||||
$_configOptions = $this->notifyLibrary->getNotificationData();
|
||||
$_notifyConfig = $this->notifyLibrary->getDefaultNotificationConfig();
|
||||
$_noPrivateMessage = array( 'new_private_message', 'reply_private_message' );
|
||||
|
||||
foreach( $_configOptions as $option )
|
||||
{
|
||||
$_notifyConfig[ $option['key'] ] = array();
|
||||
$_notifyConfig[ $option['key'] ]['selected'] = ( is_array($this->request['default_' . $option['key'] ]) AND count($this->request['default_' . $option['key'] ]) ) ? $this->request['default_' . $option['key'] ] : array();
|
||||
$_notifyConfig[ $option['key'] ]['disabled'] = ( is_array($this->request['disabled_' . $option['key'] ]) AND count($this->request['disabled_' . $option['key'] ]) ) ? $this->request['disabled_' . $option['key'] ] : array();
|
||||
$_notifyConfig[ $option['key'] ]['disable_override'] = intval($this->request['disable_override_' . $option['key'] ]);
|
||||
|
||||
/**
|
||||
* @link http://community.invisionpower.com/tracker/issue-23453-notification-defaults/
|
||||
*/
|
||||
if( in_array( $option['key'], $_noPrivateMessage ) AND in_array( 'pm', $_notifyConfig[ $option['key'] ]['selected'] ) )
|
||||
{
|
||||
$_newSelected = array();
|
||||
|
||||
foreach( $_notifyConfig[ $option['key'] ]['selected'] as $_v )
|
||||
{
|
||||
if( $_v != 'pm' )
|
||||
{
|
||||
$_newSelected[] = $_v;
|
||||
}
|
||||
}
|
||||
|
||||
$_notifyConfig[ $option['key'] ]['selected'] = $_newSelected;
|
||||
}
|
||||
}
|
||||
|
||||
$this->notifyLibrary->saveNotificationConfig( $_notifyConfig );
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['notificationconfig_saved'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
|
||||
}
|
||||
}
|
||||
@@ -1,334 +1,336 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Member management
|
||||
* Last Updated: $Date: 2009-10-01 10:02:08 -0400 (Thu, 01 Oct 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Revision: 5190 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
class admin_members_members_ranks extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
|
||||
/**
|
||||
* Editor object
|
||||
*
|
||||
* @access private
|
||||
* @var object Editor library
|
||||
*/
|
||||
private $han_editor;
|
||||
|
||||
/**
|
||||
* Trash can forum id
|
||||
*
|
||||
* @access private
|
||||
* @var integer Trash can forum
|
||||
*/
|
||||
private $trash_forum = 0;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_ranks');
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=members&section=ranks';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=members§ion=ranks';
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member' ) );
|
||||
|
||||
///-----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'title':
|
||||
$this->_titlesStart();
|
||||
break;
|
||||
|
||||
case 'rank_edit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_edit' );
|
||||
$this->_titlesForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'rank_add':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_add' );
|
||||
$this->_titlesForm( 'add' );
|
||||
break;
|
||||
|
||||
case 'do_add_rank':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_add' );
|
||||
$this->_titlesSave( 'add' );
|
||||
break;
|
||||
|
||||
case 'do_rank_edit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_edit' );
|
||||
$this->_titlesSave( 'edit' );
|
||||
break;
|
||||
|
||||
case 'rank_delete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_delete' );
|
||||
$this->_titlesDelete();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Pass to CP output hander
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper();
|
||||
$this->registry->getClass('output')->sendOutput();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Recache ranks
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function titlesRecache()
|
||||
{
|
||||
$ranks = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'id, title, pips, posts',
|
||||
'from' => 'titles',
|
||||
'order' => 'posts DESC',
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $i = $this->DB->fetch() )
|
||||
{
|
||||
$ranks[ $i['id'] ] = array(
|
||||
'TITLE' => $i['title'],
|
||||
'PIPS' => $i['pips'],
|
||||
'POSTS' => $i['posts'],
|
||||
);
|
||||
}
|
||||
|
||||
$this->cache->setCache( 'ranks', $ranks, array( 'array' => 1 ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Overview page
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _titlesStart()
|
||||
{
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['member_rank_nav'] );
|
||||
|
||||
$titles = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse macro
|
||||
//-----------------------------------------
|
||||
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_replacements', 'where' => "replacement_set_id=0 AND replacement_key='pip_pip'" ) );
|
||||
|
||||
$row['A_STAR'] = str_replace( "{style_image_url}", $this->settings['img_url'], $row['replacement_content'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Lets get on with it...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'titles', 'order' => "posts" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['A_STAR'] = $row['A_STAR'];
|
||||
$titles[] = $r;
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->html->titlesOverview( $titles );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save rank [add/edit]
|
||||
*
|
||||
* @access protected
|
||||
* @param string 'add' or 'edit'
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _titlesSave( $type = 'add' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// check for input
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( array( 'title', 'pips' ) as $field )
|
||||
{
|
||||
if ( ! isset( $this->request[ $field ] ) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['rnk_completeform'], 11239 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->request['pips'] > 100 )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['rnk_max100'], 11240 );
|
||||
}
|
||||
|
||||
if( $type == 'add' )
|
||||
{
|
||||
$this->DB->insert( 'titles', array(
|
||||
'posts' => intval( trim( $this->request['posts'] ) ),
|
||||
'title' => trim($this->request['title']),
|
||||
'pips' => trim($this->request['pips']),
|
||||
) );
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_added'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !$this->request['id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['rnk_notfound'], 11241 );
|
||||
}
|
||||
|
||||
$this->DB->update( 'titles', array ( 'posts' => trim($this->request['posts']),
|
||||
'title' => trim($this->request['title']),
|
||||
'pips' => trim($this->request['pips']),
|
||||
) , "id=" . intval( $this->request['id'] ) );
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_edit'] );
|
||||
}
|
||||
|
||||
$this->titlesRecache();
|
||||
|
||||
if( $type == 'add' )
|
||||
{
|
||||
$this->registry->output->doneScreen($this->lang->words['rnk_added2'], $this->lang->words['rnk_rankcontrol'], "{$this->form_code}&do=title", 'redirect' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->doneScreen($this->lang->words['rnk_edited'], $this->lang->words['rnk_rankcontrol'], "{$this->form_code}&do=title", 'redirect' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a rank
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _titlesDelete()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// check for input
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->request['id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['rnk_notfounddel'], 11242 );
|
||||
}
|
||||
|
||||
$this->DB->delete( 'titles', "id=" . intval($this->request['id']) );
|
||||
|
||||
$this->titlesRecache();
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_removed'] );
|
||||
|
||||
$this->registry->output->doneScreen($this->lang->words['rnk_removed2'], $this->lang->words['rnk_rankcontrol'], "{$this->form_code}&do=title", 'redirect' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the form to add/edit a rank
|
||||
*
|
||||
* @access protected
|
||||
* @param string Type of form (add|edit)
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _titlesForm( $mode='edit' )
|
||||
{
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['rnk_setup'] );
|
||||
|
||||
if ( $mode == 'edit' )
|
||||
{
|
||||
$form_code = 'do_rank_edit';
|
||||
|
||||
if ( !$this->request['id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['rnk_notfound'], 11243 );
|
||||
}
|
||||
|
||||
$rank = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'titles', 'where' => "id=" . intval($this->request['id']) ) );
|
||||
|
||||
$button = $this->lang->words['rnk_editrank'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$form_code = 'do_add_rank';
|
||||
|
||||
$rank = array( 'posts' => '', 'title' => "", 'pips' => "");
|
||||
|
||||
$button = $this->lang->words['rnk_addrank'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->titlesForm( $rank, $form_code, $button );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Member management
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
class admin_members_members_ranks extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
|
||||
/**
|
||||
* Editor object
|
||||
*
|
||||
* @access private
|
||||
* @var object Editor library
|
||||
*/
|
||||
private $han_editor;
|
||||
|
||||
/**
|
||||
* Trash can forum id
|
||||
*
|
||||
* @access private
|
||||
* @var integer Trash can forum
|
||||
*/
|
||||
private $trash_forum = 0;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_ranks');
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=members&section=ranks';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=members§ion=ranks';
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member' ) );
|
||||
|
||||
///-----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'title':
|
||||
$this->_titlesStart();
|
||||
break;
|
||||
|
||||
case 'rank_edit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_edit' );
|
||||
$this->_titlesForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'rank_add':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_add' );
|
||||
$this->_titlesForm( 'add' );
|
||||
break;
|
||||
|
||||
case 'do_add_rank':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_add' );
|
||||
$this->_titlesSave( 'add' );
|
||||
break;
|
||||
|
||||
case 'do_rank_edit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_edit' );
|
||||
$this->_titlesSave( 'edit' );
|
||||
break;
|
||||
|
||||
case 'rank_delete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_delete' );
|
||||
$this->_titlesDelete();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Pass to CP output hander
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper();
|
||||
$this->registry->getClass('output')->sendOutput();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Recache ranks
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function titlesRecache()
|
||||
{
|
||||
$ranks = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'id, title, pips, posts',
|
||||
'from' => 'titles',
|
||||
'order' => 'posts DESC',
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $i = $this->DB->fetch() )
|
||||
{
|
||||
$ranks[ $i['id'] ] = array(
|
||||
'TITLE' => $i['title'],
|
||||
'PIPS' => $i['pips'],
|
||||
'POSTS' => $i['posts'],
|
||||
);
|
||||
}
|
||||
|
||||
$this->cache->setCache( 'ranks', $ranks, array( 'array' => 1 ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Overview page
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _titlesStart()
|
||||
{
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['member_rank_nav'] );
|
||||
|
||||
$titles = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse macro
|
||||
//-----------------------------------------
|
||||
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_replacements', 'where' => "replacement_set_id=0 AND replacement_key='pip_pip'" ) );
|
||||
|
||||
$row['A_STAR'] = str_replace( "{style_image_url}", $this->settings['img_url'], $row['replacement_content'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Lets get on with it...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'titles', 'order' => "posts" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['A_STAR'] = $row['A_STAR'];
|
||||
$titles[] = $r;
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->html->titlesOverview( $titles );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save rank [add/edit]
|
||||
*
|
||||
* @access protected
|
||||
* @param string 'add' or 'edit'
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _titlesSave( $type = 'add' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// check for input
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( array( 'title', 'pips' ) as $field )
|
||||
{
|
||||
if ( ! isset( $this->request[ $field ] ) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['rnk_completeform'], 11239 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->request['pips'] > 100 )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['rnk_max100'], 11240 );
|
||||
}
|
||||
|
||||
if( $type == 'add' )
|
||||
{
|
||||
$this->DB->insert( 'titles', array(
|
||||
'posts' => intval( trim( $this->request['posts'] ) ),
|
||||
'title' => trim($this->request['title']),
|
||||
'pips' => trim($this->request['pips']),
|
||||
) );
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_added'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !$this->request['id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['rnk_notfound'], 11241 );
|
||||
}
|
||||
|
||||
$this->DB->update( 'titles', array ( 'posts' => trim($this->request['posts']),
|
||||
'title' => trim($this->request['title']),
|
||||
'pips' => trim($this->request['pips']),
|
||||
) , "id=" . intval( $this->request['id'] ) );
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_edit'] );
|
||||
}
|
||||
|
||||
$this->titlesRecache();
|
||||
|
||||
if( $type == 'add' )
|
||||
{
|
||||
$this->registry->output->doneScreen($this->lang->words['rnk_added2'], $this->lang->words['rnk_rankcontrol'], "{$this->form_code}&do=title", 'redirect' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->doneScreen($this->lang->words['rnk_edited'], $this->lang->words['rnk_rankcontrol'], "{$this->form_code}&do=title", 'redirect' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a rank
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _titlesDelete()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// check for input
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->request['id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['rnk_notfounddel'], 11242 );
|
||||
}
|
||||
|
||||
$this->DB->delete( 'titles', "id=" . intval($this->request['id']) );
|
||||
|
||||
$this->titlesRecache();
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_removed'] );
|
||||
|
||||
$this->registry->output->doneScreen($this->lang->words['rnk_removed2'], $this->lang->words['rnk_rankcontrol'], "{$this->form_code}&do=title", 'redirect' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the form to add/edit a rank
|
||||
*
|
||||
* @access protected
|
||||
* @param string Type of form (add|edit)
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _titlesForm( $mode='edit' )
|
||||
{
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['rnk_setup'] );
|
||||
|
||||
if ( $mode == 'edit' )
|
||||
{
|
||||
$form_code = 'do_rank_edit';
|
||||
|
||||
if ( !$this->request['id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['rnk_notfound'], 11243 );
|
||||
}
|
||||
|
||||
$rank = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'titles', 'where' => "id=" . intval($this->request['id']) ) );
|
||||
|
||||
$button = $this->lang->words['rnk_editrank'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$form_code = 'do_add_rank';
|
||||
|
||||
$rank = array( 'posts' => '', 'title' => "", 'pips' => "");
|
||||
|
||||
$button = $this->lang->words['rnk_addrank'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->titlesForm( $rank, $form_code, $button );
|
||||
}
|
||||
}
|
||||
@@ -1,299 +1,301 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Reputation System
|
||||
* Last Updated: $Date: 2009-10-01 10:02:08 -0400 (Thu, 01 Oct 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 5190 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
class admin_members_members_reputation extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Skin & Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_reputation' );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ) );
|
||||
|
||||
/* URL Bits */
|
||||
$this->form_code = $this->html->form_code = 'module=members&section=reputation';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=members§ion=reputation';
|
||||
|
||||
/* What to do */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'add_level_form':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
|
||||
$this->levelForm( 'add' );
|
||||
break;
|
||||
|
||||
case 'do_add_level':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
|
||||
$this->doLevelForm( 'add' );
|
||||
break;
|
||||
|
||||
case 'edit_level_form':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
|
||||
$this->levelForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'do_edit_level':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
|
||||
$this->doLevelForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'delete_level':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_delete' );
|
||||
$this->deleteLevel();
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'overview':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
|
||||
$this->reputationOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuilds the reputation level cache
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function rebuildReputationLevelCache()
|
||||
{
|
||||
/* Cache */
|
||||
$cache = array();
|
||||
|
||||
/* Query the levels */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'reputation_levels', 'order' => 'level_points DESC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$cache[] = $r;
|
||||
}
|
||||
|
||||
/* Update the cache */
|
||||
$this->cache->setCache( 'reputation_levels', $cache, array( 'array' => 1 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the selected reputation level
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteLevel()
|
||||
{
|
||||
/* ID */
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
if( ! $id )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['invalid_id'], 11244 );
|
||||
}
|
||||
|
||||
/* Delete */
|
||||
$this->DB->delete( 'reputation_levels', "level_id={$id}" );
|
||||
$this->rebuildReputationLevelCache();
|
||||
|
||||
/* Redirect */
|
||||
$this->registry->output->doneScreen( $this->lang->words['rep_level_removed'], $this->lang->words['rep_management'], $this->form_code, 'redirect' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the add/edit reputation level form
|
||||
*
|
||||
* @access public
|
||||
* @param string $mode Either add or edit
|
||||
* @return void
|
||||
*/
|
||||
public function doLevelForm( $mode='add' )
|
||||
{
|
||||
/* Error Checking */
|
||||
$errors = array();
|
||||
|
||||
if( ! $this->request['level_title'] && ! $this->request['level_image'] )
|
||||
{
|
||||
$errors[] = $this->lang->words['rep_no_title_img'];
|
||||
}
|
||||
|
||||
if( count( $errors ) )
|
||||
{
|
||||
$this->levelForm( $mode, $errors );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Build the data array */
|
||||
$data = array(
|
||||
'level_title' => $this->request['level_title'],
|
||||
'level_image' => $this->request['level_image'],
|
||||
'level_points' => intval( $this->request['level_points'] )
|
||||
);
|
||||
|
||||
/* Add the level */
|
||||
if( $mode == 'add' )
|
||||
{
|
||||
/* Insert */
|
||||
$this->DB->insert( 'reputation_levels', $data );
|
||||
$this->rebuildReputationLevelCache();
|
||||
|
||||
/* Redirect */
|
||||
$this->registry->output->doneScreen( $this->lang->words['rep_level_added'], $this->lang->words['rep_management'], $this->form_code, 'redirect' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* ID Check */
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
if( ! $id )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['invalid_id'], 11245 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->DB->update( 'reputation_levels', $data, "level_id={$id}" );
|
||||
$this->rebuildReputationLevelCache();
|
||||
|
||||
/* Redirect */
|
||||
$this->registry->output->doneScreen( $this->lang->words['rep_level_edited'], $this->lang->words['rep_management'], $this->form_code, 'redirect' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Form for adding/exiting reputation levels
|
||||
*
|
||||
* @access public
|
||||
* @param string $mode Either add or edit
|
||||
* @param array $errors Array of error messages to display
|
||||
* @return void
|
||||
*/
|
||||
public function levelForm( $mode='add', $errors=array() )
|
||||
{
|
||||
/* Add Level Form */
|
||||
if( $mode == 'add' )
|
||||
{
|
||||
/* ID */
|
||||
$id = 0;
|
||||
|
||||
/* Data */
|
||||
$data = array();
|
||||
|
||||
/* Text Bits */
|
||||
$title = $this->lang->words['rep_form_add_title'];
|
||||
$do = 'do_add_level';
|
||||
}
|
||||
/* Edit Level Form */
|
||||
else
|
||||
{
|
||||
/* ID */
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
if( ! $id )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['invalid_id'], 11246 );
|
||||
}
|
||||
|
||||
/* Data */
|
||||
$data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'reputation_levels', 'where' => 'level_id=' . $id ) );
|
||||
|
||||
/* Text Bits */
|
||||
$title = $this->lang->words['rep_form_edit_title'];
|
||||
$do = 'do_edit_level';
|
||||
}
|
||||
|
||||
/* Default Values */
|
||||
$data['level_title'] = isset( $this->request['level_title'] ) ? $this->request['level_title'] : $data['level_title'];
|
||||
$data['level_image'] = isset( $this->request['level_image'] ) ? $this->request['level_image'] : $data['level_image'];
|
||||
$data['level_points'] = isset( $this->request['level_points'] ) ? $this->request['level_points'] : $data['level_points'];
|
||||
|
||||
/* Form Elements */
|
||||
$form = array();
|
||||
|
||||
$form['level_title'] = $this->registry->output->formInput( 'level_title' , $data['level_title'] );
|
||||
$form['level_image'] = $this->registry->output->formInput( 'level_image' , $data['level_image'] );
|
||||
$form['level_points'] = $this->registry->output->formInput( 'level_points', $data['level_points'] );
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->reputationForm( $id, $do, $title, $form, $errors );
|
||||
}
|
||||
|
||||
/**
|
||||
* Reputation overview
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function reputationOverview()
|
||||
{
|
||||
/* INIT */
|
||||
$levels = array();
|
||||
|
||||
/* Query Levels */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'reputation_levels', 'order' => 'level_points ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['level_image'] = $r['level_image'] ? "<img src='{$this->settings['public_dir']}style_extra/reputation_icons/{$r['level_image']}'>" : '';
|
||||
|
||||
$levels[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->reputationOverview( $levels );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Reputation System
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
class admin_members_members_reputation extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Skin & Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_reputation' );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ) );
|
||||
|
||||
/* URL Bits */
|
||||
$this->form_code = $this->html->form_code = 'module=members&section=reputation';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=members§ion=reputation';
|
||||
|
||||
/* What to do */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'add_level_form':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
|
||||
$this->levelForm( 'add' );
|
||||
break;
|
||||
|
||||
case 'do_add_level':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
|
||||
$this->doLevelForm( 'add' );
|
||||
break;
|
||||
|
||||
case 'edit_level_form':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
|
||||
$this->levelForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'do_edit_level':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
|
||||
$this->doLevelForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'delete_level':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_delete' );
|
||||
$this->deleteLevel();
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'overview':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
|
||||
$this->reputationOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuilds the reputation level cache
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function rebuildReputationLevelCache()
|
||||
{
|
||||
/* Cache */
|
||||
$cache = array();
|
||||
|
||||
/* Query the levels */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'reputation_levels', 'order' => 'level_points DESC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$cache[] = $r;
|
||||
}
|
||||
|
||||
/* Update the cache */
|
||||
$this->cache->setCache( 'reputation_levels', $cache, array( 'array' => 1 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the selected reputation level
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteLevel()
|
||||
{
|
||||
/* ID */
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
if( ! $id )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['invalid_id'], 11244 );
|
||||
}
|
||||
|
||||
/* Delete */
|
||||
$this->DB->delete( 'reputation_levels', "level_id={$id}" );
|
||||
$this->rebuildReputationLevelCache();
|
||||
|
||||
/* Redirect */
|
||||
$this->registry->output->doneScreen( $this->lang->words['rep_level_removed'], $this->lang->words['rep_management'], $this->form_code, 'redirect' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the add/edit reputation level form
|
||||
*
|
||||
* @access public
|
||||
* @param string $mode Either add or edit
|
||||
* @return void
|
||||
*/
|
||||
public function doLevelForm( $mode='add' )
|
||||
{
|
||||
/* Error Checking */
|
||||
$errors = array();
|
||||
|
||||
if( ! $this->request['level_title'] && ! $this->request['level_image'] )
|
||||
{
|
||||
$errors[] = $this->lang->words['rep_no_title_img'];
|
||||
}
|
||||
|
||||
if( count( $errors ) )
|
||||
{
|
||||
$this->levelForm( $mode, $errors );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Build the data array */
|
||||
$data = array(
|
||||
'level_title' => $this->request['level_title'],
|
||||
'level_image' => $this->request['level_image'],
|
||||
'level_points' => intval( $this->request['level_points'] )
|
||||
);
|
||||
|
||||
/* Add the level */
|
||||
if( $mode == 'add' )
|
||||
{
|
||||
/* Insert */
|
||||
$this->DB->insert( 'reputation_levels', $data );
|
||||
$this->rebuildReputationLevelCache();
|
||||
|
||||
/* Redirect */
|
||||
$this->registry->output->doneScreen( $this->lang->words['rep_level_added'], $this->lang->words['rep_management'], $this->form_code, 'redirect' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* ID Check */
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
if( ! $id )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['invalid_id'], 11245 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->DB->update( 'reputation_levels', $data, "level_id={$id}" );
|
||||
$this->rebuildReputationLevelCache();
|
||||
|
||||
/* Redirect */
|
||||
$this->registry->output->doneScreen( $this->lang->words['rep_level_edited'], $this->lang->words['rep_management'], $this->form_code, 'redirect' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Form for adding/exiting reputation levels
|
||||
*
|
||||
* @access public
|
||||
* @param string $mode Either add or edit
|
||||
* @param array $errors Array of error messages to display
|
||||
* @return void
|
||||
*/
|
||||
public function levelForm( $mode='add', $errors=array() )
|
||||
{
|
||||
/* Add Level Form */
|
||||
if( $mode == 'add' )
|
||||
{
|
||||
/* ID */
|
||||
$id = 0;
|
||||
|
||||
/* Data */
|
||||
$data = array();
|
||||
|
||||
/* Text Bits */
|
||||
$title = $this->lang->words['rep_form_add_title'];
|
||||
$do = 'do_add_level';
|
||||
}
|
||||
/* Edit Level Form */
|
||||
else
|
||||
{
|
||||
/* ID */
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
if( ! $id )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['invalid_id'], 11246 );
|
||||
}
|
||||
|
||||
/* Data */
|
||||
$data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'reputation_levels', 'where' => 'level_id=' . $id ) );
|
||||
|
||||
/* Text Bits */
|
||||
$title = $this->lang->words['rep_form_edit_title'];
|
||||
$do = 'do_edit_level';
|
||||
}
|
||||
|
||||
/* Default Values */
|
||||
$data['level_title'] = isset( $this->request['level_title'] ) ? $this->request['level_title'] : $data['level_title'];
|
||||
$data['level_image'] = isset( $this->request['level_image'] ) ? $this->request['level_image'] : $data['level_image'];
|
||||
$data['level_points'] = isset( $this->request['level_points'] ) ? $this->request['level_points'] : $data['level_points'];
|
||||
|
||||
/* Form Elements */
|
||||
$form = array();
|
||||
|
||||
$form['level_title'] = $this->registry->output->formInput( 'level_title' , $data['level_title'] );
|
||||
$form['level_image'] = $this->registry->output->formInput( 'level_image' , $data['level_image'] );
|
||||
$form['level_points'] = $this->registry->output->formInput( 'level_points', $data['level_points'] );
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->reputationForm( $id, $do, $title, $form, $errors );
|
||||
}
|
||||
|
||||
/**
|
||||
* Reputation overview
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function reputationOverview()
|
||||
{
|
||||
/* INIT */
|
||||
$levels = array();
|
||||
|
||||
/* Query Levels */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'reputation_levels', 'order' => 'level_points ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['level_image'] = $r['level_image'] ? "<img src='{$this->settings['public_dir']}style_extra/reputation_icons/{$r['level_image']}'>" : '';
|
||||
|
||||
$levels[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->reputationOverview( $levels );
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -14,28 +14,35 @@
|
||||
<subitem>
|
||||
<subitemtitle>Список неактивированных</subitemtitle>
|
||||
<subsection>tools</subsection>
|
||||
<subitemurl>do=validating</subitemurl>
|
||||
<subitemurl>section=tools&do=validating</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
<subitem>
|
||||
<subitemtitle>Список заблокированных</subitemtitle>
|
||||
<subsection>tools</subsection>
|
||||
<subitemurl>do=locked</subitemurl>
|
||||
<subitemurl>section=tools&do=locked</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
<subitem>
|
||||
<subitemtitle>Список забаненных</subitemtitle>
|
||||
<subsection>tools</subsection>
|
||||
<subitemurl>do=banned</subitemurl>
|
||||
<subitemurl>section=tools&do=banned</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
<subitem>
|
||||
<subitemtitle>Список спамеров</subitemtitle>
|
||||
<subsection>tools</subsection>
|
||||
<subitemurl>do=spam</subitemurl>
|
||||
<subitemurl>section=tools&do=spam</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
<subitem>
|
||||
<subitemtitle>Список не завершивших регистрацию</subitemtitle>
|
||||
<subsection>members</subsection>
|
||||
<subitemurl>section=tools&do=incomplete</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
@@ -131,6 +138,19 @@
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Настройки уведомлений</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Настройки уведомлений</subitemtitle>
|
||||
<subsection>notifications</subsection>
|
||||
<subitemurl></subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
</tabitems>
|
||||
</menu>
|
||||
@@ -118,6 +118,10 @@
|
||||
<group>
|
||||
<grouptitle>Дополнительные поля</grouptitle>
|
||||
<items>
|
||||
<item>
|
||||
<key>profilefields_global</key>
|
||||
<string>Can access custom profile fields management?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>profilefields_add</key>
|
||||
<string>Может добавлять новые?</string>
|
||||
@@ -158,4 +162,13 @@
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Уведомления</grouptitle>
|
||||
<items>
|
||||
<item>
|
||||
<key>configure_notifications</key>
|
||||
<string>Может настраивать уведомления?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
</permissions>
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Define the default restrictions section
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @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 $Rev: 4948 $
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user