Version 3.3.4

This commit is contained in:
Neo committed 2025-12-19 00:35:52 -08:00
1 parent 78706903a2
commit fb6b5baabc
2206 files changed
+409828 -382984

No files matched your search

@@ -1,226 +1,246 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Template comparison
* Last Updated: $Date: 2011-07-12 10:53:25 -0400 (Tue, 12 Jul 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since Friday 19th May 2006 17:33
* @version $Revision: 9208 $
*/
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 admin_core_ajax_compare extends ipsAjaxCommand
{
/**
* Skin functions object handle
*
* @var object
*/
protected $skinFunctions;
/**
* HTML Skin object
*
* @var object
*/
protected $html;
/**
* Main executable
*
* @param object registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load functions and cache classes
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/
$this->skinFunctions = new skinDifferences( $registry );
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_templates');
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'css':
$this->_getCssDifferences();
break;
default:
case 'differences':
$this->_getDifferences();
break;
}
}
/**
* Get differences of a CSS file
*
* @return @e void
*/
protected function _getCssDifferences()
{
//-----------------------------------------
// Init
//-----------------------------------------
$setID = intval($this->request['setID']);
$fileID = intval($this->request['file_id']);
//-----------------------------------------
// Get requested
//-----------------------------------------
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => 'css_id=' . $fileID ) );
if( $current['css_id'] )
{
//-----------------------------------------
// Get the original
//-----------------------------------------
$set = $this->DB->buildAndFetch( array( 'select' => 'set_master_key', 'from' => 'skin_collections', 'where' => 'set_id=' . $current['css_set_id'] ) );
$set['set_master_key'] = $set['set_master_key'] ? $set['set_master_key'] : 'root';
$original = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => "css_set_id=0 AND css_master_key='{$set['set_master_key']}' AND css_group='{$current['css_group']}'" ) );
}
else
{
$original['css_content'] = $current['css_content'];
}
//-----------------------------------------
// Get Diff library
//-----------------------------------------
require_once( IPS_KERNEL_PATH . 'classDifference.php' );/*noLibHook*/
$classDifference = new classDifference();
$classDifference->method = 'PHP';
$difference = $classDifference->getDifferences( $original['css_content'], $current['css_content'] );
if( $classDifference->diff_found )
{
$difference = str_replace( "\n", "<br>", $difference );
$difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference );
$difference = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", "&nbsp;" ,$difference );
$difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference );
}
else
{
$difference = htmlspecialchars($current['css_content']);
$difference = str_replace( ' ', '&nbsp;', $difference );
$difference = str_replace( "\r", '<br />', $difference );
$difference = str_replace( "\n", '<br />', $difference );
$difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference );
$difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference );
}
$this->returnHtml( $this->html->differenceResult( $difference ) );
}
/**
* Get differences of a template
*
* @return @e void
*/
protected function _getDifferences()
{
//-----------------------------------------
// Init
//-----------------------------------------
$setID = intval($this->request['setID']);
$templateID = intval($this->request['template_id']);
//-----------------------------------------
// Get requested
//-----------------------------------------
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => 'template_id=' . $templateID ) );
if( $current['template_set_id'] )
{
//-----------------------------------------
// Get the original
//-----------------------------------------
$set = $this->DB->buildAndFetch( array( 'select' => 'set_master_key', 'from' => 'skin_collections', 'where' => 'set_id=' . $current['template_set_id'] ) );
$set['set_master_key'] = $set['set_master_key'] ? $set['set_master_key'] : 'root';
$original = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "template_set_id=0 AND template_master_key='{$set['set_master_key']}' AND template_group='{$current['template_group']}' AND template_name='{$current['template_name']}'" ) );
}
else
{
$original['template_content'] = $current['template_content'];
}
//-----------------------------------------
// Get Diff library
//-----------------------------------------
require_once( IPS_KERNEL_PATH . 'classDifference.php' );/*noLibHook*/
$classDifference = new classDifference();
$classDifference->method = 'PHP';
$difference = $classDifference->getDifferences( $original['template_content'], $current['template_content'] );
if( $classDifference->diff_found )
{
$difference = str_replace( "\n", "<br>", $difference );
$difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference );
$difference = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", "&nbsp;" ,$difference );
$difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference );
}
else
{
$difference = htmlspecialchars($current['template_content']);
$difference = str_replace( ' ', '&nbsp;', $difference );
$difference = str_replace( "\r", '<br />', $difference );
$difference = str_replace( "\n", '<br />', $difference );
$difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference );
$difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference );
}
$this->returnHtml( $this->html->differenceResult( $difference ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Template comparison
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33
* @version $Revision: 10914 $
*/
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 admin_core_ajax_compare extends ipsAjaxCommand
{
/**
* Skin functions object handle
*
* @var object
*/
protected $skinFunctions;
/**
* HTML Skin object
*
* @var object
*/
protected $html;
/**
* Main executable
*
* @param object registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load functions and cache classes
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/
$this->skinFunctions = new skinDifferences( $registry );
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_templates');
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'css':
$this->_getCssDifferences();
break;
default:
case 'differences':
$this->_getDifferences();
break;
}
}
/**
* Get differences of a CSS file
*
* @return @e void
*/
protected function _getCssDifferences()
{
//-----------------------------------------
// Init
//-----------------------------------------
$setID = intval($this->request['setID']);
$fileID = intval($this->request['file_id']);
//-----------------------------------------
// Get requested
//-----------------------------------------
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => 'css_id=' . $fileID ) );
if( $current['css_id'] )
{
//-----------------------------------------
// Get the original
//-----------------------------------------
$set = $this->DB->buildAndFetch( array( 'select' => 'set_master_key', 'from' => 'skin_collections', 'where' => 'set_id=' . $current['css_set_id'] ) );
$set['set_master_key'] = $set['set_master_key'] ? $set['set_master_key'] : 'root';
$original = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => "css_set_id=0 AND css_master_key='{$set['set_master_key']}' AND css_group='{$current['css_group']}'" ) );
}
else
{
$original['css_content'] = $current['css_content'];
}
//-----------------------------------------
// Get Diff library
//-----------------------------------------
require_once( IPS_KERNEL_PATH . 'classDifference.php' );/*noLibHook*/
$classDifference = new classDifference();
$classDifference->method = 'PHP';
$difference = $classDifference->getDifferences( $original['css_content'], $current['css_content'] );
if( $classDifference->diff_found )
{
$difference = str_replace( "\n", "<br>", $difference );
$difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference );
$difference = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", "&nbsp;" ,$difference );
$difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference );
}
else
{
$difference = htmlspecialchars($current['css_content']);
$difference = str_replace( ' ', '&nbsp;', $difference );
$difference = str_replace( "\r", '<br />', $difference );
$difference = str_replace( "\n", '<br />', $difference );
$difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference );
$difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference );
}
$this->returnHtml( $this->html->differenceResult( $difference ) );
}
/**
* Get differences of a template
*
* @return @e void
*/
protected function _getDifferences()
{
//-----------------------------------------
// Init
//-----------------------------------------
$setID = intval($this->request['setID']);
$templateID = intval($this->request['template_id']);
//-----------------------------------------
// Get requested
//-----------------------------------------
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => 'template_id=' . $templateID ) );
if( $current['template_set_id'] )
{
//-----------------------------------------
// Get the original
//-----------------------------------------
$set = $this->DB->buildAndFetch( array( 'select' => 'set_master_key', 'from' => 'skin_collections', 'where' => 'set_id=' . $current['template_set_id'] ) );
$set['set_master_key'] = $set['set_master_key'] ? $set['set_master_key'] : 'root';
$original = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "template_set_id=0 AND template_master_key='{$set['set_master_key']}' AND template_group='{$current['template_group']}' AND template_name='{$current['template_name']}'" ) );
}
else
{
$original['template_content'] = $current['template_content'];
}
//-----------------------------------------
// Get Diff library
//-----------------------------------------
require_once( IPS_KERNEL_PATH . 'classDifference.php' );/*noLibHook*/
$classDifference = new classDifference();
$classDifference->method = 'PHP';
$difference = $classDifference->getDifferences( $original['template_content'], $current['template_content'], 'unified' );
if ( 1 == 1 )
{
$difference = str_replace( array( "\r\n", "\r" ), "\n", $difference );
$difference = preg_replace( '#(^|\n)(\-|\+)([^\n]+?)\n#', "\n\\1\\2\\3\n\n", $difference );
$difference = htmlspecialchars( $difference );
$difference = preg_replace( '#^@@([^@]+?)@@#m', '', $difference );
$difference = preg_replace( '#(^|\n)\-([^\n]+?)\n#', "\\1<del>\\2</del>\n", $difference );
$difference = preg_replace( '#(^|\n)\+([^\n]+?)\n#', "\\1<ins>\\2</ins>\n", $difference );
$difference = str_replace( "</ins>\n\n", "</ins>\n", $difference );
$difference = str_replace( "</del>\n", '</del>', $difference );
$difference = str_replace( "\n\n<ins>", "\n<ins>", $difference );
$difference = str_replace( "\n\n<del>", "\n<del>", $difference );
$difference = '<pre>' . $difference . '</pre>';
}
else
{
if( $classDifference->diff_found )
{
$difference = str_replace( "\n", "<br>", $difference );
$difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference );
$difference = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", "&nbsp;" ,$difference );
$difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference );
}
else
{
$difference = htmlspecialchars($current['template_content']);
$difference = str_replace( ' ', '&nbsp;', $difference );
$difference = str_replace( "\r", '<br />', $difference );
$difference = str_replace( "\n", '<br />', $difference );
$difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference );
$difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference );
}
}
$this->returnHtml( $this->html->differenceResult( $difference ) );
}
}
@@ -1,274 +1,274 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* AJAX Functions For applications/core/js/ipb3CSS.js file
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since Friday 19th May 2006 17:33
* @version $Revision: 8644 $
*/
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 admin_core_ajax_css extends ipsAjaxCommand
{
/**
* Skin functions object handle
*
* @var object
*/
protected $skinFunctions;
/**
* Main executable
*
* @param object registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//-----------------------------------------
// Load functions and cache classes
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
$this->skinFunctions = new skinCaching( $registry );
/* Check... */
if ( ! $registry->getClass('class_permissions')->checkPermission( 'css_manage', ipsRegistry::$current_application, 'templates' ) )
{
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
exit();
}
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'getCSSGroups':
$this->_getCSSGroups();
break;
case 'getCSSForEdit':
$this->_getCSSForEdit();
break;
case 'saveCSS':
$this->_saveCSS();
break;
case 'revertCSS':
/* Check... */
if ( !$registry->getClass('class_permissions')->checkPermission( 'css_delete', ipsRegistry::$current_application, 'templates' ) )
{
$this->returnJsonError( $registry->lang->words['sk_ajax_noperm'] );
exit();
}
$this->_revertCSS();
break;
}
}
/**
* Reverts CSS
*
* @return string Json
*/
protected function _revertCSS()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$cssID = intval( $this->request['css_id'] );
$fromDelete = intval( $this->request['fromDelete'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ! $cssID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit();
}
//-----------------------------------------
// Get template data
//-----------------------------------------
$css = $this->skinFunctions->revertCSS( $cssID, $setID, $fromDelete );
$this->returnJsonArray( array( 'cssData' => $css, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
}
/**
* Saves the CSS
*
* @return string Json
*/
protected function _saveCSS()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$cssID = intval( $this->request['css_id'] );
$type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit';
$css_content = $_POST['css_content'];
$css_group = IPSText::alphanumericalClean( $_POST['_css_group'] );
$css_position = intval( $this->request['css_position'] );
$css_attributes = $_POST['css_attributes'];
$css_app = IPSText::alphanumericalClean( $_POST['css_app'] );
$css_app_hide = intval( $this->request['css_app_hide'] );
$css_modules = trim( $this->request['css_modules'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ( $type == 'edit' AND ! $cssID ) )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit();
}
//-----------------------------------------
// Add checks
//-----------------------------------------
if ( $type == 'add' )
{
if ( ! $css_group )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit();
}
}
//-----------------------------------------
// Save it
//-----------------------------------------
if ( $type == 'edit' )
{
$css_id = $this->skinFunctions->saveCSSFromEdit( $cssID, $setID, $css_content, $css_group, $css_position, $css_attributes, $css_app, $css_app_hide, $css_modules );
}
else
{
try
{
$css_id = $this->skinFunctions->saveCSSFromAdd( $setID, $css_content, str_replace( '.css', '', $css_group ), $css_position, $css_attributes, $css_app, $css_app_hide, $css_modules );
}
catch( Exception $err )
{
$this->returnJsonError( $err->getMessage() );
exit();
}
}
//-----------------------------------------
// Get Data
//-----------------------------------------
$css = $this->skinFunctions->fetchCSSForEdit( $css_id, $setID );
$this->returnJsonArray( array( 'cssData' => $css, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
}
/**
* Fetch a JSON list of template data ready for editing
*
* @return string Json
*/
protected function _getCSSForEdit()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$cssID = intval( $this->request['css_id'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ! $cssID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit();
}
//-----------------------------------------
// Get template data
//-----------------------------------------
$css = $this->skinFunctions->fetchCSSForEdit( $cssID, $setID );
$this->returnJsonArray( array( 'cssData' => $css ) );
}
/**
* Fetch a JSON list of CSS group names
*
* @return string Json
*/
protected function _getCSSGroups()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit();
}
//-----------------------------------------
// Get CSS
//-----------------------------------------
$_css = $this->skinFunctions->fetchCSS( $setID );
//-----------------------------------------
// Fix up positioning
//-----------------------------------------
foreach( $_css as $_id => $_data )
{
unset( $_data['css_content'] );
$css[ $_data['css_position'] . '.' . $_data['css_id'] ] = $_data;
}
ksort( $css, SORT_NUMERIC );
$this->returnJsonArray( array( 'css' => $css ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* AJAX Functions For applications/core/js/ipb3CSS.js file
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33
* @version $Revision: 10914 $
*/
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 admin_core_ajax_css extends ipsAjaxCommand
{
/**
* Skin functions object handle
*
* @var object
*/
protected $skinFunctions;
/**
* Main executable
*
* @param object registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//-----------------------------------------
// Load functions and cache classes
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
$this->skinFunctions = new skinCaching( $registry );
/* Check... */
if ( ! $registry->getClass('class_permissions')->checkPermission( 'css_manage', ipsRegistry::$current_application, 'templates' ) )
{
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
exit();
}
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'getCSSGroups':
$this->_getCSSGroups();
break;
case 'getCSSForEdit':
$this->_getCSSForEdit();
break;
case 'saveCSS':
$this->_saveCSS();
break;
case 'revertCSS':
/* Check... */
if ( !$registry->getClass('class_permissions')->checkPermission( 'css_delete', ipsRegistry::$current_application, 'templates' ) )
{
$this->returnJsonError( $registry->lang->words['sk_ajax_noperm'] );
exit();
}
$this->_revertCSS();
break;
}
}
/**
* Reverts CSS
*
* @return string Json
*/
protected function _revertCSS()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$cssID = intval( $this->request['css_id'] );
$fromDelete = intval( $this->request['fromDelete'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ! $cssID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit();
}
//-----------------------------------------
// Get template data
//-----------------------------------------
$css = $this->skinFunctions->revertCSS( $cssID, $setID, $fromDelete );
$this->returnJsonArray( array( 'cssData' => $css, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
}
/**
* Saves the CSS
*
* @return string Json
*/
protected function _saveCSS()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$cssID = intval( $this->request['css_id'] );
$type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit';
$css_content = $_POST['css_content'];
$css_group = IPSText::alphanumericalClean( $_POST['_css_group'] );
$css_position = intval( $this->request['css_position'] );
$css_attributes = $_POST['css_attributes'];
$css_app = IPSText::alphanumericalClean( $_POST['css_app'] );
$css_app_hide = intval( $this->request['css_app_hide'] );
$css_modules = trim( $this->request['css_modules'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ( $type == 'edit' AND ! $cssID ) )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit();
}
//-----------------------------------------
// Add checks
//-----------------------------------------
if ( $type == 'add' )
{
if ( ! $css_group )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit();
}
}
//-----------------------------------------
// Save it
//-----------------------------------------
if ( $type == 'edit' )
{
$css_id = $this->skinFunctions->saveCSSFromEdit( $cssID, $setID, $css_content, $css_group, $css_position, $css_attributes, $css_app, $css_app_hide, $css_modules );
}
else
{
try
{
$css_id = $this->skinFunctions->saveCSSFromAdd( $setID, $css_content, str_replace( '.css', '', $css_group ), $css_position, $css_attributes, $css_app, $css_app_hide, $css_modules );
}
catch( Exception $err )
{
$this->returnJsonError( $err->getMessage() );
exit();
}
}
//-----------------------------------------
// Get Data
//-----------------------------------------
$css = $this->skinFunctions->fetchCSSForEdit( $css_id, $setID );
$this->returnJsonArray( array( 'cssData' => $css, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
}
/**
* Fetch a JSON list of template data ready for editing
*
* @return string Json
*/
protected function _getCSSForEdit()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$cssID = intval( $this->request['css_id'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ! $cssID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit();
}
//-----------------------------------------
// Get template data
//-----------------------------------------
$css = $this->skinFunctions->fetchCSSForEdit( $cssID, $setID );
$this->returnJsonArray( array( 'cssData' => $css ) );
}
/**
* Fetch a JSON list of CSS group names
*
* @return string Json
*/
protected function _getCSSGroups()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit();
}
//-----------------------------------------
// Get CSS
//-----------------------------------------
$_css = $this->skinFunctions->fetchCSS( $setID );
//-----------------------------------------
// Fix up positioning
//-----------------------------------------
foreach( $_css as $_id => $_data )
{
unset( $_data['css_content'] );
$css[ $_data['css_position'] . '.' . $_data['css_id'] ] = $_data;
}
ksort( $css, SORT_NUMERIC );
$this->returnJsonArray( array( 'css' => $css ) );
}
}
@@ -1,114 +1,115 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Login handler abstraction : AJAX Find Names functions
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 8644 $
* @see public_core_ajax_findnames
*
*/
if ( ! defined( 'IN_ACP' ) )
{
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 admin_core_ajax_findnames extends ipsAjaxCommand
{
/**
* Class entry point
*
* @param object Registry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
switch( $this->request['do'] )
{
case 'get-member-names':
$this->_getMemberNames();
break;
}
}
/**
* Returns possible matches for the string input
*
* @return @e void Outputs to screen
*/
protected function _getMemberNames()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$name = IPSText::convertUnicode( $this->convertAndMakeSafe( ipsRegistry::$request['name'], 0 ) );
//-----------------------------------------
// Check length
//-----------------------------------------
if ( IPSText::mbstrlen( $name ) < 3 )
{
$this->returnJsonError( 'requestTooShort' );
}
//-----------------------------------------
// Try query...
//-----------------------------------------
$this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id',
'from' => array( 'members' => 'm' ),
'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( mb_strtolower( $name ) ) . "%'",
'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC',
'limit' => array( 0, 15 ),
'add_join' => array( array( 'select' => 'p.*',
'from' => array( 'profile_portal' => 'p' ),
'where' => 'p.pp_member_id=m.member_id',
'type' => 'left' ) ) ) );
$this->DB->execute();
//-----------------------------------------
// Got any results?
//-----------------------------------------
if ( ! $this->DB->getTotalRows() )
{
$this->returnJsonArray( array( ) );
}
$return = array();
while( $r = $this->DB->fetch() )
{
if( !$r['members_display_name'] )
{
continue;
}
$photo = IPSMember::buildProfilePhoto( $r );
$group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] );
$return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'],
'showas'=> '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')',
'img' => $photo['pp_mini_photo'],
'img_w' => $photo['pp_mini_width'],
'img_h' => $photo['pp_mini_height']
);
}
$this->returnJsonArray( $return );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Login handler abstraction : AJAX Find Names functions
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 10914 $
* @see public_core_ajax_findnames
*
*/
if ( ! defined( 'IN_ACP' ) )
{
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 admin_core_ajax_findnames extends ipsAjaxCommand
{
/**
* Class entry point
*
* @param object Registry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
switch( $this->request['do'] )
{
case 'get-member-names':
$this->_getMemberNames();
break;
}
}
/**
* Returns possible matches for the string input
*
* @return @e void Outputs to screen
*/
protected function _getMemberNames()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$name = IPSText::convertUnicode( $this->convertAndMakeSafe( $this->request['name'], 0 ), true );
$name = IPSText::convertCharsets( $name, 'utf-8', IPS_DOC_CHAR_SET );
//-----------------------------------------
// Check length
//-----------------------------------------
if ( IPSText::mbstrlen( $name ) < 3 )
{
$this->returnJsonError( 'requestTooShort' );
}
//-----------------------------------------
// Try query...
//-----------------------------------------
$this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id',
'from' => array( 'members' => 'm' ),
'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( strtolower( $name ) ) . "%'",
'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC',
'limit' => array( 0, 15 ),
'add_join' => array( array( 'select' => 'p.*',
'from' => array( 'profile_portal' => 'p' ),
'where' => 'p.pp_member_id=m.member_id',
'type' => 'left' ) ) ) );
$this->DB->execute();
//-----------------------------------------
// Got any results?
//-----------------------------------------
if ( ! $this->DB->getTotalRows() )
{
$this->returnJsonArray( array( ) );
}
$return = array();
while( $r = $this->DB->fetch() )
{
if( !$r['members_display_name'] )
{
continue;
}
$photo = IPSMember::buildProfilePhoto( $r );
$group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] );
$return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'],
'showas'=> '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')',
'img' => $photo['pp_mini_photo'],
'img_w' => $photo['pp_mini_width'],
'img_h' => $photo['pp_mini_height']
);
}
$this->returnJsonArray( $return );
}
}
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -3,21 +3,21 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* IP.Board v3.3.4
* AJAX Functions For applications/core/js/ipb3CSS.js file
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* Author: Matt Mecham
*
* @author $Author: ips_terabyte $
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33
* @version $Revision: 8644 $
* @version $Revision: 10914 $
*/
@@ -1,84 +1,84 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* AJAX Functions For applications/core/js/ipb3CSS.js file
* Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since Friday 19th May 2006 17:33
* @version $Revision: 8644 $
*/
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 admin_core_ajax_skinsets extends ipsAjaxCommand
{
/**
* Skin functions object handle
*
* @var object
*/
protected $skinFunctions;
/**
* Main executable
*
* @param object registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
$this->html = $this->registry->output->loadTemplate('cp_skin_templates');
$this->form_code = $this->html->form_code = 'module=templates&amp;section=skinsets';
$this->form_code_js = $this->html->form_code_js = 'module=templates&section=skinsets';
//-----------------------------------------
// Load functions and cache classes
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
$this->skinFunctions = new skinCaching( $registry );
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'showAddDialogue':
$this->_showAddDialogue();
break;
}
}
/**
* Displays the add dialogue
*
* @return string Json
*/
protected function _showAddDialogue()
{
$this->returnHtml( $this->html->newSkinSetPopUp( IPSLib::hasActiveLicense( false ) ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* AJAX Functions For applications/core/js/ipb3CSS.js file
* Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33
* @version $Revision: 8644 $
*/
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 admin_core_ajax_skinsets extends ipsAjaxCommand
{
/**
* Skin functions object handle
*
* @var object
*/
protected $skinFunctions;
/**
* Main executable
*
* @param object registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
$this->html = $this->registry->output->loadTemplate('cp_skin_templates');
$this->form_code = $this->html->form_code = 'module=templates&amp;section=skinsets';
$this->form_code_js = $this->html->form_code_js = 'module=templates&section=skinsets';
//-----------------------------------------
// Load functions and cache classes
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
$this->skinFunctions = new skinCaching( $registry );
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'showAddDialogue':
$this->_showAddDialogue();
break;
}
}
/**
* Displays the add dialogue
*
* @return string Json
*/
protected function _showAddDialogue()
{
$this->returnHtml( $this->html->newSkinSetPopUp( IPSLib::hasActiveLicense( false ) ) );
}
}
@@ -3,11 +3,11 @@
* @file tabs.php AJAX storage of tab order preference
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* @since 8th Feb 2011
* $LastChangedDate: 2011-03-10 16:00:38 -0500 (Thu, 10 Mar 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8021 $
*/
File diff suppressed because it is too large. Load diff
@@ -1,319 +1,319 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* AJAX Functions For applications/core/js/ipb3Templates.js file
* Last Updated: $Date: 2011-07-12 17:54:40 -0400 (Tue, 12 Jul 2011) $
* </pre>
*
* Author: Matt Mecham
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since Friday 19th May 2006 17:33
* @version $Revision: 9218 $
*/
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 admin_core_ajax_templates extends ipsAjaxCommand
{
/**
* Skin functions object handle
*
* @var object
*/
protected $skinFunctions;
/**
* Main executable
*
* @param object registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//-----------------------------------------
// Load functions and cache classes
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
$this->skinFunctions = new skinCaching( $registry );
/* Check... */
if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_manage', ipsRegistry::$current_application, 'templates' ) )
{
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
}
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'getTemplateBitList':
$this->_getTemplateBitList();
break;
case 'getTemplateGroupList':
$this->_getTemplateGroupList();
break;
case 'getTemplateForEdit':
$this->_getTemplateForEdit();
break;
case 'saveTemplateBit':
$this->_saveTemplateBit();
break;
case 'revertTemplateBit':
/* Check... */
if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_delete', ipsRegistry::$current_application, 'templates' ) )
{
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
exit();
}
$this->_revertTemplateBit();
break;
}
}
/**
* Reverts a template bit
*
* @return @e void
*/
protected function _revertTemplateBit()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$templateID = intval( $this->request['template_id'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ! $templateID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
//-----------------------------------------
// Get template data
//-----------------------------------------
$template = $this->skinFunctions->revertTemplateBit( $templateID, $setID );
$this->returnJsonArray( array( 'templateData' => $template, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
}
/**
* Saves the template bit
*
* @return @e void
*/
protected function _saveTemplateBit()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$test = $_POST['_template_name'];
$setID = intval( $this->request['template_set'] );
$templateID = intval( $this->request['template_id'] );
$type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit';
$template_content = $_POST['template_content'];
$template_group = IPSText::alphanumericalClean( $_POST['template_group'] );
$ent_template_group = str_replace( "skin_", "", IPSText::alphanumericalClean( $_POST['_template_group'] ) );
$template_name = IPSText::alphanumericalClean( $_POST['_template_name'] );
$template_data = $_POST['template_data'];
IPSDebug::fireBug( 'info', array( 'Template content: ' . $template_content ) );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ( $type == 'edit' AND ! $templateID ) )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
//-----------------------------------------
// Add checks
//-----------------------------------------
if ( $type == 'add' )
{
if ( ! $template_name )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
}
//-----------------------------------------
// Save it
//-----------------------------------------
if ( $type == 'edit' )
{
try
{
$template_id = $this->skinFunctions->saveTemplateBitFromEdit( $templateID, $setID, $template_content, $template_data );
}
catch( Exception $err )
{
$this->returnJsonError( $this->lang->words[ 'templates_' . $err->getMessage() ] ? $this->lang->words[ 'templates_' . $err->getMessage() ] : $err->getMessage() );//. ' ' . implode( "\n", $this->skinFunctions->fetchMessages() ) );
}
}
else
{
$template_group = ( $ent_template_group ) ? 'skin_' . $ent_template_group : $template_group;
try
{
$template_id = $this->skinFunctions->saveTemplateBitFromAdd( $setID, $template_content, $template_data, $template_group, $template_name );
}
catch( Exception $err )
{
$this->returnJsonError( $this->lang->words[ 'templates_' . $err->getMessage() ] ? $this->lang->words[ 'templates_' . $err->getMessage() ] : $err->getMessage() );// . ' ' . implode( "\n", $this->skinFunctions->fetchMessages() ) );
}
}
//-----------------------------------------
// Fetch new data and return
//-----------------------------------------
$template = $this->skinFunctions->fetchTemplateBitForEdit( $template_id, $setID );
//-----------------------------------------
// Get Data
//-----------------------------------------
$this->returnJsonArray( array( 'templateData' => $template, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
}
/**
* Fetch a JSON list of template data ready for editing
*
* @return @e void
*/
protected function _getTemplateForEdit()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$templateID = intval( $this->request['template_id'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ! $templateID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
//-----------------------------------------
// Get template data
//-----------------------------------------
$template = $this->skinFunctions->fetchTemplateBitForEdit( $templateID, $setID );
$this->returnJsonArray( array( 'templateData' => $template ) );
}
/**
* Fetch a JSON list of template groups
*
* @return @e void
*/
protected function _getTemplateGroupList()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
//-----------------------------------------
// Get templates
//-----------------------------------------
$templateGroups = $this->skinFunctions->fetchTemplates( $setID, 'groupNames' );
//-----------------------------------------
// Add in group counts
//-----------------------------------------
foreach( $templateGroups as $name => $data )
{
$templateGroups[ $name ]['_modCount'] = $this->skinFunctions->fetchModifiedTemplateCount( $setID, $name );
unset( $templateGroups[ $name ]['template_name'] );
unset( $templateGroups[ $name ]['template_data'] );
unset( $templateGroups[ $name ]['template_content'] );
}
$this->returnJsonArray( array( 'groups' => $templateGroups ) );
}
/**
* Fetch a JSON list of template bits for the template group
*
* @return @e void
*/
protected function _getTemplateBitList()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$templateGroup = IPSText::alphanumericalClean( $this->request['templateGroup'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ! $templateGroup )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
//-----------------------------------------
// Get templates
//-----------------------------------------
$templates = $this->skinFunctions->fetchTemplates( $setID, 'groupTemplatesNoContent', $templateGroup );
$this->returnJsonArray( array( 'templates' => array_values( $templates ),
'groupData' => array( '_modCount' => $this->skinFunctions->fetchModifiedTemplateCount( $setID, $templateGroup ) ) ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* AJAX Functions For applications/core/js/ipb3Templates.js file
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* Author: Matt Mecham
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33
* @version $Revision: 10914 $
*/
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 admin_core_ajax_templates extends ipsAjaxCommand
{
/**
* Skin functions object handle
*
* @var object
*/
protected $skinFunctions;
/**
* Main executable
*
* @param object registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//-----------------------------------------
// Load functions and cache classes
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
$this->skinFunctions = new skinCaching( $registry );
/* Check... */
if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_manage', ipsRegistry::$current_application, 'templates' ) )
{
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
}
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'getTemplateBitList':
$this->_getTemplateBitList();
break;
case 'getTemplateGroupList':
$this->_getTemplateGroupList();
break;
case 'getTemplateForEdit':
$this->_getTemplateForEdit();
break;
case 'saveTemplateBit':
$this->_saveTemplateBit();
break;
case 'revertTemplateBit':
/* Check... */
if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_delete', ipsRegistry::$current_application, 'templates' ) )
{
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
exit();
}
$this->_revertTemplateBit();
break;
}
}
/**
* Reverts a template bit
*
* @return @e void
*/
protected function _revertTemplateBit()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$templateID = intval( $this->request['template_id'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ! $templateID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
//-----------------------------------------
// Get template data
//-----------------------------------------
$template = $this->skinFunctions->revertTemplateBit( $templateID, $setID );
$this->returnJsonArray( array( 'templateData' => $template, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
}
/**
* Saves the template bit
*
* @return @e void
*/
protected function _saveTemplateBit()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$test = $_POST['_template_name'];
$setID = intval( $this->request['template_set'] );
$templateID = intval( $this->request['template_id'] );
$type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit';
$template_content = $_POST['template_content'];
$template_group = IPSText::alphanumericalClean( $_POST['template_group'] );
$ent_template_group = str_replace( "skin_", "", IPSText::alphanumericalClean( $_POST['_template_group'] ) );
$template_name = IPSText::alphanumericalClean( $_POST['_template_name'] );
$template_data = $_POST['template_data'];
IPSDebug::fireBug( 'info', array( 'Template content: ' . $template_content ) );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ( $type == 'edit' AND ! $templateID ) )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
//-----------------------------------------
// Add checks
//-----------------------------------------
if ( $type == 'add' )
{
if ( ! $template_name )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
}
//-----------------------------------------
// Save it
//-----------------------------------------
if ( $type == 'edit' )
{
try
{
$template_id = $this->skinFunctions->saveTemplateBitFromEdit( $templateID, $setID, $template_content, $template_data );
}
catch( Exception $err )
{
$this->returnJsonError( $this->lang->words[ 'templates_' . $err->getMessage() ] ? $this->lang->words[ 'templates_' . $err->getMessage() ] : $err->getMessage() );//. ' ' . implode( "\n", $this->skinFunctions->fetchMessages() ) );
}
}
else
{
$template_group = ( $ent_template_group ) ? 'skin_' . $ent_template_group : $template_group;
try
{
$template_id = $this->skinFunctions->saveTemplateBitFromAdd( $setID, $template_content, $template_data, $template_group, $template_name );
}
catch( Exception $err )
{
$this->returnJsonError( $this->lang->words[ 'templates_' . $err->getMessage() ] ? $this->lang->words[ 'templates_' . $err->getMessage() ] : $err->getMessage() );// . ' ' . implode( "\n", $this->skinFunctions->fetchMessages() ) );
}
}
//-----------------------------------------
// Fetch new data and return
//-----------------------------------------
$template = $this->skinFunctions->fetchTemplateBitForEdit( $template_id, $setID );
//-----------------------------------------
// Get Data
//-----------------------------------------
$this->returnJsonArray( array( 'templateData' => $template, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
}
/**
* Fetch a JSON list of template data ready for editing
*
* @return @e void
*/
protected function _getTemplateForEdit()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$templateID = intval( $this->request['template_id'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ! $templateID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
//-----------------------------------------
// Get template data
//-----------------------------------------
$template = $this->skinFunctions->fetchTemplateBitForEdit( $templateID, $setID );
$this->returnJsonArray( array( 'templateData' => $template ) );
}
/**
* Fetch a JSON list of template groups
*
* @return @e void
*/
protected function _getTemplateGroupList()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
//-----------------------------------------
// Get templates
//-----------------------------------------
$templateGroups = $this->skinFunctions->fetchTemplates( $setID, 'groupNames' );
//-----------------------------------------
// Add in group counts
//-----------------------------------------
foreach( $templateGroups as $name => $data )
{
$templateGroups[ $name ]['_modCount'] = $this->skinFunctions->fetchModifiedTemplateCount( $setID, $name );
unset( $templateGroups[ $name ]['template_name'] );
unset( $templateGroups[ $name ]['template_data'] );
unset( $templateGroups[ $name ]['template_content'] );
}
$this->returnJsonArray( array( 'groups' => $templateGroups ) );
}
/**
* Fetch a JSON list of template bits for the template group
*
* @return @e void
*/
protected function _getTemplateBitList()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$templateGroup = IPSText::alphanumericalClean( $this->request['templateGroup'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ! $templateGroup )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
//-----------------------------------------
// Get templates
//-----------------------------------------
$templates = $this->skinFunctions->fetchTemplates( $setID, 'groupTemplatesNoContent', $templateGroup );
$this->returnJsonArray( array( 'templates' => array_values( $templates ),
'groupData' => array( '_modCount' => $this->skinFunctions->fetchModifiedTemplateCount( $setID, $templateGroup ) ) ) );
}
}
@@ -1,217 +1,217 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* AJAX Functions For applications/core/js/ipb3Templates.js file
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* Author: Matt Mecham
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since Friday 19th May 2006 17:33
* @version $Revision: 8644 $
*/
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 admin_core_ajax_templatesandr extends ipsAjaxCommand
{
/**
* Skin functions object handle
*
* @var object
*/
protected $skinFunctions;
/**
* Main executable
*
* @param object registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//-----------------------------------------
// Load functions and cache classes
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/
$this->skinFunctions = new skinDifferences( $registry );
/* Check... */
if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_manage', ipsRegistry::$current_application, 'templates' ) )
{
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
}
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'getTemplateBitList':
$this->_getTemplateBitList();
break;
case 'replace':
$this->_replace();
break;
}
}
/**
* Fetch a JSON list of template bits for the template group
*
* @return @e void
*/
protected function _replace()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$finalIDs = array();
$templates = array();
$sessionID = IPSText::md5Clean( $this->request['sessionID'] );
$sessionData = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'template_sandr',
'where' => "sandr_session_id='" . addslashes( $sessionID ) ."'" ) );
$templateData = unserialize( $sessionData['sandr_results'] );
if ( is_array( $templateData ) )
{
foreach( $templateData as $_group => $_data )
{
if ( !empty( $_POST['groups'][ $_group ] ) )
{
foreach( $_data as $_name => $_id )
{
$finalIDs[] = $_id;
}
}
else
{
foreach( $_data as $_name => $_id )
{
if ( !empty( $_POST['templates'][ $_id ] ) )
{
$finalIDs[] = $_id;
}
}
}
}
}
/* Check... */
if ( ! count( $finalIDs ) )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
/* Load templates */
$this->DB->build( array( 'select' => '*',
'from' => 'skin_templates',
'where' => 'template_id IN ('. implode( ',', $finalIDs ) . ')' ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$templates[ $row['template_id'] ] = $row;
}
/* Perform the replacement */
foreach( $templates as $template_id => $template )
{
if ( $sessionData['sandr_is_regex'] )
{
$before = str_replace( '#', '\#', IPSText::stripslashes( $sessionData['sandr_search_for'] ) );
$after = preg_replace( '#\\\\\\\\(\d+?)#i', '$\\1', $sessionData['sandr_replace_with'] );
$template['template_content'] = preg_replace( "#{$before}#si", $after, $template['template_content'] );
}
else
{
$template['template_content'] = str_ireplace( $sessionData['sandr_search_for'], $sessionData['sandr_replace_with'], $template['template_content'] );
}
/* Save it */
$this->skinFunctions->saveTemplateBitFromEdit( $template['template_id'], $sessionData['sandr_set_id'], $template['template_content'], $template['template_data'] );
}
/* Done */
$this->returnJsonArray( array( 'status' => 'ok' ) );
}
/**
* Fetch a JSON list of template bits for the template group
*
* @return @e void
*/
protected function _getTemplateBitList()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$templateGroup = IPSText::alphanumericalClean( $this->request['templateGroup'] );
$sessionID = IPSText::md5Clean( $this->request['sessionID'] );
$templates = array();
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ! $templateGroup or ! $sessionID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
//-----------------------------------------
// Get templates
//-----------------------------------------
$sessionData = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'template_sandr',
'where' => "sandr_session_id='" . addslashes( $sessionID ) ."'" ) );
$templateIDs = unserialize( $sessionData['sandr_results'] );
$this->DB->build( array( 'select' => '*',
'from' => 'skin_templates',
'where' => 'template_id IN ('. implode( ',', array_values( $templateIDs[ $templateGroup] ) ) . ')' ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
unset( $row['template_content'] );
$templates[] = $row;
}
$this->returnJsonArray( array( 'templates' => $templates ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* AJAX Functions For applications/core/js/ipb3Templates.js file
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* Author: Matt Mecham
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33
* @version $Revision: 10914 $
*/
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 admin_core_ajax_templatesandr extends ipsAjaxCommand
{
/**
* Skin functions object handle
*
* @var object
*/
protected $skinFunctions;
/**
* Main executable
*
* @param object registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//-----------------------------------------
// Load functions and cache classes
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/
$this->skinFunctions = new skinDifferences( $registry );
/* Check... */
if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_manage', ipsRegistry::$current_application, 'templates' ) )
{
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
}
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'getTemplateBitList':
$this->_getTemplateBitList();
break;
case 'replace':
$this->_replace();
break;
}
}
/**
* Fetch a JSON list of template bits for the template group
*
* @return @e void
*/
protected function _replace()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$finalIDs = array();
$templates = array();
$sessionID = IPSText::md5Clean( $this->request['sessionID'] );
$sessionData = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'template_sandr',
'where' => "sandr_session_id='" . addslashes( $sessionID ) ."'" ) );
$templateData = unserialize( $sessionData['sandr_results'] );
if ( is_array( $templateData ) )
{
foreach( $templateData as $_group => $_data )
{
if ( !empty( $_POST['groups'][ $_group ] ) )
{
foreach( $_data as $_name => $_id )
{
$finalIDs[] = $_id;
}
}
else
{
foreach( $_data as $_name => $_id )
{
if ( !empty( $_POST['templates'][ $_id ] ) )
{
$finalIDs[] = $_id;
}
}
}
}
}
/* Check... */
if ( ! count( $finalIDs ) )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
/* Load templates */
$this->DB->build( array( 'select' => '*',
'from' => 'skin_templates',
'where' => 'template_id IN ('. implode( ',', $finalIDs ) . ')' ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$templates[ $row['template_id'] ] = $row;
}
/* Perform the replacement */
foreach( $templates as $template_id => $template )
{
if ( $sessionData['sandr_is_regex'] )
{
$before = str_replace( '#', '\#', IPSText::stripslashes( $sessionData['sandr_search_for'] ) );
$after = preg_replace( '#\\\\\\\\(\d+?)#i', '$\\1', $sessionData['sandr_replace_with'] );
$template['template_content'] = preg_replace( "#{$before}#si", $after, $template['template_content'] );
}
else
{
$template['template_content'] = str_ireplace( $sessionData['sandr_search_for'], $sessionData['sandr_replace_with'], $template['template_content'] );
}
/* Save it */
$this->skinFunctions->saveTemplateBitFromEdit( $template['template_id'], $sessionData['sandr_set_id'], $template['template_content'], $template['template_data'] );
}
/* Done */
$this->returnJsonArray( array( 'status' => 'ok' ) );
}
/**
* Fetch a JSON list of template bits for the template group
*
* @return @e void
*/
protected function _getTemplateBitList()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval( $this->request['setID'] );
$templateGroup = IPSText::alphanumericalClean( $this->request['templateGroup'] );
$sessionID = IPSText::md5Clean( $this->request['sessionID'] );
$templates = array();
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $setID OR ! $templateGroup or ! $sessionID )
{
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
}
//-----------------------------------------
// Get templates
//-----------------------------------------
$sessionData = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'template_sandr',
'where' => "sandr_session_id='" . addslashes( $sessionID ) ."'" ) );
$templateIDs = unserialize( $sessionData['sandr_results'] );
$this->DB->build( array( 'select' => '*',
'from' => 'skin_templates',
'where' => 'template_id IN ('. implode( ',', array_values( $templateIDs[ $templateGroup] ) ) . ')' ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
unset( $row['template_content'] );
$templates[] = $row;
}
$this->returnJsonArray( array( 'templates' => $templates ) );
}
}
@@ -1,181 +1,181 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* AJAX Functions For applications/core/js/ipb3CSS.js file
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* Author: Matt Mecham
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since Friday 19th May 2006 17:33
* @version $Revision: 8644 $
*/
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 admin_core_ajax_uagents extends ipsAjaxCommand
{
/**
* User agent functions
*
* @var object Skin templates
*/
protected $userAgentFunctions;
/**
* Main executable
*
* @param object registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//-----------------------------------------
// Load functions and cache classes
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/useragents/userAgentFunctions.php', 'userAgentFunctions' );
$this->userAgentFunctions = new $classToLoad( $registry );
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'saveuAgent':
if ( !$registry->getClass('class_permissions')->checkPermission( 'ua_manage', ipsRegistry::$current_application, 'tools' ) )
{
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
}
$this->_saveuAgent();
break;
case 'removeuAgent':
if ( !$registry->getClass('class_permissions')->checkPermission( 'ua_remove', ipsRegistry::$current_application, 'tools' ) )
{
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
}
$this->_removeuAgent();
break;
}
}
/**
* Reverts replacement
*
* @return @e void
*/
protected function _removeuAgent()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$uagent_id = intval( $this->request['uagent_id'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $uagent_id )
{
$this->returnJsonError('Missing Data');
}
//-----------------------------------------
// Get template data
//-----------------------------------------
$userAgents = $this->userAgentFunctions->removeUserAgent( $uagent_id );
$this->returnJsonArray( array( 'uagents' => $userAgents, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) );
}
/**
* Saves the user agent
*
* @return @e void
*/
protected function _saveuAgent()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$uagent_id = intval( $this->request['uagent_id'] );
$uagent_key = IPSText::alphanumericalClean( $this->request['uagent_key'] );
$uagent_name = $this->convertAndMakeSafe( $_POST['uagent_name'] );
$uagent_regex = $this->convertUnicode( $_POST['uagent_regex'] );
$uagent_regex_capture = intval( $this->request['uagent_regex_capture'] );
$uagent_type = IPSText::alphanumericalClean( $this->request['uagent_type'] );
$uagent_position = intval( $this->request['uagent_position'] );
$type = $this->request['type'];
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( $type == 'edit' AND ! $uagent_id )
{
$this->returnJsonError('Missing Data');
}
//-----------------------------------------
// Other checks
//-----------------------------------------
if ( ! $uagent_key OR ! $uagent_name OR ! $uagent_regex OR ! $uagent_type )
{
$this->returnJsonError('Missing Data');
}
//-----------------------------------------
// Save it
//-----------------------------------------
if ( $type == 'edit' )
{
try
{
$userAgentID = $this->userAgentFunctions->saveUserAgentFromEdit( $uagent_id, $uagent_key, $uagent_name, $uagent_regex, $uagent_regex_capture, $uagent_type, $uagent_position );
}
catch( Exception $err )
{
$this->returnJsonError( $err->getMessage() . ' ' . str_replace( "\n", "\\n", implode( ",", $this->userAgentFunctions->fetchMessages() ) ) );
}
}
else
{
try
{
$userAgentID = $this->userAgentFunctions->saveUserAgentFromAdd( $uagent_key, $uagent_name, $uagent_regex, $uagent_regex_capture, $uagent_type, $uagent_position );
}
catch( Exception $err )
{
$this->returnJsonError( $err->getMessage() );
}
}
//-----------------------------------------
// Get Data
//-----------------------------------------
$this->returnJsonArray( array( 'uagents' => $this->userAgentFunctions->fetchAgents(), 'returnid' => $userAgentID, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* AJAX Functions For applications/core/js/ipb3CSS.js file
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* Author: Matt Mecham
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33
* @version $Revision: 10914 $
*/
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 admin_core_ajax_uagents extends ipsAjaxCommand
{
/**
* User agent functions
*
* @var object Skin templates
*/
protected $userAgentFunctions;
/**
* Main executable
*
* @param object registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//-----------------------------------------
// Load functions and cache classes
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/useragents/userAgentFunctions.php', 'userAgentFunctions' );
$this->userAgentFunctions = new $classToLoad( $registry );
//-----------------------------------------
// What shall we do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'saveuAgent':
if ( !$registry->getClass('class_permissions')->checkPermission( 'ua_manage', ipsRegistry::$current_application, 'tools' ) )
{
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
}
$this->_saveuAgent();
break;
case 'removeuAgent':
if ( !$registry->getClass('class_permissions')->checkPermission( 'ua_remove', ipsRegistry::$current_application, 'tools' ) )
{
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
}
$this->_removeuAgent();
break;
}
}
/**
* Reverts replacement
*
* @return @e void
*/
protected function _removeuAgent()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$uagent_id = intval( $this->request['uagent_id'] );
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( ! $uagent_id )
{
$this->returnJsonError('Missing Data');
}
//-----------------------------------------
// Get template data
//-----------------------------------------
$userAgents = $this->userAgentFunctions->removeUserAgent( $uagent_id );
$this->returnJsonArray( array( 'uagents' => $userAgents, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) );
}
/**
* Saves the user agent
*
* @return @e void
*/
protected function _saveuAgent()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$uagent_id = intval( $this->request['uagent_id'] );
$uagent_key = IPSText::alphanumericalClean( $this->request['uagent_key'] );
$uagent_name = $this->convertAndMakeSafe( $_POST['uagent_name'] );
$uagent_regex = $this->convertUnicode( $_POST['uagent_regex'] );
$uagent_regex_capture = intval( $this->request['uagent_regex_capture'] );
$uagent_type = IPSText::alphanumericalClean( $this->request['uagent_type'] );
$uagent_position = intval( $this->request['uagent_position'] );
$type = $this->request['type'];
//-----------------------------------------
// Checks...
//-----------------------------------------
if ( $type == 'edit' AND ! $uagent_id )
{
$this->returnJsonError('Missing Data');
}
//-----------------------------------------
// Other checks
//-----------------------------------------
if ( ! $uagent_key OR ! $uagent_name OR ! $uagent_regex OR ! $uagent_type )
{
$this->returnJsonError('Missing Data');
}
//-----------------------------------------
// Save it
//-----------------------------------------
if ( $type == 'edit' )
{
try
{
$userAgentID = $this->userAgentFunctions->saveUserAgentFromEdit( $uagent_id, $uagent_key, $uagent_name, $uagent_regex, $uagent_regex_capture, $uagent_type, $uagent_position );
}
catch( Exception $err )
{
$this->returnJsonError( $err->getMessage() . ' ' . str_replace( "\n", "\\n", implode( ",", $this->userAgentFunctions->fetchMessages() ) ) );
}
}
else
{
try
{
$userAgentID = $this->userAgentFunctions->saveUserAgentFromAdd( $uagent_key, $uagent_name, $uagent_regex, $uagent_regex_capture, $uagent_type, $uagent_position );
}
catch( Exception $err )
{
$this->returnJsonError( $err->getMessage() );
}
}
//-----------------------------------------
// Get Data
//-----------------------------------------
$this->returnJsonArray( array( 'uagents' => $this->userAgentFunctions->fetchAgents(), 'returnid' => $userAgentID, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) );
}
}
@@ -1,20 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Group management
* Last Updated: $Date: 2011-09-09 19:44:48 -0400 (Fri, 09 Sep 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since Monday 15th January 2007 (15:01)
* @version $Revision: 9476 $
* @file applications.php Applications management
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* @since 15 January 2007
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -23,34 +17,39 @@ if ( ! defined( 'IN_ACP' ) )
exit();
}
/**
*
* @class admin_core_applications_applications
* @brief Applications management
*/
class admin_core_applications_applications extends ipsCommand
{
/**
* Skin object
* Skin object shortcut
*
* @var object Skin templates
* @var $html
*/
public $html;
/**
* Shortcut for url
* String for the screen url bit
*
* @var string URL shortcut
* @var $form_code
*/
public $form_code;
public $form_code = '';
/**
* Shortcut for url (javascript)
* String for the JS url bit
*
* @var string JS URL shortcut
* @var $form_code_js
*/
public $form_code_js;
public $form_code_js = '';
/**
* Main class entry point
* Main function executed automatically by the controller
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
* @param object $registry Registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
@@ -58,17 +57,11 @@ class admin_core_applications_applications extends ipsCommand
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate( 'cp_skin_applications' );
$this->registry->class_localization->loadLanguageFile( array( 'admin_applications' ) );
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=applications&amp;section=applications&amp;';
$this->form_code_js = $this->html->form_code_js = 'module=applications&section=applications&';
$this->form_code = $this->html->form_code = 'module=applications&amp;section=applications&amp;';
$this->form_code_js = $this->html->form_code_js = 'module=applications&section=applications&';
//-----------------------------------------
// What to do...
@@ -82,6 +75,9 @@ class admin_core_applications_applications extends ipsCommand
$this->request['do'] = 'applications_overview';
$this->applicationsOverview();
break;
case 'application_details' :
$this->applicationViewDetails();
break;
case 'application_manage_position' :
$this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'app_manage' );
$this->applicationManagePosition();
@@ -194,17 +190,8 @@ class admin_core_applications_applications extends ipsCommand
*/
public function applicationToggle()
{
//--------------------------------------------
// INIT
//--------------------------------------------
$app_id = intval( $this->request['app_id'] );
//-----------------------------------------
// Got an application?
//-----------------------------------------
$application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $app_id ) );
/* Get application */
$application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . intval( $this->request['app_id'] ) ) );
if ( ! $application['app_id'] )
{
@@ -216,8 +203,20 @@ class admin_core_applications_applications extends ipsCommand
$this->registry->output->showError( $this->lang->words['cannot_toggle_defaults'], 111161.1 );
}
$this->DB->update( 'core_applications', array( 'app_enabled' => $application['app_enabled'] ? 0 : 1 ), 'app_id=' . $app_id );
/* We're disabling the app? */
if ( $application['app_enabled'] )
{
$this->DB->update( 'core_applications', array( 'app_enabled' => 0, 'app_position' => 0 ), 'app_id=' . $application['app_id'] );
}
else
{
$appsCount = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as total', 'from' => 'core_applications', 'where' => 'app_enabled=1' ) );
$appsCount['total'] = intval($appsCount['total']) + 1;
$this->DB->update( 'core_applications', array( 'app_enabled' => 1, 'app_position' => $appsCount['total'] ), 'app_id=' . $application['app_id'] );
}
/* Recache */
$this->moduleRecacheAll( 1 );
//-----------------------------------------
@@ -360,7 +359,6 @@ class admin_core_applications_applications extends ipsCommand
// Replace out the SQL details
//-----------------------------------------
$sphinxTemplate = str_replace( "<!--SPHINX_CONF_HOST-->", ipsRegistry::$settings['sql_host'], $sphinxTemplate );
$sphinxTemplate = str_replace( "<!--SPHINX_CONF_USER-->", ipsRegistry::$settings['sql_user'], $sphinxTemplate );
$sphinxTemplate = str_replace( "<!--SPHINX_CONF_PASS-->", ipsRegistry::$settings['sql_pass'], $sphinxTemplate );
@@ -393,6 +391,8 @@ class admin_core_applications_applications extends ipsCommand
}
}
$appSphinxTemplate = str_replace( "<!--SPHINX_DB_SET_NAMES-->", ( ! empty( ipsRegistry::$settings['sql_charset'] ) ) ? 'sql_query_pre = SET NAMES ' . ipsRegistry::$settings['sql_charset'] : '', $appSphinxTemplate );
$sphinxCompiled .= $appSphinxTemplate;
}
}
@@ -855,7 +855,9 @@ class admin_core_applications_applications extends ipsCommand
// Done...
//-----------------------------------------
/* Recache menu */
$this->applicationsMenuDataRecache();
if ( $return )
{
$this->registry->output->global_message = sprintf( $this->lang->words['a_insertupdated'], $inserted, $updated );
@@ -1204,13 +1206,11 @@ class admin_core_applications_applications extends ipsCommand
if ( ! $app_id )
{
$ajax->returnString( $this->lang->words['postform_badmd5'] );
exit();
}
if ( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false )
{
$ajax->returnString( $this->lang->words['postform_badmd5'] );
exit();
}
//-----------------------------------------
@@ -1248,10 +1248,15 @@ class admin_core_applications_applications extends ipsCommand
//-----------------------------------------
// Load known modules
//-----------------------------------------
$this->DB->build( array( 'select' => 'm.*', 'from' => array( 'core_sys_module' => 'm' ), 'where' => 'm.sys_module_visible=1', 'order' => 'a.app_position, m.sys_module_position ASC', 'add_join' => array( array( 'select' => 'a.*', 'from' => array( 'core_applications' => 'a' ), 'where' => 'm.sys_module_application=a.app_directory', 'type' => 'inner' ) ) ) );
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'core_sys_module' => 'm' ),
'where' => 'm.sys_module_visible=1',
'order' => 'a.app_position, m.sys_module_position ASC',
'add_join' => array( array( 'select' => 'a.*',
'from' => array( 'core_applications' => 'a' ),
'where' => 'm.sys_module_application=a.app_directory',
'type' => 'inner' ) )
) );
$this->DB->execute();
while ( $row = $this->DB->fetch() )
@@ -1266,7 +1271,7 @@ class admin_core_applications_applications extends ipsCommand
}
}
$modules[$row['sys_module_application']][] = $_row;
$modules[ $row['sys_module_application'] ][] = $_row;
}
$this->cache->setCache( 'module_cache', $modules, array( 'array' => 1 ) );
@@ -1462,6 +1467,31 @@ class admin_core_applications_applications extends ipsCommand
$this->DB->delete( 'core_sys_settings_titles', "conf_title_app='{$application['app_directory']}'" );
$settingsFile = IPSLib::getAppDir( $application['app_directory'] ) . '/xml/' . $application['app_directory'] . '_settings.xml';
if( is_file( $settingsFile ) )
{
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
$xml = new classXML( IPS_DOC_CHAR_SET );
$xml->load( $settingsFile );
$keys = array();
foreach( $xml->fetchElements('setting') as $setting )
{
$entry = $xml->fetchElementsFromRecord( $setting );
if ( $entry['conf_is_title'] )
{
continue;
}
$keys[] = "'{$entry['conf_key']}'";
}
if ( !empty( $keys ) )
{
$this->DB->delete( 'core_sys_conf_settings', 'conf_key IN(' . implode( ',', $keys ) . ')' );
}
}
//-----------------------------------------
// Remove Application Caches
//-----------------------------------------
@@ -1486,7 +1516,6 @@ class admin_core_applications_applications extends ipsCommand
//-----------------------------------------
// Remove tables
//-----------------------------------------
$_file = IPSLib::getAppDir( $application['app_directory'] ) . '/setup/versions/install/sql/' . $application['app_directory'] . '_' . ipsRegistry::dbFunctions()->getDriverType() . '_tables.php';
@@ -1500,7 +1529,6 @@ class admin_core_applications_applications extends ipsCommand
//-----------------------------------------
// Capture create tables first
//-----------------------------------------
preg_match( "/CREATE TABLE (\S+)(\s)?\(/", $q, $match );
@@ -1513,7 +1541,6 @@ class admin_core_applications_applications extends ipsCommand
//-----------------------------------------
// Then capture alter tables
//-----------------------------------------
preg_match( "/ALTER TABLE (\S+)\sADD\s(\S+)\s/i", $q, $match );
@@ -1528,7 +1555,6 @@ class admin_core_applications_applications extends ipsCommand
//-----------------------------------------
// Check for uninstall sql
//-----------------------------------------
/* Any "extra" configs required for this driver? */
if ( is_file( IPS_ROOT_PATH . 'setup/sql/' . $this->settings['sql_driver'] . '_install.php' ) )
@@ -1569,7 +1595,7 @@ class admin_core_applications_applications extends ipsCommand
$this->DB->delete( 'permission_index', "app='{$application['app_directory']}'" );
$this->DB->delete( 'reputation_index', "app='{$application['app_directory']}'" );
$this->DB->delete( 'reputation_cache', "app='{$application['app_directory']}'" );
$this->DB->delete( 'tags_index', "app='{$application['app_directory']}'" );
$this->DB->delete( 'core_tags', "tag_meta_app='{$application['app_directory']}'" );
$this->DB->delete( 'faq', "app='{$application['app_directory']}'" );
$this->DB->delete( 'custom_bbcode', "bbcode_app='{$application['app_directory']}'" );
$this->DB->delete( 'upgrade_history', "upgrade_app='{$application['app_directory']}'" );
@@ -2036,10 +2062,12 @@ XML;
public function applicationSave( $type = 'add' )
{
/* Init vars */
$app_title = trim( $this->request['app_title'] );
$app_title = trim( $this->request['app_title'] );
$app_public = trim( $this->request['app_public_title'] );
$app_directory = trim( $this->request['app_directory'] );
$app_enabled = intval( $this->request['app_enabled'] );
$application = array();
$app_enabled = intval( $this->request['app_enabled'] );
$application = array();
$sphinxRebuild = false;
/* Editing? */
if ( $type == 'edit' )
@@ -2071,13 +2099,24 @@ XML;
return;
}
if ( ! $app_enabled && in_array( $app_directory, array( 'core', 'forums', 'members' ) ) )
if ( ( empty($app_enabled) || empty($app_public) ) && in_array( $app_directory, array( 'core', 'forums', 'members' ) ) )
{
$this->registry->output->showError( $this->lang->words['cannot_toggle_defaults'], 111161.2 );
}
/* $setup update array */
$array = array( 'app_title' => $app_title, 'app_public_title' => trim( $this->request['app_public_title'] ), 'app_enabled' => $app_enabled, 'app_hide_tab' => intval( $this->request['app_hide_tab'] ), 'app_description' => trim( $this->request['app_description'] ), 'app_author' => trim( $this->request['app_author'] ), 'app_version' => trim( $this->request['app_version'] ), 'app_directory' => $app_directory, 'app_website' => trim( $this->request['app_website'] ), 'app_update_check' => trim( $this->request['app_update_check'] ), 'app_global_caches' => ( is_array( $this->request['app_global_caches'] ) && count( $this->request['app_global_caches'] ) ) ? implode( ',', $this->request['app_global_caches'] ) : '', 'app_tab_groups' => ( is_array( $this->request['app_tab_groups'] ) && count( $this->request['app_tab_groups'] ) ) ? implode( ',', $this->request['app_tab_groups'] ) : '' );
/* $etup update array */
$array = array( 'app_title' => $app_title,
'app_public_title' => $app_public,
'app_enabled' => $app_enabled,
'app_hide_tab' => intval( $this->request['app_hide_tab'] ),
'app_description' => trim( $this->request['app_description'] ),
'app_author' => trim( $this->request['app_author'] ),
'app_version' => trim( $this->request['app_version'] ),
'app_directory' => $app_directory,
'app_website' => trim( $this->request['app_website'] ),
'app_update_check' => trim( $this->request['app_update_check'] ),
'app_global_caches' => ( is_array( $this->request['app_global_caches'] ) && count( $this->request['app_global_caches'] ) ) ? implode( ',', $this->request['app_global_caches'] ) : '',
'app_tab_groups' => ( is_array( $this->request['app_tab_groups'] ) && count( $this->request['app_tab_groups'] ) ) ? implode( ',', $this->request['app_tab_groups'] ) : '' );
//-----------------------------------------
// IN DEV?
@@ -2096,24 +2135,41 @@ XML;
if ( $type == 'add' )
{
$array['app_added'] = time();
$array['app_added'] = IPS_UNIX_TIME_NOW;
$array['app_location'] = 'other';
$max = $this->DB->buildAndFetch( array( 'select' => 'MAX(app_position) as position', 'from' => 'core_applications' ) );
$array['app_position'] = $max['position'] + 1;
$array['app_position'] = intval($max['position']) + 1;
$this->DB->insert( 'core_applications', $array );
$this->registry->output->global_message = $this->lang->words['a_newapp'];
}
else
{
/* We're disabling the app? */
if ( empty($app_enabled) )
{
$array['app_position'] = 0;
}
else
{
if ( empty($application['app_enabled']) )
{
$appsCount = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as total', 'from' => 'core_applications', 'where' => 'app_enabled=1' ) );
$array['app_position'] = $appsCount['total'] + 1;
}
}
/* Update the application record */
$this->DB->update( 'core_applications', $array, 'app_id=' . $application['app_id'] );
/* Update modules and tasks, if the application directory changed */
if ( $application['app_directory'] != $app_directory )
{
$sphinxRebuild = true;
$this->DB->update( 'task_manager', array( 'task_application' => $app_directory ), "task_application='{$application['app_directory']}'" );
$this->DB->update( 'core_sys_module', array( 'sys_module_application' => $app_directory ), "sys_module_application='{$application['app_directory']}'" );
$this->DB->update( 'admin_logs', array( 'appcomponent' => $app_directory ), "appcomponent='{$application['app_directory']}'" );
@@ -2134,7 +2190,6 @@ XML;
$this->DB->update( 'reputation_index', array( 'app' => $app_directory ), "app='{$application['app_directory']}'" );
$this->DB->update( 'skin_css', array( 'css_app' => $app_directory ), "css_app='{$application['app_directory']}'" );
$this->DB->update( 'skin_css_previous', array( 'p_css_app' => $app_directory ), "p_css_app='{$application['app_directory']}'" );
$this->DB->update( 'tags_index', array( 'app' => $app_directory ), "app='{$application['app_directory']}'" );
$this->DB->update( 'upgrade_history', array( 'upgrade_app' => $app_directory ), "upgrade_app='{$application['app_directory']}'" );
}
@@ -2142,6 +2197,12 @@ XML;
$this->registry->output->global_message = $this->lang->words['a_editappdone'];
}
/* Have we toggled this? */
if ( $app_enabled != $application['app_enabled'] )
{
$sphinxRebuild = true;
}
//-----------------------------------------
// Recache
//-----------------------------------------
@@ -2179,9 +2240,8 @@ XML;
//-----------------------------------------
// Sphinx involved?
//-----------------------------------------
if ( $this->settings['search_method'] == 'sphinx' )
if ( $sphinxRebuild AND $this->settings['search_method'] == 'sphinx' && is_file( IPSLib::getAppDir( $app_directory ) . '/extensions/sphinxTemplate.php' ) )
{
$this->registry->output->global_message .= sprintf( $this->lang->words['rebuild_sphinx'], $this->settings['_base_url'] );
}
@@ -2200,13 +2260,13 @@ XML;
{
/* Init vars */
$application = array();
$form = array();
$form = array();
$defaultTab = '';
//-----------------------------------------
// Add or edit?
//-----------------------------------------
if ( $type == 'add' )
{
$formcode = 'application_add_do';
@@ -2273,8 +2333,14 @@ XML;
$form['app_global_caches'] = $this->registry->output->formMultiDropdown( 'app_global_caches[]', $_caches, isset( $_POST['app_global_caches'] ) ? $_POST['app_global_caches'] : explode( ',', $application['app_global_caches'] ), 15 );
/* Got a default tab specified? */
if ( !empty($this->request['_tab']) )
{
$defaultTab = trim($this->request['_tab']);
}
/* Output */
$this->registry->output->html .= $this->html->application_form( $form, $title, $formcode, $button, $application );
$this->registry->output->html .= $this->html->application_form( $form, $title, $formcode, $button, $application, $defaultTab );
}
/**
@@ -2300,32 +2366,31 @@ XML;
if ( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false )
{
$ajax->returnString( $this->lang->words['postform_badmd5'] );
exit();
}
//-----------------------------------------
// Save new position
//-----------------------------------------
$position = 1;
if ( is_array( $this->request['apps'] ) and count( $this->request['apps'] ) )
{
foreach( $this->request['apps'] as $this_id )
{
$location = $this->DB->buildAndFetch( array( 'select' => 'app_location', 'from' => 'core_applications', 'where' => 'app_id=' . $this_id ) );
$buffer = array( 'root' => 0, 'ips' => 100, 'other' => 200 );
$this->DB->update( 'core_applications', array( 'app_position' => $position + $buffer[$location['app_location']] ), 'app_id=' . $this_id );
$position ++;
}
}
$position = 1;
if ( is_array($this->request['apps']) && count($this->request['apps']) )
{
/* Reset all apps to 0 temporarily */
$this->DB->update( 'core_applications', array( 'app_position' => 0 ) );
foreach( $this->request['apps'] as $this_id )
{
$this->DB->update( 'core_applications', array( 'app_position' => $position ), 'app_id=' . intval($this_id) );
$position++;
}
}
$this->applicationsRecache();
$this->applicationsMenuDataRecache();
$ajax->returnString( 'OK' );
$ajax->returnString('OK');
}
/**
@@ -2336,20 +2401,27 @@ XML;
public function applicationsOverview()
{
/* Init vars */
$folders = array();
$application = array();
$_apps = array();
$uninstalled = array();
$appsUpdates = 0;
$checkUpdates = ! empty( $this->request['checkUpdates'] ) ? true : false;
$folders = array();
$applications = array( 'enabled' => array( 'core' => array() ), 'disabled' => array() );
$_apps = array();
$uninstalled = array();
$checkUpdates = false;
$appsUpdates = 0;
$message = '';
/* Get the setup class */
require_once ( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/
/* Get hooks file for update check */
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'core' ) . '/modules_admin/applications/hooks.php', 'admin_core_applications_hooks' );
$hooksClass = new $classToLoad();
$hooksClass->makeRegistryShortcuts( $this->registry );
/* Checking for updates? */
if ( !empty( $this->request['checkUpdates'] ) )
{
$checkUpdates = true;
/* Get hooks file for update check */
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'core' ) . '/modules_admin/applications/hooks.php', 'admin_core_applications_hooks' );
$hooksClass = new $classToLoad();
$hooksClass->makeRegistryShortcuts( $this->registry );
}
//-----------------------------------------
// Get DB applications
@@ -2375,7 +2447,7 @@ XML;
$row['app_update_available'] = array( 0 );
}
$_apps[IPSLib::getAppFolder( $row['app_directory'] ) . '/' . $row['app_directory']] = $row;
$_apps[ IPSLib::getAppFolder( $row['app_directory'] ) . '/' . $row['app_directory'] ] = $row;
}
//-----------------------------------------
@@ -2407,17 +2479,11 @@ XML;
//-----------------------------------------
// Installed Loop...
//-----------------------------------------
foreach( $_apps as $_app_path => $row )
{
$app_dir = $row['app_directory'];
//-----------------------------------------
// Enabled?
//-----------------------------------------
$row['_app_enabled'] = ( $row['app_enabled'] ) ? 'tick.png' : 'cross.png';
/* Version numbers */
$_a = ( $app_dir == 'forums' or $app_dir == 'members' ) ? 'core' : $app_dir;
$numbers = IPSSetUp::fetchAppVersionNumbers( $_a );
@@ -2441,7 +2507,7 @@ XML;
$phpVersion = str_replace( substr( $phpVersion, strrpos( $phpVersion, '.' ) ), '', $phpVersion );
$encoding = "Zend {$phpVersion}";
}
elseif ( substr( $file, 36, 7 ) == 'ionCube' )
elseif ( substr( $file, 36, 7 ) == 'ionCube' or substr( $file, 37, 7 ) == 'ionCube' )
{
$encoding = 'Ioncube';
}
@@ -2449,18 +2515,16 @@ XML;
$row['_human_current'] .= " ({$encoding})";
}
$application[$row['app_location']][] = $row;
if ( $row['app_enabled'] )
{
$applications['enabled'][ $row['app_directory'] ] = $row;
}
else
{
$applications['disabled'][ $row['app_directory'] ] = $row;
}
}
/* Make sure they are in the proper order, hacky but it works :) */
$__apps = array();
$__apps['root'] = $application['root'] ? $application['root'] : array();
$__apps['ips'] = $application['ips'] ? $application['ips'] : array();
$__apps['other'] = $application['other'] ? $application['other'] : array();
$application = $__apps;
//-----------------------------------------
// Uninstalled
//-----------------------------------------
@@ -2499,14 +2563,115 @@ XML;
}
/* Got updates to show? */
$message = NULL;
if ( $checkUpdates === true )
{
$message = ( $appsUpdates == 1 ) ? $this->lang->words['updates_string_single'] : sprintf( $this->lang->words['updates_string_more'], $appsUpdates );
}
/* Output */
$this->registry->output->html .= $this->html->applications_list( $application, $uninstalled, $message );
$this->registry->output->html .= $this->html->applications_list( $applications, $uninstalled, $message );
}
/**
* View details about an application
*
* @return @e void [Outputs to screen]
*/
protected function applicationViewDetails()
{
$id = intval($this->request['app_id']);
if( !$id )
{
$this->registry->output->showError( $this->lang->words['a_noid'], 11110.1 );
}
$appData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $id ) );
if( !$appData['app_id'] )
{
$this->registry->output->showError( $this->lang->words['a_nodetails'], 11111.1 );
}
/* Format dates */
$lastUpdate = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'upgrade_history', 'where' => "upgrade_app='{$appData['app_directory']}'", 'order' => 'upgrade_version_id DESC', 'limit' => array( 1 ) ) );
$appData['_installed'] = $this->registry->getClass('class_localization')->getDate( $appData['app_added'], 'DATE' );
$appData['_updated'] = ( $lastUpdate['upgrade_date'] > $appData['app_added'] ) ? $this->registry->getClass('class_localization')->getDate( $lastUpdate['upgrade_date'], 'DATE' ) : '--';
/* Get the setup class */
require_once ( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/
/* Version numbers */
$_a = in_array( $appData['app_directory'], array( 'forums', 'members' ) ) ? 'core' : $appData['app_directory'];
$numbers = IPSSetUp::fetchAppVersionNumbers( $_a );
$appData['_human_version'] = $numbers['latest'][1];
$appData['_long_version'] = $numbers['latest'][0];
$appData['_human_current'] = $numbers['current'][1];
$appData['_long_current'] = $numbers['current'][0];
/* Got updates? */
if ( $appData['app_update_check'] )
{
/* Get hooks file for update check */
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'core' ) . '/modules_admin/applications/hooks.php', 'admin_core_applications_hooks' );
$hooksClass = new $classToLoad();
$hooksClass->makeRegistryShortcuts( $this->registry );
$appData['app_update_available'] = $hooksClass->_updateAvailable( $appData['app_update_check'], $appData['app_long_version'] );
}
else
{
$appData['app_update_available'] = array( 0 );
}
/* Get related hooks */
$hooks = array();
$this->DB->build( array( 'select' => '*',
'from' => 'core_hooks',
//This is a bit hackish but there's no way around...
'where' => 'hook_requirements LIKE \'%:"' . $this->DB->addSlashes( $appData['app_directory'] ) . '";a:%\'',
'order' => 'hook_id ASC'
) );
$outer = $this->DB->execute();
/* Got results? */
if ( $this->DB->getTotalRows( $outer ) )
{
/* Get hooks file for update check */
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'core' ) . '/modules_admin/applications/hooks.php', 'admin_core_applications_hooks' );
$hooksClass = new $classToLoad();
$hooksClass->makeRegistryShortcuts( $this->registry );
/* Loop */
while ( $rh = $this->DB->fetch( $outer ) )
{
/* Check requirements */
if( $rh['hook_enabled'] )
{
$rh['_require_errors'] = $hooksClass->checkHookRequirements( $rh );
}
$hooks[] = $rh;
}
}
/* Upgrade history */
$upgradeHistory = array();
$this->DB->build( array( 'select' => '*', 'from' => 'upgrade_history', 'where' => "upgrade_app='" . $this->DB->addSlashes( $appData['app_directory'] ) . "'", 'order' => 'upgrade_version_id DESC' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$upgradeHistory[] = $r;
}
/* Output */
$this->registry->output->html .= $this->html->application_details( $appData, $upgradeHistory, $hooks );
}
/**
@@ -2582,6 +2747,7 @@ XML;
}
$this->cache->setCache( 'app_cache', $apps, array( 'array' => 1 ) );
ipsRegistry::$applications = $apps;
/* Do we have an incomingEmails extension anywhere? */
$systemvars = $this->cache->getCache( 'systemvars' );
@@ -2592,11 +2758,12 @@ XML;
$tabs = array();
foreach( $apps as $dir => $data )
{
if ( ! $data['app_hide_tab'] )
{
# app_hide_tab is already checked in the output class
#if ( ! $data['app_hide_tab'] )
#{
$tabs[] = array( 'app' => $dir, 'groups' => $data['app_tab_groups'], 'module' => '', // Can't use IPSLib::getAppTitle() because of the IN_ACP check in it
'title' => $this->lang->words[$data['app_public_title']] ? $this->lang->words[$data['app_public_title']] : $data['app_public_title'] );
}
#}
if ( is_file( IPSLib::getAppDir( $dir ) . '/extensions/coreVariables.php' ) )
{
@@ -2648,11 +2815,11 @@ XML;
*/
protected function _getHasExtensionItemMarking( $appDir )
{
if ( is_file( IPSLib::getAppDir( $appDir ) . '/extensions/coreExtensions.php' ) )
$_file = IPSLib::getAppDir( $appDir ) . '/extensions/coreExtensions.php';
if ( is_file( $_file ) )
{
require_once( IPSLib::getAppDir( $appDir ) . '/extensions/coreExtensions.php' );/*noLibHook*/
if ( class_exists( 'itemMarking__' . $appDir ) )
$classToLoad = IPSLib::loadLibrary( $_file, 'itemMarking__'.$appDir, $appDir );
if ( class_exists( $classToLoad ) )
{
return true;
}
@@ -2794,7 +2961,7 @@ XML;
//-----------------------------------------
$this->DB->build( array( 'select' => '*', 'from' => 'core_sys_module', 'order' => 'sys_module_position ASC' ) );
$this->DB->build( array( 'select' => '*', 'from' => 'core_sys_module', 'where' => 'sys_module_visible=1 AND sys_module_admin=1', 'order' => 'sys_module_position ASC' ) );
$this->DB->execute();
while ( $module = $this->DB->fetch() )
@@ -1,42 +1,42 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Blog Application
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 27th Aug 2004
* @version $Revision: 8644 $
*
*/
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_core_applications_blog extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://myipb.in/products/blog/");
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Blog Application
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 27th Aug 2004
* @version $Revision: 10914 $
*
*/
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_core_applications_blog extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://external.ipslink.com/ipboard30/landing/?p=blog");
}
}
@@ -1,39 +1,39 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Blog Application
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @version $Revision: 8644 $
*/
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_core_applications_ccs extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://myipb.in/products/content/");
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Blog Application
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @version $Revision: 10914 $
*/
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_core_applications_ccs extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://www.invisionpower.com/products/content/");
}
}
@@ -1,68 +1,68 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Download Manager Application
* Last Updated: $Date: 2011-05-11 12:57:46 -0400 (Wed, 11 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 17 February 2003
* @version $Revision: 8727 $
*
*/
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_core_applications_copyright extends ipsCommand
{
/**
* HTML skin
*
* @var object Skin file
*/
public $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
//-----------------------------------------
// Load HTML
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate( 'cp_skin_applications' );
$this->registry->getClass( 'class_localization' )->loadLanguageFile( array( 'admin_applications' ) );
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=applications&amp;section=copyright';
$this->form_code_js = $this->html->form_code_js = 'module=applications&section=copyright';
//-----------------------------------------
// Just redirect to the setting
//-----------------------------------------
$this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=core&amp;module=settings&amp;section=settings&amp;do=setting_view&amp;conf_title_keyword=ipbcopyright' );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Download Manager Application
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 17 February 2003
* @version $Revision: 10914 $
*
*/
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_core_applications_copyright extends ipsCommand
{
/**
* HTML skin
*
* @var object Skin file
*/
public $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
//-----------------------------------------
// Load HTML
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate( 'cp_skin_applications' );
$this->registry->getClass( 'class_localization' )->loadLanguageFile( array( 'admin_applications' ) );
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=applications&amp;section=copyright';
$this->form_code_js = $this->html->form_code_js = 'module=applications&section=copyright';
//-----------------------------------------
// Just redirect to the setting
//-----------------------------------------
$this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=core&amp;module=settings&amp;section=settings&amp;do=setting_view&amp;conf_title_keyword=ipbcopyright' );
}
}
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'applications' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
@@ -1,42 +1,42 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Download Manager Application
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since Who knows...
* @version $Revision: 8644 $
*
*/
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_core_applications_downloads extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://myipb.in/products/downloads/");
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Download Manager Application
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Who knows...
* @version $Revision: 10914 $
*
*/
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_core_applications_downloads extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://www.invisionpower.com/products/downloads/");
}
}
@@ -1,42 +1,42 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Gallery Application
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since Who knows...
* @version $Revision: 8644 $
*
*/
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_core_applications_gallery extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://myipb.in/products/gallery/");
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Gallery Application
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Who knows...
* @version $Revision: 10914 $
*
*/
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_core_applications_gallery extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://www.invisionpower.com/products/gallery/");
}
}
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,39 +1,39 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Nexus Application
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @version $Revision: 8644 $
*/
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_core_applications_nexus extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://myipb.in/products/nexus/");
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Nexus Application
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @version $Revision: 10914 $
*/
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_core_applications_nexus extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://www.invisionpower.com/products/nexus/");
}
}
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>Управление модулями</title>
<title>Manage Applications &amp; Modules</title>
<subitems>
<subitem>
<subitemtitle>Список модулей</subitemtitle>
<subitemtitle>Manage Applications &amp; Modules</subitemtitle>
<subitemlang>manage_apps_modules</subitemlang>
<subsection>applications</subsection>
<subitemurl>do=applications_overview</subitemurl>
@@ -14,18 +14,17 @@
</subitem>
</subitems>
</item>
<item>
<title>Управление хуками (hooks)</title>
<item>
<title>Manage Hooks</title>
<subitems>
<subitem>
<subitemtitle>Список хуков</subitemtitle>
<subitemtitle>Manage Hooks</subitemtitle>
<subitemlang>manage_hooks</subitemlang>
<subsection>hooks</subsection>
<subitemurl>do=hooks_overview</subitemurl>
<subitemrolekey>hooks_manage</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitem>
</subitems>
</item>
</tabitems>
@@ -1,62 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Управление приложениями</grouptitle>
<grouptitle>Manage Applications</grouptitle>
<grouplang>core_manage_apps</grouplang>
<items>
<item>
<key>app_manage</key>
<string>Может изменять/добавлять приложения?</string>
<string>Can manage applications?</string>
</item>
<item>
<key>app_delete</key>
<string>Может удалять приложения?</string>
<string>Can delete applications?</string>
</item>
<item>
<key>app_install</key>
<string>Может устанавливать новые приложения?</string>
<string>Can install new applications?</string>
</item>
<item>
<key>build_sphinx</key>
<string>Может создавать sphinx.conf? ВНИМАНИЕ: будут доступны данные для соединения с базой данных</string>
<string>Can build sphinx.conf? WARNING: Exposes database login details</string>
</item>
</items>
</group>
<group>
<grouptitle>Управление модулями</grouptitle>
<grouptitle>Manage Modules</grouptitle>
<grouplang>core_manage_modules</grouplang>
<items>
<item>
<key>module_manage</key>
<string>Может изменять/добавлять модули?</string>
<string>Can edit/add application modules?</string>
</item>
<item>
<key>module_delete</key>
<string>Может удалять модули приложений?</string>
<string>Can delete application modules?</string>
</item>
</items>
</group>
<group>
<grouptitle>Покупка приложений</grouptitle>
<grouptitle>Purchase Applications</grouptitle>
<grouplang>core_purchase_app</grouplang>
<items>
<item>
<key>purchase_app</key>
<string>Может просматривать страницу с платными приложениями?</string>
<string>Can view pages to purchase additional applications?</string>
</item>
</items>
</group>
<group>
<grouptitle>Управление модификациями</grouptitle>
<grouptitle>Manage Hooks</grouptitle>
<grouplang>core_manage_hooks</grouplang>
<items>
<item>
<key>hooks_manage</key>
<string>Может добавлять/изменять модификации?</string>
<string>Can manage hooks?</string>
</item>
<item>
<key>hooks_delete</key>
<string>Может удалять модификации?</string>
<string>Can remove hooks?</string>
</item>
</items>
</group>
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'diagnostics' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>Состояние системы</title>
<title>Overview</title>
<subitems>
<subitem>
<subitemtitle>Обзор системы</subitemtitle>
<subitemtitle>Overview</subitemtitle>
<subitemlang>diag_overview</subitemlang>
<subsection>diagnostics</subsection>
<subitemurl></subitemurl>
@@ -15,23 +15,10 @@
</subitems>
</item>
<item>
<title>Проверка версий файлов</title>
<subitems>
<title>Whitespace Checker</title>
<subitems>
<subitem>
<subitemtitle>Проверка версий файлов</subitemtitle>
<subitemlang>version_checker</subitemlang>
<subsection>diagnostics</subsection>
<subitemurl>do=fileversions</subitemurl>
<subitemrolekey>version_checker</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>Проверка лишних пробелов</title>
<subitems>
<subitem>
<subitemtitle>Поиск файлов содержащих лишние пробелы</subitemtitle>
<subitemtitle>Whitespace Checker</subitemtitle>
<subitemlang>whitespace_checker</subitemlang>
<subsection>diagnostics</subsection>
<subitemurl>do=whitespace</subitemurl>
@@ -39,12 +26,12 @@
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
</item>
<item>
<title>Проверка прав файлов</title>
<subitems>
<title>Permissions Checker</title>
<subitems>
<subitem>
<subitemtitle>Проверка прав доступа к файлам</subitemtitle>
<subitemtitle>Permissions Checker</subitemtitle>
<subitemlang>permissions_checker</subitemlang>
<subsection>diagnostics</subsection>
<subitemurl>do=filepermissions</subitemurl>
@@ -54,10 +41,10 @@
</subitems>
</item>
<item>
<title>Проверка сетевых соединений</title>
<subitems>
<title>Connection Checker</title>
<subitems>
<subitem>
<subitemtitle>Проверка сетевых соединений</subitemtitle>
<subitemtitle>Connection Checker</subitemtitle>
<subitemlang>connection_checker</subitemlang>
<subsection>diagnostics</subsection>
<subitemurl>do=connections</subitemurl>
@@ -65,12 +52,12 @@
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
</item>
<item>
<title>Проверка структуры базы</title>
<subitems>
<title>Database Checker</title>
<subitems>
<subitem>
<subitemtitle>Проверка структуры базы данных</subitemtitle>
<subitemtitle>Database Checker</subitemtitle>
<subitemlang>db_checker</subitemlang>
<subsection>diagnostics</subsection>
<subitemurl>do=dbchecker</subitemurl>
@@ -78,12 +65,12 @@
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
</item>
<item>
<title>Проверка индексов базы</title>
<subitems>
<title>Database Index Checker</title>
<subitems>
<subitem>
<subitemtitle>Проверка индексов базы данных</subitemtitle>
<subitemtitle>Database Index Checker</subitemtitle>
<subitemlang>dbi_checker</subitemlang>
<subsection>diagnostics</subsection>
<subitemurl>do=dbindex</subitemurl>
@@ -91,6 +78,19 @@
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
</item>
<item>
<title>Email Tester</title>
<subitems>
<subitem>
<subitemtitle>Email Tester</subitemtitle>
<subitemlang>email_checker</subitemlang>
<subsection>diagnostics</subsection>
<subitemurl>do=email</subitemurl>
<subitemrolekey>email_checker</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
</tabitems>
</menu>
@@ -1,32 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Инструменты диагностики</grouptitle>
<grouptitle>Diagnostic Tools</grouptitle>
<grouplang>core_diag_tools</grouplang>
<items>
<item>
<key>index_checker</key>
<string>Может проверять индексы таблиц базы? Внимание: позволяет выполнять запросы к базе.</string>
<string>Can use the database index checker? Warning: Allows ability to run database queries indirectly.</string>
</item>
<item>
<key>database_checker</key>
<string>Может использовать проверку базы данных? Внимание: позволяет выполнять запросы к базе.</string>
<string>Can use the database checker? Warning: Allows ability to run database queries indirectly.</string>
</item>
<item>
<key>whitespace_checker</key>
<string>Может проверять файлы на лишние пробелы?</string>
</item>
<item>
<key>version_checker</key>
<string>Может проверять файлы на правильность версии?</string>
<string>Can use the whitespace checker?</string>
</item>
<item>
<key>connection_checker</key>
<string>Может использовать проверку сетевых соединений?</string>
<string>Can use the connection checker?</string>
</item>
<item>
<key>permission_checker</key>
<string>Может проверять файлы и директории на правильность расстановки прав доступа?</string>
<string>Can use the permissions checker?</string>
</item>
<item>
<key>email_checker</key>
<string>Can use the email tester?</string>
</item>
</items>
</group>
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'help' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,145 +1,145 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Quick help - shows popups with help information
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 1st march 2002
* @version $Revision: 8644 $
*
*/
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_core_help_quickhelp extends ipsCommand
{
/**
* Array of help text
*
* @var array Help texts
*/
protected $help_text = array();
/**
* Initialize the help text array
*
* @return @e void [Outputs to screen]
*/
protected function _initText()
{
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ) );
return array( 'mg_dohtml' => array( 'title' => $this->lang->words['q_html'],
'body' => $this->lang->words['q_html_info'],
),
'mod_mmod' => array( 'title' => $this->lang->words['q_multi'],
'body' => $this->lang->words['q_multi_info'],
),
'set_spider' => array( 'title' => $this->lang->words['q_bots'],
'body' => $this->lang->words['q_bots_info'],
),
'mg_upload' => array( 'title' => $this->lang->words['q_upload'],
'body' => $this->lang->words['q_upload_info'],
),
'mg_promote' => array( 'title' => $this->lang->words['q_promote'],
'body' => $this->lang->words['q_promote_info'],
),
's_reg_antispam' => array ( 'title' => $this->lang->words['q_captcha'],
'body' => $this->lang->words['q_captcha_info'],
),
'm_bulkemail' => array ( 'title' => $this->lang->words['q_bulk'],
'body' => $this->lang->words['q_bulk_info'],
),
'comp_menu' => array ( 'title' => $this->lang->words['q_components'],
'body' => $this->lang->words['q_components_info'],
),
);
}
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$id = $this->request['id'];
if( $this->request['do'] == 'redirect' )
{
$this->_redirect( $id );
}
$this->help_text = $this->_initText();
if ($this->help_text[ $id ]['title'] == "")
{
$this->registry->output->showError( $this->lang->words['q_nohelp'], 11148 );
}
$this->registry->output->html .= $this->registry->output->global_template->quickHelp( $this->help_text[$id]['title'], $this->help_text[$id]['body'] );
$this->registry->output->printPopupWindow();
}
/**
* Redirect offsite for more help/options
*
* @param string 'key' to redirect to
* @return @e void [Outputs to screen]
*/
private function _redirect( $id )
{
switch( $id )
{
case 'docs':
$url = "http://myipb.in/docs-ipb";
break;
case 'resources':
$url = "http://myipb.in/forums";
break;
case 'contact':
$url = "http://myipb.in/contact";
break;
case 'features':
$url = "http://myipb.in/suggestfeatures";
break;
case 'bugs':
$url = "http://myipb.in/bugtrack";
break;
default:
case 'support':
$url = "http://myipb.in/clientarea";
break;
}
$this->registry->output->silentRedirect( $url );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Quick help - shows popups with help information
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 1st march 2002
* @version $Revision: 10914 $
*
*/
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_core_help_quickhelp extends ipsCommand
{
/**
* Array of help text
*
* @var array Help texts
*/
protected $help_text = array();
/**
* Initialize the help text array
*
* @return @e void [Outputs to screen]
*/
protected function _initText()
{
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ) );
return array( 'mg_dohtml' => array( 'title' => $this->lang->words['q_html'],
'body' => $this->lang->words['q_html_info'],
),
'mod_mmod' => array( 'title' => $this->lang->words['q_multi'],
'body' => $this->lang->words['q_multi_info'],
),
'set_spider' => array( 'title' => $this->lang->words['q_bots'],
'body' => $this->lang->words['q_bots_info'],
),
'mg_upload' => array( 'title' => $this->lang->words['q_upload'],
'body' => $this->lang->words['q_upload_info'],
),
'mg_promote' => array( 'title' => $this->lang->words['q_promote'],
'body' => $this->lang->words['q_promote_info'],
),
's_reg_antispam' => array ( 'title' => $this->lang->words['q_captcha'],
'body' => $this->lang->words['q_captcha_info'],
),
'm_bulkemail' => array ( 'title' => $this->lang->words['q_bulk'],
'body' => $this->lang->words['q_bulk_info'],
),
'comp_menu' => array ( 'title' => $this->lang->words['q_components'],
'body' => $this->lang->words['q_components_info'],
),
);
}
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$id = $this->request['id'];
if( $this->request['do'] == 'redirect' )
{
$this->_redirect( $id );
}
$this->help_text = $this->_initText();
if ($this->help_text[ $id ]['title'] == "")
{
$this->registry->output->showError( $this->lang->words['q_nohelp'], 11148 );
}
$this->registry->output->html .= $this->registry->output->global_template->quickHelp( $this->help_text[$id]['title'], $this->help_text[$id]['body'] );
$this->registry->output->printPopupWindow();
}
/**
* Redirect offsite for more help/options
*
* @param string 'key' to redirect to
* @return @e void [Outputs to screen]
*/
private function _redirect( $id )
{
switch( $id )
{
case 'docs':
$url = "http://external.ipslink.com/ipboard30/landing/?p=docs-ipb";
break;
case 'resources':
$url = "http://external.ipslink.com/ipboard30/landing/?p=resources";
break;
case 'contact':
$url = "http://external.ipslink.com/ipboard30/landing/?p=contact";
break;
case 'features':
$url = "http://external.ipslink.com/ipboard30/landing/?p=suggestfeatures";
break;
case 'bugs':
$url = "http://external.ipslink.com/ipboard30/landing/?p=bugs";
break;
default:
case 'support':
$url = "http://external.ipslink.com/ipboard30/landing/?p=support";
break;
}
$this->registry->output->silentRedirect( $url );
}
}
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,66 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<menu>
<tabitems>
<item>
<title>Документация</title>
<subitems>
<subitem>
<subitemtitle>Документация</subitemtitle>
<subitemlang>help_documentation</subitemlang>
<subsection>quickhelp</subsection>
<subitemurl>do=redirect&amp;id=docs</subitemurl>
<subisredirect>1</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>Тех. поддержка</title>
<subitems>
<subitem>
<subitemtitle>Техническая поддержка</subitemtitle>
<subitemlang>help_support</subitemlang>
<subsection>quickhelp</subsection>
<subitemurl>do=redirect&amp;id=support</subitemurl>
<subisredirect>1</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>Форумы</title>
<subitems>
<subitem>
<subitemtitle>Форумы IBResource</subitemtitle>
<subitemlang>help_resources</subitemlang>
<subsection>quickhelp</subsection>
<subitemurl>do=redirect&amp;id=resources</subitemurl>
<subisredirect>1</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>Контакты</title>
<subitems>
<subitem>
<subitemtitle>Контактная информация</subitemtitle>
<subitemlang>help_contact</subitemlang>
<subsection>quickhelp</subsection>
<subitemurl>do=redirect&amp;id=contact</subitemurl>
<subisredirect>1</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>Сообщить об ошибке</title>
<subitems>
<subitem>
<subitemtitle>Сообщить об ошибке</subitemtitle>
<subitemlang>help_bugs</subitemlang>
<subsection>quickhelp</subsection>
<subitemurl>do=redirect&amp;id=bugs</subitemurl>
<subisredirect>1</subisredirect>
</subitem>
</subitems>
</item>
</tabitems>
<?xml version="1.0" encoding="UTF-8"?>
<menu>
<tabitems>
<item>
<title>Documentation</title>
<subitems>
<subitem>
<subitemtitle>Documentation</subitemtitle>
<subitemlang>help_documentation</subitemlang>
<subsection>quickhelp</subsection>
<subitemurl>do=redirect&amp;id=docs</subitemurl>
<subisredirect>1</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>Technical Support</title>
<subitems>
<subitem>
<subitemtitle>Technical Support</subitemtitle>
<subitemlang>help_support</subitemlang>
<subsection>quickhelp</subsection>
<subitemurl>do=redirect&amp;id=support</subitemurl>
<subisredirect>1</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>Additional Resources</title>
<subitems>
<subitem>
<subitemtitle>Additional Resources</subitemtitle>
<subitemlang>help_resources</subitemlang>
<subsection>quickhelp</subsection>
<subitemurl>do=redirect&amp;id=resources</subitemurl>
<subisredirect>1</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>IPS Contact Information</title>
<subitems>
<subitem>
<subitemtitle>IPS Contact Information</subitemtitle>
<subitemlang>help_contact</subitemlang>
<subsection>quickhelp</subsection>
<subitemurl>do=redirect&amp;id=contact</subitemurl>
<subisredirect>1</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>Feature Requests</title>
<subitems>
<subitem>
<subitemtitle>Feature Requests</subitemtitle>
<subitemlang>help_features</subitemlang>
<subsection>quickhelp</subsection>
<subitemurl>do=redirect&amp;id=features</subitemurl>
<subisredirect>1</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>Report a Bug</title>
<subitems>
<subitem>
<subitemtitle>Report a Bug</subitemtitle>
<subitemlang>help_bugs</subitemlang>
<subsection>quickhelp</subsection>
<subitemurl>do=redirect&amp;id=bugs</subitemurl>
<subisredirect>1</subisredirect>
</subitem>
</subitems>
</item>
</tabitems>
</menu>
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'languages' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -1,10 +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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<menu>
<tabitems>
<tabitems>
<item>
<title>Языки</title>
<title>Manage Languages</title>
<subitems>
<subitem>
<subitemtitle>Языки системы</subitemtitle>
<subitemtitle>Manage Languages</subitemtitle>
<subitemlang>languages</subitemlang>
<subsection>manage_languages</subsection>
<subitemurl></subitemurl>
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Управление языками</grouptitle>
<grouptitle>Manage Languages</grouptitle>
<grouplang>core_languages</grouplang>
<items>
<item>
<key>lang_words</key>
<string>Может добавлять/изменять слова?</string>
<string>Can add/edit the language bit texts?</string>
</item>
<item>
<key>lang_packs</key>
<string>Может добавлять/изменять языковые наборы?</string>
<string>Can add/edit language packs?</string>
</item>
<item>
<key>lang_pack_info</key>
<string>Может изменять настройки и информацию языковых наборов?</string>
<string>Can alter the language pack properties and information?</string>
</item>
</items>
</group>
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,408 +1,413 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* ACP Login/Logout Routines
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since Tuesday 17th August 2004
* @version $Revision: 8644 $
*/
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_core_login_manualResolver extends ipsCommand
{
/**
* HTML Skin object
*
* @var object
*/
protected $html;
/**#@+
* Registry objects
*
* @var object
*/
public $registry;
public $DB;
public $settings;
public $request;
public $lang;
public $member;
public $memberData;
/**#@-*/
/**
* Login handler object
*
* @var object
*/
protected $han_login;
/**
* Initiate login handler
*
* @return @e void
*/
public function initHanLogin()
{
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$this->han_login = new $classToLoad( $this->registry );
$this->han_login->is_admin_auth = 1;
$this->han_login->init();
}
/**
* Class entry point
*
* @param object Registry reference
* @param string Validation message
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry, $validationMessage='' )
{
/* Make object */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->lang = $this->registry->getClass('class_localization');
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_login' ), 'core' );
$this->initHanLogin();
//-----------------------------------------
// What to do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'login':
default:
$this->loginForm();
break;
case 'login-complete':
$this->loginComplete();
break;
case 'login-out':
$this->loginOut();
break;
}
}
/**
* Check and verify the login was successful
*
* @return @e void
*/
public function loginComplete()
{
//-----------------------------------------
// Check form details.
//-----------------------------------------
$this->request['email'] = str_replace( '|', '&#124;', $this->request['email'] );
$username = '';
$email = '';
//-----------------------------------------
// Is this a username or email address?
//-----------------------------------------
$_type = $this->han_login->emailOrUsername();
switch( $_type )
{
case 1:
$username = $this->request['username'];
break;
case 2:
$email = $this->request['username'];
break;
case 3:
$username = $this->request['username'];
$email = $this->request['username'];
break;
}
//-----------------------------------------
// Check auth
//-----------------------------------------
$this->han_login->loginAuthenticate( $username, $email, trim($this->request['password']) );
//-----------------------------------------
// Check return code...
//-----------------------------------------
$mem = $this->han_login->member_data;
if ( ( ! $mem['member_id'] ) or ( $this->han_login->return_code == 'NO_USER' ) )
{
$this->_writeToLog( $this->request['username'], 'fail' );
$this->loginForm( $this->lang->words['bad_email_password'] );
}
if ( $this->han_login->return_code == 'NO_ACCESS' )
{
$this->_writeToLog( $this->request['username'], 'fail' );
$this->loginForm( $this->lang->words['no_acp_access'] );
}
else if ( $this->han_login->return_code != 'SUCCESS' )
{
$this->_writeToLog( $this->request['username'], 'fail' );
$this->loginForm( $this->lang->words['bad_email_password'] );
}
//-----------------------------------------
// And sort secondary groups...
//-----------------------------------------
$mem = $this->member->setUpSecondaryGroups( $mem );
//-----------------------------------------
// Check access...
//-----------------------------------------
if ( $mem['g_access_cp'] != 1 )
{
$this->_writeToLog( $this->request['username'], 'fail' );
$this->loginForm( $this->lang->words['no_acp_access'] );
}
else
{
//-----------------------------------------
// Fix up query string...
//-----------------------------------------
$extra_query = "";
if ( $_POST['qstring'] )
{
$extra_query = stripslashes( $_POST['qstring'] );
$extra_query = str_replace( $this->settings['_original_base_url'] , "" , $extra_query );
$extra_query = str_ireplace( "?index." . $this->settings['php_ext'] , "" , $extra_query );
$extra_query = ltrim( $extra_query, '?' );
$extra_query = preg_replace( "!adsess=(\w){32}!" , "" , $extra_query );
$extra_query = str_replace( "adsess=x" , "" , $extra_query );
$extra_query = str_replace( array( 'old_&', 'old_&amp;' ) , "" , $extra_query );
$extra_query = preg_replace( "!s=(\w){32}!" , "" , $extra_query );
$extra_query = str_replace( "module=login" , "" , $extra_query );
$extra_query = str_replace( "do=login-complete" , "" , $extra_query );
$extra_query = str_replace( "/admin" , "" , $extra_query );
$extra_query = str_replace( '&amp;' , '&', $extra_query );
$extra_query = preg_replace( "#&{1,}#" , "&", $extra_query );
$extra_query = preg_replace( "#messageinabottleacp=(.*?)$#" , "" , $extra_query );
}
//-----------------------------------------
// Insert session
//-----------------------------------------
$sess_id = md5( uniqid( microtime() ) );
$this->DB->delete( 'core_sys_cp_sessions', 'session_member_id=' . $mem['member_id'] );
/* Grab user agent */
$uAgent = array();
$this->DB->insert( 'core_sys_cp_sessions', array (
'session_id' => $sess_id,
'session_ip_address' => $this->member->ip_address,
'session_member_name' => $mem['members_display_name'],
'session_member_id' => $mem['member_id'],
'session_member_login_key' => $mem['member_login_key'],
'session_location' => 'index',
'session_log_in_time' => time(),
'session_running_time' => time(),
'session_app_data' => serialize( $uAgent ),
'session_url' => '',
) );
$this->request['adsess'] = $sess_id;
//-----------------------------------------
// Redirect...
//-----------------------------------------
$url = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/index.php?adsess=' . $sess_id . '&' . $extra_query;
$this->_writeToLog( $this->request['username'], 'ok' );
ipsRegistry::getClass('output')->global_message = '';
ipsRegistry::getClass('output')->silentRedirect( $url );
}
}
/**
* Log the user out
*
* @return @e void
*/
public function loginOut()
{
//-----------------------------------------
// Do it..
//-----------------------------------------
$this->DB->delete( 'core_sys_cp_sessions', "session_id='" . $this->request['adsess'] . "'" );
//-----------------------------------------
// Redirect...
//-----------------------------------------
ipsRegistry::getClass('output')->redirect( $this->settings['base_url'] . '/' . CP_DIRECTORY . '/index.php', $this->lang->words['logout_complete'] );
}
/**
* Log the user out
*
* @param string Message to show on the form
* @return @e void
*/
public function loginForm( $message='' )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$message = $message ? $message : $this->member->sessionClass()->getMessage();
//-------------------------------------------------------
// Remove all out of date sessions, like a good boy. Woof.
//-------------------------------------------------------
$cut_off_stamp = time() - 60*60*2;
$this->DB->delete( 'core_sys_cp_sessions', "session_running_time < {$cut_off_stamp}" );
//------------------------------------------------------
// Start form
//------------------------------------------------------
$qs = str_replace( '&amp;' , '&' , IPSText::parseCleanValue( urldecode( my_getenv( 'QUERY_STRING' ) ) ) );
$qs = str_replace( 'adsess=' , 'old_adsess=' , $qs );
$qs = str_replace( 'module=menu', '' , $qs );
$additional_data = $this->han_login->additionalFormHTML();
$replace = false;
$data = array();
if( !is_null($additional_data) AND is_array($additional_data) AND count($additional_data) )
{
$replace = $additional_data[0];
$data = $additional_data[1];
}
$uses_name = false;
$uses_email = false;
foreach( ipsRegistry::cache()->getCache('login_methods') as $method )
{
$login_methods[ $method['login_folder_name'] ] = $method['login_folder_name'];
if( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' )
{
$uses_name = true;
}
if( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' )
{
$uses_email = true;
}
}
if( $uses_name AND $uses_email )
{
$this->lang->words['gl_signinname'] = $this->lang->words['enter_name_and_email'];
}
else if( $uses_email )
{
$this->lang->words['gl_signinname'] = $this->lang->words['enter_useremail'];
}
else
{
$this->lang->words['gl_signinname'] = $this->lang->words['enter_username'];
}
ipsRegistry::getClass('output')->html_title = $this->lang->words['ipb_login'];
ipsRegistry::getClass('output')->html_main = ipsRegistry::getClass('output')->global_template->log_in_form( $qs, $message, $replace == 'replace' ? true : false, $data );
ipsRegistry::getClass('output')->html_main = str_replace( '<%TITLE%>' , ipsRegistry::getClass('output')->html_title, ipsRegistry::getClass('output')->html_main );
@header("Content-type: text/html");
print ipsRegistry::getClass('output')->html_main;
exit();
}
/**
* Write to the admin log in loggy ma log
*
* @param string Username
* @param string ok/fail flag
* @return @e void
* @note This is private so that a hacker couldn't get into ACP, upload a new hook that lets them clear the log, and then clear the login log
*/
private function _writeToLog( $username='', $flag='fail' )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$username = $username ? $username : $this->request['username'];
$flag = ( $flag == 'ok' ) ? 1 : 0;
$admin_post_details = array();
//-----------------------------------------
// Generate POST / GET details
//-----------------------------------------
foreach( $_GET as $k => $v )
{
$admin_post_details['get'][ $k ] = $v;
}
foreach( $_POST as $k => $v )
{
if ( $k == 'password' AND IPSText::mbstrlen( $v ) > 1 )
{
$v = $v ? ( (IPSText::mbstrlen( $v ) - 1) > 0 ? str_repeat( '*', IPSText::mbstrlen( $v ) - 1 ) : '' ) . substr( $v, -1, 1 ) : '';
}
$admin_post_details['post'][ $k ] = $v;
}
//-----------------------------------------
// Write to disk...
//-----------------------------------------
$this->DB->insert( 'admin_login_logs', array( 'admin_ip_address' => $this->member->ip_address,
'admin_username' => $username,
'admin_time' => time(),
'admin_success' => $flag,
'admin_post_details' => serialize( $admin_post_details ) ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* ACP Login/Logout Routines
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Tuesday 17th August 2004
* @version $Revision: 10914 $
*/
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_core_login_manualResolver extends ipsCommand
{
/**
* HTML Skin object
*
* @var object
*/
protected $html;
/**#@+
* Registry objects
*
* @var object
*/
public $registry;
public $DB;
public $settings;
public $request;
public $lang;
public $member;
public $memberData;
/**#@-*/
/**
* Login handler object
*
* @var object
*/
protected $han_login;
/**
* Initiate login handler
*
* @return @e void
*/
public function initHanLogin()
{
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$this->han_login = new $classToLoad( $this->registry );
$this->han_login->is_admin_auth = 1;
$this->han_login->init();
}
/**
* Class entry point
*
* @param object Registry reference
* @param string Validation message
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry, $validationMessage='' )
{
/* Make object */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->lang = $this->registry->getClass('class_localization');
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_login' ), 'core' );
$this->initHanLogin();
//-----------------------------------------
// What to do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'login':
default:
$this->loginForm();
break;
case 'login-complete':
$this->loginComplete();
break;
case 'login-out':
$this->loginOut();
break;
}
}
/**
* Check and verify the login was successful
*
* @return @e void
*/
public function loginComplete()
{
/* Fetch sessions API */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/session/api.php', 'session_api' );
$publicApi = new $classToLoad( $this->registry );
//-----------------------------------------
// Check form details.
//-----------------------------------------
$this->request['email'] = str_replace( '|', '&#124;', $this->request['email'] );
$username = '';
$email = '';
//-----------------------------------------
// Is this a username or email address?
//-----------------------------------------
$_type = $this->han_login->emailOrUsername();
switch( $_type )
{
case 1:
$username = $this->request['username'];
break;
case 2:
$email = $this->request['username'];
break;
case 3:
$username = $this->request['username'];
$email = $this->request['username'];
break;
}
//-----------------------------------------
// Check auth
//-----------------------------------------
$this->han_login->loginAuthenticate( $username, $email, trim($this->request['password']) );
//-----------------------------------------
// Check return code...
//-----------------------------------------
$mem = $this->han_login->member_data;
if ( ( ! $mem['member_id'] ) or ( $this->han_login->return_code == 'NO_USER' ) )
{
$this->_writeToLog( $this->request['username'], 'fail' );
$this->loginForm( $this->lang->words['bad_email_password'] );
}
if ( $this->han_login->return_code == 'NO_ACCESS' )
{
$this->_writeToLog( $this->request['username'], 'fail' );
$this->loginForm( $this->lang->words['no_acp_access'] );
}
else if ( $this->han_login->return_code != 'SUCCESS' )
{
$this->_writeToLog( $this->request['username'], 'fail' );
$this->loginForm( $this->lang->words['bad_email_password'] );
}
//-----------------------------------------
// And sort secondary groups...
//-----------------------------------------
$mem = $this->member->setUpSecondaryGroups( $mem );
//-----------------------------------------
// Check access...
//-----------------------------------------
if ( $mem['g_access_cp'] != 1 )
{
$this->_writeToLog( $this->request['username'], 'fail' );
$this->loginForm( $this->lang->words['no_acp_access'] );
}
else
{
//-----------------------------------------
// Fix up query string...
//-----------------------------------------
$extra_query = "";
if ( $_POST['qstring'] )
{
$extra_query = stripslashes( $_POST['qstring'] );
$extra_query = str_replace( $this->settings['_original_base_url'] , "" , $extra_query );
$extra_query = str_ireplace( "?index." . $this->settings['php_ext'] , "" , $extra_query );
$extra_query = ltrim( $extra_query, '?' );
$extra_query = preg_replace( '!adsess=(\w){32}!' , "" , $extra_query );
$extra_query = str_replace( "adsess=x" , "" , $extra_query );
$extra_query = str_replace( array( 'old_&', 'old_&amp;' ) , "" , $extra_query );
$extra_query = preg_replace( '!s=(\w){32}!' , "" , $extra_query );
$extra_query = str_replace( "module=login" , "" , $extra_query );
$extra_query = str_replace( "do=login-complete" , "" , $extra_query );
$extra_query = str_replace( "/admin" , "" , $extra_query );
$extra_query = str_replace( '&amp;' , '&', $extra_query );
$extra_query = preg_replace( "#&{1,}#" , "&", $extra_query );
$extra_query = preg_replace( "#messageinabottleacp=(.*?)$#" , "" , $extra_query );
}
//-----------------------------------------
// Insert session
//-----------------------------------------
$sess_id = md5( uniqid( microtime() ) );
$this->DB->delete( 'core_sys_cp_sessions', 'session_member_id=' . $mem['member_id'] );
/* Grab user agent */
$uAgent = array();
$this->DB->insert( 'core_sys_cp_sessions', array( 'session_id' => $sess_id,
'session_ip_address' => $this->member->ip_address,
'session_member_name' => $mem['members_display_name'],
'session_member_id' => $mem['member_id'],
'session_member_login_key' => $mem['member_login_key'],
'session_location' => 'index',
'session_log_in_time' => time(),
'session_running_time' => time(),
'session_app_data' => serialize( $uAgent ),
'session_url' => '' ) );
$this->request['adsess'] = $sess_id;
/* Log them in public side if not already */
$publicApi->logGuestInAsMember( $mem['member_id'] );
//-----------------------------------------
// Redirect...
//-----------------------------------------
$url = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/index.php?adsess=' . $sess_id . '&' . $extra_query;
$this->_writeToLog( $this->request['username'], 'ok' );
ipsRegistry::getClass('output')->global_message = '';
ipsRegistry::getClass('output')->silentRedirect( $url );
}
}
/**
* Log the user out
*
* @return @e void
*/
public function loginOut()
{
//-----------------------------------------
// Do it..
//-----------------------------------------
$this->DB->delete( 'core_sys_cp_sessions', "session_id='" . $this->request['adsess'] . "'" );
//-----------------------------------------
// Redirect...
//-----------------------------------------
ipsRegistry::getClass('output')->silentRedirect( $this->settings['_admin_link'] );
}
/**
* Log the user out
*
* @param string Message to show on the form
* @return @e void
*/
public function loginForm( $message='' )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$message = $message ? $message : $this->member->sessionClass()->getMessage();
//-------------------------------------------------------
// Remove all out of date sessions, like a good boy. Woof.
//-------------------------------------------------------
$cut_off_stamp = time() - 60*60*2;
$this->DB->delete( 'core_sys_cp_sessions', "session_running_time < {$cut_off_stamp}" );
//------------------------------------------------------
// Start form
//------------------------------------------------------
$qs = str_replace( '&amp;' , '&' , IPSText::parseCleanValue( urldecode( my_getenv( 'QUERY_STRING' ) ) ) );
$qs = str_replace( 'adsess=' , 'old_adsess=' , $qs );
$qs = str_replace( 'module=menu', '' , $qs );
$additional_data = $this->han_login->additionalFormHTML();
$replace = false;
$data = array();
if( !is_null($additional_data) AND is_array($additional_data) AND count($additional_data) )
{
$replace = $additional_data[0];
$data = $additional_data[1];
}
$uses_name = false;
$uses_email = false;
foreach( ipsRegistry::cache()->getCache('login_methods') as $method )
{
$login_methods[ $method['login_folder_name'] ] = $method['login_folder_name'];
if( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' )
{
$uses_name = true;
}
if( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' )
{
$uses_email = true;
}
}
if( $uses_name AND $uses_email )
{
$this->lang->words['gl_signinname'] = $this->lang->words['enter_name_and_email'];
}
else if( $uses_email )
{
$this->lang->words['gl_signinname'] = $this->lang->words['enter_useremail'];
}
else
{
$this->lang->words['gl_signinname'] = $this->lang->words['enter_username'];
}
ipsRegistry::getClass('output')->html_title = $this->lang->words['ipb_login'];
ipsRegistry::getClass('output')->html_main = ipsRegistry::getClass('output')->global_template->log_in_form( $qs, $message, $replace == 'replace' ? true : false, $data );
ipsRegistry::getClass('output')->html_main = str_replace( '<%TITLE%>' , ipsRegistry::getClass('output')->html_title, ipsRegistry::getClass('output')->html_main );
@header("Content-type: text/html");
print ipsRegistry::getClass('output')->html_main;
exit();
}
/**
* Write to the admin log in loggy ma log
*
* @param string Username
* @param string ok/fail flag
* @return @e void
* @note This is private so that a hacker couldn't get into ACP, upload a new hook that lets them clear the log, and then clear the login log
*/
private function _writeToLog( $username='', $flag='fail' )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$username = $username ? $username : $this->request['username'];
$flag = ( $flag == 'ok' ) ? 1 : 0;
$admin_post_details = array();
//-----------------------------------------
// Generate POST / GET details
//-----------------------------------------
foreach( $_GET as $k => $v )
{
$admin_post_details['get'][ $k ] = $v;
}
foreach( $_POST as $k => $v )
{
if ( $k == 'password' AND IPSText::mbstrlen( $v ) > 1 )
{
$v = $v ? ( (IPSText::mbstrlen( $v ) - 1) > 0 ? str_repeat( '*', IPSText::mbstrlen( $v ) - 1 ) : '' ) . substr( $v, -1, 1 ) : '';
}
$admin_post_details['post'][ $k ] = $v;
}
//-----------------------------------------
// Write to disk...
//-----------------------------------------
$this->DB->insert( 'admin_login_logs', array( 'admin_ip_address' => $this->member->ip_address,
'admin_username' => $username,
'admin_time' => time(),
'admin_success' => $flag,
'admin_post_details' => serialize( $admin_post_details ) ) );
}
}
@@ -1,326 +1,358 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Admin logs
* Last Updated: $LastChangedDate: 2011-06-01 22:13:27 -0400 (Wed, 01 Jun 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 27th January 2004
* @version $Rev: 8938 $
*/
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_core_logs_adminlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_adminlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=adminlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=adminlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
//-----------------------------------------
// Fix up navigation bar
//-----------------------------------------
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=adminlogs', $this->lang->words['alog_adminlogs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'view':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'adminlogs_view' );
$this->_view();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'adminlogs_delete' );
$this->_remove();
break;
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'adminlogs_view' );
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* View all logs for a given admin
*
* @return @e void [Outputs to screen]
*/
protected function _view()
{
///----------------------------------------
// Basic init
//-----------------------------------------
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
///----------------------------------------
// No mid or search string?
//-----------------------------------------
if ( !$this->request['search_string'] AND !$this->request['mid'] )
{
$this->registry->output->global_message = $this->lang->words['alog_nostring'];
$this->_listCurrent();
return;
}
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
///----------------------------------------
// mid?
//-----------------------------------------
if ( !$this->request['search_string'] )
{
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'admin_logs', 'where' => "member_id=" . intval($this->request['mid']) ) );
$query = "{$this->form_code}&amp;mid=" . ( $this->request['mid'] ? $this->request['mid'] : 'zero' ) . "&amp;do=view";
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'admin_logs' => 'm' ),
'where' => 'm.member_id=' . intval($this->request['mid']),
'order' => 'm.ctime DESC',
'limit' => array( $start, 20 ),
'add_join' => array(
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
}
///----------------------------------------
// search string?
//-----------------------------------------
else
{
$this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
if( !$this->DB->checkForField( $this->request['search_type'], 'admin_logs' ) )
{
$this->registry->output->showError( $this->lang->words['alog_whatfield'], 4110, true );
}
if( $this->request['search_type'] == 'member_id' )
{
$dbq = "m." . $this->request['search_type'] . "='" . $this->request['search_string'] . "'";
}
else
{
$dbq = "m." . $this->request['search_type'] . " LIKE '%" . $this->request['search_string'] . "%'";
}
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'admin_logs m', 'where' => $dbq ) );
$query = "{$this->form_code}&amp;do=view&amp;search_type=" . $this->request['search_type'] . "&amp;search_string=" . urlencode($this->request['search_string']);
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'admin_logs' => 'm' ),
'where' => $dbq,
'order' => 'm.ctime DESC',
'limit' => array( $start, 20 ),
'add_join' => array(
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
}
///----------------------------------------
// Page links
//-----------------------------------------
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'],
'itemsPerPage' => 20,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . $query,
)
);
///----------------------------------------
// Get db results
//-----------------------------------------
while ( $row = $this->DB->fetch() )
{
if( !$row['member_id'] )
{
$row['member_id'] = 'zero';
}
if( !$row['members_display_name'] )
{
$row['members_display_name'] = $this->lang->words['noname_availabl'];
}
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
$rows[] = $row;
}
///----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->adminlogsView( $rows, $links );
}
/**
* Remove logs by an admin
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if ( !$this->request['mid'] )
{
$this->registry->output->showError( $this->lang->words['alog_whoselog'], 11114 );
}
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
$this->DB->delete( 'admin_logs', "member_id=" . intval($this->request['mid']) );
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->form_code );
}
/**
* List the current logs with links to view per-admin
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$rows = array();
$admins = array();
//-----------------------------------------
// LAST FIVE ACTIONS
//-----------------------------------------
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'admin_logs' => 'm' ),
'order' => 'm.ctime DESC',
'limit' => array( 5 ),
'add_join' => array(
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
while ( $row = $this->DB->fetch() )
{
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
$rows[] = $row;
}
//-----------------------------------------
// All admins
//-----------------------------------------
$this->DB->build( array(
'select' => 'count(l.member_id) as act_count, l.member_id',
'from' => array( 'admin_logs' => 'l' ),
'group' => 'l.member_id',
'order' => 'act_count DESC',
'add_join' => array(
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.member_id',
'type' => 'left',
),
),
) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
if( !$r['member_id'] )
{
$r['member_id'] = 'zero';
}
if( !$r['members_display_name'] )
{
$r['members_display_name'] = $this->lang->words['noname_availabl'];
}
$admins[ $r['member_id'] ] = $r;
}
//-----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->adminlogsWrapper( $rows, $admins );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Admin logs
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 10914 $
*/
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_core_logs_adminlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_adminlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=adminlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=adminlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'view':
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=adminlogs', $this->lang->words['alog_adminlogs'] );
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'adminlogs_view' );
$this->_view();
break;
case 'remove':
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=adminlogs', $this->lang->words['alog_adminlogs'] );
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'adminlogs_delete' );
$this->_remove();
break;
default:
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=adminlogs', $this->lang->words['alog_adminlogs'] );
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'adminlogs_view' );
$this->_listCurrent();
break;
case 'showArchived':
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=adminlogs&do=showArchived', $this->lang->words['archiver_title'] );
$this->_listArchiver();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* View archive logs
*
* @return @e void [Outputs to screen]
*/
protected function _listArchiver()
{
$data = array();
$start = intval( $this->request['st'] );
/* Get count */
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'core_archive_log' ) );
$this->DB->build( array( 'select' => '*',
'from' => 'core_archive_log',
'order' => 'archlog_date DESC',
'limit' => array( $start, 50 ) ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$data[] = $row;
}
/* Pagination */
$links = $this->registry->output->generatePagination( array( 'totalItems' => $count['count'],
'itemsPerPage' => 50,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . $this->form_code . '&amp;do=showArchived' ) );
/* Show output */
$this->registry->output->html .= $this->html->archiverlogsView( $data, $links );
}
/**
* View all logs for a given admin
*
* @return @e void [Outputs to screen]
*/
protected function _view()
{
///----------------------------------------
// Basic init
//-----------------------------------------
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
///----------------------------------------
// No mid or search string?
//-----------------------------------------
if ( !$this->request['search_string'] AND !$this->request['mid'] )
{
$this->registry->output->global_message = $this->lang->words['alog_nostring'];
$this->_listCurrent();
return;
}
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
///----------------------------------------
// mid?
//-----------------------------------------
if ( !$this->request['search_string'] )
{
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'admin_logs', 'where' => "member_id=" . intval($this->request['mid']) ) );
$query = "{$this->form_code}&amp;mid=" . ( $this->request['mid'] ? $this->request['mid'] : 'zero' ) . "&amp;do=view";
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'admin_logs' => 'm' ),
'where' => 'm.member_id=' . intval($this->request['mid']),
'order' => 'm.ctime DESC',
'limit' => array( $start, 20 ),
'add_join' => array(
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
}
///----------------------------------------
// search string?
//-----------------------------------------
else
{
$this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
if( !$this->DB->checkForField( $this->request['search_type'], 'admin_logs' ) )
{
$this->registry->output->showError( $this->lang->words['alog_whatfield'], 4110, true );
}
if( $this->request['search_type'] == 'member_id' )
{
$dbq = "m." . $this->request['search_type'] . "='" . $this->request['search_string'] . "'";
}
else
{
$dbq = "m." . $this->request['search_type'] . " LIKE '%" . $this->request['search_string'] . "%'";
}
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'admin_logs m', 'where' => $dbq ) );
$query = "{$this->form_code}&amp;do=view&amp;search_type=" . $this->request['search_type'] . "&amp;search_string=" . urlencode($this->request['search_string']);
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'admin_logs' => 'm' ),
'where' => $dbq,
'order' => 'm.ctime DESC',
'limit' => array( $start, 20 ),
'add_join' => array(
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
}
///----------------------------------------
// Page links
//-----------------------------------------
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'],
'itemsPerPage' => 20,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . $query,
)
);
///----------------------------------------
// Get db results
//-----------------------------------------
while ( $row = $this->DB->fetch() )
{
if( !$row['member_id'] )
{
$row['member_id'] = 'zero';
}
if( !$row['members_display_name'] )
{
$row['members_display_name'] = $this->lang->words['noname_availabl'];
}
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
$rows[] = $row;
}
///----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->adminlogsView( $rows, $links );
}
/**
* Remove logs by an admin
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if ( !$this->request['mid'] )
{
$this->registry->output->showError( $this->lang->words['alog_whoselog'], 11114 );
}
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
$this->DB->delete( 'admin_logs', "member_id=" . intval($this->request['mid']) );
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->form_code );
}
/**
* List the current logs with links to view per-admin
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$rows = array();
$admins = array();
//-----------------------------------------
// LAST FIVE ACTIONS
//-----------------------------------------
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'admin_logs' => 'm' ),
'order' => 'm.ctime DESC',
'limit' => array( 5 ),
'add_join' => array(
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
while ( $row = $this->DB->fetch() )
{
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
$rows[] = $row;
}
//-----------------------------------------
// All admins
//-----------------------------------------
$this->DB->build( array(
'select' => 'count(l.member_id) as act_count, l.member_id',
'from' => array( 'admin_logs' => 'l' ),
'group' => 'l.member_id, m.members_display_name',
'order' => 'act_count DESC',
'add_join' => array(
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.member_id',
'type' => 'left',
),
),
) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
if( !$r['member_id'] )
{
$r['member_id'] = 'zero';
}
if( !$r['members_display_name'] )
{
$r['members_display_name'] = $this->lang->words['noname_availabl'];
}
$admins[ $r['member_id'] ] = $r;
}
//-----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->adminlogsWrapper( $rows, $admins );
}
}
@@ -3,12 +3,12 @@
* @file defaultSection.php Define the default section for the 'logs' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: ips_terabyte $
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* $Revision: 8655 $
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
*/
$DEFAULT_SECTION = 'adminlogs';
$DEFAULT_SECTION = 'logsSplash';
@@ -1,275 +1,267 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Email error logs
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 27th January 2004
* @version $Rev: 8644 $
*/
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_core_logs_emailerrorlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_emailerrorlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=emailerrorlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=emailerrorlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
//-----------------------------------------
// Fix up navigation bar
//-----------------------------------------
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=emailerrorlogs', $this->lang->words['elog_email_err_logs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'list':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_view' );
$this->_listCurrent();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_delete' );
$this->_remove();
break;
case 'viewemail':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_view' );
$this->_viewEmail();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Remove email logs
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if ( $this->request['type'] == 'all' )
{
$this->DB->delete( 'mail_error_logs' );
}
else
{
$ids = array();
foreach ( $this->request as $k => $v )
{
if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
{
if ($this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
$ids = IPSLib::cleanIntArray( $ids );
//-----------------------------------------
if ( count($ids) < 1 )
{
$this->registry->output->showError( $this->lang->words['erlog_noneselected'], 11115 );
}
$this->DB->delete( 'mail_error_logs', "mlog_id IN (" . implode( ',', $ids ) . ")" );
}
$this->registry->getClass('adminFunctions')->saveAdminLog( $this->lang->words['erlog_removed'] );
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
}
/**
* List the current logs
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
//-----------------------------------------
// Check URL parameters
//-----------------------------------------
$url_query = array();
$db_query = array();
if ( $this->request['type'] AND $this->request['type'] != "" )
{
$string = IPSText::parseCleanValue( urldecode($this->request['string']) );
if ( $string == "" )
{
$this->registry->output->showError( $this->lang->words['erlog_enter_sumthang_yo'], 11116 );
}
$url_query[] = 'type=' . $this->request['type'];
$url_query[] = 'string=' . urlencode($string);
switch( $this->request['type'] )
{
case 'subject':
$db_query[] = $this->request['match'] == 'loose' ? "mlog_subject LIKE '%". preg_replace_callback( '/([=_\?\x00-\x1F\x80-\xFF])/', create_function( '$match', 'return "=" . strtoupper( dechex( ord( "$match[1]" ) ) );' ), $string ) ."%'" : "mlog_subject='{$string}'";
break;
case 'email_from':
$db_query[] = $this->request['match'] == 'loose' ? "mlog_from LIKE '%{$string}%'" : "mlog_from='{$string}'";
break;
case 'email_to':
$db_query[] = $this->request['match'] == 'loose' ? "mlog_to LIKE '%{$string}%'" : "mlog_to='{$string}'";
break;
case 'error':
$db_query[] = $this->request['match'] == 'loose' ? "mlog_msg LIKE '%{$string}%' or mlog_smtp_msg LIKE '%{$string}%'" : "mlog_msg='{$string} or mlog_smtp_msg='{$string}'";
break;
}
}
if( $this->request['match'] )
{
$url_query[] = 'match=' . $this->request['match'];
}
//-----------------------------------------
// LIST 'EM
//-----------------------------------------
$dbe = "";
$url = "";
if ( count($db_query) > 0 )
{
$dbe = implode( ' AND ', $db_query );
}
if ( count($url_query) > 0 )
{
$url = '&amp;' . implode( '&amp;', $url_query );
}
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as cnt', 'from' => 'mail_error_logs', 'where' => $dbe ) );
$links = $this->registry->output->generatePagination( array( 'totalItems' => $count['cnt'],
'itemsPerPage' => 25,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}" . $url,
)
);
$this->DB->build( array( 'select' => '*', 'from' => 'mail_error_logs', 'where' => $dbe, 'order' => 'mlog_date DESC', 'limit' => array( $start, 25 ) ) );
$this->DB->execute();
while ( $row = $this->DB->fetch() )
{
$row['_date'] = $this->registry->class_localization->getDate( $row['mlog_date'], 'SHORT' );
$row['mlog_subject'] = ( empty( $row['mlog_subject'] ) ) ? '--' : $row['mlog_subject'];
$row['mlog_subject'] = ( strpos( $row['mlog_subject'], "=?".IPS_DOC_CHAR_SET."?Q?" ) !== FALSE )
? str_replace( "=?".IPS_DOC_CHAR_SET."?Q?", "", str_replace( "?=", "", preg_replace_callback( '/=([A-F0-9]{2})/', create_function( '$match', 'return chr( hexdec( "$match[1]" ) );' ), $row['mlog_subject'] ) ) )
: $row['mlog_subject'];
$rows[] = $row;
}
$this->registry->output->html .= $this->html->emailerrorlogsWrapper( $rows, $links );
}
/**
* View an individual email
*
* @return @e void [Outputs to screen]
*/
protected function _viewEmail()
{
if ( !$this->request['id'] )
{
$this->registry->output->showError( $this->lang->words['erlog_404'], 11117 );
}
$id = intval($this->request['id']);
$row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'mail_error_logs', 'where' => "mlog_id={$id}" ) );
if ( ! $row['mlog_id'] )
{
$this->registry->output->showError( $this->lang->words['erlog_404'], 11118 );
}
$row['_date'] = $this->registry->class_localization->getDate( $row['mlog_date'], 'LONG' );
$row['mlog_content'] = nl2br($row['mlog_content']);
$row['mlog_subject'] = ( strpos( $row['mlog_subject'], "=?".IPS_DOC_CHAR_SET."?Q?" ) !== FALSE )
? str_replace( "=?".IPS_DOC_CHAR_SET."?Q?", "", str_replace( "?=", "", preg_replace_callback( '/=([A-F0-9]{2})/', create_function( '$match', 'return chr( hexdec( "$match[1]" ) );' ), $row['mlog_subject'] ) ) )
: $row['mlog_subject'];
$row['mlog_msg'] = $row['mlog_msg'] ? $row['mlog_msg'] : $this->lang->words['erlog_noinfo'];
$row['mlog_code'] = $row['mlog_code'] ? $row['mlog_code'] : $this->lang->words['erlog_noinfo'];
$row['mlog_smtp_error'] = $row['mlog_smtp_error'] ? $row['mlog_smtp_error'] : $this->lang->words['erlog_noinfo'];
$this->registry->output->html .= $this->html->emailerrorlogsEmail( $row );
$this->registry->output->printPopupWindow();
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Email error logs
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 10914 $
*/
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_core_logs_emailerrorlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_emailerrorlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=emailerrorlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=emailerrorlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=emailerrorlogs', $this->lang->words['elog_email_err_logs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'list':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_view' );
$this->_listCurrent();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_delete' );
$this->_remove();
break;
case 'viewemail':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_view' );
$this->_viewEmail();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Remove email logs
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if ( $this->request['type'] == 'all' )
{
$this->DB->delete( 'mail_error_logs' );
}
else
{
$ids = array();
foreach ( $this->request as $k => $v )
{
if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
{
if ($this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
$ids = IPSLib::cleanIntArray( $ids );
//-----------------------------------------
if ( count($ids) < 1 )
{
$this->registry->output->showError( $this->lang->words['erlog_noneselected'], 11115 );
}
$this->DB->delete( 'mail_error_logs', "mlog_id IN (" . implode( ',', $ids ) . ")" );
}
$this->registry->getClass('adminFunctions')->saveAdminLog( $this->lang->words['erlog_removed'] );
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
}
/**
* List the current logs
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
//-----------------------------------------
// Check URL parameters
//-----------------------------------------
$url_query = array();
$db_query = array();
if ( $this->request['type'] AND $this->request['type'] != "" )
{
$string = IPSText::parseCleanValue( urldecode($this->request['string']) );
if ( $string == "" )
{
$this->registry->output->showError( $this->lang->words['erlog_enter_sumthang_yo'], 11116 );
}
$url_query[] = 'type=' . $this->request['type'];
$url_query[] = 'string=' . urlencode($string);
switch( $this->request['type'] )
{
case 'subject':
$db_query[] = $this->request['match'] == 'loose' ? "mlog_subject LIKE '%". preg_replace_callback( '/([=_\?\x00-\x1F\x80-\xFF])/', create_function( '$match', 'return "=" . strtoupper( dechex( ord( "$match[1]" ) ) );' ), $string ) ."%'" : "mlog_subject='{$string}'";
break;
case 'email_from':
$db_query[] = $this->request['match'] == 'loose' ? "mlog_from LIKE '%{$string}%'" : "mlog_from='{$string}'";
break;
case 'email_to':
$db_query[] = $this->request['match'] == 'loose' ? "mlog_to LIKE '%{$string}%'" : "mlog_to='{$string}'";
break;
case 'error':
$db_query[] = $this->request['match'] == 'loose' ? "mlog_msg LIKE '%{$string}%' or mlog_smtp_msg LIKE '%{$string}%'" : "mlog_msg='{$string} or mlog_smtp_msg='{$string}'";
break;
}
}
if( $this->request['match'] )
{
$url_query[] = 'match=' . $this->request['match'];
}
//-----------------------------------------
// LIST 'EM
//-----------------------------------------
$dbe = "";
$url = "";
if ( count($db_query) > 0 )
{
$dbe = implode( ' AND ', $db_query );
}
if ( count($url_query) > 0 )
{
$url = '&amp;' . implode( '&amp;', $url_query );
}
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as cnt', 'from' => 'mail_error_logs', 'where' => $dbe ) );
$links = $this->registry->output->generatePagination( array( 'totalItems' => $count['cnt'],
'itemsPerPage' => 25,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}" . $url,
)
);
$this->DB->build( array( 'select' => '*', 'from' => 'mail_error_logs', 'where' => $dbe, 'order' => 'mlog_date DESC', 'limit' => array( $start, 25 ) ) );
$this->DB->execute();
while ( $row = $this->DB->fetch() )
{
$row['_date'] = $this->registry->class_localization->getDate( $row['mlog_date'], 'SHORT' );
$row['mlog_subject'] = ( empty( $row['mlog_subject'] ) ) ? '--' : $row['mlog_subject'];
$row['mlog_subject'] = ( strpos( $row['mlog_subject'], "=?".IPS_DOC_CHAR_SET."?Q?" ) !== FALSE )
? str_replace( "=?".IPS_DOC_CHAR_SET."?Q?", "", str_replace( "?=", "", preg_replace_callback( '/=([A-F0-9]{2})/', create_function( '$match', 'return chr( hexdec( "$match[1]" ) );' ), $row['mlog_subject'] ) ) )
: $row['mlog_subject'];
$rows[] = $row;
}
$this->registry->output->html .= $this->html->emailerrorlogsWrapper( $rows, $links );
}
/**
* View an individual email
*
* @return @e void [Outputs to screen]
*/
protected function _viewEmail()
{
if ( !$this->request['id'] )
{
$this->registry->output->showError( $this->lang->words['erlog_404'], 11117 );
}
$id = intval($this->request['id']);
$row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'mail_error_logs', 'where' => "mlog_id={$id}" ) );
if ( ! $row['mlog_id'] )
{
$this->registry->output->showError( $this->lang->words['erlog_404'], 11118 );
}
$row['_date'] = $this->registry->class_localization->getDate( $row['mlog_date'], 'LONG' );
$row['mlog_content'] = nl2br($row['mlog_content']);
$row['mlog_subject'] = ( strpos( $row['mlog_subject'], "=?".IPS_DOC_CHAR_SET."?Q?" ) !== FALSE )
? str_replace( "=?".IPS_DOC_CHAR_SET."?Q?", "", str_replace( "?=", "", preg_replace_callback( '/=([A-F0-9]{2})/', create_function( '$match', 'return chr( hexdec( "$match[1]" ) );' ), $row['mlog_subject'] ) ) )
: $row['mlog_subject'];
$row['mlog_msg'] = $row['mlog_msg'] ? $row['mlog_msg'] : $this->lang->words['erlog_noinfo'];
$row['mlog_code'] = $row['mlog_code'] ? $row['mlog_code'] : $this->lang->words['erlog_noinfo'];
$row['mlog_smtp_error'] = $row['mlog_smtp_error'] ? $row['mlog_smtp_error'] : $this->lang->words['erlog_noinfo'];
$this->registry->output->html .= $this->html->emailerrorlogsEmail( $row );
$this->registry->output->printPopupWindow();
}
}
@@ -1,247 +1,239 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Error logs
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 27th January 2004
* @version $Rev: 8644 $
*/
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_core_logs_errorlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_errorlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=errorlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=errorlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
//-----------------------------------------
// Fix up navigation bar
//-----------------------------------------
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=errorlogs', $this->lang->words['error_log_thelogs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'list':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'errorlogs_view' );
$this->_listCurrent();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'errorlogs_delete' );
$this->_remove();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Remove email logs
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if( $this->request['type'] == 'all' )
{
$this->DB->delete( 'error_logs' );
}
else
{
$ids = array();
foreach( $this->request as $k => $v )
{
if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
{
if ($this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
$ids = IPSLib::cleanIntArray( $ids );
//-----------------------------------------
if( count($ids) < 1 )
{
$this->registry->output->showError( $this->lang->words['erlog_noneselected'], 11115 );
}
$this->DB->delete( 'error_logs', "log_id IN (" . implode( ',', $ids ) . ")" );
}
$this->registry->adminFunctions->saveAdminLog( $this->lang->words['error_log_removed'] );
$this->registry->output->silentRedirect( $this->settings['base_url'] . "&{$this->form_code}" );
}
/**
* List the current logs
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$start = intval( $this->request['st'] ) >= 0 ? intval( $this->request['st'] ) : 0;
/* Check URL parameters */
$url_query = array();
$db_query = array();
if( $this->request['type'] )
{
$string = IPSText::parseCleanValue( urldecode( $this->request['string'] ) );
if( $string == "" )
{
$this->registry->output->showError( $this->lang->words['erlog_enter_sumthang_yo'], 11116 );
}
$url_query[] = 'type=' . $this->request['type'];
$url_query[] = 'string=' . urlencode( $string );
switch( $this->request['type'] )
{
case 'log_error':
$db_query[] = $this->request['match'] == 'loose' ? "e.log_error LIKE '%{$string}%'" : "e.log_error='{$string}'";
break;
case 'log_error_code':
$db_query[] = $this->request['match'] == 'loose' ? "e.log_error_code LIKE '%{$string}%'" : "e.log_error_code='{$string}'";
break;
case 'log_request_uri':
$db_query[] = $this->request['match'] == 'loose' ? "e.log_request_uri LIKE '%{$string}%'" : "e.log_request_uri='{$string}'";
break;
case 'members_display_name':
$db_query[] = $this->request['match'] == 'loose' ? "m.members_display_name LIKE '%{$string}%'" : "m.members_display_name='{$string}'";
break;
}
}
/* Build extra query stuff */
$dbe = '';
$url = '';
if( count( $db_query ) )
{
$dbe = implode( ' AND ', $db_query );
}
if( count( $url_query ) )
{
$url = '&amp;' . implode( '&amp;', $url_query );
}
/* Pagination */
$count = $this->DB->buildAndFetch( array(
'select' => 'count(*) as cnt',
'from' => array( 'error_logs' => 'e' ),
'where' => $dbe,
'add_join' => array(
array(
'from' => array( 'members' => 'm' ),
'where' => 'e.log_member=m.member_id',
'type' => 'left',
)
)
) );
$links = $this->registry->output->generatePagination( array(
'totalItems' => $count['cnt'],
'itemsPerPage' => 25,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}" . $url,
)
);
/* Query the logs */
$this->DB->build( array(
'select' => 'e.*',
'from' => array( 'error_logs' => 'e' ),
'where' => $dbe,
'order' => 'e.log_date DESC',
'limit' => array( $start, 25 ),
'add_join' => array(
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'e.log_member=m.member_id',
'type' => 'left',
)
)
) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$row['_date'] = $this->registry->class_localization->getDate( $row['log_date'], 'SHORT' );
$rows[] = $row;
}
$this->registry->output->html .= $this->html->errorlogsWrapper( $rows, $links );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Error logs
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 10914 $
*/
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_core_logs_errorlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_errorlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=errorlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=errorlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=errorlogs', $this->lang->words['error_log_thelogs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'list':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'errorlogs_view' );
$this->_listCurrent();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'errorlogs_delete' );
$this->_remove();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Remove email logs
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if( $this->request['type'] == 'all' )
{
$this->DB->delete( 'error_logs' );
}
else
{
$ids = array();
foreach( $this->request as $k => $v )
{
if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
{
if ($this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
$ids = IPSLib::cleanIntArray( $ids );
//-----------------------------------------
if( count($ids) < 1 )
{
$this->registry->output->showError( $this->lang->words['erlog_noneselected'], 11115 );
}
$this->DB->delete( 'error_logs', "log_id IN (" . implode( ',', $ids ) . ")" );
}
$this->registry->adminFunctions->saveAdminLog( $this->lang->words['error_log_removed'] );
$this->registry->output->silentRedirect( $this->settings['base_url'] . "&{$this->form_code}" );
}
/**
* List the current logs
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$start = intval( $this->request['st'] ) >= 0 ? intval( $this->request['st'] ) : 0;
/* Check URL parameters */
$url_query = array();
$db_query = array();
if( $this->request['type'] )
{
$string = IPSText::parseCleanValue( urldecode( $this->request['string'] ) );
if( $string == "" )
{
$this->registry->output->showError( $this->lang->words['erlog_enter_sumthang_yo'], 11116 );
}
$url_query[] = 'type=' . $this->request['type'];
$url_query[] = 'string=' . urlencode( $string );
switch( $this->request['type'] )
{
case 'log_error':
$db_query[] = $this->request['match'] == 'loose' ? "e.log_error LIKE '%{$string}%'" : "e.log_error='{$string}'";
break;
case 'log_error_code':
$db_query[] = $this->request['match'] == 'loose' ? "e.log_error_code LIKE '%{$string}%'" : "e.log_error_code='{$string}'";
break;
case 'log_request_uri':
$db_query[] = $this->request['match'] == 'loose' ? "e.log_request_uri LIKE '%{$string}%'" : "e.log_request_uri='{$string}'";
break;
case 'members_display_name':
$db_query[] = $this->request['match'] == 'loose' ? "m.members_display_name LIKE '%{$string}%'" : "m.members_display_name='{$string}'";
break;
}
}
/* Build extra query stuff */
$dbe = '';
$url = '';
if( count( $db_query ) )
{
$dbe = implode( ' AND ', $db_query );
}
if( count( $url_query ) )
{
$url = '&amp;' . implode( '&amp;', $url_query );
}
/* Pagination */
$count = $this->DB->buildAndFetch( array(
'select' => 'count(*) as cnt',
'from' => array( 'error_logs' => 'e' ),
'where' => $dbe,
'add_join' => array(
array(
'from' => array( 'members' => 'm' ),
'where' => 'e.log_member=m.member_id',
'type' => 'left',
)
)
) );
$links = $this->registry->output->generatePagination( array(
'totalItems' => $count['cnt'],
'itemsPerPage' => 25,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}" . $url,
)
);
/* Query the logs */
$this->DB->build( array(
'select' => 'e.*',
'from' => array( 'error_logs' => 'e' ),
'where' => $dbe,
'order' => 'e.log_date DESC',
'limit' => array( $start, 25 ),
'add_join' => array(
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'e.log_member=m.member_id',
'type' => 'left',
)
)
) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$row['_date'] = $this->registry->class_localization->getDate( $row['log_date'], 'SHORT' );
$rows[] = $row;
}
$this->registry->output->html .= $this->html->errorlogsWrapper( $rows, $links );
}
}
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,160 +1,165 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Admin Login Logs
* Last Updated: $LastChangedDate: 2011-09-01 08:16:37 -0400 (Thu, 01 Sep 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @version $Rev: 9439 $
*/
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_core_system_loginlog extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* Check Permissions */
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'acplogin_log' );
/* Language */
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs', 'admin_system' ) );
/* URLs */
$this->form_code = 'module=system&amp;section=loginlog';
$this->form_code_js = 'module=system&section=loginlog';
/* Navigation */
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=system&section=loginlog', $this->lang->words['al_error_logs'] );
/* Load skin */
$this->html = $this->registry->output->loadTemplate('cp_skin_system');
switch( $this->request['do'] )
{
default:
$this->loginLogsView();
break;
case 'view_detail':
$this->loginLogDetails();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* View Details of a Log in Attempt
*
* @return @e void
*/
public function loginLogDetails()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$admin_id = intval( $this->request['detail'] );
//-----------------------------------------
// Get data from the deebee
//-----------------------------------------
$log = $this->DB->buildAndFetch( array( 'select' => '*','from' => 'admin_login_logs', 'where' => 'admin_id='.$admin_id ) );
if ( ! $log['admin_id'] )
{
$this->registry->output->global_message = $this->lang->words['ll_noid'];
$this->login_logs_view();
return;
}
//-----------------------------------------
// Display...
//-----------------------------------------
$log['_admin_time'] = $this->registry->class_localization->getDate( $log['admin_time'], 'LONG' );
$log['_admin_post_details'] = unserialize( $log['admin_post_details'] );
//-----------------------------------------
// Show...
//-----------------------------------------
$this->registry->output->html .= $this->html->acp_last_logins_detail( $log );
$this->registry->output->printPopupWindow();
}
/**
* View admin login logs
*
* @return @e void
*/
public function loginLogsView()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$start = intval( $this->request['st'] );
$perpage = 50;
//-----------------------------------------
// Get log count
//-----------------------------------------
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'admin_login_logs' ) );
$links = $this->registry->output->generatePagination( array(
'totalItems' => intval( $count['count'] ),
'itemsPerPage' => $perpage,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'].$this->form_code
) );
//-----------------------------------------
// Get from DB
//-----------------------------------------
$this->DB->build( array( 'select' => '*', 'from' => 'admin_login_logs', 'order' => 'admin_time DESC', 'limit' => array( $start, $perpage ) ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$row['_admin_time'] = $this->registry->class_localization->getDate( $row['admin_time'], 'ACP' );
$logins .= $this->html->acp_last_logins_row( $row );
}
//-----------------------------------------
// Print...
//-----------------------------------------
$this->registry->output->html .= $this->registry->output->global_template->information_box( $this->lang->words['ll_title'], $this->lang->words['ll_msg'] );
$this->registry->output->html .= $this->html->acp_last_logins_wrapper( $logins, $links );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Admin Login Logs
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
*/
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_core_logs_loginlog extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* Check Permissions */
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'acplogin_log' );
/* Language */
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs', 'admin_system' ) );
/* URLs */
$this->form_code = 'module=logs&amp;section=loginlog';
$this->form_code_js = 'module=logs&section=loginlog';
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=loginlog', $this->lang->words['al_error_logs'] );
/* Load skin */
$this->html = $this->registry->output->loadTemplate('cp_skin_system');
switch( $this->request['do'] )
{
default:
$this->loginLogsView();
break;
case 'view_detail':
$this->loginLogDetails();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* View Details of a Log in Attempt
*
* @return @e void
*/
public function loginLogDetails()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$admin_id = intval( $this->request['detail'] );
//-----------------------------------------
// Get data from the deebee
//-----------------------------------------
$log = $this->DB->buildAndFetch( array( 'select' => '*','from' => 'admin_login_logs', 'where' => 'admin_id='.$admin_id ) );
if ( ! $log['admin_id'] )
{
$this->registry->output->global_message = $this->lang->words['ll_noid'];
$this->login_logs_view();
return;
}
//-----------------------------------------
// Display...
//-----------------------------------------
$log['_admin_time'] = $this->registry->class_localization->getDate( $log['admin_time'], 'LONG' );
$log['_admin_post_details'] = unserialize( $log['admin_post_details'] );
foreach( array( 'get', 'post' ) as $r )
{
if ( is_array( $log['_admin_post_details'][ $r ] ) )
{
foreach( $log['_admin_post_details'][ $r ] as $k => $v )
{
$log['_admin_post_details'][ $r ][ $k ] = htmlspecialchars( $v );
}
}
}
//-----------------------------------------
// Show...
//-----------------------------------------
$this->registry->output->html .= $this->html->acp_last_logins_detail( $log );
$this->registry->output->printPopupWindow();
}
/**
* View admin login logs
*
* @return @e void
*/
public function loginLogsView()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$start = intval( $this->request['st'] );
$perpage = 50;
//-----------------------------------------
// Get log count
//-----------------------------------------
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'admin_login_logs' ) );
$links = $this->registry->output->generatePagination( array(
'totalItems' => intval( $count['count'] ),
'itemsPerPage' => $perpage,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'].$this->form_code
) );
//-----------------------------------------
// Get from DB
//-----------------------------------------
$this->DB->build( array( 'select' => '*', 'from' => 'admin_login_logs', 'order' => 'admin_time DESC', 'limit' => array( $start, $perpage ) ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$row['_admin_time'] = $this->registry->class_localization->getDate( $row['admin_time'], 'ACP' );
$logins .= $this->html->acp_last_logins_row( $row );
}
//-----------------------------------------
// Print...
//-----------------------------------------
$this->registry->output->html .= $this->registry->output->global_template->information_box( $this->lang->words['ll_title'], $this->lang->words['ll_msg'] );
$this->registry->output->html .= $this->html->acp_last_logins_wrapper( $logins, $links );
}
}
@@ -3,11 +3,11 @@
* @file logsSplash.php Logs splash screen
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* @since 8th Feb 2011
* $LastChangedDate: 2011-09-12 20:59:05 -0400 (Mon, 12 Sep 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 9483 $
*/
@@ -1,187 +1,179 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Mobile Notification logs
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @version $Rev: 8644 $
*/
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_core_logs_mobilelogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_mobilelogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=mobilelogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=mobilelogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
//-----------------------------------------
// Fix up navigation bar
//-----------------------------------------
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=mobilelogs', $this->lang->words['mlog_mobilelogs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'remove':
$this->_remove();
break;
default:
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Remove log
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if( $this->request['type'] == 'all' )
{
$this->DB->delete( 'mobile_notifications' );
}
else
{
$ids = array();
foreach( $this->request as $k => $v )
{
if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
{
if ($this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
$ids = IPSLib::cleanIntArray( $ids );
//-----------------------------------------
if( count($ids) < 1 )
{
$this->registry->output->showError( $this->lang->words['erlog_noneselected'], 11115 );
}
$this->DB->delete( 'mobile_notifications', "id IN (" . implode( ',', $ids ) . ")" );
}
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
}
/**
* List the current logs
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
/* INIT */
$rows = array();
$st = $this->request['st'] ? intval( $this->request['st'] ) : 0;
$perPage = 25;
/* Pagination */
$total = $this->DB->buildAndFetch( array( 'select' => 'count(*) as logs', 'from' => 'mobile_notifications' ) );
$pageLinks = $this->registry->output->generatePagination( array(
'totalItems' => $total['logs'],
'itemsPerPage' => $perPage,
'currentStartValue' => $st,
'baseUrl' => $this->settings['base_url'] . $this->form_code,
) );
/* Query the logs */
$this->DB->build( array(
'select' => 'n.*',
'from' => array( 'mobile_notifications' => 'n' ),
'order' => 'n.notify_date DESC',
'limit' => array( $st, $perPage ),
'add_join' => array(
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=n.member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$row['_time'] = $this->registry->class_localization->getDate( $row['notify_date'], 'LONG' );
$row['notify_title'] = strip_tags( $row['notify_title'] );
$row['_sent'] = $row['notify_sent'] ? 'aff_tick.png' : 'aff_cross.png';
$rows[] = $row;
}
//-----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->mobileLogsWrapper( $rows, $pageLinks );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Mobile Notification logs
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
*/
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_core_logs_mobilelogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_mobilelogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=mobilelogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=mobilelogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=mobilelogs', $this->lang->words['mlog_mobilelogs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'remove':
$this->_remove();
break;
default:
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Remove log
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if( $this->request['type'] == 'all' )
{
$this->DB->delete( 'mobile_notifications' );
}
else
{
$ids = array();
foreach( $this->request as $k => $v )
{
if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
{
if ($this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
$ids = IPSLib::cleanIntArray( $ids );
//-----------------------------------------
if( count($ids) < 1 )
{
$this->registry->output->showError( $this->lang->words['erlog_noneselected'], 11115 );
}
$this->DB->delete( 'mobile_notifications', "id IN (" . implode( ',', $ids ) . ")" );
}
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
}
/**
* List the current logs
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
/* INIT */
$rows = array();
$st = $this->request['st'] ? intval( $this->request['st'] ) : 0;
$perPage = 25;
/* Pagination */
$total = $this->DB->buildAndFetch( array( 'select' => 'count(*) as logs', 'from' => 'mobile_notifications' ) );
$pageLinks = $this->registry->output->generatePagination( array(
'totalItems' => $total['logs'],
'itemsPerPage' => $perPage,
'currentStartValue' => $st,
'baseUrl' => $this->settings['base_url'] . $this->form_code,
) );
/* Query the logs */
$this->DB->build( array(
'select' => 'n.*',
'from' => array( 'mobile_notifications' => 'n' ),
'order' => 'n.notify_date DESC',
'limit' => array( $st, $perPage ),
'add_join' => array(
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=n.member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$row['_time'] = $this->registry->class_localization->getDate( $row['notify_date'], 'LONG' );
$row['notify_title'] = strip_tags( $row['notify_title'] );
$row['_sent'] = $row['notify_sent'] ? 'aff_tick.png' : 'aff_cross.png';
$rows[] = $row;
}
//-----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->mobileLogsWrapper( $rows, $pageLinks );
}
}
@@ -1,349 +1,341 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Moderator logs
* Last Updated: $LastChangedDate: 2011-09-15 17:04:35 -0400 (Thu, 15 Sep 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 27th January 2004
* @version $Rev: 9495 $
*/
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_core_logs_modlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_modlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=modlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=modlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
//-----------------------------------------
// Fix up navigation bar
//-----------------------------------------
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=modlogs', $this->lang->words['mlog_modlogs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'view':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'modlogs_view' );
$this->_view();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'modlogs_delete' );
$this->_remove();
break;
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'modlogs_view' );
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* View all logs for a given moderator
*
* @return @e void [Outputs to screen]
*/
protected function _view()
{
///----------------------------------------
// Basic init
//-----------------------------------------
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
///----------------------------------------
// No mid or search string?
//-----------------------------------------
if ( !$this->request['search_string'] AND !$this->request['mid'] )
{
$this->registry->output->global_message = $this->lang->words['mlog_nostring'];
$this->_listCurrent();
return;
}
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
///----------------------------------------
// mid?
//-----------------------------------------
if ( !$this->request['search_string'] )
{
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'moderator_logs', 'where' => "member_id=" . intval($this->request['mid']) ) );
$query = "{$this->form_code}&amp;mid=" . ( $this->request['mid'] ? $this->request['mid'] : 'zero' ) . "&amp;do=view";
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'moderator_logs' => 'm' ),
'where' => 'm.member_id=' . intval($this->request['mid']),
'order' => 'm.ctime DESC',
'limit' => array( $start, 20 ),
'add_join' => array(
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
'type' => 'left',
),
array( 'select' => 'f.id as forum_id, f.name',
'from' => array( 'forums' => 'f' ),
'where' => 'f.id=m.forum_id',
'type' => 'left',
),
)
) );
$this->DB->execute();
}
///----------------------------------------
// search string?
//-----------------------------------------
else
{
$this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
if( !$this->DB->checkForField( $this->request['search_type'], 'moderator_logs' ) )
{
$this->registry->output->showError( $this->lang->words['mlog_whatfield'], 4111 );
}
if( $this->request['search_type'] == 'topic_id' OR $this->request['search_type'] == 'forum_id' )
{
$dbq = "m." . $this->request['search_type'] . "='" . $this->request['search_string'] . "'";
}
else
{
$dbq = "m." . $this->request['search_type'] . " LIKE '%" . $this->request['search_string'] . "%'";
}
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'moderator_logs m', 'where' => $dbq ) );
$query = "{$this->form_code}&amp;do=view&amp;search_type=" . $this->request['search_type'] . "&amp;search_string=" . urlencode($this->request['search_string']);
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'moderator_logs' => 'm' ),
'where' => $dbq,
'order' => 'm.ctime DESC',
'limit' => array( $start, 20 ),
'add_join' => array(
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
'type' => 'left',
),
array( 'select' => 'f.id as forum_id, f.name',
'from' => array( 'forums' => 'f' ),
'where' => 'f.id=m.forum_id',
'type' => 'left',
),
)
) );
$this->DB->execute();
}
///----------------------------------------
// Page links
//-----------------------------------------
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'],
'itemsPerPage' => 20,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . $query,
)
);
///----------------------------------------
// Get db results
//-----------------------------------------
while ( $row = $this->DB->fetch() )
{
if( !$row['member_id'] )
{
$row['member_id'] = 'zero';
}
if( !$row['members_display_name'] )
{
$row['members_display_name'] = $this->lang->words['noname_availablm'];
}
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
$row['topic'] = $row['topic_id'] ? $this->lang->words['mlog_topicid'] . $row['topic_id'] : '&nbsp;';
$row['http_referer'] = preg_replace( "/s=(\w){32}/" , "", $row['http_referer'] );
$rows[] = $row;
}
///----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->modlogsView( $rows, $links );
}
/**
* Remove logs by a moderator
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if ( !$this->request['mid'] )
{
$this->registry->output->showError( $this->lang->words['mlog_noid'], 11131 );
}
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
$this->DB->delete( 'moderator_logs', "member_id=" . intval($this->request['mid']) );
$this->registry->getClass('adminFunctions')->saveAdminLog( $this->lang->words['mlog_removed'] . $this->request['mid'] );
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->form_code );
}
/**
* List the current logs with links to view per-admin
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$rows = array();
$admins = array();
//-----------------------------------------
// VIEW LAST 5
//-----------------------------------------
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'moderator_logs' => 'm' ),
'order' => 'm.ctime DESC',
'limit' => array( 0, 5 ),
'add_join' => array(
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
'type' => 'left',
),
array( 'select' => 'f.id as forum_id, f.name',
'from' => array( 'forums' => 'f' ),
'where' => 'f.id=m.forum_id',
'type' => 'left',
),
)
) );
$this->DB->execute();
while ( $row = $this->DB->fetch() )
{
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
$row['topic'] = $row['topic_id'] ? $this->lang->words['mlog_topicid'] . $row['topic_id'] : '&nbsp;';
$row['http_referer'] = preg_replace( "/s=(\w){32}/" , "", $row['http_referer'] );
$rows[] = $row;
}
//-----------------------------------------
// All mods
//-----------------------------------------
$this->DB->build( array(
'select' => 'count(l.member_id) as act_count, l.member_id',
'from' => array( 'moderator_logs' => 'l' ),
'group' => 'l.member_id',
'order' => 'act_count DESC',
'add_join' => array(
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.member_id',
'type' => 'left',
),
),
) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
if( !$r['member_id'] )
{
$r['member_id'] = 'zero';
}
if( !$r['members_display_name'] )
{
$r['members_display_name'] = $this->lang->words['noname_availablm'];
}
$admins[ $r['member_id'] ] = $r;
}
//-----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->modlogsWrapper( $rows, $admins );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Moderator logs
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 10914 $
*/
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_core_logs_modlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_modlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=modlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=modlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=modlogs', $this->lang->words['mlog_modlogs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'view':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'modlogs_view' );
$this->_view();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'modlogs_delete' );
$this->_remove();
break;
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'modlogs_view' );
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* View all logs for a given moderator
*
* @return @e void [Outputs to screen]
*/
protected function _view()
{
///----------------------------------------
// Basic init
//-----------------------------------------
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
///----------------------------------------
// No mid or search string?
//-----------------------------------------
if ( !$this->request['search_string'] AND !$this->request['mid'] )
{
$this->registry->output->global_message = $this->lang->words['mlog_nostring'];
$this->_listCurrent();
return;
}
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
///----------------------------------------
// mid?
//-----------------------------------------
if ( !$this->request['search_string'] )
{
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'moderator_logs', 'where' => "member_id=" . intval($this->request['mid']) ) );
$query = "{$this->form_code}&amp;mid=" . ( $this->request['mid'] ? $this->request['mid'] : 'zero' ) . "&amp;do=view";
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'moderator_logs' => 'm' ),
'where' => 'm.member_id=' . intval($this->request['mid']),
'order' => 'm.ctime DESC',
'limit' => array( $start, 20 ),
'add_join' => array(
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
'type' => 'left',
),
array( 'select' => 'f.id as forum_id, f.name',
'from' => array( 'forums' => 'f' ),
'where' => 'f.id=m.forum_id',
'type' => 'left',
),
)
) );
$this->DB->execute();
}
///----------------------------------------
// search string?
//-----------------------------------------
else
{
$this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
if( !$this->DB->checkForField( $this->request['search_type'], 'moderator_logs' ) )
{
$this->registry->output->showError( $this->lang->words['mlog_whatfield'], 4111 );
}
if( $this->request['search_type'] == 'topic_id' OR $this->request['search_type'] == 'forum_id' )
{
$dbq = "m." . $this->request['search_type'] . "='" . $this->request['search_string'] . "'";
}
else
{
$dbq = "m." . $this->request['search_type'] . " LIKE '%" . $this->request['search_string'] . "%'";
}
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'moderator_logs m', 'where' => $dbq ) );
$query = "{$this->form_code}&amp;do=view&amp;search_type=" . $this->request['search_type'] . "&amp;search_string=" . urlencode($this->request['search_string']);
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'moderator_logs' => 'm' ),
'where' => $dbq,
'order' => 'm.ctime DESC',
'limit' => array( $start, 20 ),
'add_join' => array(
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
'type' => 'left',
),
array( 'select' => 'f.id as forum_id, f.name',
'from' => array( 'forums' => 'f' ),
'where' => 'f.id=m.forum_id',
'type' => 'left',
),
)
) );
$this->DB->execute();
}
///----------------------------------------
// Page links
//-----------------------------------------
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'],
'itemsPerPage' => 20,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . $query,
)
);
///----------------------------------------
// Get db results
//-----------------------------------------
while ( $row = $this->DB->fetch() )
{
if( !$row['member_id'] )
{
$row['member_id'] = 'zero';
}
if( !$row['members_display_name'] )
{
$row['members_display_name'] = $this->lang->words['noname_availablm'];
}
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
$row['topic'] = $row['topic_id'] ? $this->lang->words['mlog_topicid'] . $row['topic_id'] : '&nbsp;';
$row['http_referer'] = preg_replace( "/s=(\w){32}/" , "", $row['http_referer'] );
$rows[] = $row;
}
///----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->modlogsView( $rows, $links );
}
/**
* Remove logs by a moderator
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if ( !$this->request['mid'] )
{
$this->registry->output->showError( $this->lang->words['mlog_noid'], 11131 );
}
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
$this->DB->delete( 'moderator_logs', "member_id=" . intval($this->request['mid']) );
$this->registry->getClass('adminFunctions')->saveAdminLog( $this->lang->words['mlog_removed'] . $this->request['mid'] );
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->form_code );
}
/**
* List the current logs with links to view per-admin
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$rows = array();
$admins = array();
//-----------------------------------------
// VIEW LAST 5
//-----------------------------------------
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'moderator_logs' => 'm' ),
'order' => 'm.ctime DESC',
'limit' => array( 0, 5 ),
'add_join' => array(
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
'type' => 'left',
),
array( 'select' => 'f.id as forum_id, f.name',
'from' => array( 'forums' => 'f' ),
'where' => 'f.id=m.forum_id',
'type' => 'left',
),
)
) );
$this->DB->execute();
while ( $row = $this->DB->fetch() )
{
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
$row['topic'] = $row['topic_id'] ? $this->lang->words['mlog_topicid'] . $row['topic_id'] : '&nbsp;';
$row['http_referer'] = preg_replace( "/s=(\w){32}/" , "", $row['http_referer'] );
$rows[] = $row;
}
//-----------------------------------------
// All mods
//-----------------------------------------
$this->DB->build( array(
'select' => 'count(l.member_id) as act_count, l.member_id',
'from' => array( 'moderator_logs' => 'l' ),
'group' => 'l.member_id, m.members_display_name',
'order' => 'act_count DESC',
'add_join' => array(
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.member_id',
'type' => 'left',
),
),
) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
if( !$r['member_id'] )
{
$r['member_id'] = 'zero';
}
if( !$r['members_display_name'] )
{
$r['members_display_name'] = $this->lang->words['noname_availablm'];
}
$admins[ $r['member_id'] ] = $r;
}
//-----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->modlogsWrapper( $rows, $admins );
}
}
@@ -1,191 +1,183 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Admin logs
* Last Updated: $LastChangedDate: 2011-05-12 22:28:10 -0400 (Thu, 12 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @version $Rev: 8754 $
*/
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_core_logs_spamlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_spamlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=spamlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=spamlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
//-----------------------------------------
// Fix up navigation bar
//-----------------------------------------
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=spamlogs', $this->lang->words['slog_spamlogs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'remove':
$this->_remove();
break;
default:
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Remove log
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if( $this->request['type'] == 'all' )
{
$this->DB->delete( 'spam_service_log' );
}
else
{
$ids = array();
foreach( $this->request as $k => $v )
{
if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
{
if ($this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
$ids = IPSLib::cleanIntArray( $ids );
//-----------------------------------------
if( count($ids) < 1 )
{
$this->registry->output->showError( $this->lang->words['erlog_noneselected'], 11115 );
}
$this->DB->delete( 'spam_service_log', "id IN (" . implode( ',', $ids ) . ")" );
}
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
}
/**
* List the current logs
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
/* INIT */
$rows = array();
$st = $this->request['st'] ? intval( $this->request['st'] ) : 0;
$perPage = 25;
$where = '';
$qs = '';
if( $this->request['search_term'] )
{
$where = "log_msg LIKE '%{$this->request['search_term']}%' OR email_address LIKE '%{$this->request['search_term']}%'";
$qs = '&search_term=' . $this->request['search_term'];
}
/* Pagination */
$total = $this->DB->buildAndFetch( array( 'select' => 'count(*) as logs', 'from' => 'spam_service_log', 'where' => $where ) );
if( $this->request['search_term'] )
{
$this->registry->output->global_message = sprintf( $this->lang->words['spamlog_sresults'], $total['logs'] );
}
$pageLinks = $this->registry->output->generatePagination( array(
'totalItems' => $total['logs'],
'itemsPerPage' => $perPage,
'currentStartValue' => $st,
'baseUrl' => $this->settings['base_url'] . $this->form_code . $qs,
) );
/* Query the logs */
$this->DB->build( array(
'select' => '*',
'from' => 'spam_service_log',
'order' => 'log_date DESC',
'where' => $where,
'limit' => array( $st, $perPage ),
) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$row['_time'] = $this->registry->class_localization->getDate( $row['log_date'], 'LONG' );
$rows[] = $row;
}
//-----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->spamlogsWrapper( $rows, $pageLinks );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Admin logs
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
*/
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_core_logs_spamlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_spamlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=spamlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=spamlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=spamlogs', $this->lang->words['slog_spamlogs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'remove':
$this->_remove();
break;
default:
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Remove log
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if( $this->request['type'] == 'all' )
{
$this->DB->delete( 'spam_service_log' );
}
else
{
$ids = array();
foreach( $this->request as $k => $v )
{
if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
{
if ($this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
$ids = IPSLib::cleanIntArray( $ids );
//-----------------------------------------
if( count($ids) < 1 )
{
$this->registry->output->showError( $this->lang->words['erlog_noneselected'], 11115 );
}
$this->DB->delete( 'spam_service_log', "id IN (" . implode( ',', $ids ) . ")" );
}
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
}
/**
* List the current logs
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
/* INIT */
$rows = array();
$st = $this->request['st'] ? intval( $this->request['st'] ) : 0;
$perPage = 25;
$where = '';
$qs = '';
if( $this->request['search_term'] )
{
$where = "log_msg LIKE '%{$this->request['search_term']}%' OR email_address LIKE '%{$this->request['search_term']}%'";
$qs = '&search_term=' . $this->request['search_term'];
}
/* Pagination */
$total = $this->DB->buildAndFetch( array( 'select' => 'count(*) as logs', 'from' => 'spam_service_log', 'where' => $where ) );
if( $this->request['search_term'] )
{
$this->registry->output->global_message = sprintf( $this->lang->words['spamlog_sresults'], $total['logs'] );
}
$pageLinks = $this->registry->output->generatePagination( array(
'totalItems' => $total['logs'],
'itemsPerPage' => $perPage,
'currentStartValue' => $st,
'baseUrl' => $this->settings['base_url'] . $this->form_code . $qs,
) );
/* Query the logs */
$this->DB->build( array(
'select' => '*',
'from' => 'spam_service_log',
'order' => 'log_date DESC',
'where' => $where,
'limit' => array( $st, $perPage ),
) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$row['_time'] = $this->registry->class_localization->getDate( $row['log_date'], 'LONG' );
$rows[] = $row;
}
//-----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->spamlogsWrapper( $rows, $pageLinks );
}
}
@@ -1,289 +1,281 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Search Engine Spider logs
* Last Updated: $LastChangedDate: 2011-05-11 22:11:30 -0400 (Wed, 11 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 27th January 2004
* @version $Rev: 8734 $
*/
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_core_logs_spiderlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Spider map
*
* @var array Spider keys to values
*/
protected $bot_map = array();
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* Load bat names from the useragents cache */
foreach( $this->cache->getCache( 'useragents' ) as $agent )
{
if( $agent['uagent_type'] == 'search' )
{
$this->bot_map[ $agent['uagent_key'] ] = $agent['uagent_name'];
}
}
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_spiderlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=spiderlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=spiderlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
//-----------------------------------------
// Fix up navigation bar
//-----------------------------------------
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=spiderlogs', $this->lang->words['slog_spider_logs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'view':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_view' );
$this->_view();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_delete' );
$this->_remove();
break;
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_view' );
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* View all logs for a given moderator
*
* @return @e void [Outputs to screen]
*/
protected function _view()
{
///----------------------------------------
// Basic init
//-----------------------------------------
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
$botty = IPSText::parseCleanValue( urldecode($this->request['bid'] ) );
$botty = str_replace( "&#33;", "!", $botty );
///----------------------------------------
// No bid or search string?
//-----------------------------------------
if ( !$this->request['search_string'] AND !$this->request['bid'] )
{
$this->registry->output->global_message = $this->lang->words['slog_nostring'];
$this->_listCurrent();
return;
}
///----------------------------------------
// mid?
//-----------------------------------------
if ( !$this->request['search_string'] )
{
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(sid) as count', 'from' => 'spider_logs', 'where' => "bot='{$botty}'" ) );
$row_count = $row['count'];
$query = "&amp;{$this->form_code}&amp;bid=" . $this->request['bid'] . "&amp;do=view";
$this->DB->build( array( 'select' => '*',
'from' => 'spider_logs',
'where' => "bot='{$botty}'",
'order' => 'entry_date DESC',
'limit' => array( $start, 20 ) ) );
$this->DB->execute();
}
else
{
$this->request[ 'search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(sid) as count', 'from' => 'spider_logs', 'where' => "query_string LIKE '%" . $this->request['search_string'] . "%'" ) );
$row_count = $row['count'];
$query = "&amp;{$this->form_code}&amp;do=view&amp;search_string=" . urlencode($this->request['search_string']);
$this->DB->build( array( 'select' => '*',
'from' => 'spider_logs',
'where' => "(query_string LIKE '%" . $this->request['search_string'] . "%') OR (request_addr LIKE '%" . $this->request['search_string'] . "%')",
'order' => 'entry_date DESC',
'limit' => array( $start, 20 ) ) );
$this->DB->execute();
}
///----------------------------------------
// Page links
//-----------------------------------------
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count,
'itemsPerPage' => 20,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . $query,
)
);
///----------------------------------------
// Get db results
//-----------------------------------------
while ( $row = $this->DB->fetch() )
{
$extra = "";
if( $row['query_string'] )
{
if ( stripos( '#lo-fi#i', $row['query_string'] ) !== false )
{
$extra = $this->lang->words['slog_lofi'];
$query_string_html = $extra . ' ' . $row['query_string'];
}
else
{
$query_string_html = "<a href='" . $this->settings['board_url'] . "/index." . $this->settings['php_ext'] . "?{$row['query_string']}' target='_blank'>" . IPSText::truncate($row['query_string']) . "</a>";
}
}
else
{
$query_string_html = "<a href='http://" . $_SERVER['HTTP_HOST'] . "{$row['request_addr']}' target='_blank'>" . IPSText::truncate($row['request_addr']) . "</a>";
}
$row['_bot_name'] = $this->bot_map[ mb_strtolower($row['bot']) ];
$row['_query_string'] = $query_string_html;
$row['_time'] = $this->registry->getClass('class_localization')->getDate( $row['entry_date'], 'LONG' );
$rows[] = $row;
}
///----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->spiderlogsView( $rows, $links );
}
/**
* Remove logs by a moderator
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if ( $this->request['bid'] == "" )
{
$this->registry->output->showError( $this->lang->words['slog_nologs'], 11132 );
}
$botty = urldecode($this->request['bid']);
$botty = str_replace( "&#33;", "!", $botty );
$this->DB->delete( 'spider_logs', "bot='{$botty}'" );
$this->registry->getClass('adminFunctions')->saveAdminLog($this->lang->words['slog_adminlog']);
$this->registry->output->silentRedirect( $this->settings['base_url']."&amp;{$this->form_code}" );
}
/**
* List the current logs with links to view per-admin
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$spiders = array();
//-----------------------------------------
// All bots
//-----------------------------------------
$this->DB->build( array( 'select' => 'count(*) as cnt, bot, max(entry_date) as entry_date',
'from' => 'spider_logs',
'group' => 'bot',
'order' => 'entry_date DESC',
) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$r['_bot_name'] = $this->bot_map[ mb_strtolower($r['bot']) ];
$r['_time'] = $this->registry->getClass('class_localization')->getDate( $r['entry_date'], 'SHORT' );
$r['_bot_url'] = urlencode($r['bot']);
$spiders[] = $r;
}
//-----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->spiderlogsWrapper( $spiders );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Search Engine Spider logs
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 10914 $
*/
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_core_logs_spiderlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Spider map
*
* @var array Spider keys to values
*/
protected $bot_map = array();
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* Load bat names from the useragents cache */
foreach( $this->cache->getCache( 'useragents' ) as $agent )
{
if( $agent['uagent_type'] == 'search' )
{
$this->bot_map[ $agent['uagent_key'] ] = $agent['uagent_name'];
}
}
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_spiderlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=spiderlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=spiderlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=spiderlogs', $this->lang->words['slog_spider_logs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'view':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_view' );
$this->_view();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_delete' );
$this->_remove();
break;
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_view' );
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* View all logs for a given moderator
*
* @return @e void [Outputs to screen]
*/
protected function _view()
{
///----------------------------------------
// Basic init
//-----------------------------------------
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
$botty = IPSText::parseCleanValue( urldecode($this->request['bid'] ) );
$botty = str_replace( "&#33;", "!", $botty );
///----------------------------------------
// No bid or search string?
//-----------------------------------------
if ( !$this->request['search_string'] AND !$this->request['bid'] )
{
$this->registry->output->global_message = $this->lang->words['slog_nostring'];
$this->_listCurrent();
return;
}
///----------------------------------------
// mid?
//-----------------------------------------
if ( !$this->request['search_string'] )
{
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(sid) as count', 'from' => 'spider_logs', 'where' => "bot='{$botty}'" ) );
$row_count = $row['count'];
$query = "&amp;{$this->form_code}&amp;bid=" . $this->request['bid'] . "&amp;do=view";
$this->DB->build( array( 'select' => '*',
'from' => 'spider_logs',
'where' => "bot='{$botty}'",
'order' => 'entry_date DESC',
'limit' => array( $start, 20 ) ) );
$this->DB->execute();
}
else
{
$this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(sid) as count', 'from' => 'spider_logs', 'where' => "query_string LIKE '%" . $this->request['search_string'] . "%'" ) );
$row_count = $row['count'];
$query = "&amp;{$this->form_code}&amp;do=view&amp;search_string=" . urlencode($this->request['search_string']);
$this->DB->build( array( 'select' => '*',
'from' => 'spider_logs',
'where' => "(query_string LIKE '%" . $this->request['search_string'] . "%') OR (request_addr LIKE '%" . $this->request['search_string'] . "%')",
'order' => 'entry_date DESC',
'limit' => array( $start, 20 ) ) );
$this->DB->execute();
}
///----------------------------------------
// Page links
//-----------------------------------------
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count,
'itemsPerPage' => 20,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . $query,
)
);
///----------------------------------------
// Get db results
//-----------------------------------------
while ( $row = $this->DB->fetch() )
{
$extra = "";
if( $row['query_string'] )
{
if ( stripos( '#lo-fi#i', $row['query_string'] ) !== false )
{
$extra = $this->lang->words['slog_lofi'];
$query_string_html = $extra . ' ' . $row['query_string'];
}
else
{
$query_string_html = "<a href='" . $this->settings['board_url'] . "/index." . $this->settings['php_ext'] . "?{$row['query_string']}' target='_blank'>" . IPSText::truncate($row['query_string']) . "</a>";
}
}
else
{
$query_string_html = "<a href='http://" . $_SERVER['HTTP_HOST'] . "{$row['request_addr']}' target='_blank'>" . IPSText::truncate($row['request_addr']) . "</a>";
}
$row['_bot_name'] = $this->bot_map[ strtolower($row['bot']) ];
$row['_query_string'] = $query_string_html;
$row['_time'] = $this->registry->getClass('class_localization')->getDate( $row['entry_date'], 'LONG' );
$rows[] = $row;
}
///----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->spiderlogsView( $rows, $links );
}
/**
* Remove logs by a moderator
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if ( $this->request['bid'] == "" )
{
$this->registry->output->showError( $this->lang->words['slog_nologs'], 11132 );
}
$botty = urldecode($this->request['bid']);
$botty = str_replace( "&#33;", "!", $botty );
$this->DB->delete( 'spider_logs', "bot='{$botty}'" );
$this->registry->getClass('adminFunctions')->saveAdminLog($this->lang->words['slog_adminlog']);
$this->registry->output->silentRedirect( $this->settings['base_url']."&amp;{$this->form_code}" );
}
/**
* List the current logs with links to view per-admin
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$spiders = array();
//-----------------------------------------
// All bots
//-----------------------------------------
$this->DB->build( array( 'select' => 'count(*) as cnt, bot, max(entry_date) as entry_date',
'from' => 'spider_logs',
'group' => 'bot',
'order' => 'entry_date DESC',
) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$r['_bot_name'] = $this->bot_map[ strtolower($r['bot']) ];
$r['_time'] = $this->registry->getClass('class_localization')->getDate( $r['entry_date'], 'SHORT' );
$r['_bot_url'] = urlencode($r['bot']);
$spiders[] = $r;
}
//-----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->spiderlogsWrapper( $spiders );
}
}
@@ -1,252 +1,246 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* SQL error logs
* Last Updated: $LastChangedDate: 2011-07-26 04:00:17 -0400 (Tue, 26 Jul 2011) $
* </pre>
*
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 27th January 2004
* @version $Rev: 9317 $
*/
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_core_logs_sqlerror extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_adminlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=sqlerror';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=sqlerror';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
//-----------------------------------------
// Fix up navigation bar
//-----------------------------------------
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=sqlerror', $this->lang->words['mlog_sqlerrors'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'view':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_view' );
$this->_view();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_delete' );
$this->_remove();
break;
case 'delete_all':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_delete' );
$this->_remove( true );
break;
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_view' );
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* View an SQL log
*
* @return @e void [Outputs to screen]
*/
protected function _view()
{
/* INIT */
$file = trim( $this->request['file'] );
/* Check file name */
if ( ! preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file ) OR ! is_file( IPS_CACHE_PATH . 'cache/' . $file ) )
{
$this->registry->output->global_message = $this->lang->words['sqllog_nofile'];
$this->_listCurrent();
return;
}
/* Fetch size */
$size = @filesize( IPS_CACHE_PATH . 'cache/' . $file );
/* Fetch content */
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
$classFileManagement = new $classToLoad();
/* Get some tail! */
$content = $classFileManagement->tailFile( IPS_CACHE_PATH . 'cache/' . $file, 300 );
$tailSize = IPSLib::strlenToBytes( strlen( $content ) );
/* Can't believe I typed that last comment */
$this->registry->output->html .= $this->html->sqlLogsView( $file, $size, htmlentities( $content ), $tailSize );
}
/**
* Remove logs by an admin
*
* @param bool $doAll Whether to delete all logs or not
* @return @e void [Outputs to screen]
*/
protected function _remove( $doAll=false )
{
//-----------------------------------------
// Deleting all?
//-----------------------------------------
if( $doAll )
{
$count = 0;
try
{
foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache' ) as $file )
{
if ( $file->isDot() OR ! $file->isFile() )
{
continue;
}
if ( preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file->getFilename() ) )
{
$count++;
@unlink( IPS_CACHE_PATH . 'cache/' . $file->getFilename() );
}
}
} catch ( Exception $e ) {}
}
else
{
$file = trim( $this->request['file'] );
$count = 1;
//-----------------------------------------
// Verify filename
//-----------------------------------------
if ( ! preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file ) OR ! is_file( IPS_CACHE_PATH . 'cache/' . $file ) )
{
$this->registry->output->global_message = $this->lang->words['sqllog_nofile'];
$this->_listCurrent();
return;
}
@unlink( IPS_CACHE_PATH . 'cache/' . $file );
}
//-----------------------------------------
// Show list again
//-----------------------------------------
$this->registry->output->global_message = sprintf( $this->lang->words['sqllog_removed'], $count );
$this->_listCurrent();
}
/**
* List the current SQL logs
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$rows = array();
$latestError = '';
/* Got a latest? */
if ( is_file( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) )
{
$unix = @filemtime( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' );
if ( $unix )
{
$mtime = gmdate( 'dmY', $unix );
$now = gmdate( 'dmY', time() );
if ( $mtime == $now )
{
$contents = htmlentities( file_get_contents( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) );
/* Display a message */
$latestError = sprintf( $this->lang->words['sqllog_latest'], $this->registry->class_localization->getDate( $unix, 'LONG' ), $contents );
}
}
}
try
{
foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache' ) as $file )
{
if ( $file->isDot() OR ! $file->isFile() )
{
continue;
}
if ( preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file->getFilename(), $matches ) )
{
$rows[] = array( 'name' => $file->getFilename(),
'mtime' => $file->getMTime(),
'size' => $file->getSize() );
}
}
} catch ( Exception $e ) {}
//-----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->sqllogsWrapper( $rows, $latestError );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* SQL error logs
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 10914 $
*/
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_core_logs_sqlerror extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_adminlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=sqlerror';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=sqlerror';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=sqlerror', $this->lang->words['sqllog_title'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'view':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_view' );
$this->_view();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_delete' );
$this->_remove();
break;
case 'delete_all':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_delete' );
$this->_remove( true );
break;
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_view' );
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* View an SQL log
*
* @return @e void [Outputs to screen]
*/
protected function _view()
{
/* INIT */
$file = trim( $this->request['file'] );
/* Check file name */
if ( ! preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file ) OR ! is_file( IPS_CACHE_PATH . 'cache/' . $file ) )
{
$this->registry->output->global_message = $this->lang->words['sqllog_nofile'];
$this->_listCurrent();
return;
}
/* Fetch size */
$size = @filesize( IPS_CACHE_PATH . 'cache/' . $file );
/* Fetch content */
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
$classFileManagement = new $classToLoad();
/* Get some tail! */
$content = $classFileManagement->tailFile( IPS_CACHE_PATH . 'cache/' . $file, 300 );
$tailSize = IPSLib::strlenToBytes( strlen( $content ) );
/* Can't believe I typed that last comment */
$this->registry->output->html .= $this->html->sqlLogsView( $file, $size, htmlentities( $content ), $tailSize );
}
/**
* Remove logs by an admin
*
* @param bool $doAll Whether to delete all logs or not
* @return @e void [Outputs to screen]
*/
protected function _remove( $doAll=false )
{
//-----------------------------------------
// Deleting all?
//-----------------------------------------
if( $doAll )
{
$count = 0;
try
{
foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache' ) as $file )
{
if ( $file->isDot() OR ! $file->isFile() )
{
continue;
}
if ( preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file->getFilename() ) )
{
$count++;
@unlink( IPS_CACHE_PATH . 'cache/' . $file->getFilename() );
}
}
} catch ( Exception $e ) {}
}
else
{
$file = trim( $this->request['file'] );
$count = 1;
//-----------------------------------------
// Verify filename
//-----------------------------------------
if ( ! preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file ) OR ! is_file( IPS_CACHE_PATH . 'cache/' . $file ) )
{
$this->registry->output->global_message = $this->lang->words['sqllog_nofile'];
$this->_listCurrent();
return;
}
@unlink( IPS_CACHE_PATH . 'cache/' . $file );
}
//-----------------------------------------
// Show list again
//-----------------------------------------
$this->registry->output->global_message = sprintf( $this->lang->words['sqllog_removed'], $count );
$this->_listCurrent();
}
/**
* List the current SQL logs
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$rows = array();
$latestError = '';
/* Got a latest? */
if ( is_file( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) )
{
$unix = @filemtime( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' );
if ( $unix )
{
$mtime = gmdate( 'dmY', $unix );
$now = gmdate( 'dmY', time() );
if ( $mtime == $now )
{
$contents = htmlentities( file_get_contents( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) );
/* Display a message */
$latestError = sprintf( $this->lang->words['sqllog_latest'], $this->registry->class_localization->getDate( $unix, 'LONG' ), $contents );
}
}
}
try
{
foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache' ) as $file )
{
if ( $file->isDot() OR ! $file->isFile() )
{
continue;
}
if ( preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file->getFilename(), $matches ) )
{
$rows[ $file->getFilename() ] = array( 'name' => $file->getFilename(),
'mtime' => $file->getMTime(),
'size' => $file->getSize() );
}
}
} catch ( Exception $e ) {}
ksort( $rows );
//-----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->sqllogsWrapper( $rows, $latestError );
}
}
@@ -0,0 +1,213 @@
<?php
/**
* @file taskmanager.php Task manager
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
*/
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_core_system_taskmanager
* @brief Task manager
*/
class admin_core_logs_tasklogs extends ipsCommand
{
/**
* Skin object shortcut
*
* @var $html
*/
public $html;
/**
* String for the screen url bit
*
* @var $form_code
*/
public $form_code = '';
/**
* String for the JS url bit
*
* @var $form_code_js
*/
public $form_code_js = '';
/**
* Main function executed automatically by the controller
*
* @param object $registry Registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
/* Load Class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/class_taskmanager.php', 'class_taskmanager' );
$this->func_taskmanager = new $classToLoad( $registry );
/* Load Skin and Language */
$this->html = $this->registry->output->loadTemplate('cp_skin_system');
$this->registry->class_localization->loadLanguageFile( array( 'admin_system' ) );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=tasklogs', $this->lang->words['sched_error_logs'] );
/* URLs */
$this->form_code = $this->html->form_code = 'module=logs&amp;section=tasklogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=tasklogs';
switch( $this->request['do'] )
{
default:
case 'task_logs':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tasklogs_view' );
$this->taskLogsOverview();
break;
case 'task_log_show':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tasklogs_view' );
$this->taskLogsShow();
break;
case 'task_log_delete':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tasklogs_delete' );
$this->taskLogsDelete();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Remove logs for a specific task or all
*
* @return @e void
*/
public function taskLogsDelete()
{
/* INIT */
$prune = intval( $this->request['task_prune'] ) ? intval( $this->request['task_prune'] ) : 30;
$prune = time() - ( $prune * 86400 );
if( $this->request['task_title'] != -1 )
{
$where = "log_title='{$this->request['task_title']}' AND log_date > {$prune}";
}
else
{
$where = "log_date > {$prune}";
}
/* Delete */
$this->DB->delete( 'task_logs', $where );
/* Bounce */
$this->registry->output->global_message = $this->lang->words['t_removed'];
$this->taskLogsOverview();
}
/**
* Show task logs
*
* @return @e void
*/
public function taskLogsShow()
{
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
/* INIT */
$limit = intval( $this->request['task_count'] ) ? intval( $this->request['task_count'] ) : 30;
$limit = $limit > 150 ? 150 : $limit;
/* Query the tasks */
if ( $this->request['task_title'] != -1 )
{
$this->DB->build( array( 'select' => '*', 'from' => 'task_logs', 'where' => "log_title='".$this->request['task_title']."'", 'order' => 'log_date DESC', 'limit' => array(0,$limit) ) );
}
else
{
$this->DB->build( array( 'select' => '*', 'from' => 'task_logs', 'order' => 'log_date DESC', 'limit' => array(0,$limit) ) );
}
$this->DB->execute();
/* Loop through the tasks */
$rows = array();
while( $row = $this->DB->fetch() )
{
$row['log_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $row['log_date'], 'TINY' );
$rows[] = $row;
}
$this->registry->output->html .= $this->html->taskManagerLogsShowWrapper( $rows );
}
/**
* Builds the task log overview screen
*
* @return @e void
*/
public function taskLogsOverview()
{
//-----------------------------------------
// Fix up navigation bar
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=system&section=taskmanager&do=task_logs', $this->lang->words['sched_error_logs'] );
/* INIT */
$tasks = array( 0 => array( -1, 'All tasks' ) );
$last5 = "";
$form = array();
/* Get thet ask titles */
$this->DB->build( array( 'select' => '*', 'from' => 'task_manager', 'order' => 'task_title' ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$tasks[] = array( $r['task_title'], $r['task_title'] );
}
/* Get the last 5 logs */
$this->DB->build( array( 'select' => '*', 'from' => 'task_logs', 'order' => 'log_date DESC', 'limit' => array(0,5) ) );
$this->DB->execute();
$last5 = array();
while ( $row = $this->DB->fetch() )
{
//$row['log_desc'] = IPSText::truncate( $row['log_desc'] );
$row['log_date'] = $this->registry->class_localization->getDate( $row['log_date'], 'TINY' );
$last5[] = $row;
}
/* Build the form elements */
$form['task_title'] = $this->registry->output->formDropdown( 'task_title', $tasks, $this->request['task_title'] );
$form['task_title_delete'] = $this->registry->output->formDropdown( 'task_title', $tasks, $this->request['task_title_delete'] );
$form['task_count'] = $this->registry->output->formInput( 'task_count', $this->request['task_count'] ? $this->request['task_count'] : 30 );
$form['task_prune'] = $this->registry->output->formInput( 'task_prune', $this->request['task_prune'] ? $this->request['task_prune'] : 30 );
/* Output */
$this->registry->output->html .= $this->html->taskManagerLogsOverview( $last5, $form );
}
}
@@ -1,517 +1,401 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Warn logs
* Last Updated: $LastChangedDate: 2011-05-12 17:45:20 -0400 (Thu, 12 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 27th January 2004
* @version $Rev: 8752 $
*/
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_core_logs_warnlogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_warnlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=warnlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=warnlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
//-----------------------------------------
// Fix up navigation bar
//-----------------------------------------
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=warnlogs', $this->lang->words['wlog_warn_logs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'view':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'warnlogs_view' );
$this->_view();
break;
case 'viewcontact':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'warnlogs_view' );
$this->_viewContact();
break;
case 'viewnote':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'warnlogs_view' );
$this->_viewNote();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'warnlogs_delete' );
$this->_remove();
break;
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'warnlogs_view' );
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* View all logs for a given moderator
*
* @return @e void [Outputs to screen]
*/
protected function _view()
{
///----------------------------------------
// Basic init
//-----------------------------------------
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
///----------------------------------------
// No mid or search string?
//-----------------------------------------
if ( !$this->request['search_string'] AND !$this->request['mid'] )
{
$this->registry->output->global_message = $this->lang->words['wlog_nostring'];
$this->_listCurrent();
return;
}
///----------------------------------------
// mid?
//-----------------------------------------
if ( !$this->request['search_string'] )
{
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(wlog_id) as count', 'from' => 'warn_logs', 'where' => "wlog_mid=".intval($this->request['mid']) ) );
$query = "{$this->form_code}&amp;mid=" . $this->request['mid'] . "&amp;do=view";
$this->DB->build( array( 'select' => 'l.*',
'from' => array( 'warn_logs' => 'l' ),
'where' => 'l.wlog_mid=' . intval($this->request['mid']),
'order' => 'l.wlog_date DESC',
'limit' => array( $start, 30 ),
'add_join' => array(
array( 'select' => 'm.member_id as a_id, m.members_display_name as a_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.wlog_mid',
'type' => 'left'
),
array( 'select' => 'p.member_id as p_id, p.members_display_name as p_name',
'from' => array( 'members' => 'p' ),
'where' => 'p.member_id=l.wlog_addedby',
'type' => 'left'
),
)
) );
$this->DB->execute();
}
else
{
$this->request[ 'search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
if ( ($this->request['search_type'] == 'notes') )
{
$dbq = "l.wlog_notes LIKE '%" . $this->request['search_string'] . "%'";
}
else
{
$dbq = "l.wlog_contact_content LIKE '%" . $this->request['search_string'] . "%'";
}
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(l.wlog_id) as count', 'from' => 'warn_logs l', 'where' => $dbq ) );
$query = "{$this->form_code}&amp;do=view&amp;search_type=" . $this->request['search_type'] . "&amp;search_string=" . urlencode($this->request['search_string']);
$this->DB->build( array( 'select' => 'l.*',
'from' => array( 'warn_logs' => 'l' ),
'where' => $dbq,
'order' => 'l.wlog_date DESC',
'limit' => array( $start, 30 ),
'add_join' => array(
array( 'select' => 'm.member_id as a_id, m.members_display_name as a_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.wlog_mid',
'type' => 'left'
),
array( 'select' => 'p.member_id as p_id, p.members_display_name as p_name',
'from' => array( 'members' => 'p' ),
'where' => 'p.member_id=l.wlog_addedby',
'type' => 'left'
),
)
) );
$this->DB->execute();
}
///----------------------------------------
// Page links
//-----------------------------------------
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'],
'itemsPerPage' => 20,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . $query,
)
);
///----------------------------------------
// Get teh results
//-----------------------------------------
$days = array( 'd' => $this->lang->words['wlog_days'], 'h' => $this->lang->words['wlog_hours'] );
while ( $row = $this->DB->fetch() )
{
///----------------------------------------
// Basics
//-----------------------------------------
$row['_a_name'] = $row['a_name'] ? $row['a_name'] : sprintf( $this->lang->words['wlog_deleted'], $row['wlog_mid'] );
$row['_date'] = $this->registry->class_localization->getDate( $row['wlog_date'], 'LONG' );
$row['_type'] = ( $row['wlog_type'] == 'pos' ) ? '<span style="color:green;font-weight:bold">-</span>' : '<span style="color:red;font-weight:bold">+</span>';
$row['_type'] = ( $row['wlog_type'] == 'custom' ) ? '<span style="color:grey;font-weight:bold">C</span>' : $row['_type'];
$row['_cont'] = ( $row['wlog_contact'] != 'none' ) ? "<a href='#' onclick='return acp.openWindow(\"{$this->settings['base_url']}&{$this->form_code}&do=viewcontact&id={$row['wlog_id']}\", 400,400, \"{$this->lang->words['wlog_log']}\"); return false;'>{$this->lang->words['wlog_view']}</a>" : '&nbsp;';
///----------------------------------------
// Mod Q
//-----------------------------------------
if ( strstr( $row['wlog_notes'], '<content>' ) )
{
$mod = preg_match( "#<mod>(.+?)</mod>#is" , $row['wlog_notes'], $mm );
$mod = trim($mm[1]);
list($v, $u, $i) = explode( ',', $mod);
$row['_mod'] = ( $i == 1 ) ? $this->lang->words['wlog_indef'] : ( $v == "" ? $this->lang->words['wlog_none'] : $v . ' ' . $days[$u] );
///----------------------------------------
// Susp
//-----------------------------------------
$susp = preg_match( "#<susp>(.+?)</susp>#is" , $row['wlog_notes'], $sm );
$susp = trim($sm[1]);
list($v, $u) = explode( ',', $susp );
$row['_susp'] = $v == '' ? $this->lang->words['wlog_none'] : $v . ' ' . $days[$u];
///----------------------------------------
// Posting Susp
//-----------------------------------------
$post = preg_match( "#<post>(.+?)</post>#is" , $row['wlog_notes'], $pm );
$post = trim($pm[1]);
list($v, $u, $i) = explode( ',', $post );
$row['_post'] = ( $i == 1 ) ? $this->lang->words['wlog_indef'] : ( $v == "" ? $this->lang->words['wlog_none'] : $v . ' ' . $days[$u] );
}
else
{
$_wlog = unserialize( $row['wlog_notes'] );
$row['_mod'] = $_wlog['mod_indef'] ? $this->lang->words['wlog_indef'] : ( $_wlog['mod'] == 0 ? $this->lang->words['wlog_none'] : $_wlog['mod'] . ' ' . $days[ $_wlog['mod_unit'] ? $_wlog['mod_unit'] : 'd' ] );
$row['_susp'] = $_wlog['ban'] ? $this->lang->words['wlog_indef'] : ( $_wlog['susp'] == 0 ? $this->lang->words['wlog_none'] : $_wlog['susp'] . ' ' . $days[ $_wlog['susp_unit'] ? $_wlog['susp_unit'] : 'd' ] );
$row['_post'] = $_wlog['post_indef'] ? $this->lang->words['wlog_indef'] : ( $_wlog['post'] == 0 ? $this->lang->words['wlog_none'] : $_wlog['post'] . ' ' . $days[ $_wlog['post_unit'] ? $_wlog['post_unit'] : 'd' ] );
}
//-----------------------------------------
$rows[] = $row;
}
///----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->warnlogsView( $rows, $links );
}
/**
* Remove logs by a moderator
*
* @return @e void [Outputs to screen]
*/
protected function _remove()
{
if ( $this->request['mid'] == "" )
{
$this->registry->output->showError( $this->lang->words['wlog_nofind'], 11133 );
}
$this->DB->delete( 'warn_logs', "wlog_mid=" . intval($this->request['mid']) );
$this->registry->getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['wlog_removelogs'], $this->request['mid'] ) );
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
}
/**
* List the current logs with links to view per-admin
*
* @return @e void [Outputs to screen]
*/
protected function _listCurrent()
{
$rows = array();
$members = array();
//-----------------------------------------
// VIEW LAST 5
//-----------------------------------------
$this->DB->build( array( 'select' => 'l.*',
'from' => array( 'warn_logs' => 'l' ),
'order' => 'l.wlog_date DESC',
'limit' => array( 0, 10 ),
'add_join' => array(
array( 'select' => 'm.member_id as a_id, m.members_display_name as a_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.wlog_mid',
'type' => 'left'
),
array( 'select' => 'p.member_id as p_id, p.members_display_name as p_name',
'from' => array( 'members' => 'p' ),
'where' => 'p.member_id=l.wlog_addedby',
'type' => 'left'
),
)
) );
$this->DB->execute();
while ( $row = $this->DB->fetch() )
{
$row['_a_name'] = $row['a_name'] ? $row['a_name'] : sprintf( $this->lang->words['wlog_deleted'], $row['wlog_mid'] );
$row['_date'] = $this->registry->class_localization->getDate( $row['wlog_date'], 'LONG' );
$row['_type'] = ( $row['wlog_type'] == 'pos' ) ? '<span style="color:green;font-weight:bold">-</span>' : '<span style="color:red;font-weight:bold">+</span>';
$row['_type'] = ( $row['wlog_type'] == 'custom' ) ? '<span style="color:grey;font-weight:bold">C</span>' : $row['_type'];
$row['_cont'] = ( $row['wlog_contact'] != 'none' ) ? "<a title='{$this->lang->words['wlog_showmessage']}' href='#' onclick='return acp.openWindow(\"{$this->settings['base_url']}&{$this->form_code}&do=viewcontact&id={$row['wlog_id']}\",400,400,\"{$this->lang->words['wlog_log']}\"); return false;'><img src='{$this->settings['skin_acp_url']}/images/icons/tick.png' alt='{$this->lang->words['wlog_contacted']}'></a>" : '&nbsp;';
$rows[] = $row;
}
//-----------------------------------------
// All members
//-----------------------------------------
$this->DB->build( array(
'select' => 'count(l.wlog_mid) as act_count',
'from' => array( 'warn_logs' => 'l' ),
'group' => 'l.wlog_mid',
'order' => 'act_count DESC',
'add_join' => array(
array(
'select' => 'm.member_id, m.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.wlog_mid',
'type' => 'left',
),
),
) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$members[ $r['member_id'] ] = $r;
}
//-----------------------------------------
// Output
//-----------------------------------------
$this->registry->output->html .= $this->html->warnlogsWrapper( $rows, $members );
}
/**
* Popup window to view a note
*
* @return @e void [Outputs to screen]
*/
protected function _viewNote()
{
if ( !$this->request['id'] )
{
$this->registry->output->showError( $this->lang->words['wlog_nologs'], 11134 );
}
$id = intval($this->request['id']);
$row = $this->DB->buildAndFetch( array( 'select' => 'l.*',
'from' => array( 'warn_logs' => 'l' ),
'where' => 'l.wlog_id=' . $id,
'add_join' => array(
array( 'select' => 'm.member_id as a_id, m.members_display_name as a_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.wlog_mid',
'type' => 'left'
),
array( 'select' => 'p.member_id as p_id, p.members_display_name as p_name, p.member_group_id, p.mgroup_others',
'from' => array( 'members' => 'p' ),
'where' => 'p.member_id=l.wlog_addedby',
'type' => 'left'
),
)
) );
if ( ! $row['wlog_id'] )
{
$this->registry->output->showError( $this->lang->words['wlog_cantresolve'], 11135 );
}
$cont = array();
if ( strstr( $row['wlog_notes'], '<content>' ) )
{
preg_match( "#<content>(.+?)</content>#is", $row['wlog_notes'], $cont );
}
else
{
$_array = unserialize( $row['wlog_notes'] );
if ( is_array( $_array ) AND $_array['content'] )
{
$cont[1] = $_array['content'];
}
}
$row['_date'] = $this->registry->class_localization->getDate( $row['wlog_date'], 'LONG' );
$row['a_name'] = $row['a_name'] ? $row['a_name'] : sprintf( $this->lang->words['deleted_member_warnlog'], $row['wlog_mid'] );
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_html = 0;
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'warn';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
$row['_text'] = IPSText::getTextClass('bbcode')->preDisplayParse( $cont[1] );
$this->registry->output->html .= $this->html->warnlogsNote( $row );
$this->registry->output->printPopupWindow();
}
/**
* Popup window to view a contact
*
* @return @e void [Outputs to screen]
*/
protected function _viewContact()
{
if ( !$this->request['id'] )
{
$this->registry->output->showError( $this->lang->words['wlog_nologs'], 11136 );
}
$id = intval($this->request['id']);
$row = $this->DB->buildAndFetch( array( 'select' => 'l.*',
'from' => array( 'warn_logs' => 'l' ),
'where' => 'l.wlog_id=' . $id,
'add_join' => array(
array( 'select' => 'm.member_id as a_id, m.members_display_name as a_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.wlog_mid',
'type' => 'left'
),
array( 'select' => 'p.member_id as p_id, p.members_display_name as p_name, p.member_group_id, p.mgroup_others',
'from' => array( 'members' => 'p' ),
'where' => 'p.member_id=l.wlog_addedby',
'type' => 'left'
),
)
) );
if ( ! $row['wlog_id'] )
{
$this->registry->output->showError( $this->lang->words['wlog_nologs'], 11137 );
}
if( strpos( $row['wlog_contact_content'], '<content>' ) )
{
$subject = preg_match( "#<subject>(.+?)</subject>#is", $row['wlog_contact_content'], $subj );
$content = preg_match( "#<content>(.+?)</content>#is", $row['wlog_contact_content'], $cont );
$row['_subject'] = $subj[1];
$row['_text'] = $cont[1];
}
else
{
$row['_subject'] = $this->lang->words['subj_not_avail'];
$row['_text'] = $row['wlog_contact_content'];
}
$row['_type'] = $row['wlog_contact'] == 'pm' ? $this->lang->words['wlog_pm'] : $this->lang->words['wlog_email'];
$row['_date'] = $this->registry->class_localization->getDate( $row['wlog_date'], 'LONG' );
$row['a_name'] = $row['a_name'] ? $row['a_name'] : sprintf( $this->lang->words['wlog_deleted'], $row['wlog_mid'] );
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
IPSText::getTextClass( 'bbcode' )->parse_html = 1;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'warn';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
$row['_text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['_text'] );
$row['_text'] = $this->registry->output->replaceMacros( $row['_text'] );
$this->registry->output->html .= $this->html->warnlogsContact( $row );
$this->registry->output->printPopupWindow();
}
<?php
/**
* @file warnlogs.php Warn logs
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* @since 27th January 2004
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
*/
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_core_logs_warnlogs
* @brief Warn logs
*/
class admin_core_logs_warnlogs extends ipsCommand
{
/**
* Skin object shortcut
*
* @var $html
*/
public $html;
/**
* String for the screen url bit
*
* @var $form_code
*/
public $form_code = '';
/**
* String for the JS url bit
*
* @var $form_code_js
*/
public $form_code_js = '';
/**
* Main function executed automatically by the controller
*
* @param object $registry Registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_warnlogs');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=warnlogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=warnlogs';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=warnlogs', $this->lang->words['wlog_warn_logs'] );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'view':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'warnlogs_view' );
$this->_view();
break;
case 'viewnote':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'warnlogs_view' );
$this->_viewNote();
break;
case 'remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'warnlogs_delete' );
$this->_remove();
break;
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'warnlogs_view' );
$this->_listCurrent();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* View all logs for a given moderator
*
* @return @e void
*/
protected function _view()
{
///----------------------------------------
// Basic init
//-----------------------------------------
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
/* Load reasons */
$reasons = array();
$this->DB->build( array( 'select' => '*', 'from' => 'members_warn_reasons', 'order' => 'wr_order' ) );
$this->DB->execute();
while ( $row = $this->DB->fetch() )
{
$reasons[ $row['wr_id'] ] = $row;
}
///----------------------------------------
// No mid or search string?
//-----------------------------------------
if ( !$this->request['search_string'] AND !$this->request['mid'] )
{
$this->registry->output->global_message = $this->lang->words['wlog_nostring'];
$this->_listCurrent();
return;
}
///----------------------------------------
// mid?
//-----------------------------------------
if ( !$this->request['search_string'] )
{
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(wl_id) as count', 'from' => 'members_warn_logs', 'where' => "wl_member=".intval($this->request['mid']) ) );
$query = "{$this->form_code}&amp;mid=" . $this->request['mid'] . "&amp;do=view";
$this->DB->build( array( 'select' => 'l.*',
'from' => array( 'members_warn_logs' => 'l' ),
'where' => 'l.wl_member=' . intval($this->request['mid']),
'order' => 'l.wl_date DESC',
'limit' => array( $start, 30 ),
'add_join' => array(
array( 'select' => 'm.member_id as a_id, m.members_display_name as a_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.wl_member',
'type' => 'left'
),
array( 'select' => 'p.member_id as p_id, p.members_display_name as p_name',
'from' => array( 'members' => 'p' ),
'where' => 'p.member_id=l.wl_moderator',
'type' => 'left'
),
)
) );
$this->DB->execute();
}
else
{
$this->request[ 'search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
$dbq = "l.wl_note_member LIKE '%" . $this->request['search_string'] . "%' OR l.wl_note_mods LIKE '%" . $this->request['search_string'] . "%'";
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(l.wl_id) as count', 'from' => 'members_warn_logs l', 'where' => $dbq ) );
$query = "{$this->form_code}&amp;do=view&amp;search_type=" . $this->request['search_type'] . "&amp;search_string=" . urlencode($this->request['search_string']);
$this->DB->build( array( 'select' => 'l.*',
'from' => array( 'members_warn_logs' => 'l' ),
'where' => $dbq,
'order' => 'l.wl_date DESC',
'limit' => array( $start, 30 ),
'add_join' => array(
array( 'select' => 'm.member_id as a_id, m.members_display_name as a_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.wl_member',
'type' => 'left'
),
array( 'select' => 'p.member_id as p_id, p.members_display_name as p_name',
'from' => array( 'members' => 'p' ),
'where' => 'p.member_id=l.wl_moderator',
'type' => 'left'
),
)
) );
$this->DB->execute();
}
///----------------------------------------
// Page links
//-----------------------------------------
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'],
'itemsPerPage' => 30,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . $query,
)
);
///----------------------------------------
// Get teh results
//-----------------------------------------
$days = array( 'd' => $this->lang->words['wlog_days'], 'h' => $this->lang->words['wlog_hours'] );
while ( $row = $this->DB->fetch() )
{
$row['_a_name'] = $row['a_name'] ? $row['a_name'] : sprintf( $this->lang->words['wlog_deleted'], $row['wl_member'] );
$row['_date'] = $this->registry->class_localization->getDate( $row['wl_date'], 'LONG' );
$row['wl_reason'] = $row['wl_reason'] ? $reasons[ $row['wl_reason'] ]['wr_name'] : '--';
$row['_mod'] = $row['wl_mq'] == -1 ? $this->lang->words['wlog_indef'] : ( $row['wl_mq'] == 0 ? $this->lang->words['wlog_none'] : $row['wl_mq'] . ' ' . $days[ $row['wl_mq_unit'] ? $row['wl_mq_unit'] : 'd' ] );
$row['_susp'] = $row['wl_suspend'] == -1 ? $this->lang->words['wlog_indef'] : ( $row['wl_suspend'] == 0 ? $this->lang->words['wlog_none'] : $row['wl_suspend'] . ' ' . $row[ $row['wl_suspend_unit'] ? $row['wl_suspend_unit'] : 'd' ] );
$row['_post'] = $row['wl_rpa'] == -1 ? $this->lang->words['wlog_indef'] : ( $row['wl_rpa'] == 0 ? $this->lang->words['wlog_none'] : $row['wl_rpa'] . ' ' . $days[ $row['wl_rpa_unit'] ? $row['wl_rpa_unit'] : 'd' ] );
$rows[] = $row;
}
///----------------------------------------
// And output
//-----------------------------------------
$this->registry->output->html .= $this->html->warnlogsView( $rows, $links );
}
/**
* Remove logs by a moderator
*
* @return @e void
*/
protected function _remove()
{
if ( $this->request['mid'] == "" )
{
$this->registry->output->showError( $this->lang->words['wlog_nofind'], 11133 );
}
$this->DB->delete( 'members_warn_logs', "wl_member=" . intval($this->request['mid']) );
$this->registry->getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['wlog_removelogs'], $this->request['mid'] ) );
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
}
/**
* List the current logs with links to view per-admin
*
* @return @e void
*/
protected function _listCurrent()
{
/* Init vars */
$rows = array();
$members = array();
//-----------------------------------------
// VIEW LAST 5
//-----------------------------------------
$this->DB->build( array( 'select' => 'l.*',
'from' => array( 'members_warn_logs' => 'l' ),
'order' => 'l.wl_date DESC',
'limit' => array( 0, 10 ),
'add_join' => array(
array( 'select' => 'm.member_id as a_id, m.members_display_name as a_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.wl_member',
'type' => 'left'
),
array( 'select' => 'p.member_id as p_id, p.members_display_name as p_name',
'from' => array( 'members' => 'p' ),
'where' => 'p.member_id=l.wl_moderator',
'type' => 'left'
),
)
) );
$this->DB->execute();
while ( $row = $this->DB->fetch() )
{
$row['_a_name'] = $row['a_name'] ? $row['a_name'] : sprintf( $this->lang->words['wlog_deleted'], $row['wl_member'] );
$row['_date'] = $this->registry->class_localization->getDate( $row['wl_date'], 'LONG' );
$rows[] = $row;
}
//-----------------------------------------
// All members
//-----------------------------------------
$st = intval( $this->request['st'] );
$perpage = 15;
$count = $this->DB->buildAndFetch( array( 'select' => 'count( ' .$this->DB->buildDistinct( 'wl_member' ) . ') as count', 'from' => 'members_warn_logs' ) );
if ( $count['count'] )
{
$this->DB->build( array(
'select' => 'count(l.wl_member) as act_count',
'from' => array( 'members_warn_logs' => 'l' ),
'group' => 'l.wl_member, m.member_id, m.members_display_name',
'order' => 'act_count DESC',
'add_join' => array(
array(
'select' => 'm.member_id, m.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.wl_member',
'type' => 'left',
),
),
'limit' => array( $st, $perpage ),
) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$members[ $r['member_id'] ] = $r;
}
}
$pagination = $this->registry->output->generatePagination( array( 'totalItems' => $count['count'],
'itemsPerPage' => $perpage,
'currentStartValue' => $st,
'baseUrl' => $this->settings['base_url'] . $this->form_code,
) );
//-----------------------------------------
// Output
//-----------------------------------------
$this->registry->output->html .= $this->html->warnlogsWrapper( $rows, $members, $pagination );
}
/**
* Popup window to view a note
*
* @return @e void
*/
protected function _viewNote()
{
if ( !$this->request['id'] )
{
$this->registry->output->showError( $this->lang->words['wlog_nologs'], 11134 );
}
$id = intval($this->request['id']);
$row = $this->DB->buildAndFetch( array( 'select' => 'l.*',
'from' => array( 'members_warn_logs' => 'l' ),
'where' => 'l.wl_id=' . $id,
'add_join' => array(
array( 'select' => 'm.member_id as a_id, m.members_display_name as a_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=l.wl_member',
'type' => 'left'
),
array( 'select' => 'p.member_id as p_id, p.members_display_name as p_name, p.member_group_id, p.mgroup_others',
'from' => array( 'members' => 'p' ),
'where' => 'p.member_id=l.wl_moderator',
'type' => 'left'
),
)
) );
if ( ! $row['wl_id'] )
{
$this->registry->output->showError( $this->lang->words['wlog_cantresolve'], 11135 );
}
$row['_date'] = $this->registry->class_localization->getDate( $row['wl_date'], 'LONG' );
$row['a_name'] = $row['a_name'] ? $row['a_name'] : sprintf( $this->lang->words['deleted_member_warnlog'], $row['wl_member'] );
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_html = 0;
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'warn';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
$row['wl_note_member'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['wl_note_member'] );
$row['wl_note_mods'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['wl_note_mods'] );
$this->registry->output->html .= $this->html->warnlogsNote( $row );
$this->registry->output->printPopupWindow();
}
}
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,86 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Журнал администраторских действий</grouptitle>
<grouptitle>Admin Logs</grouptitle>
<grouplang>core_adminlogs</grouplang>
<items>
<item>
<key>adminlogs_view</key>
<string>Может просматривать журнал?</string>
<string>Can view admin logs?</string>
</item>
<item>
<key>adminlogs_delete</key>
<string>Может удлаять записи?</string>
<string>Can delete admin logs?</string>
</item>
</items>
</group>
<group>
<grouptitle>Журнал модераторских действий</grouptitle>
<grouptitle>Admin Login Logs</grouptitle>
<grouplang>core_acp_loginlogs</grouplang>
<items>
<item>
<key>acplogin_log</key>
<string>Can view admin login logs?</string>
</item>
</items>
</group>
<group>
<grouptitle>Moderator Logs</grouptitle>
<grouplang>core_modlogs</grouplang>
<items>
<item>
<key>modlogs_view</key>
<string>Может просматривать журнал?</string>
<string>Can view moderator logs?</string>
</item>
<item>
<key>modlogs_delete</key>
<string>Может удлаять записи?</string>
<string>Can delete moderator logs?</string>
</item>
</items>
</group>
<group>
<grouptitle>Журнал ошибок Email</grouptitle>
<grouptitle>Email Error Logs</grouptitle>
<grouplang>core_eelogs</grouplang>
<items>
<item>
<key>emailerrorlogs_view</key>
<string>Может просматривать журнал?</string>
<string>Can view email error logs?</string>
</item>
<item>
<key>emailerrorlogs_delete</key>
<string>Может удлаять записи?</string>
<string>Can delete email error logs?</string>
</item>
</items>
</group>
<group>
<grouptitle>Журнал действий поисковых роботов</grouptitle>
<grouptitle>Spider Logs</grouptitle>
<grouplang>core_spiderlogs</grouplang>
<items>
<item>
<key>spiderlogs_view</key>
<string>Может просматривать журнал?</string>
<string>Can view spider logs?</string>
</item>
<item>
<key>spiderlogs_delete</key>
<string>Может удлаять записи?</string>
<string>Can delete spider logs?</string>
</item>
</items>
</group>
<group>
<grouptitle>Журнал пользовательских предупреждений</grouptitle>
<grouptitle>Warn Logs</grouptitle>
<grouplang>core_warnlogs</grouplang>
<items>
<item>
<key>warnlogs_view</key>
<string>Может просматривать журнал?</string>
<string>Can view warn logs?</string>
</item>
<item>
<key>warnlogs_delete</key>
<string>Может удлаять записи?</string>
<string>Can delete warn logs?</string>
</item>
</items>
</group>
<group>
<grouptitle>Журнал ошибок системы</grouptitle>
<grouptitle>Error Logs</grouptitle>
<grouplang>core_errorlogs</grouplang>
<items>
<item>
<key>errorlogs_view</key>
<string>Может просматривать журнал?</string>
<string>Can view error logs?</string>
</item>
<item>
<key>errorlogs_delete</key>
<string>Может удлаять записи?</string>
<string>Can delete error logs?</string>
</item>
</items>
</group>
@@ -0,0 +1,210 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* API Users
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright © 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 1st march 2002
* @version $Revision: 10914 $
*
*/
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_core_logs_xmlrpclogs extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Shortcut for url
*
* @var string URL shortcut
*/
protected $form_code;
/**
* Shortcut for url (javascript)
*
* @var string JS URL shortcut
*/
protected $form_code_js;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin...
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_tools' ) );
$this->html = $this->registry->output->loadTemplate('cp_skin_api');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=xmlrpclogs';
$this->form_code_js = $this->html->form_code_js = 'module=logs&section=xmlrpclogs';
//-----------------------------------------
// What are we to do, today?
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'log_list':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'api_logs' );
$this->logList();
break;
case 'log_view_detail':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'api_logs' );
$this->logViewDetail();
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();
}
/**
* API Logs View
* View API Log
*
* @return @e void [Outputs]
* @author Matt Mecham
* @since 2.3.2
*/
public function logViewDetail()
{
//-----------------------------------------
// Fix up navigation bar
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=xmlrpclogs', $this->lang->words['api_error_logs'] );
//-----------------------------------------
// Get data from the deebee
//-----------------------------------------
$log = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'api_log', 'where' => 'api_log_id=' . intval( $this->request['api_log_id'] ) ) );
if ( ! $log['api_log_id'] )
{
$this->registry->output->global_message = $this->lang->words['a_lognoid'];
$this->logList();
return;
}
//-----------------------------------------
// Display...
//-----------------------------------------
$log['_api_log_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $log['api_log_date'], 'LONG' );
$log['_api_log_allowed'] = $log['api_log_allowed'] ? 'tick.png' : 'cross.png';
$log['_api_log_query'] = htmlspecialchars( $log['api_log_query'] );
//-----------------------------------------
// Show...
//-----------------------------------------
$this->registry->output->html .= $this->html->api_log_detail( $log );
$this->registry->output->printPopupWindow();
}
/**
* API Logs List
* List API Logs
*
* @return @e void [Outputs]
* @author Matt Mecham
* @since 2.3.2
*/
public function logList()
{
//-----------------------------------------
// Fix up navigation bar
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
$this->registry->output->core_nav = array();
$this->registry->output->ignoreCoreNav = true;
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=logsSplash', $this->lang->words['nav_logssplash'] );
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=xmlrpclogs', $this->lang->words['api_error_logs'] );
//-----------------------------------------
// INIT
//-----------------------------------------
$start = intval( $this->request['st'] );
$perpage = 50;
$logs = array();
//-----------------------------------------
// Get log count
//-----------------------------------------
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'api_log' ) );
$links = $this->registry->output->generatePagination( array( 'totalItems' => intval( $count['count'] ),
'itemsPerPage' => $perpage,
'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . $this->form_code . '&amp;do=log_list' ) );
//-----------------------------------------
// Get from DB
//-----------------------------------------
$this->DB->build( array( 'select' => '*', 'from' => 'api_log', 'order' => 'api_log_date DESC', 'limit' => array( $start, $perpage ) ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$row['_api_log_date'] = ipsRegistry::getClass('class_localization')->getDate( $row['api_log_date'], 'LONG' );
$row['_api_log_allowed'] = $row['api_log_allowed'] ? 'tick.png' : 'cross.png';
$logs[] = $row;
}
//-----------------------------------------
// Print...
//-----------------------------------------
$this->registry->output->html .= $this->html->api_login_view( $logs, $links );
}
}
@@ -0,0 +1,14 @@
<?php
/**
* @file defaultSection.php Define the default section for the 'mobileapp' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2010-10-14 13:11:17 -0400 (Thu, 14 Oct 2010) $
* @version v3.3.4
* $Revision: 477 $
*/
$DEFAULT_SECTION = 'images';
@@ -0,0 +1,224 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Manage mobile app images
* Last Updated: $Date: 2012-03-30 16:23:27 +0100 (Fri, 30 Mar 2012) $
* </pre>
*
* @author $Author: mark $
* @copyright (c) 2001 - 2011 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 2012-04-20
* @version $Revision: 10526 $
*
*/
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_core_mobileapp_images extends ipsCommand
{
/**
* Skin Functions Class
*
* @var object
*/
protected $skinFunctions;
/**
* Recursive depth guide
*
* @var array
*/
protected $_depthGuide = array();
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**#@+
* URL bits
*
* @var string
*/
public $form_code = '';
public $form_code_js = '';
/**#@-*/
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_mobileapp');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=mobileapp&amp;section=images&amp;';
$this->form_code_js = $this->html->form_code_js = 'module=mobileapp&section=images&';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_mobileapp' ) );
/* Load up iOS class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/mobile/iosImages.php', 'classes_mobile_iosImages' );
$this->images = new $classToLoad();
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'overview':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_images' );
$this->_overview();
break;
case 'exportXml':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_images' );
$this->_export();
break;
case 'importXml':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_images' );
$this->_import();
break;
case 'refresh':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_images' );
$this->_refresh();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Refresh stuffs
*/
protected function _refresh()
{
$dirErrors = $this->images->checkDirectories();
$imgErrors = $this->images->checkImages();
if ( count( $dirErrors ) || $imgErrors['missing'] !== false OR $imgErrors['dimensions'] !== false OR $imgErrors['writeable'] !== false )
{
$this->images->setStyleLastUpdated( time() );
$this->registry->output->global_message = $this->lang->words['mi_recache_done'];
}
else
{
$this->registry->output->global_error = $this->lang->words['mi_error_refresh_failed'];
}
$this->_overview();
}
/**
* Export as XML archive
*/
protected function _export()
{
$xml = $this->images->getXmlArchive();
if ( ! $xml )
{
$this->registry->output->global_error = $this->lang->words['mi_error_no_export'];
$this->_overview();
return;
}
$this->registry->output->showDownload( $xml, 'mobileiOsImages.xml' );
}
/**
* Import an XML archive
*/
protected function _import()
{
try
{
$xml = $this->registry->adminFunctions->importXml();
}
catch ( Exception $e )
{
$this->registry->output->showError( $e->getMessage() );
}
$result = $this->images->importXmlArchive( $xml );
if ( ! $result )
{
$this->registry->output->global_error = $this->lang->words['mi_import_failed'];
}
$this->_overview();
}
/**
* List the import form
*
* @return @e void
*/
protected function _overview()
{
$dirErrors = $this->images->checkDirectories();
$imgErrors = $this->images->checkImages();
$currentImages = $this->images->getImageDirContents();
$defaultImages = $this->images->getDefaultImageDirContents();
$canImport = true;
if ( $dirErrors !== false )
{
$canImport = false;
foreach( $dirErrors as $error )
{
$this->registry->output->global_error .= sprintf( $this->lang->words['mi_error_' . $error['key'] ], $error['extra'] ) . '<br />';
}
}
if ( $imgErrors['writeable'] !== false )
{
$canImport = false;
$this->registry->output->global_error .= $this->lang->words['mi_error_images_writeable'] . '<br />';
}
if ( $imgErrors['missing'] !== false )
{
foreach( $imgErrors['missing'] as $img )
{
$this->registry->output->global_error .= sprintf( $this->lang->words['mi_error_missing_img'], '<a href="' . $this->images->getDefaultImageUrl() . $img . '" target="_blank">' . $img . '</a>' ) . '<br />';
}
}
$this->registry->output->html .= $this->html->overview( $currentImages, $defaultImages, $this->images->getImageDir(), $imgErrors, $canImport );
}
}
@@ -0,0 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com/">IP.Board</a>
</body>
</html>
@@ -0,0 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<menu>
<tabitems>
<item>
<title>Mobile App</title>
<subitems>
<subitem>
<subitemtitle>Mobile App</subitemtitle>
<subitemlang>skins_manage_app_images</subitemlang>
<subsection>images</subsection>
<subitemurl>do=overview</subitemurl>
<subitemrolekey>app_images</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
</tabitems>
</menu>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Manage App Images</grouptitle>
<grouplang>core_templates</grouplang>
<items>
<item>
<key>app_images</key>
<string>Can view and manage app images?</string>
</item>
</items>
</group>
</permissions>
File diff suppressed because it is too large. Load diff
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'mycp' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
@@ -1,202 +1,202 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Admin change email/password
* Last Updated: $Date: 2011-05-31 16:58:52 -0400 (Tue, 31 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 5th January 2005
* @version $Revision: 8932 $
*/
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_core_mycp_details extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_mycp');
//-----------------------------------------
// Load language
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_mycp' ) );
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=mycp&amp;section=dashboard';
$this->form_code_js = $this->html->form_code_js = 'module=mycp&section=dashboard';
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'form':
default:
$this->_showForm();
break;
case 'save':
$this->_saveForm();
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();
}
/**
* Show the form so admin can reset email/pass
*
* @return @e void
*/
protected function _showForm()
{
$this->registry->output->html .= $this->html->showChangeForm();
}
/**
* Save new email and/or pass
*
* @return @e void
*/
protected function _saveForm()
{
if( !$this->request['email'] AND !$this->request['password'] )
{
$this->registry->output->global_error = $this->lang->words['change_nothing_update'];
$this->_showForm();
return;
}
if( $this->request['email'] )
{
if( !$this->request['email_confirm'] )
{
$this->registry->output->global_error = $this->lang->words['change_both_fields'];
$this->_showForm();
return;
}
else if( $this->request['email'] != $this->request['email_confirm'] )
{
$this->registry->output->global_error = $this->lang->words['change_not_match'];
$this->_showForm();
return;
}
$email = trim($this->request['email']);
if( ! IPSText::checkEmailAddress( $email ) )
{
$this->registry->output->global_error = $this->lang->words['bad_email_supplied'];
$this->_showForm();
return;
}
$email_check = IPSMember::load( mb_strtolower($email) );
if ( $email_check['member_id'] )
{
if ( $email_check['member_id'] == $this->memberData['member_id'] )
{
$this->registry->output->global_error = $this->lang->words['already_using_email'];
}
else
{
$this->registry->output->global_error = $this->lang->words['change_email_already_used'];
}
$this->_showForm();
return;
}
//-----------------------------------------
// Load handler...
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$han_login = new $classToLoad( $this->registry );
$han_login->init();
$han_login->changeEmail( trim( mb_strtolower( $this->memberData['email'] ) ), trim( mb_strtolower( $email ) ), $this->memberData );
IPSLib::runMemberSync( 'onEmailChange', $this->memberData['member_id'], mb_strtolower( $email ), $this->memberData['email'] );
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'email' => mb_strtolower( $email ) ) ) );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['changed_email'], $email ) );
}
if( $this->request['password'] )
{
if( !$this->request['password_confirm'] )
{
$this->registry->output->global_error = $this->lang->words['change_both_fields'];
$this->_showForm();
return;
}
else if( $this->request['password'] != $this->request['password_confirm'] )
{
$this->registry->output->global_error = $this->lang->words['change_not_match_pw'];
$this->_showForm();
return;
}
$password = $this->request['password'];
$salt = str_replace( '\\', "\\\\", IPSMember::generatePasswordSalt(5) );
$key = IPSMember::generateAutoLoginKey();
$md5_once = md5( trim($password) );
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$han_login = new $classToLoad( $this->registry );
$han_login->init();
$han_login->changePass( $this->memberData['email'], $md5_once, $password, $this->memberData );
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'members_pass_salt' => $salt, 'member_login_key' => $key ) ) );
IPSMember::updatePassword( $this->memberData['member_id'], $md5_once );
IPSLib::runMemberSync( 'onPassChange', $this->memberData['member_id'], $password );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['changed_password'] );
}
$this->registry->output->global_message = $this->lang->words['details_updated'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Admin change email/password
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 5th January 2005
* @version $Revision: 10914 $
*/
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_core_mycp_details extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_mycp');
//-----------------------------------------
// Load language
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_mycp' ) );
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=mycp&amp;section=dashboard';
$this->form_code_js = $this->html->form_code_js = 'module=mycp&section=dashboard';
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'form':
default:
$this->_showForm();
break;
case 'save':
$this->_saveForm();
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();
}
/**
* Show the form so admin can reset email/pass
*
* @return @e void
*/
protected function _showForm()
{
$this->registry->output->html .= $this->html->showChangeForm();
}
/**
* Save new email and/or pass
*
* @return @e void
*/
protected function _saveForm()
{
if( !$this->request['email'] AND !$this->request['password'] )
{
$this->registry->output->global_error = $this->lang->words['change_nothing_update'];
$this->_showForm();
return;
}
if( $this->request['email'] )
{
if( !$this->request['email_confirm'] )
{
$this->registry->output->global_error = $this->lang->words['change_both_fields'];
$this->_showForm();
return;
}
else if( $this->request['email'] != $this->request['email_confirm'] )
{
$this->registry->output->global_error = $this->lang->words['change_not_match'];
$this->_showForm();
return;
}
$email = trim($this->request['email']);
if( ! IPSText::checkEmailAddress( $email ) )
{
$this->registry->output->global_error = $this->lang->words['bad_email_supplied'];
$this->_showForm();
return;
}
$email_check = IPSMember::load( strtolower($email) );
if ( $email_check['member_id'] )
{
if ( $email_check['member_id'] == $this->memberData['member_id'] )
{
$this->registry->output->global_error = $this->lang->words['already_using_email'];
}
else
{
$this->registry->output->global_error = $this->lang->words['change_email_already_used'];
}
$this->_showForm();
return;
}
//-----------------------------------------
// Load handler...
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$han_login = new $classToLoad( $this->registry );
$han_login->init();
$han_login->changeEmail( trim( strtolower( $this->memberData['email'] ) ), trim( strtolower( $email ) ), $this->memberData );
IPSLib::runMemberSync( 'onEmailChange', $this->memberData['member_id'], strtolower( $email ), $this->memberData['email'] );
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'email' => strtolower( $email ) ) ) );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['changed_email'], $email ) );
}
if( $this->request['password'] )
{
if( !$this->request['password_confirm'] )
{
$this->registry->output->global_error = $this->lang->words['change_both_fields'];
$this->_showForm();
return;
}
else if( $this->request['password'] != $this->request['password_confirm'] )
{
$this->registry->output->global_error = $this->lang->words['change_not_match_pw'];
$this->_showForm();
return;
}
$password = $this->request['password'];
$salt = str_replace( '\\', "\\\\", IPSMember::generatePasswordSalt(5) );
$key = IPSMember::generateAutoLoginKey();
$md5_once = md5( trim($password) );
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$han_login = new $classToLoad( $this->registry );
$han_login->init();
$han_login->changePass( $this->memberData['email'], $md5_once, $password, $this->memberData );
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'members_pass_salt' => $salt, 'member_login_key' => $key ) ) );
IPSMember::updatePassword( $this->memberData['member_id'], $md5_once );
IPSLib::runMemberSync( 'onPassChange', $this->memberData['member_id'], $password );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['changed_password'] );
}
$this->registry->output->global_message = $this->lang->words['details_updated'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] );
}
}
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>Панель управления</title>
<title>My Dashboard</title>
<subitems>
<subitem>
<subitemtitle>Панель управления</subitemtitle>
<subitemtitle>My Dashboard</subitemtitle>
<subitemlang>dashboard</subitemlang>
<subsection>dashboard</subsection>
<subitemurl></subitemurl>
@@ -15,10 +15,10 @@
</subitems>
</item>
<item>
<title>Изменить свои данные</title>
<title>Change My Details</title>
<subitems>
<subitem>
<subitemtitle>Изменение своих данных</subitemtitle>
<subitemtitle>Change My Details</subitemtitle>
<subitemlang>mydetails</subitemlang>
<subsection>details</subsection>
<subitemurl></subitemurl>
@@ -1,408 +1,415 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Bad Word Filters
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 27th January 2004
* @version $Rev: 8644 $
*/
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_core_posts_badwords extends ipsCommand
{
/**
* HTML skin object
*
* @var object
*/
public $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* Load Skin and Lang */
$this->html = $this->registry->output->loadTemplate( 'cp_skin_badwords' );
$this->html->form_code = '&amp;module=posts&amp;section=badwords';
$this->html->form_code_js = '&module=posts&section=badwords';
$this->lang->loadLanguageFile( array( 'admin_posts' ) );
/* What to do */
switch( $this->request['do'] )
{
case 'badword_add':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_manage' );
$this->badwordAdd();
break;
case 'badword_remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_delete' );
$this->badwordRemove();
break;
case 'badword_edit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_manage' );
$this->badwordEditForm();
break;
case 'badword_doedit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_manage' );
$this->handleBadwordEdit();
break;
case 'badword_export':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_manage' );
$this->badwordsExport();
break;
case 'badword_import':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_manage' );
$this->badwordsImport();
break;
default:
case 'overview':
case 'badword':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_manage' );
$this->badwordsOvervew();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Remove a badword filter
*
* @return @e void
*/
public function badwordRemove()
{
/* Check ID */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['bwl_nofiter'], 11138 );
}
/* Delete */
$this->DB->delete( 'badwords', "wid={$id}" );
/* Rebuild cache and bounce */
$this->badwordsRebuildCache();
$this->registry->output->global_message = $this->lang->words['bwl_filter_removed'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code );
}
/**
* Handles the badword edit form
*
* @return @e void
*/
public function handleBadwordEdit()
{
/* Check for before */
if( ! $this->request['before'] )
{
$this->registry->output->showError( $this->lang->words['bwl_noword'], 11139 );
}
/* Check ID */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['bwl_nofilter'], 11140 );
}
/* Match */
$this->request['match'] = $this->request['match'] ? 1 : 0;
/* Swap Text */
$this->DB->setDataType( array( 'type', 'swop' ), 'string' );
$this->DB->update( 'badwords', array(
'type' => trim( $this->request['before'] ),
'swop' => trim( $this->request['after'] ),
'm_exact' => $this->request['match']
), "wid=" . $id );
/* Recache and bounce */
$this->badwordsRebuildCache();
$this->registry->output->global_message = $this->lang->words['bwl_filter_edited'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code );
}
/**
* Edit Badword Form
*
* @return @e void
* @author Josh
*/
public function badwordEditForm()
{
/* Check ID */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['bwl_nofilter'], 11141 );
}
/* Get the field */
$this->DB->build( array( 'select' => '*', 'from' => 'badwords', 'where' => "wid='{$id}'" ) );
$this->DB->execute();
if ( ! $r = $this->DB->fetch() )
{
$this->registry->output->showError( $this->lang->words['bwl_filter_404'], 11142 );
}
/* Form Fields */
$form = array();
$form['before'] = $this->registry->output->formInput('before', stripslashes( $r['type'] ) );
$form['after'] = $this->registry->output->formInput('after' , stripslashes( $r['swop'] ) );
$form['match'] = $this->registry->output->formDropdown( 'match', array( 0 => array( 1, $this->lang->words['bwl_exact'] ), 1 => array( 0, $this->lang->words['bwl_loose'] ) ), $r['m_exact'] );
/* Output */
$this->registry->output->html .= $this->html->badwordEditForm( $id, $form );
}
/**
* Handle add bad word request
*
* @return @e void
*/
public function badwordAdd()
{
/* Check for before text */
if( ! $this->request['before'] )
{
$this->registry->output->showError( $this->lang->words['bwl_noword'], 11143 );
}
/* Match */
$this->request['match'] = $this->request['match'] ? 1 : 0;
/* Insert filter */
$this->DB->setDataType( array( 'type', 'swop' ), 'string' );
$this->DB->insert( 'badwords', array(
'type' => trim( $this->request['before'] ),
'swop' => trim( $this->request['after'] ),
'm_exact' => $this->request['match']
)
);
/* Rebuild the cache */
$this->badwordsRebuildCache();
/* Bounce */
$this->registry->output->global_message = $this->lang->words['bwl_filter_new'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code );
}
/**
* Badword Overview Screen
*
* @return @e void
*/
public function badwordsOvervew()
{
/* Query the bad words */
$this->DB->build( array( 'select' => '*', 'from' => 'badwords', 'order' => 'type' ) );
$this->DB->execute();
/* Loop through the results */
$rows = array();
if ( $this->DB->getTotalRows() )
{
while ( $r = $this->DB->fetch() )
{
$words[] = $r;
}
foreach( $words as $r )
{
$r['replace'] = $r['swop'] ? stripslashes( $r['swop'] ) : '######';
$r['method'] = $r['m_exact'] ? $this->lang->words['bwl_exact'] : $this->lang->words['bwl_loose'];
$r['type'] = stripslashes( $r['type'] );
$rows[] = $r;
}
}
/* Output */
$this->registry->output->html .= $this->html->badwordsWrapper( $rows );
}
/**
* Import badwords from an xml file
*
* @return @e void
*/
public function badwordsImport()
{
/* Get Badwords XML */
$content = $this->registry->adminFunctions->importXml( 'ipb_badwords.xml' );
/* Check for content */
if ( ! $content )
{
$this->registry->output->global_message = $this->lang->words['bwl_upload_failed'];
$this->badwordsOvervew();
return;
}
//-----------------------------------------
// Get xml class
//-----------------------------------------
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
$xml = new classXML( IPS_DOC_CHAR_SET );
$xml->loadXML( $content );
if( !count( $xml->fetchElements('badword') ) )
{
$this->registry->output->global_message = $this->lang->words['bwl_upload_wrong'];
$this->badwordsOvervew();
return;
}
/* Get a list of current badwords */
$words = array();
$this->DB->build( array( 'select' => '*', 'from' => 'badwords', 'order' => 'type' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$words[ $r['type'] ] = 1;
}
/* Loop through the xml document and insert new bad words */
foreach( $xml->fetchElements('badword') as $badword )
{
$entry = $xml->fetchElementsFromRecord( $badword );
/* Get the filter settings */
$type = $entry['type'];
$swop = $entry['swop'];
$m_exact = $entry['m_exact'];
/* Skip if it's already in the db */
if ( $words[ $type ] )
{
continue;
}
/* Add to the db */
if ( $type )
{
$this->DB->insert( 'badwords', array( 'type' => $type, 'swop' => $swop, 'm_exact' => $m_exact ) );
}
}
/* Rebuild cache and bounce */
$this->badwordsRebuildCache();
$this->registry->output->global_message = $this->lang->words['bwl_upload_good'];
$this->badwordsOvervew();
}
/**
* Exports badwords to an xml file
*
* @return @e void
*/
public function badwordsExport()
{
//-----------------------------------------
// Get xml class
//-----------------------------------------
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
$xml = new classXML( IPS_DOC_CHAR_SET );
$xml->newXMLDocument();
$xml->addElement( 'badwordexport' );
$xml->addElement( 'badwordgroup', 'badwordexport' );
/* Query the badwords */
$this->DB->build( array( 'select' => 'type, swop, m_exact', 'from' => 'badwords', 'order' => 'type' ) );
$this->DB->execute();
/* Add the bad word entries to the xml file */
while( $r = $this->DB->fetch() )
{
$xml->addElementAsRecord( 'badwordgroup', 'badword', $r );
}
/* Create the xml document and send to the browser */
$xmlData = $xml->fetchDocument();
$this->registry->output->showDownload( $xmlData, 'ipb_badwords.xml' );
}
/**
* Rebuild badword cache
*
* @return @e void
*/
public function badwordsRebuildCache()
{
$cache = array();
$this->DB->build( array( 'select' => 'type,swop,m_exact', 'from' => 'badwords' ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$cache[] = $r;
}
usort( $cache, array( $this, '_thisUsort' ) );
$this->cache->setCache( 'badwords', $cache, array( 'array' => 1 ) );
}
/**
* Custom sort operation
*
* @param string A
* @param string B
* @return integer
*/
protected function _thisUsort($a, $b)
{
if ( IPSText::mbstrlen($a['type']) == IPSText::mbstrlen($b['type']) )
{
return 0;
}
return ( IPSText::mbstrlen($a['type']) > IPSText::mbstrlen($b['type']) ) ? -1 : 1;
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Bad Word Filters
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 10914 $
*/
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_core_posts_badwords extends ipsCommand
{
/**
* HTML skin object
*
* @var object
*/
public $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* Load Skin and Lang */
$this->html = $this->registry->output->loadTemplate( 'cp_skin_badwords' );
$this->html->form_code = '&amp;module=posts&amp;section=badwords';
$this->html->form_code_js = '&module=posts&section=badwords';
$this->lang->loadLanguageFile( array( 'admin_posts' ) );
/* What to do */
switch( $this->request['do'] )
{
case 'badword_add':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_manage' );
$this->badwordAdd();
break;
case 'badword_remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_delete' );
$this->badwordRemove();
break;
case 'badword_edit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_manage' );
$this->badwordEditForm();
break;
case 'badword_doedit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_manage' );
$this->handleBadwordEdit();
break;
case 'badword_export':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_manage' );
$this->badwordsExport();
break;
case 'badword_import':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_manage' );
$this->badwordsImport();
break;
default:
case 'overview':
case 'badword':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'badword_manage' );
$this->badwordsOvervew();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Remove a badword filter
*
* @return @e void
*/
public function badwordRemove()
{
/* Check ID */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['bwl_nofiter'], 11138 );
}
/* Delete */
$this->DB->delete( 'badwords', "wid={$id}" );
/* Rebuild cache and bounce */
$this->badwordsRebuildCache();
$this->registry->output->global_message = $this->lang->words['bwl_filter_removed'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code );
}
/**
* Handles the badword edit form
*
* @return @e void
*/
public function handleBadwordEdit()
{
/* Check for before */
if( ! $this->request['before'] )
{
$this->registry->output->showError( $this->lang->words['bwl_noword'], 11139 );
}
/* Check ID */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['bwl_nofilter'], 11140 );
}
/* Match */
$this->request['match'] = $this->request['match'] ? 1 : 0;
/* Swap Text */
$this->DB->setDataType( array( 'type', 'swop' ), 'string' );
$this->DB->update( 'badwords', array(
'type' => $this->request['before'], // do not trim - see bug report 34433
'swop' => $this->request['after'], // do not trim - see bug report 34433
'm_exact' => $this->request['match']
), "wid=" . $id );
/* Recache and bounce */
$this->badwordsRebuildCache();
$this->registry->output->global_message = $this->lang->words['bwl_filter_edited'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code );
}
/**
* Edit Badword Form
*
* @return @e void
* @author Josh
*/
public function badwordEditForm()
{
/* Check ID */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['bwl_nofilter'], 11141 );
}
/* Get the field */
$this->DB->build( array( 'select' => '*', 'from' => 'badwords', 'where' => "wid='{$id}'" ) );
$this->DB->execute();
if ( ! $r = $this->DB->fetch() )
{
$this->registry->output->showError( $this->lang->words['bwl_filter_404'], 11142 );
}
/* Form Fields */
$form = array();
$form['before'] = $this->registry->output->formInput('before', stripslashes( $r['type'] ) );
$form['after'] = $this->registry->output->formInput('after' , stripslashes( $r['swop'] ) );
$form['match'] = $this->registry->output->formDropdown( 'match', array( 0 => array( 1, $this->lang->words['bwl_exact'] ), 1 => array( 0, $this->lang->words['bwl_loose'] ) ), $r['m_exact'] );
/* Output */
$this->registry->output->html .= $this->html->badwordEditForm( $id, $form );
}
/**
* Handle add bad word request
*
* @return @e void
*/
public function badwordAdd()
{
/* Check for before text */
if( ! $this->request['before'] )
{
$this->registry->output->showError( $this->lang->words['bwl_noword'], 11143 );
}
/* Match */
$this->request['match'] = $this->request['match'] ? 1 : 0;
/* Insert filter */
$this->DB->setDataType( array( 'type', 'swop' ), 'string' );
$this->DB->insert( 'badwords', array(
'type' => $this->request['before'], // do not trim - see bug report 34433
'swop' => $this->request['after'], // do not trim - see bug report 34433
'm_exact' => $this->request['match']
)
);
/* Rebuild the cache */
$this->badwordsRebuildCache();
/* Bounce */
$this->registry->output->global_message = $this->lang->words['bwl_filter_new'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code );
}
/**
* Badword Overview Screen
*
* @return @e void
*/
public function badwordsOvervew()
{
/* Query the bad words */
$this->DB->build( array( 'select' => '*', 'from' => 'badwords', 'order' => 'type' ) );
$this->DB->execute();
/* Loop through the results */
$rows = array();
if ( $this->DB->getTotalRows() )
{
while ( $r = $this->DB->fetch() )
{
$words[] = $r;
}
foreach( $words as $r )
{
$r['replace'] = $r['swop'] ? stripslashes( $r['swop'] ) : '######';
$r['method'] = $r['m_exact'] ? $this->lang->words['bwl_exact'] : $this->lang->words['bwl_loose'];
$r['type'] = stripslashes( $r['type'] );
$rows[] = $r;
}
}
/* Output */
$this->registry->output->html .= $this->html->badwordsWrapper( $rows );
}
/**
* Import badwords from an xml file
*
* @return @e void
*/
public function badwordsImport()
{
/* Get Badwords XML */
try
{
$content = $this->registry->adminFunctions->importXml( 'ipb_badwords.xml' );
}
catch ( Exception $e )
{
$this->registry->output->showError( $e->getMessage() );
}
/* Check for content */
if ( ! $content )
{
$this->registry->output->global_message = $this->lang->words['bwl_upload_failed'];
$this->badwordsOvervew();
return;
}
//-----------------------------------------
// Get xml class
//-----------------------------------------
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
$xml = new classXML( IPS_DOC_CHAR_SET );
$xml->loadXML( $content );
if( !count( $xml->fetchElements('badword') ) )
{
$this->registry->output->global_message = $this->lang->words['bwl_upload_wrong'];
$this->badwordsOvervew();
return;
}
/* Get a list of current badwords */
$words = array();
$this->DB->build( array( 'select' => '*', 'from' => 'badwords', 'order' => 'type' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$words[ $r['type'] ] = 1;
}
/* Loop through the xml document and insert new bad words */
foreach( $xml->fetchElements('badword') as $badword )
{
$entry = $xml->fetchElementsFromRecord( $badword );
/* Get the filter settings */
$type = $entry['type'];
$swop = $entry['swop'];
$m_exact = $entry['m_exact'];
/* Skip if it's already in the db */
if ( $words[ $type ] )
{
continue;
}
/* Add to the db */
if ( $type )
{
$this->DB->insert( 'badwords', array( 'type' => $type, 'swop' => $swop, 'm_exact' => $m_exact ) );
}
}
/* Rebuild cache and bounce */
$this->badwordsRebuildCache();
$this->registry->output->global_message = $this->lang->words['bwl_upload_good'];
$this->badwordsOvervew();
}
/**
* Exports badwords to an xml file
*
* @return @e void
*/
public function badwordsExport()
{
//-----------------------------------------
// Get xml class
//-----------------------------------------
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
$xml = new classXML( IPS_DOC_CHAR_SET );
$xml->newXMLDocument();
$xml->addElement( 'badwordexport' );
$xml->addElement( 'badwordgroup', 'badwordexport' );
/* Query the badwords */
$this->DB->build( array( 'select' => 'type, swop, m_exact', 'from' => 'badwords', 'order' => 'type' ) );
$this->DB->execute();
/* Add the bad word entries to the xml file */
while( $r = $this->DB->fetch() )
{
$xml->addElementAsRecord( 'badwordgroup', 'badword', $r );
}
/* Create the xml document and send to the browser */
$xmlData = $xml->fetchDocument();
$this->registry->output->showDownload( $xmlData, 'ipb_badwords.xml' );
}
/**
* Rebuild badword cache
*
* @return @e void
*/
public function badwordsRebuildCache()
{
$cache = array();
$this->DB->build( array( 'select' => 'type,swop,m_exact', 'from' => 'badwords' ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$cache[] = $r;
}
usort( $cache, array( $this, '_thisUsort' ) );
$this->cache->setCache( 'badwords', $cache, array( 'array' => 1 ) );
}
/**
* Custom sort operation
*
* @param string A
* @param string B
* @return integer
*/
protected function _thisUsort($a, $b)
{
if ( IPSText::mbstrlen($a['type']) == IPSText::mbstrlen($b['type']) )
{
return 0;
}
return ( IPSText::mbstrlen($a['type']) > IPSText::mbstrlen($b['type']) ) ? -1 : 1;
}
}
File diff suppressed because it is too large. Load diff
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'posts' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,476 +1,475 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* BBCode Media Tag Management
* Last Updated: $LastChangedDate: 2011-08-04 06:15:18 -0400 (Thu, 04 Aug 2011) $
* </pre>
*
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since 27th January 2004
* @version $Rev: 9361 $
*/
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_core_posts_media extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_bbcode');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=posts&amp;section=media';
$this->form_code_js = $this->html->form_code_js = 'module=posts&section=media';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_posts' ) );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'do_del':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_delete' );
$this->_mediaTagDelete();
break;
case 'form_add':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagForm( 'add' );
break;
case 'form_edit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagForm( 'edit' );
break;
case 'domediatagadd':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagSave( 'add' );
break;
case 'domediatagedit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagSave( 'edit' );
break;
case 'mediatag_export':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagExport();
break;
case 'mediatag_import':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagImport();
break;
case 'reorder':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_moveMediaTag();
break;
case 'index':
case 'overview':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagIndex();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Reorder media tags
*
* @return @e void
*/
protected function _moveMediaTag()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
$ajax = new $classToLoad();
//-----------------------------------------
// Checks...
//-----------------------------------------
if( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false )
{
$ajax->returnString( $this->lang->words['postform_badmd5'] );
exit();
}
//-----------------------------------------
// Save new position
//-----------------------------------------
$position = 1;
if( is_array($this->request['media']) AND count($this->request['media']) )
{
foreach( $this->request['media'] as $this_id )
{
$this->DB->update( 'bbcode_mediatag', array( 'mediatag_position' => $position ), 'mediatag_id=' . $this_id );
$position++;
}
}
$ajax->returnString( 'OK' );
exit();
}
/**
* Import a mediaTag XML file
*
* @return @e void [Outputs to screen]
*/
protected function _mediaTagImport()
{
$content = $this->registry->getClass('adminFunctions')->importXml( 'mediatag.xml' );
//-----------------------------------------
// Got anything?
//-----------------------------------------
if ( ! $content )
{
$this->registry->output->global_message = $this->lang->words['m_upload_failed'];
$this->_mediaTagIndex();
return;
}
$this->doMediaImport( $content );
$this->registry->output->global_message = $this->lang->words['m_upload_complete'];
$this->_mediaTagIndex();
}
/**
* Abstracted import routine for installer
*
* @param string XML file content
* @return @e void
*/
public function doMediaImport( $content )
{
//-----------------------------------------
// Get xml mah-do-dah
//-----------------------------------------
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
$xml = new classXML( IPS_DOC_CHAR_SET );
$xml->loadXML( $content );
//-----------------------------------------
// Get current custom bbcodes
//-----------------------------------------
$tags = array();
$this->DB->build( array( 'select' => '*', 'from' => 'bbcode_mediatag' ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$tags[ $r['mediatag_name'] ] = $r['mediatag_id'];
}
//-----------------------------------------
// pArse
//-----------------------------------------
foreach( $xml->fetchElements('mediatag') as $mediatag )
{
$entry = $xml->fetchElementsFromRecord( $mediatag );
$name = $entry['mediatag_name'];
$match = $entry['mediatag_match'];
$replace = $entry['mediatag_replace'];
$array = array(
'mediatag_name' => $name,
'mediatag_match' => $match,
'mediatag_replace' => $replace
);
if ( $tags[ $name ] )
{
$this->DB->update( 'bbcode_mediatag', $array, "mediatag_id=" . $tags[ $name ] );
continue;
}
if ( $name )
{
$this->DB->insert( 'bbcode_mediatag', $array );
}
}
$this->recacheMediaTag();
}
/**
* Export a mediaTag XML file
*
* @return @e void [Outputs to screen]
*/
protected function _mediaTagExport()
{
//-----------------------------------------
// Get xml mah-do-dah
//-----------------------------------------
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
$xml = new classXML( IPS_DOC_CHAR_SET );
$xml->newXMLDocument();
$xml->addElement( 'mediatagexport' );
$xml->addElement( 'mediataggroup', 'mediatagexport' );
$select = array( 'select' => '*', 'from' => 'bbcode_mediatag' );
if( $this->request['id'] )
{
$select['where'] = 'mediatag_id=' . intval($this->request['id']);
}
$this->DB->build( $select );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$xml->addElementAsRecord( 'mediataggroup', 'mediatag', $r );
}
$xmlData = $xml->fetchDocument();
//-----------------------------------------
// Send to browser.
//-----------------------------------------
$this->registry->output->showDownload( $xmlData, 'mediatag.xml', '', 0 );
}
/**
* Delete a custom media tag
*
* @return @e void
*/
protected function _mediaTagDelete()
{
/* ID */
$id = intval( $this->request['id'] );
/* Remove */
$this->DB->delete( 'bbcode_mediatag', "mediatag_id={$id}" );
$this->recacheMediaTag();
/* Redirect */
$this->registry->output->global_message = $this->lang->words['m_replace_removed'];
$this->_mediaTagIndex();
}
/**
* Save changes to a custom media tag
*
* @param string [$type='add']
* @return @e void
*/
protected function _mediaTagSave( $type='add' )
{
/* INI */
$errors = array();
/* Check input */
if( ! $this->request['mediatag_name'] )
{
$errors[] = $this->lang->words['m_error_name'];
}
if( ! $this->request['mediatag_match'] )
{
$errors[] = $this->lang->words['m_error_match'];
}
if( ! $this->request['mediatag_replace'] )
{
$errors[] = $this->lang->words['m_error_replace'];
}
if( count( $errors ) )
{
$this->_mediaTagForm( $type, $errors );
return;
}
/* Data */
$data = array(
'mediatag_name' => $this->request['mediatag_name'],
'mediatag_match' => rtrim( str_replace( '&#092;', '\\', str_replace( '&#039', "'", trim( IPSText::stripslashes( $_POST['mediatag_match'] ) ) ) ), ',' ),
'mediatag_replace' => IPSText::formToText( rtrim( str_replace( '&#092;', '\\', str_replace( '&#039', "'", trim( IPSText::stripslashes( $_POST['mediatag_replace'] ) ) ) ), ',' ) ),
);
/* Check the type */
if( $type == 'add' )
{
/* Insert the record */
$this->DB->insert( 'bbcode_mediatag', $data );
/* Update cache */
$this->recacheMediaTag();
/* All done */
$this->registry->output->global_message = sprintf( $this->lang->words['m_tag_added'], $data['mediatag_name'] );
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&amp;do=overview" );
}
else
{
/* ID */
$id = intval( $this->request['id'] );
/* Update */
$this->DB->update( 'bbcode_mediatag', $data, "mediatag_id={$id}" );
/* Recache */
$this->recacheMediaTag();
/* Done and done */
$this->registry->output->global_message = sprintf( $this->lang->words['m_tag_updated'], $data['mediatag_name'] );
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&amp;do=overview" );
}
}
/**
* Show the mediatag add/edit form
*
* @param string [$type='add']
* @param array [Optional] array of errors
* @return @e void
*/
protected function _mediaTagForm( $type='add', $errors=array() )
{
/* Check form type */
if( $type == 'add' )
{
/* Data */
$data = array(
'mediatag_name' => $this->request['mediatag_name'],
'mediatag_match' => rtrim( str_replace( '&#092;', '\\', str_replace( '&#039', "'", trim( IPSText::stripslashes( $_POST['mediatag_match'] ) ) ) ), ',' ),
'mediatag_replace' => rtrim( str_replace( '&#092;', '\\', str_replace( '&#039', "'", trim( IPSText::stripslashes( $_POST['mediatag_replace'] ) ) ) ), ',' ),
);
}
else
{
/* Data */
$id = intval( $this->request['id'] );
$data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'bbcode_mediatag', 'where' => "mediatag_id={$id}" ) );
/* Set Defaults */
$data['mediatag_name'] = !empty( $this->request['mediatag_name'] ) ? $this->request['mediatag_name'] : $data['mediatag_name'];
$data['mediatag_match'] = !empty( $this->request['mediatag_match'] ) ? IPSText::textToForm( $this->request['mediatag_match'] ) : IPSText::textToForm( $data['mediatag_match'] );
$data['mediatag_replace'] = !empty( $this->request['mediatag_replace'] ) ? IPSText::textToForm( $this->request['mediatag_replace'] ) : IPSText::textToForm( $data['mediatag_replace'] );
}
/* Setup Form */
$this->registry->output->html .= $this->html->mediaTagForm( $type, $data, $errors );
}
/**
* List all the the current media tag types
*
* @return @e void
*/
protected function _mediaTagIndex()
{
/* Query Bookmarks */
$this->DB->build( array(
'select' => '*',
'from' => 'bbcode_mediatag',
'order' => 'mediatag_position ASC',
) );
$this->DB->execute();
$bbcode_rows = "";
/* List the bookmarks */
while( $r = $this->DB->fetch() )
{
$bbcode_rows .= $this->html->mediaTagRow( $r );
}
/* End table and output */
$this->registry->output->html .= $this->html->mediaTagWrapper( $bbcode_rows );
}
/**
* Recache the mediatag config
*
* @return @e void
*/
public function recacheMediaTag()
{
/* Query the tags */
$this->DB->build( array( 'select' => '*', 'from' => 'bbcode_mediatag', 'order' => 'mediatag_position ASC' ) );
$this->DB->execute();
$media_config = array();
while( $r = $this->DB->fetch() )
{
$media_config[$r['mediatag_name']] = array(
'match' => preg_replace( "#{[0-9]}#", "(.*?)", str_replace( '.', '\.', str_replace( '?', '?', $r['mediatag_match'] ) ) ),
'replace' => $r['mediatag_replace'],
);
}
/* Save to cache */
$this->cache->setCache( 'mediatag', $media_config, array( 'array' => 1 ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* BBCode Media Tag Management
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 10914 $
*/
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_core_posts_media extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_bbcode');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=posts&amp;section=media';
$this->form_code_js = $this->html->form_code_js = 'module=posts&section=media';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_posts' ) );
///----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'do_del':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_delete' );
$this->_mediaTagDelete();
break;
case 'form_add':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagForm( 'add' );
break;
case 'form_edit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagForm( 'edit' );
break;
case 'domediatagadd':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagSave( 'add' );
break;
case 'domediatagedit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagSave( 'edit' );
break;
case 'mediatag_export':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagExport();
break;
case 'mediatag_import':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagImport();
break;
case 'reorder':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_moveMediaTag();
break;
case 'index':
case 'overview':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'media_manage' );
$this->_mediaTagIndex();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Reorder media tags
*
* @return @e void
*/
protected function _moveMediaTag()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
$ajax = new $classToLoad();
//-----------------------------------------
// Checks...
//-----------------------------------------
if( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false )
{
$ajax->returnString( $this->lang->words['postform_badmd5'] );
exit();
}
//-----------------------------------------
// Save new position
//-----------------------------------------
$position = 1;
if( is_array($this->request['media']) AND count($this->request['media']) )
{
foreach( $this->request['media'] as $this_id )
{
$this->DB->update( 'bbcode_mediatag', array( 'mediatag_position' => $position ), 'mediatag_id=' . $this_id );
$position++;
}
}
$ajax->returnString( 'OK' );
exit();
}
/**
* Import a mediaTag XML file
*
* @return @e void [Outputs to screen]
*/
protected function _mediaTagImport()
{
$content = $this->registry->getClass('adminFunctions')->importXml( 'mediatag.xml' );
//-----------------------------------------
// Got anything?
//-----------------------------------------
if ( ! $content )
{
$this->registry->output->global_message = $this->lang->words['m_upload_failed'];
$this->_mediaTagIndex();
return;
}
$this->doMediaImport( $content );
$this->registry->output->global_message = $this->lang->words['m_upload_complete'];
$this->_mediaTagIndex();
}
/**
* Abstracted import routine for installer
*
* @param string XML file content
* @return @e void
*/
public function doMediaImport( $content )
{
//-----------------------------------------
// Get xml mah-do-dah
//-----------------------------------------
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
$xml = new classXML( IPS_DOC_CHAR_SET );
$xml->loadXML( $content );
//-----------------------------------------
// Get current custom bbcodes
//-----------------------------------------
$tags = array();
$this->DB->build( array( 'select' => '*', 'from' => 'bbcode_mediatag' ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$tags[ $r['mediatag_name'] ] = $r['mediatag_id'];
}
//-----------------------------------------
// pArse
//-----------------------------------------
foreach( $xml->fetchElements('mediatag') as $mediatag )
{
$entry = $xml->fetchElementsFromRecord( $mediatag );
$name = $entry['mediatag_name'];
if ( $name )
{
$array = array( 'mediatag_name' => $name,
'mediatag_match' => $entry['mediatag_match'],
'mediatag_replace' => $entry['mediatag_replace']
);
if ( $tags[ $name ] )
{
$this->DB->update( 'bbcode_mediatag', $array, "mediatag_id=" . $tags[ $name ] );
}
else
{
$this->DB->insert( 'bbcode_mediatag', $array );
}
}
}
$this->recacheMediaTag();
}
/**
* Export a mediaTag XML file
*
* @return @e void [Outputs to screen]
*/
protected function _mediaTagExport()
{
//-----------------------------------------
// Get xml mah-do-dah
//-----------------------------------------
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
$xml = new classXML( IPS_DOC_CHAR_SET );
$xml->newXMLDocument();
$xml->addElement( 'mediatagexport' );
$xml->addElement( 'mediataggroup', 'mediatagexport' );
$select = array( 'select' => '*', 'from' => 'bbcode_mediatag' );
if( $this->request['id'] )
{
$select['where'] = 'mediatag_id=' . intval($this->request['id']);
}
$this->DB->build( $select );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
// Unset a few values to keep it cleaner
unset( $r['mediatag_id'], $r['mediatag_position'] );
$xml->addElementAsRecord( 'mediataggroup', 'mediatag', $r );
}
$xmlData = $xml->fetchDocument();
//-----------------------------------------
// Send to browser.
//-----------------------------------------
$this->registry->output->showDownload( $xmlData, 'mediatag.xml', '', 0 );
}
/**
* Delete a custom media tag
*
* @return @e void
*/
protected function _mediaTagDelete()
{
/* ID */
$id = intval( $this->request['id'] );
/* Remove */
$this->DB->delete( 'bbcode_mediatag', "mediatag_id={$id}" );
$this->recacheMediaTag();
/* Redirect */
$this->registry->output->global_message = $this->lang->words['m_replace_removed'];
$this->_mediaTagIndex();
}
/**
* Save changes to a custom media tag
*
* @param string [$type='add']
* @return @e void
*/
protected function _mediaTagSave( $type='add' )
{
/* INI */
$errors = array();
/* Check input */
if( ! $this->request['mediatag_name'] )
{
$errors[] = $this->lang->words['m_error_name'];
}
if( ! $this->request['mediatag_match'] )
{
$errors[] = $this->lang->words['m_error_match'];
}
if( ! $this->request['mediatag_replace'] )
{
$errors[] = $this->lang->words['m_error_replace'];
}
if( count( $errors ) )
{
$this->_mediaTagForm( $type, $errors );
return;
}
/* Data */
$data = array(
'mediatag_name' => $this->request['mediatag_name'],
'mediatag_match' => rtrim( str_replace( '&#092;', '\\', str_replace( '&#039', "'", trim( IPSText::stripslashes( $_POST['mediatag_match'] ) ) ) ), ',' ),
'mediatag_replace' => IPSText::formToText( rtrim( str_replace( '&#092;', '\\', str_replace( '&#039', "'", trim( IPSText::stripslashes( $_POST['mediatag_replace'] ) ) ) ), ',' ) ),
);
/* Check the type */
if( $type == 'add' )
{
/* Insert the record */
$this->DB->insert( 'bbcode_mediatag', $data );
/* Update cache */
$this->recacheMediaTag();
/* All done */
$this->registry->output->global_message = sprintf( $this->lang->words['m_tag_added'], $data['mediatag_name'] );
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&amp;do=overview" );
}
else
{
/* ID */
$id = intval( $this->request['id'] );
/* Update */
$this->DB->update( 'bbcode_mediatag', $data, "mediatag_id={$id}" );
/* Recache */
$this->recacheMediaTag();
/* Done and done */
$this->registry->output->global_message = sprintf( $this->lang->words['m_tag_updated'], $data['mediatag_name'] );
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&amp;do=overview" );
}
}
/**
* Show the mediatag add/edit form
*
* @param string [$type='add']
* @param array [Optional] array of errors
* @return @e void
*/
protected function _mediaTagForm( $type='add', $errors=array() )
{
/* Check form type */
if( $type == 'add' )
{
/* Data */
$data = array(
'mediatag_name' => $this->request['mediatag_name'],
'mediatag_match' => rtrim( str_replace( '&#092;', '\\', str_replace( '&#039', "'", trim( IPSText::stripslashes( $_POST['mediatag_match'] ) ) ) ), ',' ),
'mediatag_replace' => rtrim( str_replace( '&#092;', '\\', str_replace( '&#039', "'", trim( IPSText::stripslashes( $_POST['mediatag_replace'] ) ) ) ), ',' ),
);
}
else
{
/* Data */
$id = intval( $this->request['id'] );
$data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'bbcode_mediatag', 'where' => "mediatag_id={$id}" ) );
/* Set Defaults */
$data['mediatag_name'] = !empty( $this->request['mediatag_name'] ) ? $this->request['mediatag_name'] : $data['mediatag_name'];
$data['mediatag_match'] = !empty( $this->request['mediatag_match'] ) ? IPSText::textToForm( $this->request['mediatag_match'] ) : IPSText::textToForm( $data['mediatag_match'] );
$data['mediatag_replace'] = !empty( $this->request['mediatag_replace'] ) ? IPSText::textToForm( $this->request['mediatag_replace'] ) : IPSText::textToForm( $data['mediatag_replace'] );
}
/* Setup Form */
$this->registry->output->html .= $this->html->mediaTagForm( $type, $data, $errors );
}
/**
* List all the the current media tag types
*
* @return @e void
*/
protected function _mediaTagIndex()
{
/* Query Bookmarks */
$this->DB->build( array(
'select' => '*',
'from' => 'bbcode_mediatag',
'order' => 'mediatag_position ASC',
) );
$this->DB->execute();
$bbcode_rows = "";
/* List the bookmarks */
while( $r = $this->DB->fetch() )
{
$bbcode_rows .= $this->html->mediaTagRow( $r );
}
/* End table and output */
$this->registry->output->html .= $this->html->mediaTagWrapper( $bbcode_rows );
}
/**
* Recache the mediatag config
*
* @return @e void
*/
public function recacheMediaTag()
{
/* Query the tags */
$this->DB->build( array( 'select' => '*', 'from' => 'bbcode_mediatag', 'order' => 'mediatag_position ASC' ) );
$this->DB->execute();
$media_config = array();
while( $r = $this->DB->fetch() )
{
$media_config[$r['mediatag_name']] = array(
'match' => preg_replace( "#{[0-9]}#", "(.*?)", str_replace( '.', '\.', str_replace( '?', '?', $r['mediatag_match'] ) ) ),
'replace' => $r['mediatag_replace'],
);
}
/* Save to cache */
$this->cache->setCache( 'mediatag', $media_config, array( 'array' => 1 ) );
}
}
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>Смайлики</title>
<title>Emoticon Management</title>
<subitems>
<subitem>
<subitemtitle>Управление смайликами</subitemtitle>
<subitemtitle>Emoticon Management</subitemtitle>
<subitemlang>emoticons</subitemlang>
<subsection>emoticons</subsection>
<subitemurl>do=overview</subitemurl>
@@ -15,23 +15,23 @@
</subitems>
</item>
<item>
<title>BB-коды</title>
<title>BBCode Management</title>
<subitems>
<subitem>
<subitemtitle>Управление BB-кодами</subitemtitle>
<subitemtitle>BBCode Management</subitemtitle>
<subitemlang>bbcode</subitemlang>
<subsection>bbcode</subsection>
<subitemurl>do=overview</subitemurl>
<subitemrolekey>bbcode_manage</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</subitem>
</subitems>
</item>
<item>
<title>Manage Media Tag</title>
<subitems>
<subitem>
<subitemtitle>Медиа BB-коды</subitemtitle>
<subitemtitle>Manage Media Tag</subitemtitle>
<subitemlang>mediatag</subitemlang>
<subsection>media</subsection>
<subitemurl>do=overview</subitemurl>
@@ -41,10 +41,10 @@
</subitems>
</item>
<item>
<title>Нецензурные слова</title>
<title>Bad Word Filters</title>
<subitems>
<subitem>
<subitemtitle>Управление нецензурными словами</subitemtitle>
<subitemtitle>Bad Word Filters</subitemtitle>
<subitemlang>badwords</subitemlang>
<subsection>badwords</subsection>
<subitemurl>do=overview</subitemurl>
@@ -1,66 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Управление нецензурными словами</grouptitle>
<grouptitle>Manage Badwords</grouptitle>
<grouplang>core_badwords</grouplang>
<items>
<item>
<key>badword_manage</key>
<string>Может добавлять/изменять?</string>
<string>Can manage badwords?</string>
</item>
<item>
<key>badword_delete</key>
<string>Может удалять?</string>
<string>Can delete badwords?</string>
</item>
</items>
</group>
<group>
<grouptitle>Смайлики</grouptitle>
<grouptitle>Emoticons</grouptitle>
<grouplang>core_emoticons</grouplang>
<items>
<item>
<key>emoticons_manage</key>
<string>Имеет доступ к менеджеру смайликов?</string>
<string>Can access emoticon manager?</string>
</item>
<item>
<key>emoticons_edit</key>
<string>Может изменять смайлики?</string>
<string>Can edit emoticons?</string>
</item>
<item>
<key>emoticons_add</key>
<string>Может добавлять смайлики?</string>
<string>Can add new emoticons?</string>
</item>
<item>
<key>emoticons_delete</key>
<string>Может удалять смайлики?</string>
<string>Can remove emoticons?</string>
</item>
</items>
</group>
<group>
<grouptitle>BB-коды</grouptitle>
<grouptitle>BBCode</grouptitle>
<grouplang>core_bbcode</grouplang>
<items>
<item>
<key>bbcode_manage</key>
<string>Может добавлять/изменять?</string>
<string>Can manage bbcode?</string>
</item>
<item>
<key>bbcode_delete</key>
<string>Может удалять?</string>
<string>Can delete bbcode?</string>
</item>
</items>
</group>
<group>
<grouptitle>Управление Media тегами</grouptitle>
<grouptitle>Manage Media</grouptitle>
<grouplang>core_media</grouplang>
<items>
<item>
<key>media_manage</key>
<string>Может добавлять/изменять?</string>
<string>Can manage media bbcode supported sites?</string>
</item>
<item>
<key>media_delete</key>
<string>Может удалять?</string>
<string>Can remove supported media bbcode sites?</string>
</item>
</items>
</group>
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'report' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,23 +2,10 @@
<menu>
<tabitems>
<item>
<title>Обзор системы</title>
<title>Plugin Manager</title>
<subitems>
<subitem>
<subitemtitle>Обзор</subitemtitle>
<subitemlang>reports_overview</subitemlang>
<subsection>reports</subsection>
<subitemurl>do=show_main</subitemurl>
<subitemrolekey></subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>Плагины системы</title>
<subitems>
<subitem>
<subitemtitle>Плагины системы жалоб</subitemtitle>
<subitemtitle>Plugin Manager</subitemtitle>
<subitemlang>reports_plugin</subitemlang>
<subsection>reports</subsection>
<subitemurl>do=plugin</subitemurl>
@@ -28,10 +15,10 @@
</subitems>
</item>
<item>
<title>Статусы жалоб</title>
<title>Status &amp; Severity Levels</title>
<subitems>
<subitem>
<subitemtitle>Статусы жалоб</subitemtitle>
<subitemtitle>Status &amp; Severity Levels</subitemtitle>
<subitemlang>reports_ssl</subitemlang>
<subsection>reports</subsection>
<subitemurl>do=status</subitemurl>
@@ -1,40 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Плагины системы жалоб</grouptitle>
<grouptitle>Report Center Plugins</grouptitle>
<grouplang>core_reports</grouplang>
<items>
<item>
<key>plugins_manage</key>
<string>Может добавлять/изменять плагины?</string>
<string>Can add/edit supported reported content plugins?</string>
</item>
<item>
<key>plugins_remove</key>
<string>Может удалять плагины?</string>
<string>Can remove reported content plugins?</string>
</item>
</items>
</group>
<group>
<grouptitle>Управление статусами жалоб</grouptitle>
<grouptitle>Report Center Status and Severity Management</grouptitle>
<grouplang>core_statsev</grouplang>
<items>
<item>
<key>sands_manage</key>
<string>Может добавлять/изменять статусы жалоб?</string>
<string>Can add/edit report center status and severity levels?</string>
</item>
<item>
<key>sands_remove</key>
<string>Может удалять статусы?</string>
</item>
</items>
</group>
<group>
<grouptitle>Статистика системы жалоб</grouptitle>
<grouplang>core_rcstats</grouplang>
<items>
<item>
<key>stats_access</key>
<string>Может просматривать статистику?</string>
<string>Can remove status and severity levels?</string>
</item>
</items>
</group>
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'settings' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com/">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com/">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'sql' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -2,18 +2,18 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* IP.Board v3.3.4
* SQL Admin
* Last Updated: $Date: 2011-03-11 06:59:39 -0500 (Fri, 11 Mar 2011) $
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: ips_terabyte $
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @version $Rev: 8031 $
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionpower.com">IP.Board</a>
</body>
</html>
Loaded 100 of 2206 files, more files were not shown because too many files have changed in this diff. Show more