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

Binary file not shown.
+2 -2
View File
@@ -3,11 +3,11 @@
* @file api_core.php Core functions for the API classes * @file api_core.php Core functions for the API classes
*~TERABYTE_DOC_READY~ *~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED! * $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $ * $Author: ips_terabyte $
* @since - * @since -
* $LastChangedDate: 2011-03-18 17:34:15 -0400 (Fri, 18 Mar 2011) $ * $LastChangedDate: 2011-03-18 17:34:15 -0400 (Fri, 18 Mar 2011) $
* @version v3.2.3 * @version v3.3.4
* $Revision: 8129 $ * $Revision: 8129 $
*/ */
+6 -6
View File
@@ -3,12 +3,12 @@
* @file api_topic_view.php Forums topic view API * @file api_topic_view.php Forums topic view API
*~TERABYTE_DOC_READY~ *~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED! * $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $ * $Author: mark $
* @since 2.2.0 * @since 2.2.0
* $LastChangedDate: 2011-03-18 17:34:15 -0400 (Fri, 18 Mar 2011) $ * $LastChangedDate: 2011-12-20 11:14:05 -0500 (Tue, 20 Dec 2011) $
* @version v3.2.3 * @version v3.3.4
* $Revision: 8129 $ * $Revision: 10035 $
*/ */
if ( ! class_exists( 'apiCore' ) ) if ( ! class_exists( 'apiCore' ) )
@@ -87,7 +87,7 @@ class apiTopicView extends apiCore
$this->topic_list_config['order_field'] = ( $this->topic_list_config['order_field'] == 'started' ) ? 'start_date' : $this->topic_list_config['order_field']; $this->topic_list_config['order_field'] = ( $this->topic_list_config['order_field'] == 'started' ) ? 'start_date' : $this->topic_list_config['order_field'];
$this->topic_list_config['order_field'] = ( $this->topic_list_config['order_field'] == 'lastpost' ) ? 'last_post' : $this->topic_list_config['order_field']; $this->topic_list_config['order_field'] = ( $this->topic_list_config['order_field'] == 'lastpost' ) ? 'last_post' : $this->topic_list_config['order_field'];
$this->topic_list_config['forums'] = ( is_array( $this->topic_list_config['forums'] ) ) ? implode( ",", $this->topic_list_config['forums'] ) : $this->topic_list_config['forums']; $this->topic_list_config['forums'] = ( is_array( $this->topic_list_config['forums'] ) ) ? implode( ",", $this->topic_list_config['forums'] ) : $this->topic_list_config['forums'];
//----------------------------------------- //-----------------------------------------
// Fix up allowed forums // Fix up allowed forums
//----------------------------------------- //-----------------------------------------
+9 -9
View File
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
+9 -9
View File
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -3,11 +3,11 @@
* @file group_form.php Core group editing form * @file group_form.php Core group editing form
*~TERABYTE_DOC_READY~ *~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED! * $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $ * $Author: bfarber $
* @since - * @since -
* $LastChangedDate: 2011-07-20 20:19:22 -0400 (Wed, 20 Jul 2011) $ * $LastChangedDate: 2011-07-20 20:19:22 -0400 (Wed, 20 Jul 2011) $
* @version v3.2.3 * @version v3.3.4
* $Revision: 9296 $ * $Revision: 9296 $
*/ */
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -1,95 +1,95 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Member property updater (AJAX) * Member property updater (AJAX)
* Last Updated: $Date: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $ * Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since 1st march 2002 * @since 1st march 2002
* @version $Revision: 7442 $ * @version $Revision: 10914 $
* *
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class admin_member_form__core implements admin_member_form class admin_member_form__core implements admin_member_form
{ {
/** /**
* Tab name * Tab name
* This can be left blank and the application title will * This can be left blank and the application title will
* be used * be used
* *
* @var string * @var string
*/ */
public $tab_name = ""; public $tab_name = "";
/** /**
* Returns sidebar links for this tab * Returns sidebar links for this tab
* You may return an empty array or FALSE to not have * You may return an empty array or FALSE to not have
* any links show in the sidebar for this block. * any links show in the sidebar for this block.
* *
* The links must have 'section=xxxxx&module=xxxxx[&do=xxxxxx]'. The rest of the URL * The links must have 'section=xxxxx&module=xxxxx[&do=xxxxxx]'. The rest of the URL
* is added automatically. * is added automatically.
* *
* The image must be a full URL or blank to use a default image. * The image must be a full URL or blank to use a default image.
* *
* Use the format: * Use the format:
* $array[] = array( 'img' => '', 'url' => '', 'title' => '' ); * $array[] = array( 'img' => '', 'url' => '', 'title' => '' );
* *
* @author Matt Mecham * @author Matt Mecham
* @param array Member data * @param array Member data
* @return array Array of links * @return array Array of links
*/ */
public function getSidebarLinks( $member=array() ) public function getSidebarLinks( $member=array() )
{ {
$array = array(); $array = array();
if( $member['failed_login_count'] ) if( $member['failed_login_count'] )
{ {
$array[] = array( 'img' => '', $array[] = array( 'img' => '',
'url' => "app=members&amp;module=members&amp;section=tools&amp;do=do_locked&amp;auth_key=".ipsRegistry::member()->form_hash."&amp;mid_{$member['member_id']}=1&amp;type=unlock", 'url' => "app=members&amp;module=members&amp;section=tools&amp;do=do_locked&amp;auth_key=".ipsRegistry::member()->form_hash."&amp;mid_{$member['member_id']}=1&amp;type=unlock",
'title' => ipsRegistry::getClass('class_localization')->words['reset_failed_logins'] ); 'title' => ipsRegistry::getClass('class_localization')->words['reset_failed_logins'] );
} }
return $array; return $array;
} }
/** /**
* Returns content for the page. * Returns content for the page.
* *
* @author Matt Mecham * @author Matt Mecham
* @param array Member data * @param array Member data
* @return array Array of tabs, content * @return array Array of tabs, content
*/ */
public function getDisplayContent( $member=array(), $tabsUsed=5 ) public function getDisplayContent( $member=array(), $tabsUsed=5 )
{ {
return array( 'tabs' => '', 'content' => '', 'tabsUsed' => 0 ); return array( 'tabs' => '', 'content' => '', 'tabsUsed' => 0 );
} }
/** /**
* Process the entries for saving and return * Process the entries for saving and return
* *
* @author Brandon Farber * @author Brandon Farber
* @return array Multi-dimensional array (core, extendedProfile) for saving * @return array Multi-dimensional array (core, extendedProfile) for saving
*/ */
public function getForSave() public function getForSave()
{ {
return array( 'core' => array(), 'extendedProfile' => array() ); return array( 'core' => array(), 'extendedProfile' => array() );
} }
} }
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -1,340 +1,319 @@
<?php <?php
/** /**
* Report center comments class * Report center comments class
* *
* @author $author$ * @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Downloads * @package IP.Downloads
* @link http://hatynka.in * @link http://www.invisionpower.com
* @version $Rev: 9229 $ * @version $Rev: 10914 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class comments_core_reports extends classes_comments_renderer class comments_core_reports extends classes_comments_renderer
{ {
/** /**
* Internal remap array * Internal remap array
* *
* @param array * @param array
*/ */
protected $_remap = array( 'comment_id' => 'id', protected $_remap = array( 'comment_id' => 'id',
'comment_author_id' => 'comment_by', 'comment_author_id' => 'comment_by',
'comment_author_name' => 'author_name', 'comment_author_name' => 'author_name',
'comment_text' => 'comment', 'comment_text' => 'comment',
'comment_ip_address' => 'ip_address', 'comment_ip_address' => 'ip_address',
'comment_edit_date' => 'edit_date', 'comment_edit_date' => 'edit_date',
'comment_date' => 'comment_date', 'comment_date' => 'comment_date',
'comment_approved' => 'approved', 'comment_approved' => 'approved',
'comment_parent_id' => 'rid' ); 'comment_parent_id' => 'rid' );
/** /**
* Internal parent remap array * Internal parent remap array
* *
* @param array * @param array
*/ */
protected $_parentRemap = array( 'parent_id' => 'id', protected $_parentRemap = array( 'parent_id' => 'id',
'parent_owner_id' => 'updated_by', 'parent_owner_id' => 'updated_by',
'parent_parent_id' => 'uid', 'parent_parent_id' => 'uid',
'parent_title' => 'title', 'parent_title' => 'title',
'parent_seo_title' => 'seoname', 'parent_seo_title' => 'seoname',
'parent_date' => 'date_created' ); 'parent_date' => 'date_created' );
/** /**
* Parent SEO template * Who am I?
* *
* @return string * @return string
*/ */
public function seoTemplate() public function whoAmI()
{ {
return ''; return 'core-reports';
} }
/** /**
* Who am I? * Comment table
* *
* @return string * @return string
*/ */
public function whoAmI() public function table()
{ {
return 'core-reports'; return 'rc_comments';
} }
/** /**
* Comment table * Enable reputation?
* *
* @return string * @return string
*/ */
public function table() public function reputationEnabled()
{ {
return 'rc_comments'; return false;
} }
/** /**
* Enable reputation? * Fetch parent
* *
* @return string * @return array
*/ */
public function reputationEnabled() public function fetchParent( $id )
{ {
return false; static $cachedReports = array();
}
if( !isset($cachedReports[ $id ]) )
/** {
* Fetch parent $cachedReports[ $id ] = $this->DB->buildAndFetch( array(
* 'select' => 'i.*',
* @return array 'from' => array( 'rc_reports_index' => 'i' ),
*/ 'where' => "i.id=" . intval($id),
public function fetchParent( $id ) 'add_join' => array(
{ array(
static $cachedReports = array(); 'select' => 'c.*',
'from' => array( 'rc_classes' => 'c' ),
if( !isset($cachedReports[ $id ]) ) 'where' => 'c.com_id=i.rc_class',
{ 'type' => 'left',
$cachedReports[ $id ] = $this->DB->buildAndFetch( array( )
'select' => 'i.*', )
'from' => array( 'rc_reports_index' => 'i' ), ) );
'where' => "i.id=" . intval($id), }
'add_join' => array(
array( return $cachedReports[ $id ];
'select' => 'c.*', }
'from' => array( 'rc_classes' => 'c' ),
'where' => 'c.com_id=i.rc_class', /**
'type' => 'left', * Fetch settings
) *
) * @return array
) ); */
} public function settings()
{
return $cachedReports[ $id ]; return array( 'urls-showParent' => "app=core&amp;module=reports&amp;do=show_report&amp;rid=%s",
} 'urls-report' => '' );
}
/**
* Fetch settings /**
* * Number of items per page
* @return array *
*/ * @return int
public function settings() */
{ public function perPage()
return array( 'urls-showParent' => "app=core&amp;module=reports&amp;do=show_report&amp;rid=%s", {
'urls-report' => '' ); return 100;
} }
/** /**
* Number of items per page * Pre save
* * Accepts an array of GENERIC data and allows manipulation before it's added to DB
* @return int *
*/ * @param string $type Type of save (edit/add)
public function perPage() * @param array $array Array of GENERIC data (comment_xxxx)
{ * @param integer $commentId Comment ID (only for edits)
return 100; * @param integer $parentId Parent content ID
} * @return @e array Array of GENERIC data
*/
/** public function preSave( $type, array $array, $commentId=0, $parentId=0 )
* Pre save {
* Accepts an array of GENERIC data and allows manipulation before it's added to DB /**
* * Always approve comments in report center
* @param string Type of save (edit/add) *
* @param array Array of GENERIC data (comment_xxxx) * @link http://community.invisionpower.com/tracker/issue-36632-report-comments-cant-be-approved/
* @param int Comment id (if available) */
* @param int Parent id $array['comment_approved'] = 1;
* @return array Array of GENERIC data
*/ return $array;
public function preSave( $type, array $array, $commentId=0, $parentId=0 ) }
{
return $array; /**
} * Post save
* Accepts an array of GENERIC data and allows manipulation after it's added to DB
/** *
* Post save * @param string Type of action (edit/add)
* Accepts an array of GENERIC data and allows manipulation after it's added to DB * @param array Array of GENERIC data (comment_xxxx)
* * @param int Comment id (if available)
* @param string Type of action (edit/add) * @param int Parent id
* @param array Array of GENERIC data (comment_xxxx) * @return array Array of GENERIC data
* @param int Comment id (if available) */
* @param int Parent id public function postSave( $type, array $array, $commentId=0, $parentId=0 )
* @return array Array of GENERIC data {
*/ $_cnt = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'rc_comments', 'where' => 'rid=' . $parentId ) );
public function postSave( $type, array $array, $commentId=0, $parentId=0 ) $this->DB->update( 'rc_reports_index', array( 'num_comments' => intval($_cnt['total']), 'date_updated' => IPS_UNIX_TIME_NOW, 'updated_by' => $array['comment_author_id'] ), "id=" . $parentId );
{
$_cnt = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'rc_comments', 'where' => 'rid=' . $parentId ) ); //-----------------------------------------
$this->DB->update( 'rc_reports_index', array( 'num_comments' => $_cnt['total'], 'date_updated' => time(), 'updated_by' => $array['comment_author_id'] ), "id=" . $parentId ); // Notify other moderators
//-----------------------------------------
//$this->DB->setDataType( 'num_comments', 'int' );
//$this->DB->update( 'rc_reports_index', array( 'num_comments' => 'plus:1', 'date_updated' => time(), 'updated_by' => $array['comment_author_id'] ), "id=" . $parentId ); $report = $this->fetchParent( $parentId );
//----------------------------------------- $this->registry->class_localization->loadLanguageFile( array( 'public_reports' ) );
// Notify other moderators
//----------------------------------------- $this->DB->loadCacheFile( IPSLib::getAppDir('core') . '/sql/' . ips_DBRegistry::getDriverType() . '_report_queries.php', 'report_sql_queries' );
$report = $this->fetchParent( $parentId ); $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') .'/sources/classes/reportLibrary.php', 'reportLibrary' );
$this->registry->setClass( 'reportLibrary', new $classToLoad( $this->registry ) );
$this->registry->class_localization->loadLanguageFile( array( 'public_reports' ) );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') . '/sources/classes/reportNotifications.php', 'reportNotifications' );
$this->DB->loadCacheFile( IPSLib::getAppDir('core') . '/sql/' . ips_DBRegistry::getDriverType() . '_report_queries.php', 'report_sql_queries' ); $notify = new $classToLoad( $this->registry );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') .'/sources/classes/reportLibrary.php', 'reportLibrary' ); $this->registry->getClass('reportLibrary')->loadPlugin( $report['my_class'], $report['app'] );
$this->registry->setClass( 'reportLibrary', new $classToLoad( $this->registry ) );
if( is_object($this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]) )
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') . '/sources/classes/reportNotifications.php', 'reportNotifications' ); {
$notify = new $classToLoad( $this->registry ); if( $report['extra_data'] && $report['extra_data'] != 'N;' )
{
$this->registry->getClass('reportLibrary')->loadPlugin( $report['my_class'], $report['app'] ); $this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->_extra = unserialize( $report['extra_data'] );
}
if( is_object($this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]) ) else
{ {
if( $report['extra_data'] && $report['extra_data'] != 'N;' ) $this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->_extra = array();
{ }
$this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->_extra = unserialize( $report['extra_data'] );
} $report_data = $this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->formatReportData( $report );
else
{ $notify->initNotify( $this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->getNotificationList( IPSText::cleanPermString( $report['mod_group_perm'] ), $report_data ), $report_data );
$this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->_extra = array(); $notify->sendReplyNotifications( $array['comment_text'] );
} }
$report_data = $this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->formatReportData( $report ); return $array;
}
$notify->initNotify( $this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->getNotificationList( IPSText::cleanPermString( $report['mod_group_perm'] ), $report_data ), $report_data );
$notify->sendReplyNotifications( $array['comment_text'] ); /**
} * Post delete. Can do stuff and that
*
return $array; * @param array Array of comment IDs to be deleted
} * @param int Parent ID
* @return void
/** */
* Post delete. Can do stuff and that public function postDelete( $commentIds, $parentId )
* {
* @param array Array of comment IDs to be deleted /* Determine most recent comment or report... */
* @param int Parent ID $_comment = $this->DB->buildAndFetch( array( 'select' => 'comment_by, comment_date', 'from' => 'rc_comments', 'where' => 'approved=1 AND rid=' . $parentId, 'order' => 'comment_date DESC', 'limit' => array( 1 ) ) );
* @return void $_report = $this->DB->buildAndFetch( array( 'select' => 'report_by, date_reported', 'from' => 'rc_reports', 'where' => 'rid=' . $parentId, 'order' => 'date_reported DESC', 'limit' => array( 1 ) ) );
*/
public function postDelete( $commentIds, $parentId ) $_date_updated = 0;
{ $_updated_by = 0;
/* Determine most recent comment or report... */
$_comment = $this->DB->buildAndFetch( array( 'select' => 'comment_by, comment_date', 'from' => 'rc_comments', 'where' => 'approved=1 AND rid=' . $parentId, 'order' => 'comment_date DESC', 'limit' => array( 1 ) ) ); if( $_comment['comment_date'] )
$_report = $this->DB->buildAndFetch( array( 'select' => 'report_by, date_reported', 'from' => 'rc_reports', 'where' => 'rid=' . $parentId, 'order' => 'date_reported DESC', 'limit' => array( 1 ) ) ); {
$_date_updated = $_comment['comment_date'];
$_date_updated = 0; $_updated_by = $_comment['comment_by'];
$_updated_by = 0; }
if( $_comment['comment_date'] ) if( $_report['date_reported'] > $_date_updated )
{ {
$_date_updated = $_comment['comment_date']; $_date_updated = $_report['date_reported'];
$_updated_by = $_comment['comment_by']; $_updated_by = $_report['report_by'];
} }
if( $_report['date_reported'] > $_date_updated ) $_cnt = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'rc_comments', 'where' => 'rid=' . $parentId ) );
{ $this->DB->update( 'rc_reports_index', array( 'num_comments' => intval($_cnt['total']), 'date_updated' => $_date_updated, 'updated_by' => $_updated_by ), "id=" . $parentId );
$_date_updated = $_report['date_reported']; }
$_updated_by = $_report['report_by'];
} /**
* Fetch a total count of comments we can see
$_cnt = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'rc_comments', 'where' => 'rid=' . $parentId ) ); *
$this->DB->update( 'rc_reports_index', array( 'num_comments' => $_cnt['total'], 'date_updated' => $_date_updated, 'updated_by' => $_updated_by ), "id=" . $parentId ); * @param mixed parent Id or parent array
* @return int
//$this->DB->setDataType( 'num_comments', 'int' ); */
//$this->DB->update( 'rc_reports_index', array( 'num_comments' => 'minus:' . count($commentIds) ), "id=" . $parentId ); public function count( $parent )
} {
/* Get parent */
/** if ( is_numeric( $parent ) )
* Toggles visibility {
* $parent = $this->fetchParent( $parent );
* @param string on/off }
* @param array Array of comment IDs to be deleted
* @param int Parent ID return intval($parent['num_comments']);
* @return void }
*/
public function postVisibility( $toggle, $commentIds, $parentId ) /**
{ * Perform a permission check
} *
* @param string Type of check (add/edit/delete/editall/deleteall/approve all)
/** * @param array Array of GENERIC data
* Fetch a total count of comments we can see * @return true or string to be used in exception
* */
* @param mixed parent Id or parent array public function can( $type, array $array )
* @return int {
*/ /* Init */
public function count( $parent ) $comment = array();
{
/* Get parent */ /* Got data? */
if ( is_numeric( $parent ) ) if ( empty( $array['comment_parent_id'] ) )
{ {
$parent = $this->fetchParent( $parent ); trigger_error( "No parent ID passed to " . __FILE__, E_USER_WARNING );
} }
return intval($parent['num_comments']); /* Get the file */
} $event = $this->fetchParent( $array['comment_parent_id'] );
/** /* Fetch comment */
* Perform a permission check if ( $array['comment_id'] )
* {
* @param string Type of check (add/edit/delete/editall/deleteall/approve all) $comment = $this->fetchById( $array['comment_id'] );
* @param array Array of GENERIC data }
* @return true or string to be used in exception
*/ /* Check permissions */
public function can( $type, array $array ) switch( $type )
{ {
/* Init */ case 'view':
$comment = array(); return true;
break;
/* Got data? */
if ( empty( $array['comment_parent_id'] ) ) case 'edit':
{ if( $this->memberData['g_is_supmod'] OR $this->memberData['member_id'] != $comment['comment_mid'] )
trigger_error( "No parent ID passed to " . __FILE__, E_USER_WARNING ); {
} return true;
}
/* Get the file */
$event = $this->fetchParent( $array['comment_parent_id'] ); return 'NO_PERMISSION';
break;
/* Fetch comment */
if ( $array['comment_id'] ) case 'add':
{ return true;
$comment = $this->fetchById( $array['comment_id'] ); break;
}
case 'delete':
/* Check permissions */ return $this->memberData['g_is_supmod'] ? true : 'NO_PERMISSION';
switch( $type ) break;
{
case 'view': case 'visibility':
return true; case 'moderate':
break; return 'NO_PERMISSION';
break;
case 'edit': }
if( $this->memberData['g_is_supmod'] OR $this->memberData['member_id'] != $comment['comment_mid'] ) }
{
return true; /**
} * Returns remap keys (generic => local)
*
return 'NO_PERMISSION'; * @return array
break; */
public function remapKeys( $type='comment' )
case 'add': {
return true; return ( $type == 'comment' ) ? $this->_remap : $this->_parentRemap;
break; }
case 'delete':
return $this->memberData['g_is_supmod'] ? true : 'NO_PERMISSION';
break;
case 'visibility':
case 'moderate':
return 'NO_PERMISSION';
break;
}
}
/**
* Returns remap keys (generic => local)
*
* @return array
*/
public function remapKeys( $type='comment' )
{
return ( $type == 'comment' ) ? $this->_remap : $this->_parentRemap;
}
} }
@@ -1,207 +1,207 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Core Sessions * Core Sessions
* Last Updated: $Date: 2011-09-15 17:04:35 -0400 (Thu, 15 Sep 2011) $ * Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: bfarber $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since 20th February 2002 * @since 20th February 2002
* @version $Rev: 9495 $ * @version $Rev: 10914 $
* *
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Item Marking * Item Marking
* Last Updated: $Date: 2011-09-15 17:04:35 -0400 (Thu, 15 Sep 2011) $ * Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: bfarber $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Downloads * @package IP.Downloads
* @link http://hatynka.in * @link http://www.invisionpower.com
* @version $Rev: 9495 $ * @version $Rev: 10914 $
* *
*/ */
class itemMarking__core class itemMarking__core
{ {
/**#@+ /**#@+
* Registry Object Shortcuts * Registry Object Shortcuts
* *
* @var object * @var object
*/ */
protected $registry; protected $registry;
protected $DB; protected $DB;
protected $settings; protected $settings;
protected $request; protected $request;
protected $lang; protected $lang;
protected $member; protected $member;
protected $memberData; protected $memberData;
protected $cache; protected $cache;
protected $caches; protected $caches;
/**#@-*/ /**#@-*/
/** /**
* I'm a constructor, twisted constructor * I'm a constructor, twisted constructor
* *
* @param object ipsRegistry reference * @param object ipsRegistry reference
* @return @e void * @return @e void
*/ */
public function __construct( ipsRegistry $registry ) public function __construct( ipsRegistry $registry )
{ {
/* Make objects */ /* Make objects */
$this->registry = $registry; $this->registry = $registry;
$this->DB = $this->registry->DB(); $this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings(); $this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest(); $this->request =& $this->registry->fetchRequest();
$this->lang = $this->registry->getClass('class_localization'); $this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member(); $this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData(); $this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache(); $this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches(); $this->caches =& $this->registry->cache()->fetchCaches();
} }
/** /**
* Convert Data * Convert Data
* Takes an array of app specific data and remaps it to the DB table fields * Takes an array of app specific data and remaps it to the DB table fields
* *
* @param array * @param array
* @return array * @return array
*/ */
public function convertData( $data ) public function convertData( $data )
{ {
return $data; return $data;
} }
/** /**
* Fetch unread count * Fetch unread count
* *
* Grab the number of items truly unread * Grab the number of items truly unread
* This is called upon by 'markRead' when the number of items * This is called upon by 'markRead' when the number of items
* left hits zero (or less). * left hits zero (or less).
* *
* *
* @param array Array of data * @param array Array of data
* @param array Array of read itemIDs * @param array Array of read itemIDs
* @param int Last global reset * @param int Last global reset
* @return integer Last unread count * @return integer Last unread count
*/ */
public function fetchUnreadCount( $data, $readItems, $lastReset ) public function fetchUnreadCount( $data, $readItems, $lastReset )
{ {
$readItems = is_array( $readItems ) ? $readItems : array( 0 ); $readItems = is_array( $readItems ) ? $readItems : array( 0 );
$_count = $this->DB->buildAndFetch( array( $_count = $this->DB->buildAndFetch( array(
'select' => 'COUNT(*) as cnt, MIN(date_updated) AS lastItem', 'select' => 'COUNT(*) as cnt, MIN(date_updated) AS lastItem',
'from' => 'rc_reports_index', 'from' => 'rc_reports_index',
'where' => "id NOT IN(" . implode( ",", array_keys( $readItems ) ) . ") AND date_updated > " . intval($lastReset) 'where' => "id NOT IN(" . implode( ",", array_keys( $readItems ) ) . ") AND date_updated > " . intval($lastReset)
) ); ) );
return array( 'count' => intval( $_count['cnt'] ), return array( 'count' => intval( $_count['cnt'] ),
'lastItem' => intval( $_count['lastItem'] ) ); 'lastItem' => intval( $_count['lastItem'] ) );
} }
} }
/** /**
* Main loader class * Main loader class
*/ */
class publicSessions__core class publicSessions__core
{ {
/** /**
* Return session variables for this application * Return session variables for this application
* *
* current_appcomponent, current_module and current_section are automatically * current_appcomponent, current_module and current_section are automatically
* stored. This function allows you to add specific variables in. * stored. This function allows you to add specific variables in.
* *
* @author Matt Mecham * @author Matt Mecham
* @return array * @return array
*/ */
public function getSessionVariables() public function getSessionVariables()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$array = array( 'location_1_type' => '', $array = array( 'location_1_type' => '',
'location_1_id' => 0, 'location_1_id' => 0,
'location_2_type' => '', 'location_2_type' => '',
'location_2_id' => 0 ); 'location_2_id' => 0 );
/* @link http://community.invisionpower.com/tracker/issue-33345-start-new-topic-reply-to-this-topic-online-list-location */ /* @link http://community.invisionpower.com/tracker/issue-33345-start-new-topic-reply-to-this-topic-online-list-location */
if( ipsRegistry::$request['module'] == 'attach' ) if( ipsRegistry::$request['module'] == 'attach' )
{ {
define( 'NO_SESSION_UPDATE', true ); define( 'NO_SESSION_UPDATE', true );
} }
return $array; return $array;
} }
/** /**
* Parse/format the online list data for the records * Parse/format the online list data for the records
* *
* @author Brandon Farber * @author Brandon Farber
* @param array Online list rows to check against * @param array Online list rows to check against
* @return array Online list rows parsed * @return array Online list rows parsed
*/ */
public function parseOnlineEntries( $rows ) public function parseOnlineEntries( $rows )
{ {
if( !is_array($rows) OR !count($rows) ) if( !is_array($rows) OR !count($rows) )
{ {
return $rows; return $rows;
} }
$final = array(); $final = array();
foreach( $rows as $row ) foreach( $rows as $row )
{ {
if( $row['current_appcomponent'] == 'core' ) if( $row['current_appcomponent'] == 'core' )
{ {
if( $row['current_module'] == 'global' ) if( $row['current_module'] == 'global' )
{ {
if( $row['current_section'] == 'login' ) if( $row['current_section'] == 'login' )
{ {
$row['where_line'] = ipsRegistry::getClass( 'class_localization' )->words['WHERE_login']; $row['where_line'] = ipsRegistry::getClass( 'class_localization' )->words['WHERE_login'];
} }
} }
else if( $row['current_module'] == 'search' ) else if( $row['current_module'] == 'search' )
{ {
$row['where_line'] = ipsRegistry::getClass( 'class_localization' )->words['WHERE_search']; $row['where_line'] = ipsRegistry::getClass( 'class_localization' )->words['WHERE_search'];
} }
else if( $row['current_module'] == 'reports' ) else if( $row['current_module'] == 'reports' )
{ {
$rcCache = ipsRegistry::cache()->getCache('report_cache'); $rcCache = ipsRegistry::cache()->getCache('report_cache');
if( is_array( $rcCache ) ) if( is_array( $rcCache ) )
{ {
if( $rcCache['group_access'][ ipsRegistry::member()->getProperty('member_group_id') ] == true ) if( $rcCache['group_access'][ ipsRegistry::member()->getProperty('member_group_id') ] == true )
{ {
$row['where_line'] = ipsRegistry::getClass( 'class_localization' )->words['WHERE_reports']; $row['where_line'] = ipsRegistry::getClass( 'class_localization' )->words['WHERE_reports'];
} }
} }
} }
} }
$final[ $row['id'] ] = $row; $final[ $row['id'] ] = $row;
} }
return $final; return $final;
} }
} }
@@ -2,19 +2,19 @@
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Core registered caches, redirect resets and bitwise settings * Core registered caches, redirect resets and bitwise settings
* Last Updated: $Date: 2011-03-15 18:03:09 -0400 (Tue, 15 Mar 2011) $ * Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: bfarber $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since 20th February 2002 * @since 20th February 2002
* @version $Rev: 8085 $ * @version $Rev: 10914 $
* *
*/ */
@@ -1,323 +1,231 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Dashboard Notifications * Dashboard Notifications
* Last Updated: $Date * Last Updated: 11.07.2012
* *
* @author $Author: ips_terabyte $ * @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @version $Rev: 9551 $ * @version $Rev: 11026 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
/** /**
* Main loader class * Main loader class
*/ * DO NOT MODIFY!
class dashboardNotifications__core */
{ class dashboardNotifications__core
/** {
* Registry Object Shortcuts /**
* * Registry Object Shortcuts
* @var object *
*/ * @var object
public $settings; */
public $lang; public $settings;
public $cache; public $lang;
public $caches; public $cache;
public $DB; public $caches;
public $DB;
public function __construct()
{ public function __construct()
$this->settings = ipsRegistry::fetchSettings(); {
$this->lang = ipsRegistry::getClass('class_localization'); $this->settings = ipsRegistry::fetchSettings();
$this->caches =& ipsRegistry::cache()->fetchCaches(); $this->lang = ipsRegistry::getClass('class_localization');
$this->cache = ipsRegistry::cache(); $this->caches =& ipsRegistry::cache()->fetchCaches();
$this->DB = ipsRegistry::DB(); $this->cache = ipsRegistry::cache();
} $this->DB = ipsRegistry::DB();
}
public function get()
{ public function get()
/* INIT */ {
$entries = array(); /* INIT! */
$entries = array();
if( ! $this->settings['ipb_reg_number'] )
{ if( ! $this->settings['ipb_reg_number'] )
$entries[] = array( $this->lang->words['lc_title_nokey'], sprintf( $this->lang->words['lc_msg_nokey'], "{$this->settings['base_url']}module=tools&amp;section=licensekey" ) ); {
} $entries[] = array( $this->lang->words['lc_title_nokey'], sprintf( $this->lang->words['lc_msg_nokey'], "{$this->settings['base_url']}module=tools&amp;section=licensekey" ) );
else }
{
/* We need a classFileManagement object */ /* FURL cache OOD? */
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); if ( is_file( IPS_CACHE_PATH . 'cache/furlCache.php' ) )
$classFileManagement = new $classToLoad(); {
$mtime = intval( @filemtime( IPS_CACHE_PATH . 'cache/furlCache.php' ) );
/* Try to automatically update if expired */
$licenseData = $this->cache->getCache( 'licenseData' ); /* Check mtimes on extensions.. */
foreach( ipsRegistry::$applications as $app_dir => $application )
if( ! $licenseData || ( $licenseData['key']['_expires'] != 9999999999 AND $licenseData['key']['_expires'] < IPS_UNIX_TIME_NOW ) ) {
{ if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) )
/* Query the api */ {
$response = $classFileManagement->getFileContents( "http://myipb.in/license.php?lk={$this->settings['ipb_reg_number']}&url={$this->settings['board_url']}&flush=1" ); $_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) );
/* Get License Data */ if ( $_mtime > $mtime )
$licenseData = json_decode( $response, true ); {
$entries[] = array( $this->lang->words['furlcache_outofdate'], sprintf( $this->lang->words['furlcache_outofdate_desc'], $application['app_title'] ) . "<a href='" . $this->settings['base_url'] . "app=core&amp;module=applications&amp;section=applications&amp;do=seoRebuild'>{$this->lang->words['rebuild_furl_cache']}</a>" );
/* Copyright Removal? */ break;
if ( $licenseData['cr'] ) }
{ }
IPSLib::updateSettings( array( 'ipb_copy_number' => $licenseData['cr'], 'ips_cp_purchase' => 1 ) ); }
} }
elseif ( $this->settings['ips_cp_purchase'] )
{ /* Sphinx cache OOD? */
IPSLib::updateSettings( array( 'ips_cp_purchase' => 0 ) ); if ( $this->settings['search_method'] == 'sphinx' )
} {
$mtime = intval( $this->cache->getCache('sphinx_config') );
/* Save to cache */
$licenseData['_cached_date'] = time(); /* Check mtimes on extensions.. */
$licenseData['key']['_expires'] = $licenseData['key']['_expires'] ? $licenseData['key']['_expires'] : 9999999999; foreach( ipsRegistry::$applications as $app_dir => $application )
$licenseData['key']['expires'] = $licenseData['key']['expires'] ? $licenseData['key']['expires'] : 9999999999; {
if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) )
$this->cache->setCache( 'licenseData', $licenseData, array( 'array' => 1 ) ); {
$_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) );
}
if ( !$mtime OR $_mtime > $mtime )
/* Query the api */ {
$response = $classFileManagement->getFileContents("http://myipb.in/license.php?api=checkService&service=ipb&lk={$this->settings['ipb_reg_number']}&domain={$this->settings['board_url']}" ); $entries[] = array( $this->lang->words['sphinxconfig_outofdate'], $this->lang->words['sphinxconfig_outofdate_desc'] . ' ' . "<a href='" . $this->settings['base_url'] . "app=core&amp;module=applications&amp;section=applications&amp;do=applications_overview'>{$this->lang->words['rebuild_sphinx_config']}</a>" );
break;
/* Get License Data */ }
$response = json_decode( $response, true ); }
}
/* Is the Spam Service Working? */ }
if ( $this->settings['spam_service_enabled'] )
{ /* Minify on but /cache/tmp not writeable? */
//$lastLog = $this->DB->buildAndFetch( array( 'select' => 'log_code', 'from' => 'spam_service_log', 'order' => 'id DESC', 'limit' => 1 ) ); // Order on ID since log_date has no index if ( !empty( $this->settings['_use_minify'] ) )
{
//if ( $lastLog['log_code'] === '0' ) $entries[] = array( $this->lang->words['minifywrite_head'], $this->lang->words['minifynot_writeable'] );
}
/* Get last 5 logs, and if all 5 are errors, show message */
$_errors = 0; /* Installer Check */
$_entries = 0; if( @is_file( IPS_ROOT_PATH . 'install/index.php' ) )
$_lastError = ''; {
if ( ! @is_file( DOC_IPS_ROOT_PATH . 'cache/installer_lock.php' ) )
$this->DB->build( array( 'select' => 'log_code, log_msg', 'from' => 'spam_service_log', 'order' => 'id DESC', 'limit' => 5 ) ); {
$this->DB->execute(); $this->lang->words['cp_unlocked_warning'] = sprintf( $this->lang->words['cp_unlocked_warning'], CP_DIRECTORY );
$entries[] = array( $this->lang->words['cp_unlockedinstaller'], $this->lang->words['cp_unlocked_warning'] );
while( $_r = $this->DB->fetch() ) }
{ }
$_entries++;
/* Unfinished Upgrade */
if( $_r['log_code'] === '0' ) require_once( IPS_ROOT_PATH . '/setup/sources/base/setup.php' );/*noLibHook*/
{ $versions = IPSSetUp::fetchAppVersionNumbers( 'core' );
$_errors++;
if( $versions['current'][0] != $versions['latest'][0] )
if( !$_lastError ) {
{ $this->lang->words['cp_upgrade_warning'] = sprintf( $this->lang->words['cp_upgrade_warning'], $versions['current'][1], $versions['latest'][1], $this->settings['base_acp_url'] );
$_lastError = $_r['log_msg'];
} $entries[] = array( $this->lang->words['cp_unfinishedupgrade'], $this->lang->words['cp_upgrade_warning'] );
} }
}
/**
if( $_entries > 0 && $_errors == $_entries ) * PHP Version Check
{ *
$entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_error_msg'], $_lastError ) ); * @todo Remove this for 4.0? Installer/upgrader already do check for this anyway...
} */
} if( PHP_VERSION < '5.2.0' )
/* If it's disabled, are we entitiled to it? */ {
else $entries[] = array( sprintf( $this->lang->words['cp_yourphpversion'], PHP_VERSION ), $this->lang->words['cp_php_warning'] );
{ }
$licenseData = $this->cache->getCache( 'licenseData' );
/* Outgoing email address specified */
if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) ) if ( !$this->settings['email_out'] OR !$this->settings['email_in'] )
{ {
foreach ( $licenseData['ipbMain'] as $data ) $entries[] = array( $this->lang->words['cp_missingemail'], "{$this->lang->words['cp_missingemail1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&amp;module=settings&amp;section=settings&amp;do=findsetting&amp;key=email'>{$this->lang->words['cp_missingemail2']}</a>" );
{ }
if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] == 'Ok' )
{ /* Board Offline Check */
$entries[] = array( $this->lang->words['spam_service_disabled'], $this->lang->words['spam_service_disabled_msg'] ); if ( $this->settings['board_offline'] )
break; {
} $entries[] = array( $this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&amp;module=settings&amp;section=settings&amp;do=findsetting&amp;key=boardoffline'>{$this->lang->words['cp_boardoffline2']}</a>" );
} }
}
/* Fulltext Check */
} if( $this->settings['search_method'] == 'traditional' AND !$this->settings['use_fulltext'] AND !$this->settings['hide_ftext_note'] )
{
} $entries[] = array( $this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&amp;module=settings&amp;section=settings&amp;do=findsetting&amp;key=searchsetup'>{$this->lang->words['fulltext_find']}</a>" );
}
/* FURL cache OOD? */
if ( is_file( IPS_CACHE_PATH . 'cache/furlCache.php' ) ) /* Make sure the profile directory is writable */
{ if( ! is_dir( $this->settings['upload_dir'] . '/profile/' ) || ! is_writable( $this->settings['upload_dir'] . '/profile/' ) )
$mtime = intval( @filemtime( IPS_CACHE_PATH . 'cache/furlCache.php' ) ); {
$entries[] = array( $this->lang->words['cp_profilephotoerr_title'], sprintf( $this->lang->words['cp_profilephotoerr_msg'], $this->settings['upload_dir'] . '/profile/' ) );
/* Check mtimes on extensions.. */ }
foreach( ipsRegistry::$applications as $app_dir => $application )
{ /* Check for upgrade finish folder */
if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) ) if( is_dir( IPS_ROOT_PATH . 'upgradeFinish/' ) )
{ {
$_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) ); $entries[] = array( $this->lang->words['cp_upgradefinishfolder'], sprintf( $this->lang->words['cp_upgradefinishfolder_msg'], IPS_ROOT_PATH . 'upgradeFinish/' ) );
}
if ( $_mtime > $mtime )
{ /* Check to see if GD is intalled */
$entries[] = array( $this->lang->words['furlcache_outofdate'], sprintf( $this->lang->words['furlcache_outofdate_desc'], $application['app_title'] ) . "<a href='" . $this->settings['base_url'] . "app=core&amp;module=applications&amp;section=applications&amp;do=seoRebuild'>{$this->lang->words['rebuild_furl_cache']}</a>" ); if(! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) )
break; {
} $entries[] = array( $this->lang->words['cp_gdnotinstalled_title'], $this->lang->words['cp_gdnotinstalled_msg'] );
} }
}
} /* Performance mode check */
$perfMode = $this->cache->getCache('performanceCache');
/* Sphinx cache OOD? */
if ( $this->settings['search_method'] == 'sphinx' ) if( is_array( $perfMode ) && count( $perfMode ) )
{ {
$mtime = intval( $this->cache->getCache('sphinx_config') ); $entries[] = array( $this->lang->words['cp_perfmodeon_title'], $this->lang->words['cp_perfmodeon_msg'] );
}
/* Check mtimes on extensions.. */
foreach( ipsRegistry::$applications as $app_dir => $application ) /* Suhosin check */
{ if( extension_loaded( 'suhosin' ) )
if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) ) {
{ $_postMaxVars = @ini_get('suhosin.post.max_vars');
$_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) ); $_reqMaxVars = @ini_get('suhosin.request.max_vars');
$_postMaxLen = @ini_get('suhosin.post.max_value_length');
if ( !$mtime OR $_mtime > $mtime ) $_reqMaxLen = @ini_get('suhosin.request.max_value_length');
{
$entries[] = array( $this->lang->words['sphinxconfig_outofdate'], $this->lang->words['sphinxconfig_outofdate_desc'] . ' ' . "<a href='" . $this->settings['base_url'] . "app=core&amp;module=applications&amp;section=applications&amp;do=applications_overview'>{$this->lang->words['rebuild_sphinx_config']}</a>" ); if( $_postMaxVars < 4096 )
break; {
} $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue1'], $_postMaxVars ) );
} }
}
} if( $_reqMaxVars < 4096 )
{
/* Minify on but /cache/tmp not writeable? */ $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue2'], $_reqMaxVars ) );
if ( !empty( $this->settings['_use_minify'] ) ) }
{
$entries[] = array( $this->lang->words['minifywrite_head'], $this->lang->words['minifynot_writeable'] ); if( $_postMaxLen < 1000000 )
} {
$entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue3'], $_postMaxLen ) );
/* Installer Check */ }
if( @is_file( IPS_ROOT_PATH . 'install/index.php' ) )
{ if( $_reqMaxLen < 1000000 )
if ( ! @is_file( DOC_IPS_ROOT_PATH . 'cache/installer_lock.php' ) ) {
{ $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue4'], $_reqMaxLen ) );
$this->lang->words['cp_unlocked_warning'] = sprintf( $this->lang->words['cp_unlocked_warning'], CP_DIRECTORY ); }
$entries[] = array( $this->lang->words['cp_unlockedinstaller'], $this->lang->words['cp_unlocked_warning'] ); }
}
} /* SQL error check */
/*if ( is_file( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) )
/* Unfinished Upgrade */ {
require_once( IPS_ROOT_PATH . '/setup/sources/base/setup.php' );/*noLibHook*/ $unix = @filemtime( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' );
$versions = IPSSetUp::fetchAppVersionNumbers( 'core' );
if ( $unix )
if( $versions['current'][0] != $versions['latest'][0] ) {
{ $mtime = gmdate( 'd-j-Y', $unix );
$this->lang->words['cp_upgrade_warning'] = sprintf( $this->lang->words['cp_upgrade_warning'], $versions['current'][1], $versions['latest'][1], $this->settings['base_acp_url'] ); $now = gmdate( 'd-j-Y', time() );
$entries[] = array( $this->lang->words['cp_unfinishedupgrade'], $this->lang->words['cp_upgrade_warning'] ); if ( $mtime == $now )
} {
// Display a message
/* PHP Version Check */ }
if( PHP_VERSION < '5.1.0' ) }
{ }*/
$entries[] = array( sprintf( $this->lang->words['cp_yourphpversion'], PHP_VERSION ), $this->lang->words['cp_php_warning'] );
} return $entries;
}
/* Outgoing email address specified */
if ( !$this->settings['email_out'] OR !$this->settings['email_in'] )
{
$entries[] = array( $this->lang->words['cp_missingemail'], "{$this->lang->words['cp_missingemail1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&amp;module=settings&amp;section=settings&amp;do=findsetting&amp;key=email'>{$this->lang->words['cp_missingemail2']}</a>" );
}
/* Board Offline Check */
if ( $this->settings['board_offline'] )
{
$entries[] = array( $this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&amp;module=settings&amp;section=settings&amp;do=findsetting&amp;key=boardoffline'>{$this->lang->words['cp_boardoffline2']}</a>" );
}
/* Fulltext Check */
if( $this->settings['search_method'] == 'traditional' AND !$this->settings['use_fulltext'] AND !$this->settings['hide_ftext_note'] )
{
$entries[] = array( $this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&amp;module=settings&amp;section=settings&amp;do=findsetting&amp;key=searchsetup'>{$this->lang->words['fulltext_find']}</a>" );
}
/* Make sure the profile directory is writable */
if( ! is_dir( $this->settings['upload_dir'] . '/profile/' ) || ! is_writable( $this->settings['upload_dir'] . '/profile/' ) )
{
$entries[] = array( $this->lang->words['cp_profilephotoerr_title'], sprintf( $this->lang->words['cp_profilephotoerr_msg'], $this->settings['upload_dir'] . '/profile/' ) );
}
/* Check for upgrade finish folder */
if( is_dir( IPS_ROOT_PATH . 'upgradeFinish/' ) )
{
$entries[] = array( $this->lang->words['cp_upgradefinishfolder'], sprintf( $this->lang->words['cp_upgradefinishfolder_msg'], IPS_ROOT_PATH . 'upgradeFinish/' ) );
}
/* Check to see if GD is intalled */
if(! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) )
{
$entries[] = array( $this->lang->words['cp_gdnotinstalled_title'], $this->lang->words['cp_gdnotinstalled_msg'] );
}
/* Performance mode check */
$perfMode = $this->cache->getCache('performanceCache');
if( is_array( $perfMode ) && count( $perfMode ) )
{
$entries[] = array( $this->lang->words['cp_perfmodeon_title'], $this->lang->words['cp_perfmodeon_msg'] );
}
/* Suhosin check */
if( extension_loaded( 'suhosin' ) )
{
$_postMaxVars = @ini_get('suhosin.post.max_vars');
$_reqMaxVars = @ini_get('suhosin.request.max_vars');
$_postMaxLen = @ini_get('suhosin.post.max_value_length');
$_reqMaxLen = @ini_get('suhosin.request.max_value_length');
if( $_postMaxVars < 4096 )
{
$entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue1'], $_postMaxVars ) );
}
if( $_reqMaxVars < 4096 )
{
$entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue2'], $_reqMaxVars ) );
}
if( $_postMaxLen < 1000000 )
{
$entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue3'], $_postMaxLen ) );
}
if( $_reqMaxLen < 1000000 )
{
$entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue4'], $_reqMaxLen ) );
}
}
/* SQL error check */
/*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( 'd-j-Y', $unix );
$now = gmdate( 'd-j-Y', time() );
if ( $mtime == $now )
{
// Display a message
}
}
}*/
return $entries;
}
} }
@@ -1,25 +0,0 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Define data hook locations (core)
* Last Updated: $Date: 2011-05-18 04:49:10 -0400 (Wed, 18 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: 8812 $
*/
$dataHookLocations = array(
/* POSTING LIBRARY DATA LOCATIONS */
array( 'warnLogs', 'Insert Warn Log' ),
);
@@ -1,36 +1,36 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* BBCode Management : Determines if bbcode can be used in this section * BBCode Management : Determines if bbcode can be used in this section
* Last Updated: $LastChangedDate: 2011-04-20 18:01:37 -0400 (Wed, 20 Apr 2011) $ * Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: bfarber $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @version $Rev: 8419 $ * @version $Rev: 10914 $
* *
*/ */
if ( ! defined( 'IN_IPB' ) ) if ( ! defined( 'IN_IPB' ) )
{ {
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit(); exit();
} }
/* /*
* An array of key => value pairs * An array of key => value pairs
* When going to parse, the key should be passed to the editor * When going to parse, the key should be passed to the editor
* to determine which bbcodes should be parsed in the section * to determine which bbcodes should be parsed in the section
* *
*/ */
$BBCODE = array( $BBCODE = array(
'reports' => ipsRegistry::getClass('class_localization')->words['ctype__reports'], 'reports' => ipsRegistry::getClass('class_localization')->words['ctype__reports'],
'global_comments' => ipsRegistry::getClass('class_localization')->words['ctype__comments'], 'global_comments' => ipsRegistry::getClass('class_localization')->words['ctype__comments'],
); );
@@ -1,70 +0,0 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.2
* Sets up SEO templates
* Last Updated: $Date: 2010-07-01 18:13:46 -0400 (Thu, 01 Jul 2010) $
* </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 20th February 2002
* @version $Rev: 6596 $
*
*/
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();
}
/**
* SEO templates
*
* 'allowRedirect' is a flag to tell IP.Board whether to check the incoming link and if not formatted correctly, redirect the correct one
*
* OUT FORMAT REGEX:
* First array element is a regex to run to see if we've a match for the URL
* The second array element is the template to use the results of the parenthesis capture
*
* Special variable #{__title__} is replaced with the $title data passed to output->formatUrl( $url, $title)
*
* IMPORTANT: Remember that when these regex are used, the output has not been fully parsed so you will get:
* showuser={$data['member_id']} NOT showuser=1 so do not try and match numerics only!
*
* IN FORMAT REGEX
*
* This allows the registry to piece back together a URL based on the template regex
* So, for example: "/user/(\d+?)/", 'matches' => array( array( 'showuser' => '$1' ) )tells IP.Board to populate 'showuser' with the result
* of the parenthesis capture #1
*/
$_SEOTEMPLATES = array(
'section=register' => array( 'app' => 'core',
'allowRedirect' => 0,
'out' => array( '#app=core(&amp;|&)module=global(&amp;|&)section=register(&amp;|&|$)#i', 'register/$3' ),
'in' => array( 'regex' => "#/register(/|$|\?)#i",
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'register' ) ) ) ),
'section=rss' => array( 'app' => 'core',
'allowRedirect' => 0,
'out' => array( '#app=core(&amp;|&)module=global(&amp;|&)section=rss(&amp;|&)type=(\w+?)$#i', 'rss/$4/' ),
'in' => array( 'regex' => "#/rss/(\w+?)/$#i",
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'rss' ), array( 'type', '$1' ) ) ) ),
'section=rss2' => array( 'app' => 'core',
'allowRedirect' => 0,
'out' => array( '#app=core(&amp;|&)module=global(&amp;|&)section=rss(&amp;|&)type=(\w+?)(&amp;|&)id=(\w+?)$#i', 'rss/$4/$6-#{__title__}/' ),
'in' => array( 'regex' => "#/rss/(\w+?)/(\w+?)-#i",
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'rss' ), array( 'type', '$1' ), array( 'id', '$2' ) ) ) ),
# Changed section=rss2 id matching to use \w for more flexibility
);
@@ -2,19 +2,19 @@
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Sets up SEO templates * Sets up SEO templates
* Last Updated: $Date: 2011-09-16 07:16:26 -0400 (Fri, 16 Sep 2011) $ * Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: mmecham $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since 20th February 2002 * @since 20th February 2002
* @version $Rev: 9496 $ * @version $Rev: 10914 $
* *
*/ */
@@ -51,11 +51,29 @@ $_SEOTEMPLATES = array(
'out' => array( '#app=core(&amp;|&)module=global(&amp;|&)section=register(&amp;|&|$)#i', 'register/$3' ), 'out' => array( '#app=core(&amp;|&)module=global(&amp;|&)section=register(&amp;|&|$)#i', 'register/$3' ),
'in' => array( 'regex' => "#/register(/|$|\?)#i", 'in' => array( 'regex' => "#/register(/|$|\?)#i",
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'register' ) ) ) ), 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'register' ) ) ) ),
'tags' => array( 'app' => 'core',
'allowRedirect' => 0,
'out' => array( '#app=core(&amp;|&)module=search(&amp;|&)do=search(&amp;|&)search_tags=(\S+?)(&amp;|&)search_app=(\S+?)(&amp;|&|$)#i', 'tags/$6/$4/$7' ),
'in' => array( 'regex' => "#/tags/(\S+?)/(\S+?)/#i",
'matches' => array( array( 'app', 'core' ), array( 'module', 'search' ), array( 'do', 'search' ), array( 'search_tags', '$2' ), array( 'search_app', '$1' ) ) ) ),
'privacy' => array( 'app' => 'core',
'allowRedirect' => 0,
'out' => array( '#app=core(&amp;|&)module=global(&amp;|&)section=privacy(&amp;|&|$)#i', 'privacypolicy/$4/' ),
'in' => array( 'regex' => "#/privacypolicy/#i",
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'privacy' ) ) ) ),
'likeunsubscribe' => array( 'app' => 'core', 'likeunsubscribe' => array( 'app' => 'core',
'allowRedirect' => 0, 'allowRedirect' => 0,
'out' => array( '#app=core(&amp;|&)module=global(&amp;|&)section=like(&amp;|&)do=unsubscribe(&amp;|&)key=(\S+?)(&amp;|&|$)#i', 'unsubscribe/$5/' ), 'out' => array( '#app=core(&amp;|&)module=global(&amp;|&)section=like(&amp;|&)do=unsubscribe(&amp;|&)key=(\S+?)(&amp;|&|$)#i', 'unsubscribe/$5/' ),
'in' => array( 'regex' => "#/unsubscribe/(\S+?)/$#i", 'in' => array( 'regex' => "#/unsubscribe/(\S+?)/$#i",
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'like' ), array( 'do', 'unsubscribe' ), array( 'key', '$1' ) ) ) ), 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'like' ), array( 'do', 'unsubscribe' ), array( 'key', '$1' ) ) ) ),
'findcomment' => array( 'app' => 'core',
'allowRedirect' => 0,
'out' => array( '#app=core(&amp;|&)module=global(&amp;|&)section=comments(&amp;|&)do=findComment(&amp;|&)fromApp=(\S+?)(&amp;|&)parentId=(\d+?)(&amp;|&)commentId=(\d+?)(&amp;|&|$)#i', 'findComment/$5/$7-$9' ),
'in' => array( 'regex' => "#/findComment/(\S+?-\S+?)/(\d+?)-(\d+?)$#i",
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'comments' ), array( 'do', 'findComment' ), array( 'fromApp', '$1' ), array( 'parentId', '$2' ), array( 'commentId', '$3' ) ) ) ),
'section=rss' => array( 'app' => 'core', 'section=rss' => array( 'app' => 'core',
'allowRedirect' => 0, 'allowRedirect' => 0,
'out' => array( '#app=core(&amp;|&)module=global(&amp;|&)section=rss(&amp;|&)type=(\w+?)$#i', 'rss/$4/' ), 'out' => array( '#app=core(&amp;|&)module=global(&amp;|&)section=rss(&amp;|&)type=(\w+?)$#i', 'rss/$4/' ),
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -0,0 +1,69 @@
<?php
/**
* @file default.php Core like class (Core application)
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: mark $
* $LastChangedDate: 2011-12-08 16:43:34 +0000 (Thu, 08 Dec 2011) $
* @version v3.3.4
* $Revision: 9971 $
*/
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 like_core_default_composite
* @brief Core default like class (core application)
*/
class like_core_composite extends classes_like_composite
{
/**
* Registry Object Shortcuts
*
* @var $registry
* @var $DB
* @var $settings
* @var $request
* @var $lang
* @var $member
* @var $memberData
* @var $cache
* @var $caches
*/
protected $registry;
protected $DB;
protected $settings;
protected $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**
* Constructor
*
* @return @e void
*/
public function __construct()
{
/* Make registry objects */
$this->registry = ipsRegistry::instance();
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
}
}
@@ -3,11 +3,11 @@
* @file generate.php Navigation plugin: attachments * @file generate.php Navigation plugin: attachments
*~TERABYTE_DOC_READY~ *~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED! * $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $ * $Author: bfarber $
* @since 3/8/2011 * @since 3/8/2011
* $LastChangedDate: 2011-05-12 22:28:10 -0400 (Thu, 12 May 2011) $ * $LastChangedDate: 2011-05-12 22:28:10 -0400 (Thu, 12 May 2011) $
* @version v3.2.3 * @version v3.3.4
* $Revision: 8754 $ * $Revision: 8754 $
*/ */
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com/">IP.Board</a> <a href="http://www.invisionpower.com/">IP.Board</a>
</body> </body>
</html> </html>
@@ -1,50 +1,50 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Define the core notification types * Define the core notification types
* 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> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since 20th February 2002 * @since 20th February 2002
* @version $Rev: 8031 $ * @version $Rev: 10914 $
* *
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class core_notifications class core_notifications
{ {
public function getConfiguration() public function getConfiguration()
{ {
/** /**
* Notification types - Needs to be a method so when require_once is used, $_NOTIFY isn't empty * Notification types - Needs to be a method so when require_once is used, $_NOTIFY isn't empty
*/ */
$_NOTIFY = array( $_NOTIFY = array(
// Future... // Future...
// array( 'key' => 'reputation_received', 'default' => array( 'inline' ), 'disabled' => array() ), // array( 'key' => 'reputation_received', 'default' => array( 'inline' ), 'disabled' => array() ),
array( 'key' => 'report_center', 'default' => array( 'email' ), 'disabled' => array(), 'show_callback' => TRUE, 'icon' => 'notify_reportcenter' ), array( 'key' => 'report_center', 'default' => array( 'email' ), 'disabled' => array(), 'show_callback' => TRUE, 'icon' => 'notify_reportcenter' ),
array( 'key' => 'new_comment' , 'default' => array( 'email' ), 'disabled' => array(), 'show_callback' => false, 'icon' => 'notify_profilecomment' ), array( 'key' => 'new_comment' , 'default' => array( 'email' ), 'disabled' => array(), 'show_callback' => false, 'icon' => 'notify_profilecomment' ),
);/*noLibHook*/ );/*noLibHook*/
return $_NOTIFY; return $_NOTIFY;
} }
public function report_center() public function report_center()
{ {
return $this->memberData['access_report_center']; return $this->memberData['access_report_center'];
} }
} }
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -1,118 +1,118 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* RSS output plugin :: report center * RSS output plugin :: report center
* Last Updated: $Date: 2011-03-10 16:00:38 -0500 (Thu, 10 Mar 2011) $ * Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: bfarber $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since 6/24/2008 * @since 6/24/2008
* @version $Revision: 8021 $ * @version $Revision: 10914 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class rss_output_core class rss_output_core
{ {
/** /**
* Expiration date * Expiration date
* *
* @var integer Expiration timestamp * @var integer Expiration timestamp
*/ */
protected $expires = 0; protected $expires = 0;
/** /**
* Grab the RSS links * Grab the RSS links
* *
* @return array * @return array
*/ */
public function getRssLinks() public function getRssLinks()
{ {
//----------------------------------------- //-----------------------------------------
// As this is member specific, hardcoded // As this is member specific, hardcoded
// into output library // into output library
//----------------------------------------- //-----------------------------------------
return array(); return array();
} }
/** /**
* Grab the RSS document content and return it * Grab the RSS document content and return it
* *
* @return string RSS document * @return string RSS document
*/ */
public function returnRSSDocument() public function returnRSSDocument()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$member_id = intval( ipsRegistry::$request['member_id'] ); $member_id = intval( ipsRegistry::$request['member_id'] );
$secure_key = IPSText::md5Clean( ipsRegistry::$request['rss_key'] ); $secure_key = IPSText::md5Clean( ipsRegistry::$request['rss_key'] );
$rss_data = array(); $rss_data = array();
$to_print = ''; $to_print = '';
if( $secure_key and $member_id ) if( $secure_key and $member_id )
{ {
if( $member_id == ipsRegistry::member()->getProperty('member_id') ) if( $member_id == ipsRegistry::member()->getProperty('member_id') )
{ {
//----------------------------------------- //-----------------------------------------
// Get RSS export // Get RSS export
//----------------------------------------- //-----------------------------------------
$rss_data = ipsRegistry::DB()->buildAndFetch( array( 'select' => 'rss_cache', $rss_data = ipsRegistry::DB()->buildAndFetch( array( 'select' => 'rss_cache',
'from' => 'rc_modpref', 'from' => 'rc_modpref',
'where' => "mem_id=" . $member_id . " AND rss_key='" . $secure_key . "'" 'where' => "mem_id=" . $member_id . " AND rss_key='" . $secure_key . "'"
) ); ) );
//----------------------------------------- //-----------------------------------------
// Got one? // Got one?
//----------------------------------------- //-----------------------------------------
if ( $rss_data['rss_cache'] ) if ( $rss_data['rss_cache'] )
{ {
return $rss_data['rss_cache']; return $rss_data['rss_cache'];
} }
} }
//----------------------------------------- //-----------------------------------------
// Create a dummy one // Create a dummy one
//----------------------------------------- //-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_reports' ), 'core' ); ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_reports' ), 'core' );
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classRss.php', 'classRss' ); $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classRss.php', 'classRss' );
$rss = new $classToLoad(); $rss = new $classToLoad();
$channel_id = $rss->createNewChannel( array( 'title' => ipsRegistry::getClass('class_localization')->words['rss_feed_title'], $channel_id = $rss->createNewChannel( array( 'title' => ipsRegistry::getClass('class_localization')->words['rss_feed_title'],
'link' => ipsRegistry::$settings['board_url'], 'link' => ipsRegistry::$settings['board_url'],
'description' => ipsRegistry::getClass('class_localization')->words['reports_rss_desc'], 'description' => ipsRegistry::getClass('class_localization')->words['reports_rss_desc'],
'pubDate' => $rss->formatDate( time() ) 'pubDate' => $rss->formatDate( time() )
) ); ) );
$rss->createRssDocument(); $rss->createRssDocument();
return $rss->rss_document; return $rss->rss_document;
} }
} }
/** /**
* Grab the RSS document expiration timestamp * Grab the RSS document expiration timestamp
* *
* @return integer Expiration timestamp * @return integer Expiration timestamp
*/ */
public function grabExpiryDate() public function grabExpiryDate()
{ {
return time() + 3600; return time() + 3600;
} }
} }
@@ -1,33 +1,33 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Config file * Config file
* Last Updated: $Date: 2011-04-13 23:15:13 -0400 (Wed, 13 Apr 2011) $ * Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $author$ * @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Forums * @subpackage Forums
* @link http://hatynka.in * @link http://www.invisionpower.com
* @version $Rev: 8333 $ * @version $Rev: 10914 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
/* Can search with this app */ /* Can search with this app */
$CONFIG['can_search'] = 1; $CONFIG['can_search'] = 1;
/* Can view new content with this app */ /* Can view new content with this app */
$CONFIG['can_viewNewContent'] = 0; $CONFIG['can_viewNewContent'] = 0;
/* Can fetch user generated content */ /* Can fetch user generated content */
$CONFIG['can_userContent'] = 0; $CONFIG['can_userContent'] = 0;
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -1,178 +1,178 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Basic Forum Search * Basic Forum Search
* 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> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Forums * @subpackage Forums
* @link http://hatynka.in * @link http://www.invisionpower.com
* @version $Rev: 8644 $ * @version $Rev: 10914 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class search_engine_core extends search_engine class search_engine_core extends search_engine
{ {
/** /**
* Constructor * Constructor
* *
* @param object ipsRegistry reference * @param object ipsRegistry reference
* @return @e void * @return @e void
*/ */
public function __construct( ipsRegistry $registry ) public function __construct( ipsRegistry $registry )
{ {
parent::__construct( $registry ); parent::__construct( $registry );
} }
/** /**
* Perform a search. * Perform a search.
* Returns an array of a total count (total number of matches) * Returns an array of a total count (total number of matches)
* and an array of IDs ( 0 => 1203, 1 => 928, 2 => 2938 ).. matching the required number based on pagination. The ids returned would be based on the filters and type of search * and an array of IDs ( 0 => 1203, 1 => 928, 2 => 2938 ).. matching the required number based on pagination. The ids returned would be based on the filters and type of search
* *
* So if we had 1000 replies, and we are on page 2 of 25 per page, we'd return 25 items offset by 25 * So if we had 1000 replies, and we are on page 2 of 25 per page, we'd return 25 items offset by 25
* *
* @return array * @return array
*/ */
public function search() public function search()
{ {
/* INIT */ /* INIT */
$sort_by = IPSSearchRegistry::get('in.search_sort_by'); $sort_by = IPSSearchRegistry::get('in.search_sort_by');
$sort_order = IPSSearchRegistry::get('in.search_sort_order'); $sort_order = IPSSearchRegistry::get('in.search_sort_order');
$search_term = IPSSearchRegistry::get('in.clean_search_term'); $search_term = IPSSearchRegistry::get('in.clean_search_term');
$sortKey = ''; $sortKey = '';
$rows = array(); $rows = array();
/* Sorting */ /* Sorting */
switch( $sort_by ) switch( $sort_by )
{ {
default: default:
case 'date': case 'date':
$sortKey = 'id'; $sortKey = 'id';
break; break;
case 'title': case 'title':
$sortKey = 'title'; $sortKey = 'title';
break; break;
} }
/* Query the count */ /* Query the count */
$count = $this->DB->buildAndFetch( array('select' => 'COUNT(*) as total_results', $count = $this->DB->buildAndFetch( array('select' => 'COUNT(*) as total_results',
'from' => 'faq', 'from' => 'faq',
'where' => $this->_buildWhereStatement( $search_term ), 'where' => $this->_buildWhereStatement( $search_term ),
) ); ) );
/* Fetch data */ /* Fetch data */
$this->DB->build( array( 'select' => '*', $this->DB->build( array( 'select' => '*',
'from' => 'faq', 'from' => 'faq',
'where' => $this->_buildWhereStatement( $search_term ), 'where' => $this->_buildWhereStatement( $search_term ),
'order' => $sortKey . ' ' . $sort_order, 'order' => $sortKey . ' ' . $sort_order,
'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ), 'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ),
) ); ) );
$this->DB->execute(); $this->DB->execute();
/* Get results */ /* Get results */
while ( $_row = $this->DB->fetch() ) while ( $_row = $this->DB->fetch() )
{ {
$rows[] = $_row; $rows[] = $_row;
} }
/* Return it */ /* Return it */
return array( 'count' => $count['total_results'], 'resultSet' => $rows ); return array( 'count' => $count['total_results'], 'resultSet' => $rows );
} }
/** /**
* Builds the where portion of a search string * Builds the where portion of a search string
* *
* @param string $search_term The string to use in the search * @param string $search_term The string to use in the search
* @return string * @return string
*/ */
protected function _buildWhereStatement( $search_term ) protected function _buildWhereStatement( $search_term )
{ {
/* INI */ /* INI */
$where_clause = array(); $where_clause = array();
if( $search_term ) if( $search_term )
{ {
switch( IPSSearchRegistry::get('opt.searchType') ) switch( IPSSearchRegistry::get('opt.searchType') )
{ {
case 'both': case 'both':
default: default:
$where_clause[] = "(title LIKE '%{$search_term}%' OR text LIKE '%{$search_term}%' OR description LIKE '%{$search_term}%')"; $where_clause[] = "(title LIKE '%{$search_term}%' OR text LIKE '%{$search_term}%' OR description LIKE '%{$search_term}%')";
break; break;
case 'titles': case 'titles':
$where_clause[] = "title LIKE '%{$search_term}%'"; $where_clause[] = "title LIKE '%{$search_term}%'";
break; break;
case 'content': case 'content':
$where_clause[] = "(text LIKE '%{$search_term}%' OR description LIKE '%{$search_term}%')"; $where_clause[] = "(text LIKE '%{$search_term}%' OR description LIKE '%{$search_term}%')";
break; break;
} }
} }
/* Add in AND where conditions */ /* Add in AND where conditions */
if( isset( $this->whereConditions['AND'] ) && count( $this->whereConditions['AND'] ) ) if( isset( $this->whereConditions['AND'] ) && count( $this->whereConditions['AND'] ) )
{ {
$where_clause = array_merge( $where_clause, $this->whereConditions['AND'] ); $where_clause = array_merge( $where_clause, $this->whereConditions['AND'] );
} }
/* ADD in OR where conditions */ /* ADD in OR where conditions */
if( isset( $this->whereConditions['OR'] ) && count( $this->whereConditions['OR'] ) ) if( isset( $this->whereConditions['OR'] ) && count( $this->whereConditions['OR'] ) )
{ {
$where_clause[] = '( ' . implode( ' OR ', $this->whereConditions['OR'] ) . ' )'; $where_clause[] = '( ' . implode( ' OR ', $this->whereConditions['OR'] ) . ' )';
} }
/* Build and return the string */ /* Build and return the string */
return implode( " AND ", $where_clause ); return implode( " AND ", $where_clause );
} }
/** /**
* Remap standard columns (Apps can override ) * Remap standard columns (Apps can override )
* *
* @param string $column sql table column for this condition * @param string $column sql table column for this condition
* @return string column * @return string column
* @return @e void * @return @e void
*/ */
public function remapColumn( $column ) public function remapColumn( $column )
{ {
if ( $column == 'member_id' ) if ( $column == 'member_id' )
{ {
return ''; return '';
} }
return $column; return $column;
} }
/** /**
* Returns an array used in the searchplugin's setCondition method * Returns an array used in the searchplugin's setCondition method
* *
* @param array $data Array of forums to view * @param array $data Array of forums to view
* @return array Array with column, operator, and value keys, for use in the setCondition call * @return array Array with column, operator, and value keys, for use in the setCondition call
*/ */
public function buildFilterSQL( $data ) public function buildFilterSQL( $data )
{ {
return array(); return array();
} }
/** /**
* Can handle boolean searching * Can handle boolean searching
* *
* @return boolean * @return boolean
*/ */
public function isBoolean() public function isBoolean()
{ {
return false; return false;
} }
} }
@@ -1,59 +1,59 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Returns HTML for the form (optional class, not required) * Returns HTML for the form (optional class, not required)
* 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> * </pre>
* *
* @author $author$ * @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Forums * @subpackage Forums
* @link http://hatynka.in * @link http://www.invisionpower.com
* @version $Rev: 8644 $ * @version $Rev: 10914 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class search_form_core class search_form_core
{ {
/** /**
* Construct * Construct
* *
* @return @e void * @return @e void
*/ */
public function __construct() public function __construct()
{ {
/* Make object */ /* Make object */
$this->registry = ipsRegistry::instance(); $this->registry = ipsRegistry::instance();
$this->DB = $this->registry->DB(); $this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings(); $this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest(); $this->request =& $this->registry->fetchRequest();
$this->lang = $this->registry->getClass('class_localization'); $this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member(); $this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData(); $this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache(); $this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches(); $this->caches =& $this->registry->cache()->fetchCaches();
} }
/** /**
* Return sort drop down * Return sort drop down
* *
* @return array * @return array
*/ */
public function fetchSortDropDown() public function fetchSortDropDown()
{ {
$array = array( 'date' => $this->lang->words['s_search_type_0'], $array = array( 'date' => $this->lang->words['s_search_type_0'],
'title' => $this->lang->words['forum_sort_title'] ); 'title' => $this->lang->words['forum_sort_title'] );
return $array; return $array;
} }
} }
@@ -1,96 +1,96 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Formats forum search results * Formats forum search results
* 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> * </pre>
* *
* @author $author$ * @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Forums * @subpackage Forums
* @link http://hatynka.in * @link http://www.invisionpower.com
* @version $Rev: 8644 $ * @version $Rev: 10914 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class search_format_core extends search_format class search_format_core extends search_format
{ {
/** /**
* Constructor * Constructor
* *
* @param object ipsRegistry * @param object ipsRegistry
* @return @e void * @return @e void
*/ */
public function __construct( ipsRegistry $registry ) public function __construct( ipsRegistry $registry )
{ {
parent::__construct( $registry ); parent::__construct( $registry );
} }
/** /**
* Parse search results * Parse search results
* *
* @param array $r Search result * @param array $r Search result
* @return array $html Blocks of HTML * @return array $html Blocks of HTML
*/ */
public function parseAndFetchHtmlBlocks( $rows ) public function parseAndFetchHtmlBlocks( $rows )
{ {
return parent::parseAndFetchHtmlBlocks( $rows ); return parent::parseAndFetchHtmlBlocks( $rows );
} }
/** /**
* Formats the forum search result for display * Formats the forum search result for display
* *
* @param array $search_row Array of data * @param array $search_row Array of data
* @return mixed Formatted content, ready for display, or array containing a $sub section flag, and content * @return mixed Formatted content, ready for display, or array containing a $sub section flag, and content
*/ */
public function formatContent( $data ) public function formatContent( $data )
{ {
return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->helpSearchResult( $data, IPSSearchRegistry::get('opt.searchType') == 'titles' ? true : false ), 0 ); return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->helpSearchResult( $data, IPSSearchRegistry::get('opt.searchType') == 'titles' ? true : false ), 0 );
} }
/** /**
* Formats / grabs extra data for results * Formats / grabs extra data for results
* Takes an array of IDS (can be IDs from anything) and returns an array of expanded data. * Takes an array of IDS (can be IDs from anything) and returns an array of expanded data.
* *
* @return array * @return array
*/ */
public function processResults( $ids ) public function processResults( $ids )
{ {
$rows = array(); $rows = array();
foreach( $ids as $i => $d ) foreach( $ids as $i => $d )
{ {
$rows[ $i ] = $this->genericizeResults( $d ); $rows[ $i ] = $this->genericizeResults( $d );
} }
return $rows; return $rows;
} }
/** /**
* Reassigns fields in a generic way for results output * Reassigns fields in a generic way for results output
* *
* @param array $r * @param array $r
* @return array * @return array
*/ */
public function genericizeResults( $r ) public function genericizeResults( $r )
{ {
$r['app'] = 'core'; $r['app'] = 'core';
$r['content'] = $r['title']; $r['content'] = $r['title'];
$r['content_title'] = $r['description']; $r['content_title'] = $r['description'];
$r['updated'] = 0; $r['updated'] = 0;
$r['type_2'] = 'help'; $r['type_2'] = 'help';
$r['type_id_2'] = $r['id']; $r['type_id_2'] = $r['id'];
return $r; return $r;
} }
} }
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -2,11 +2,11 @@
/** /**
* @file plugin_attachments.php Shared media plugin: attachments * @file plugin_attachments.php Shared media plugin: attachments
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED! * $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: rtissier $ * $Author: rtissier $
* @since 3/8/2011 * @since 3/8/2011
* $LastChangedDate: 2011-03-16 19:10:59 -0400 (Wed, 16 Mar 2011) $ * $LastChangedDate: 2011-03-16 19:10:59 -0400 (Wed, 16 Mar 2011) $
* @version v3.2.3 * @version v3.3.4
* $Revision: 8108 $ * $Revision: 8108 $
*/ */
@@ -3,18 +3,18 @@
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Sphinx template file * Sphinx template file
* Last Updated: $Date: 2011-08-31 20:57:38 -0400 (Wed, 31 Aug 2011) $ * Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: bfarber $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Forums * @subpackage Forums
* @link http://hatynka.in * @link http://www.invisionpower.com
* @version $Rev: 9438 $ * @version $Rev: 10914 $
* @since 3.0.0 * @since 3.0.0
* *
*/ */
@@ -32,14 +32,14 @@ $appSphinxTemplate = <<<EOF
source <!--SPHINX_CONF_PREFIX-->core_tags_search_main : <!--SPHINX_CONF_PREFIX-->ipb_source_config source <!--SPHINX_CONF_PREFIX-->core_tags_search_main : <!--SPHINX_CONF_PREFIX-->ipb_source_config
{ {
# Set our forum PID counter # Set our forum PID counter
<!--SPHINX_DB_SET_NAMES-->
sql_query_pre = REPLACE INTO <!--SPHINX_DB_PREFIX-->cache_store VALUES( 'sphinx_core_tags_counter', (SELECT max(tag_id) FROM <!--SPHINX_DB_PREFIX-->core_tags), 0, UNIX_TIMESTAMP(), 0 ) sql_query_pre = REPLACE INTO <!--SPHINX_DB_PREFIX-->cache_store VALUES( 'sphinx_core_tags_counter', (SELECT max(tag_id) FROM <!--SPHINX_DB_PREFIX-->core_tags), 0, UNIX_TIMESTAMP(), 0 )
# Query posts for the main source # Query posts for the main source
sql_query = SELECT t.tag_id, t.tag_id as search_id, t.tag_added, t.tag_member_id, t.tag_meta_id, t.tag_meta_parent_id, t.tag_text, t.tag_meta_app, t.tag_meta_area, \ sql_query = SELECT t.tag_id, t.tag_id as search_id, t.tag_added, t.tag_member_id, t.tag_meta_id, t.tag_meta_parent_id, t.tag_text, t.tag_meta_app, REPLACE( t.tag_meta_area, '-', '_' ) as tag_meta_area, \
p.tag_perm_text, p.tag_perm_visible \ CONCAT( ',', p.tag_perm_text, ',') as tag_perm_text ,p.tag_perm_visible \
FROM <!--SPHINX_DB_PREFIX-->core_tags t \ FROM <!--SPHINX_DB_PREFIX-->core_tags t \
LEFT JOIN <!--SPHINX_DB_PREFIX-->core_tags_perms p ON ( t.tag_aai_lookup=p.tag_perm_aai_lookup ) \ LEFT JOIN <!--SPHINX_DB_PREFIX-->core_tags_perms p ON ( t.tag_aai_lookup=p.tag_perm_aai_lookup )
WHERE t.tag_id <= ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_core_tags_counter' )
# Fields # Fields
sql_attr_uint = search_id sql_attr_uint = search_id
@@ -54,11 +54,12 @@ source <!--SPHINX_CONF_PREFIX-->core_tags_search_main : <!--SPHINX_CONF_PREFIX--
source <!--SPHINX_CONF_PREFIX-->core_tags_search_delta : <!--SPHINX_CONF_PREFIX-->core_tags_search_main source <!--SPHINX_CONF_PREFIX-->core_tags_search_delta : <!--SPHINX_CONF_PREFIX-->core_tags_search_main
{ {
# Override the base sql_query_pre # Override the base sql_query_pre
<!--SPHINX_DB_SET_NAMES-->
sql_query_pre = sql_query_pre =
# Query posts for the main source # Query posts for the main source
sql_query = SELECT t.tag_id, t.tag_id as search_id, t.tag_added, t.tag_member_id, t.tag_meta_id, t.tag_meta_parent_id, t.tag_text, t.tag_meta_app, t.tag_meta_area, \ sql_query = SELECT t.tag_id, t.tag_id as search_id, t.tag_added, t.tag_member_id, t.tag_meta_id, t.tag_meta_parent_id, t.tag_text, t.tag_meta_app, REPLACE( t.tag_meta_area, '-', '_' ) as tag_meta_area, \
p.tag_perm_text, p.tag_perm_visible \ CONCAT( ',', p.tag_perm_text, ',') as tag_perm_text ,p.tag_perm_visible \
FROM <!--SPHINX_DB_PREFIX-->core_tags t \ FROM <!--SPHINX_DB_PREFIX-->core_tags t \
LEFT JOIN <!--SPHINX_DB_PREFIX-->core_tags_perms p ON ( t.tag_aai_lookup=p.tag_perm_aai_lookup ) \ LEFT JOIN <!--SPHINX_DB_PREFIX-->core_tags_perms p ON ( t.tag_aai_lookup=p.tag_perm_aai_lookup ) \
WHERE t.tag_id > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_core_tags_counter' ) WHERE t.tag_id > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_core_tags_counter' )
@@ -73,7 +74,7 @@ index <!--SPHINX_CONF_PREFIX-->core_tags_search_main
mlock = 0 mlock = 0
morphology = none morphology = none
min_word_len = 2 min_word_len = 2
charset_type = utf-8 charset_type = sbcs
html_strip = 0 html_strip = 0
#infix_fields = tag_text #infix_fields = tag_text
#min_infix_len = 3 #min_infix_len = 3
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,62 @@
<?php
/**
* @file warnings.php Warnings extension for core
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $ (Original: Mark)
* @since -
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $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 warnings_core
* @brief Warnings Extension for core
*/
class warnings_core
{
/**
* Get Content URL
*
* @param array $warning Row from members_warn_logs
* @return @e array array( url => URL to the content the warning came from, title => Title )
*/
public function getContentUrl( $warning )
{
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_profile' ), 'members' );
if ( $warning['wl_content_id1'] == 'mreport' )
{
$report = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'rc_reports_index', 'where' => "id=" . intval( $warning['wl_content_id2'] ) ) );
if ( ! empty($report['id']) )
{
return array( 'url' => ipsRegistry::getClass('output')->buildUrl( "app=core&module=reports&do=show_report&rid={$report['id']}" ), 'title' => $report['title'] );
}
}
elseif ( $warning['wl_content_id1'] == 'core-reports' )
{
$exploded = explode( '-', $warning['wl_content_id2'] );
require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );/*noLibHook*/
$comments = classes_comments_bootstrap::controller( $warning['wl_content_id1'] );
$parent = $comments->remapFromLocal( $comments->fetchParent( $exploded[0] ), 'parent' );
if ( ! empty($parent['parent_id']) )
{
return array( 'url' => ipsRegistry::getClass('output')->buildUrl( "app=core&module=global&section=comments&fromApp={$warning['wl_content_id1']}&do=findComment&parentId={$exploded[0]}&comment_id={$exploded[1]}" ), 'title' => $parent['parent_title'] );
}
}
return NULL;
}
}
+9 -9
View File
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -253,17 +253,17 @@ function IPB3TemplateDiffResults()
{ {
if ( json['data_type'] == 'css' ) if ( json['data_type'] == 'css' )
{ {
content = '<div class="acp-box"><h3>' + _text + ': ' + json['data_title'] + '.css</h3><div style="padding:4px;line-height:125%;overflow:auto"><pre>' + json['data_content'] + '</pre></div></div>'; content = '<div class="acp-box"><h3>' + _text + ': ' + json['data_title'] + '.css</h3><div style="padding:4px;line-height:125%;overflow:auto;max-height: 575px;"><pre>' + json['data_content'] + '</pre></div></div>';
} }
else else
{ {
content = '<div class="acp-box"><h3>' + _text + ': ' + json['data_group'] + ' &gt; ' + json['data_title'] + '</h3><div style="padding:4px;line-height:125%;overflow:auto"><pre>' + json['data_content'] + '</pre></div></div>'; content = '<div class="acp-box"><h3>' + _text + ': ' + json['data_group'] + ' &gt; ' + json['data_title'] + '</h3><div style="padding:4px;line-height:125%;overflow:auto;max-height: 575px;"><pre>' + json['data_content'] + '</pre></div></div>';
} }
max = document.viewport.getHeight(); max = document.viewport.getHeight();
max = ( max < 600 ) ? max : 600; max = ( max < 600 ) ? max : 600;
popup = new ipb.Popup('VPopUp', { type: 'pane', modal: false, hideAtStart: true, w: '600px', h: max + 'px', initial: content } ); popup = new ipb.Popup('VPopUp', { type: 'pane', modal: false, hideAtStart: true, w: '600px', h: max, initial: content } );
popup.show(); popup.show();
} }
}, },
@@ -335,17 +335,17 @@ function IPB3TemplateDiffResults()
if ( json['change_data_type'] == 'css' ) if ( json['change_data_type'] == 'css' )
{ {
content = '<div class="acp-box"><h3>'+ _text + ': ' + json['change_data_title'] + '.css</h3><div style="padding:4px;line-height:125%;"><pre>' + json['change_data_content'] + '</pre></div>' + _qb + "</div>"; content = '<div class="acp-box"><h3>'+ _text + ': ' + json['change_data_title'] + '.css</h3><div style="padding:4px;line-height:125%;overflow: auto;max-height: 575px;"><pre>' + json['change_data_content'] + '</pre></div>' + _qb + "</div>";
} }
else else
{ {
content = '<div class="acp-box"><h3>'+ _text + ': ' + json['change_data_group'] + ' &gt; ' + json['change_data_title'] + '</h3><div style="padding:4px;line-height:125%;"><pre>' + json['change_data_content'] + '</pre></div>' + _qb + "</div>"; content = '<div class="acp-box"><h3>'+ _text + ': ' + json['change_data_group'] + ' &gt; ' + json['change_data_title'] + '</h3><div style="padding:4px;line-height:125%;overflow: auto;max-height: 575px;"><pre>' + json['change_data_content'] + '</pre></div>' + _qb + "</div>";
} }
max = document.viewport.getHeight(); max = document.viewport.getHeight();
max = ( max < 600 ) ? max : 600; max = ( max < 600 ) ? max : 600;
IPB3TemplateDiffResults.popUps['preview-' + changeId ] = new ipb.Popup('diffPopUp', { type: 'pane', modal: false, hideAtStart: true, w: '800px', h: max + 'px', initial: content } ); IPB3TemplateDiffResults.popUps['preview-' + changeId ] = new ipb.Popup('diffPopUp', { type: 'pane', modal: false, hideAtStart: true, w: '800px', h: max, initial: content } );
IPB3TemplateDiffResults.popUps['preview-' + changeId ].show(); IPB3TemplateDiffResults.popUps['preview-' + changeId ].show();
/* Observe */ /* Observe */
@@ -402,16 +402,16 @@ function IPB3TemplateDiffResults()
/* otherwise... */ /* otherwise... */
if ( json['change_merge_content'] ) if ( json['change_merge_content'] )
{ {
/* Ok, for some reason Safari (and possibly others) doesn't show the pop-up when viewing a /* Ok, for some reason Safari (and possibly others) doesn't show the pop-up when viewing a
template bit. I presume it's because prototype/javascript will not insert invalid HTML into a node even template bit. I presume it's because prototype/javascript will not insert invalid HTML into a node even
though it's encoded properly. After a few days working on merge, this is a quick hack to get it done though it's encoded properly. After a few days working on merge, this is a quick hack to get it done
Force a 750px div in to position pop-up correctly on the screen, then once the pop-up has been created Force a 750px div in to position pop-up correctly on the screen, then once the pop-up has been created
shove the content in. shove the content in.
<3 javascript */ <3 javascript */
var _tmp = Math.floor( Math.random() * 1001 ); var _tmp = Math.floor( Math.random() * 1001 );
_qb = "<div style='float:left; margin-top:6px'><input type='button' id='mergeResolveCustom_" + _tmp + "' class='button __rc" + changeId + "' value='" + ipb.lang['resolveall_button'] + "' />&nbsp;<input type='button' id='mergeResolveNew_" + _tmp + "' class='button __rn" + changeId + "' value='" + ipb.lang['resolveall_newwin'] + "' /></div>"; _qb = "<div style='float:left; margin-top:6px'><input type='button' id='mergeResolveCustom_" + _tmp + "' class='button __rc" + changeId + "' value='" + ipb.lang['resolveall_button'] + "' />&nbsp;<input type='button' id='mergeResolveNew_" + _tmp + "' class='button __rn" + changeId + "' value='" + ipb.lang['resolveall_newwin'] + "' /></div>";
_tb = '<textarea name="content" id="mergeContent" style="width:100%; height:700px; line-height:150%">' + json['change_merge_content'] + '</textarea>' + _qb + '<div style="text-align:right" class="acp-actionbar"><input type="button" id="mergeSubmit" value="' + ipb.lang['save_button'] + '" class="button primary __i' + changeId + '" /></div>'; _tb = '<textarea name="content" id="mergeContent" style="width:100%; height:500px; line-height:150%">' + json['change_merge_content'] + '</textarea>' + _qb + '<div style="text-align:right" class="acp-actionbar"><input type="button" id="mergeSubmit" value="' + ipb.lang['save_button'] + '" class="button primary __i' + changeId + '" /></div>';
if ( json['change_data_type'] == 'css' ) if ( json['change_data_type'] == 'css' )
{ {
@@ -422,7 +422,7 @@ function IPB3TemplateDiffResults()
content = '<div class="acp-box"><h3>' + json['change_data_group'] + ' &gt; ' + json['change_data_title'] + '</h3><div style="padding:4px;">' + _tb + '</div></div>'; content = '<div class="acp-box"><h3>' + json['change_data_group'] + ' &gt; ' + json['change_data_title'] + '</h3><div style="padding:4px;">' + _tb + '</div></div>';
} }
IPB3TemplateDiffResults.popUps['edit-' + changeId ] = new ipb.Popup('diffEditPopUp_' + _tmp, { type: 'pane', modal: false, hideAtStart: true, w: '800px', h: '600px', initial: '<div style="height:750px">&nbsp;</div>' } ); IPB3TemplateDiffResults.popUps['edit-' + changeId ] = new ipb.Popup('diffEditPopUp_' + _tmp, { type: 'pane', modal: false, hideAtStart: true, w: '800px', h: 650, initial: '<div style="height:590px">&nbsp;</div>' } );
IPB3TemplateDiffResults.popUps['edit-' + changeId ].show(); IPB3TemplateDiffResults.popUps['edit-' + changeId ].show();
$('diffEditPopUp_' + _tmp + '_inner').update( content ); $('diffEditPopUp_' + _tmp + '_inner').update( content );
@@ -611,10 +611,10 @@ function IPB3TemplateDiffResults()
alert( ipb.lang['oops'] + t.responseText ); alert( ipb.lang['oops'] + t.responseText );
} }
}, },
onException: function( f,e ){ alert( "Исключение: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
} }
}; };
} }
@@ -1,31 +1,31 @@
/************************************************/ /************************************************/
/* IPB3 Javascript */ /* IPB3 Javascript */
/* -------------------------------------------- */ /* -------------------------------------------- */
/* acp.homepage.js - Homepage javascript */ /* acp.homepage.js - Homepage javascript */
/* (c) IPS, Inc 2008 */ /* (c) IPS, Inc 2008 */
/* -------------------------------------------- */ /* -------------------------------------------- */
/* Author: Brandon Farber */ /* Author: Brandon Farber */
/************************************************/ /************************************************/
ACPHomepage = { ACPHomepage = {
/*------------------------------*/ /*------------------------------*/
/* Constructor */ /* Constructor */
init: function() init: function()
{ {
Debug.write("Initializing acp.homepage.js"); Debug.write("Initializing acp.homepage.js");
}, },
editMember: function() editMember: function()
{ {
if ( $('members_display_name').value == "" ) if ( $('members_display_name').value == "" )
{ {
alert("Нужно ввести имя пользователя!"); alert("You must enter a username!");
return false; return false;
} }
return true; return true;
} }
}; };
ACPHomepage.init(); ACPHomepage.init();
@@ -0,0 +1,55 @@
/************************************************/
/* IPB3 Javascript */
/* -------------------------------------------- */
/* acp.hooksList.js - Hooks listing */
/* (c) IPS, Inc 2011 */
/* -------------------------------------------- */
/* Author: Terabyte */
/************************************************/
var _hooksList = window.IPBACP;
_hooksList.prototype.hooksList = {
popups: [],
/*
* Init function
*/
init: function()
{
Debug.write("Initializing acp.hooksList.js");
document.observe("dom:loaded", function(){
acp.hooksList.initPage();
});
},
initPage: function()
{
$('install_new_hook').observe('click', acp.hooksList.addFolder);
},
addFolder: function( e, elem )
{
Event.stop(e);
if ( ! Object.isUndefined(acp.hooksList.popups['install']) )
{
acp.hooksList.popups['install'].show();
}
else
{
// Make a new popup
acp.hooksList.popups['install'] = new ipb.Popup( 'install', {
type: 'modal',
initial: ipb.templates['install_new_hook'].evaluate(),
w: '550px',
stem: false,
hideAtStart: false
});
}
}
};
acp.hooksList.init();
@@ -0,0 +1,55 @@
/************************************************/
/* IPB3 Javascript */
/* -------------------------------------------- */
/* acp.mmobileimages.js */
/* (c) IPS, Inc 2011 */
/* -------------------------------------------- */
/* Author: Matt Mecham */
/************************************************/
var _mobileImages = window.IPBACP;
_mobileImages.prototype.mobileImages = {
popups: [],
/*
* Init function
*/
init: function()
{
Debug.write("Initializing acp.mobileImages.js");
document.observe("dom:loaded", function(){
acp.mobileImages.initPage();
});
},
initPage: function()
{
$('importXml').observe('click', acp.mobileImages.importPop);
},
importPop: function( e, elem )
{
Event.stop(e);
if ( ! Object.isUndefined(acp.mobileImages.popups['install']) )
{
acp.mobileImages.popups['install'].show();
}
else
{
// Make a new popup
acp.mobileImages.popups['install'] = new ipb.Popup( 'install', {
type: 'modal',
initial: ipb.templates['import_xml'].evaluate(),
w: '550px',
stem: false,
hideAtStart: false
});
}
}
};
acp.mobileImages.init();
+9 -9
View File
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
+17 -17
View File
@@ -85,11 +85,11 @@ function IPBCSS()
} }
else else
{ {
alert( "Похоже у нас проблемы: " + t.responseText ); alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
} }
}, },
onException: function( f,e ){ alert( "Исключение: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
}; };
@@ -133,21 +133,21 @@ function IPBCSS()
if ( json['errors'] ) if ( json['errors'] )
{ {
/* Something inline would be very nice here.. rather than this ugly alert */ /* Something inline would be very nice here.. rather than this ugly alert */
alert("Ошибка: " + json['errors'] ); alert("Message: " + json['errors'] );
} }
else else
{ {
alert("Сохранено!"); alert("Error:: Saved!");
} }
} }
} }
else else
{ {
alert( "Похоже у нас проблемы: " + t.responseText ); alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
} }
}, },
onException: function( f,e ){ alert( "Исключение: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
}; };
@@ -159,14 +159,14 @@ function IPBCSS()
/* Make sure we're mean it... */ /* Make sure we're mean it... */
if ( $('tplate_cssRow_' + css_id ).hasClassName( 'tplateRow_new') ) if ( $('tplate_cssRow_' + css_id ).hasClassName( 'tplateRow_new') )
{ {
if ( ! confirm( "Удалить CSS файл ?\nФайл будет удален из ВСЕХ стилей!" ) ) if ( ! confirm( "REMOVE CSS file?\n This will remove this template bit in ALL skins!" ) )
{ {
return false; return false;
} }
} }
else else
{ {
if ( ! confirm( "Отменить изменения в CSS файле ?\nВсе изменения будут утеряны!" ) ) if ( ! confirm( "Revert CSS file?\n All changes WILL be lost!" ) )
{ {
return false; return false;
} }
@@ -196,17 +196,17 @@ function IPBCSS()
if ( json['errors'] ) if ( json['errors'] )
{ {
/* Something inline would be very nice here.. rather than this ugly alert */ /* Something inline would be very nice here.. rather than this ugly alert */
alert("Ошибка: " + json['errors'] ); alert("Error:: " + json['errors'] );
} }
} }
} }
else else
{ {
alert( "Похоже у нас проблемы: " + t.responseText ); alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
} }
}, },
onException: function( f,e ){ alert( "Исключение: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
}; };
@@ -239,11 +239,11 @@ function IPBCSS()
} }
else else
{ {
alert( "Похоже у нас проблемы: " + t.responseText ); alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
} }
}, },
onException: function( f,e ){ alert( "Исключение: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
}; };
+418 -389
View File
@@ -1,390 +1,419 @@
function addAnotherRequirement() function addAnotherRequirement()
{ {
requireIndex = parseInt(requireIndex) + 1; requireIndex = parseInt(requireIndex) + 1;
// Show the data location dropdown now // Show the data location dropdown now
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getApplications&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + requireIndex + "&name=requireApp"; url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getApplications&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + requireIndex + "&name=requireApp";
url = url.replace( /&amp;/g, '&' ); url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url, new Ajax.Request( url,
{ {
method: 'GET', method: 'GET',
onSuccess: function ( t ) onSuccess: function ( t )
{ {
var newApp = ipb.templates['new_app_require'].evaluate({ index: requireIndex, dropdown: t.responseText }); var newApp = ipb.templates['new_app_require'].evaluate({ index: requireIndex, dropdown: t.responseText });
if ( $('RequirementsContainer').down('tbody') ) if ( $('RequirementsContainer').down('tbody') )
{ {
$('RequirementsContainer').down('tbody').insert( newApp ); $('RequirementsContainer').down('tbody').insert( newApp );
} }
else else
{ {
$('RequirementsContainer').insert( newApp ); $('RequirementsContainer').insert( newApp );
} }
}, },
onException: function( f,e ){ alert( "Exception: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
} }
function removeRequirement( idToRemove ) function getAppVersions( getIndex )
{ {
idToRemove = parseInt(idToRemove); getIndex = parseInt(getIndex);
indexValue = $F('requireApp[' + getIndex + ']');
if( $('requirementTitleRow_' + idToRemove ) != null )
{ // Show the versions dropdowns now
$('requirementTitleRow_' + idToRemove ).remove(); if ( indexValue == 0 )
} {
$('requirementRow_' + getIndex + '_versions').update('');
if( $('requirementRow_' + idToRemove ) != null ) }
{ else
$('requirementRow_' + idToRemove ).remove(); {
} url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getAppVersions&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + getIndex + "&chosenApp=" + indexValue;
} url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
function addAnotherFile() {
{ method: 'GET',
elementIndex = parseInt(elementIndex) + 1; onSuccess: function ( t )
{
var newFile = ipb.templates['new_hook_file'].evaluate({ index: elementIndex }); $('requirementRow_' + getIndex + '_versions').update( t.responseText );
},
if ( $('fileTableContainer').down('tbody') ) onException: function( f,e ){ alert( "Exception: " + e ); },
{ onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
$('fileTableContainer').down('tbody').insert( newFile ); } );
} }
else }
{
$('fileTableContainer').insert( newFile ); function removeRequirement( idToRemove )
} {
} idToRemove = parseInt(idToRemove);
function removeFile( elementIndex ) if( $('requirementTitleRow_' + idToRemove ) != null )
{ {
elementIndex = parseInt(elementIndex); $('requirementTitleRow_' + idToRemove ).remove();
}
if( $('fileRow_' + elementIndex ) != null )
{ if( $('requirementRow_' + idToRemove ) != null )
$('fileRow_' + elementIndex ).remove(); {
} $('requirementRow_' + idToRemove ).remove();
} }
}
function selectHookType( elementIndex )
{
var type = $F('hook_type[' + elementIndex + ']'); function addAnotherFile()
{
if( $('tr_classToOverload[' + elementIndex + ']') != null ) elementIndex = parseInt(elementIndex) + 1;
{
$('tr_classToOverload[' + elementIndex + ']').remove(); var newFile = ipb.templates['new_hook_file'].evaluate({ index: elementIndex });
}
if ( $('fileTableContainer').down('tbody') )
if( $('tr_skinGroup[' + elementIndex + ']') != null ) {
{ $('fileTableContainer').down('tbody').insert( newFile );
$('tr_skinGroup[' + elementIndex + ']').remove(); }
} else
{
if( $('tr_skinFunction[' + elementIndex + ']') != null ) $('fileTableContainer').insert( newFile );
{ }
$('tr_skinFunction[' + elementIndex + ']').remove(); }
}
function removeFile( elementIndex )
if( $('tr_type[' + elementIndex + ']') != null ) {
{ elementIndex = parseInt(elementIndex);
$('tr_type[' + elementIndex + ']').remove();
} if( $('fileRow_' + elementIndex ) != null )
{
if( $('tr_id[' + elementIndex + ']') != null ) $('fileRow_' + elementIndex ).remove();
{ }
$('tr_id[' + elementIndex + ']').remove(); }
}
function selectHookType( elementIndex )
if( $('tr_position[' + elementIndex + ']') != null ) {
{ var type = $F('hook_type[' + elementIndex + ']');
$('tr_position[' + elementIndex + ']').remove();
} if( $('tr_classToOverload[' + elementIndex + ']') != null )
{
if( $('tr_dataLocation[' + elementIndex + ']') != null ) $('tr_classToOverload[' + elementIndex + ']').remove();
{ }
$('tr_dataLocation[' + elementIndex + ']').remove();
} if( $('tr_skinGroup[' + elementIndex + ']') != null )
{
if( $('tr_libApplication[' + elementIndex + ']') != null ) $('tr_skinGroup[' + elementIndex + ']').remove();
{ }
$('tr_libApplication[' + elementIndex + ']').remove();
} if( $('tr_skinFunction[' + elementIndex + ']') != null )
{
if( type == 'templateHooks' ) $('tr_skinFunction[' + elementIndex + ']').remove();
{ }
// Show the skin dropdown now
if( $('tr_type[' + elementIndex + ']') != null )
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getGroupsForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex; {
url = url.replace( /&amp;/g, '&' ); $('tr_type[' + elementIndex + ']').remove();
}
new Ajax.Request( url,
{ if( $('tr_id[' + elementIndex + ']') != null )
method: 'GET', {
onSuccess: function (t ) $('tr_id[' + elementIndex + ']').remove();
{ }
var newRow = ipb.templates['hook_skinGroup'].evaluate({ index: elementIndex, dropdown: t.responseText });
if( $('tr_position[' + elementIndex + ']') != null )
if ( $('fileTable_' + elementIndex).down('tbody') ) {
{ $('tr_position[' + elementIndex + ']').remove();
$('fileTable_' + elementIndex).down('tbody').insert( newRow ); }
}
else if( $('tr_dataLocation[' + elementIndex + ']') != null )
{ {
$('fileTable_' + elementIndex).insert( newRow ); $('tr_dataLocation[' + elementIndex + ']').remove();
} }
},
onException: function( f,e ){ alert( "Exception: " + e ); }, if( $('tr_libApplication[' + elementIndex + ']') != null )
onFailure: function( t ){ alert( "Failure: " + t.responseText ); } {
} ); $('tr_libApplication[' + elementIndex + ']').remove();
} }
else if( type == 'dataHooks' )
{ if( type == 'templateHooks' )
// Show the data location dropdown now {
// Show the skin dropdown now
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getDataLocationsForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
url = url.replace( /&amp;/g, '&' ); url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getGroupsForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{ new Ajax.Request( url,
method: 'GET', {
onSuccess: function (t ) method: 'GET',
{ onSuccess: function (t )
var newRow = ipb.templates['hook_dataLocation'].evaluate({ index: elementIndex, dropdown: t.responseText }); {
var newRow = ipb.templates['hook_skinGroup'].evaluate({ index: elementIndex, dropdown: t.responseText });
if ( $('fileTable_' + elementIndex).down('tbody') )
{ if ( $('fileTable_' + elementIndex).down('tbody') )
$('fileTable_' + elementIndex).down('tbody').insert( newRow ); {
} $('fileTable_' + elementIndex).down('tbody').insert( newRow );
else }
{ else
$('fileTable_' + elementIndex).insert( newRow ); {
} $('fileTable_' + elementIndex).insert( newRow );
}, }
onException: function( f,e ){ alert( "Exception: " + e ); }, },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); } onException: function( f,e ){ alert( "Exception: " + e ); },
} ); onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} } );
else if( type == 'libraryHooks' ) }
{ else if( type == 'dataHooks' )
// Show the data location dropdown now {
// Show the data location dropdown now
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getApplications&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
url = url.replace( /&amp;/g, '&' ); url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getDataLocationsForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{ new Ajax.Request( url,
method: 'GET', {
onSuccess: function (t ) method: 'GET',
{ onSuccess: function (t )
var replace = { index: elementIndex, dropdown: t.responseText }; {
var newRow = ipb.templates['hook_classToOverload'].evaluate(replace) + ipb.templates['hook_libApplication'].evaluate(replace); var newRow = ipb.templates['hook_dataLocation'].evaluate({ index: elementIndex, dropdown: t.responseText });
if ( $('fileTable_' + elementIndex).down('tbody') ) if ( $('fileTable_' + elementIndex).down('tbody') )
{ {
$('fileTable_' + elementIndex).down('tbody').insert( newRow ); $('fileTable_' + elementIndex).down('tbody').insert( newRow );
} }
else else
{ {
$('fileTable_' + elementIndex).insert( newRow ); $('fileTable_' + elementIndex).insert( newRow );
} }
}, },
onException: function( f,e ){ alert( "Exception: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
} }
else if( type != '0' ) else if( type == 'libraryHooks' )
{ {
// Show the classToOverload field // Show the data location dropdown now
var newRow = ipb.templates['hook_classToOverload'].evaluate({ index: elementIndex }); url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getApplications&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
url = url.replace( /&amp;/g, '&' );
if ( $('fileTable_' + elementIndex).down('tbody') )
{ new Ajax.Request( url,
$('fileTable_' + elementIndex).down('tbody').insert( newRow ); {
} method: 'GET',
else onSuccess: function (t )
{ {
$('fileTable_' + elementIndex).insert( newRow ); var replace = { index: elementIndex, dropdown: t.responseText };
} var newRow = ipb.templates['hook_classToOverload'].evaluate(replace) + ipb.templates['hook_libApplication'].evaluate(replace);
}
} if ( $('fileTable_' + elementIndex).down('tbody') )
{
function getTemplatesForAdd( elementIndex ) $('fileTable_' + elementIndex).down('tbody').insert( newRow );
{ }
var type = $F('skinGroup[' + elementIndex + ']'); else
{
if( $('tr_skinFunction[' + elementIndex + ']') != null ) $('fileTable_' + elementIndex).insert( newRow );
{ }
$('tr_skinFunction[' + elementIndex + ']').remove(); },
} onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
if( $('tr_type[' + elementIndex + ']') != null ) } );
{ }
$('tr_type[' + elementIndex + ']').remove(); else if( type != '0' )
} {
// Show the classToOverload field
if( $('tr_id[' + elementIndex + ']') != null )
{ var newRow = ipb.templates['hook_classToOverload'].evaluate({ index: elementIndex });
$('tr_id[' + elementIndex + ']').remove();
} if ( $('fileTable_' + elementIndex).down('tbody') )
{
if( $('tr_position[' + elementIndex + ']') != null ) $('fileTable_' + elementIndex).down('tbody').insert( newRow );
{ }
$('tr_position[' + elementIndex + ']').remove(); else
} {
$('fileTable_' + elementIndex).insert( newRow );
/* Got a type? */ }
if( type != '0' ) }
{ }
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getTemplatesForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&group=" + type;
url = url.replace( /&amp;/g, '&' ); function getTemplatesForAdd( elementIndex )
{
new Ajax.Request( url, var type = $F('skinGroup[' + elementIndex + ']');
{
method: 'GET', if( $('tr_skinFunction[' + elementIndex + ']') != null )
onSuccess: function (t ) {
{ $('tr_skinFunction[' + elementIndex + ']').remove();
var newRow = ipb.templates['hook_skinFunction'].evaluate({ index: elementIndex, dropdown: t.responseText }); }
if ( $('fileTable_' + elementIndex).down('tbody') ) if( $('tr_type[' + elementIndex + ']') != null )
{ {
$('fileTable_' + elementIndex).down('tbody').insert( newRow ); $('tr_type[' + elementIndex + ']').remove();
} }
else
{ if( $('tr_id[' + elementIndex + ']') != null )
$('fileTable_' + elementIndex).insert( newRow ); {
} $('tr_id[' + elementIndex + ']').remove();
}, }
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); } if( $('tr_position[' + elementIndex + ']') != null )
} ); {
} $('tr_position[' + elementIndex + ']').remove();
} }
function getTypeOfHook( elementIndex ) /* Got a type? */
{ if( type != '0' )
var template = $F('skinFunction[' + elementIndex + ']'); {
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getTemplatesForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&group=" + type;
if( $('tr_type[' + elementIndex + ']') != null ) url = url.replace( /&amp;/g, '&' );
{
$('tr_type[' + elementIndex + ']').remove(); new Ajax.Request( url,
} {
method: 'GET',
if( $('tr_id[' + elementIndex + ']') != null ) onSuccess: function (t )
{ {
$('tr_id[' + elementIndex + ']').remove(); var newRow = ipb.templates['hook_skinFunction'].evaluate({ index: elementIndex, dropdown: t.responseText });
}
if ( $('fileTable_' + elementIndex).down('tbody') )
if( $('tr_position[' + elementIndex + ']') != null ) {
{ $('fileTable_' + elementIndex).down('tbody').insert( newRow );
$('tr_position[' + elementIndex + ']').remove(); }
} else
{
/* Insert the new hook type row */ $('fileTable_' + elementIndex).insert( newRow );
if ( template != '0' ) }
{ },
var newRow = ipb.templates['hook_pointTypes'].evaluate({ index: elementIndex }); onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
if ( $('fileTable_' + elementIndex).down('tbody') ) } );
{ }
$('fileTable_' + elementIndex).down('tbody').insert( newRow ); }
}
else function getTypeOfHook( elementIndex )
{ {
$('fileTable_' + elementIndex).insert( newRow ); var template = $F('skinFunction[' + elementIndex + ']');
}
} if( $('tr_type[' + elementIndex + ']') != null )
} {
$('tr_type[' + elementIndex + ']').remove();
function getHookIds( elementIndex ) }
{
var template = $F('skinFunction[' + elementIndex + ']'); if( $('tr_id[' + elementIndex + ']') != null )
var type = $F('type[' + elementIndex + ']'); {
$('tr_id[' + elementIndex + ']').remove();
if( $('tr_id[' + elementIndex + ']') != null ) }
{
$('tr_id[' + elementIndex + ']').remove(); if( $('tr_position[' + elementIndex + ']') != null )
} {
$('tr_position[' + elementIndex + ']').remove();
if( $('tr_position[' + elementIndex + ']') != null ) }
{
$('tr_position[' + elementIndex + ']').remove(); /* Insert the new hook type row */
} if ( template != '0' )
{
/* Got a type? */ var newRow = ipb.templates['hook_pointTypes'].evaluate({ index: elementIndex });
if( type != '0' )
{ if ( $('fileTable_' + elementIndex).down('tbody') )
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getHookIds&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&type=" + type + "&template=" + template; {
url = url.replace( /&amp;/g, '&' ); $('fileTable_' + elementIndex).down('tbody').insert( newRow );
}
new Ajax.Request( url, else
{ {
method: 'GET', $('fileTable_' + elementIndex).insert( newRow );
onSuccess: function (t ) }
{ }
var newRow = ipb.templates['hook_pointIds'].evaluate({ index: elementIndex, dropdown: t.responseText }); }
if ( $('fileTable_' + elementIndex).down('tbody') ) function getHookIds( elementIndex )
{ {
$('fileTable_' + elementIndex).down('tbody').insert( newRow ); var template = $F('skinFunction[' + elementIndex + ']');
} var type = $F('type[' + elementIndex + ']');
else var group = $F('skinGroup[' + elementIndex + ']');
{
$('fileTable_' + elementIndex).insert( newRow ); if( $('tr_id[' + elementIndex + ']') != null )
} {
}, $('tr_id[' + elementIndex + ']').remove();
onException: function( f,e ){ alert( "Exception: " + e ); }, }
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); if( $('tr_position[' + elementIndex + ']') != null )
} {
} $('tr_position[' + elementIndex + ']').remove();
}
function getHookEntryPoints( elementIndex )
{ /* Got a type? */
var type = $F('type[' + elementIndex + ']'); if( type != '0' )
{
Debug.write( type ); url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getHookIds&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&type=" + type + "&template=" + template + "&group=" + group;
url = url.replace( /&amp;/g, '&' );
if( $('tr_position[' + elementIndex + ']') != null )
{ new Ajax.Request( url,
$('tr_position[' + elementIndex + ']').remove(); {
} method: 'GET',
onSuccess: function (t )
var options = ''; {
var newRow = ipb.templates['hook_pointIds'].evaluate({ index: elementIndex, dropdown: t.responseText });
if( type == 'foreach' )
{ if ( $('fileTable_' + elementIndex).down('tbody') )
options += "<option value='outer.pre'>(outer.pre) " + ipb.lang['a_outerpre'] + "</option>"; {
options += "<option value='inner.pre'>(inner.pre) " + ipb.lang['a_innerpre'] + "</option>"; $('fileTable_' + elementIndex).down('tbody').insert( newRow );
options += "<option value='inner.post'>(inner.post) " + ipb.lang['a_innerpost']+ "</option>"; }
options += "<option value='outer.post'>(outer.post) " + ipb.lang['a_outerpost']+ "</option>"; else
} {
else $('fileTable_' + elementIndex).insert( newRow );
{ }
options += "<option value='pre.startif'>(pre.startif) " + ipb.lang['a_prestartif'] + "</option>"; },
options += "<option value='post.startif'>(post.startif) " + ipb.lang['a_poststartif'] + "</option>"; onException: function( f,e ){ alert( "Exception: " + e ); },
options += "<option value='pre.else'>(pre.else) " + ipb.lang['a_preelse'] + "</option>"; onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
options += "<option value='post.else'>(post.else) " + ipb.lang['a_postelse'] + "</option>"; } );
options += "<option value='pre.endif'>(pre.endif) " + ipb.lang['a_preendif'] + "</option>"; }
options += "<option value='post.endif'>(post.endif) " + ipb.lang['a_postendif'] + "</option>"; }
}
/* Insert the new hook type row */ function getHookEntryPoints( elementIndex )
//if ( type != '0' ) {
//{ var type = $F('type[' + elementIndex + ']');
var newRow = ipb.templates['hook_pointLocation'].evaluate({ index: elementIndex, hookPoints: options });
Debug.write( type );
if ( $('fileTable_' + elementIndex).down('tbody') )
{ if( $('tr_position[' + elementIndex + ']') != null )
$('fileTable_' + elementIndex).down('tbody').insert( newRow ); {
} $('tr_position[' + elementIndex + ']').remove();
else }
{
$('fileTable_' + elementIndex).insert( newRow ); var options = '';
}
//} if( type == 'foreach' )
{
options += "<option value='outer.pre'>(outer.pre) " + ipb.lang['a_outerpre'] + "</option>";
options += "<option value='inner.pre'>(inner.pre) " + ipb.lang['a_innerpre'] + "</option>";
options += "<option value='inner.post'>(inner.post) " + ipb.lang['a_innerpost']+ "</option>";
options += "<option value='outer.post'>(outer.post) " + ipb.lang['a_outerpost']+ "</option>";
}
else
{
options += "<option value='pre.startif'>(pre.startif) " + ipb.lang['a_prestartif'] + "</option>";
options += "<option value='post.startif'>(post.startif) " + ipb.lang['a_poststartif'] + "</option>";
options += "<option value='pre.else'>(pre.else) " + ipb.lang['a_preelse'] + "</option>";
options += "<option value='post.else'>(post.else) " + ipb.lang['a_postelse'] + "</option>";
options += "<option value='pre.endif'>(pre.endif) " + ipb.lang['a_preendif'] + "</option>";
options += "<option value='post.endif'>(post.endif) " + ipb.lang['a_postendif'] + "</option>";
}
/* Insert the new hook type row */
//if ( type != '0' )
//{
var newRow = ipb.templates['hook_pointLocation'].evaluate({ index: elementIndex, hookPoints: options });
if ( $('fileTable_' + elementIndex).down('tbody') )
{
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
}
else
{
$('fileTable_' + elementIndex).insert( newRow );
}
//}
} }
@@ -217,14 +217,14 @@ function IPBTemplateDiff()
*/ */
this.timeOutAjax = function( t ) this.timeOutAjax = function( t )
{ {
if ( confirm( "Нет ответа от сервера.\nХотите подождать?" ) ) if ( confirm( "No response from the webserver.\nDo you wish to continue waiting?" ) )
{ {
return true; return true;
} }
else else
{ {
t.transport.abort(); t.transport.abort();
alert( "Запрос отменен" ); alert( "Request Cancelled" );
} }
}; };
@@ -233,7 +233,7 @@ function IPBTemplateDiff()
*/ */
this.failureAjax = function( t ) this.failureAjax = function( t )
{ {
alert( "Ошибка: " + t.responseText ); alert( "Failure: " + t.responseText );
}; };
/** /**
@@ -241,7 +241,7 @@ function IPBTemplateDiff()
*/ */
this.exceptionAjax = function( t ) this.exceptionAjax = function( t )
{ {
alert( "Исключение: " + t.responseText ); alert( "Exception: " + t.responseText );
}; };
/** /**
@@ -255,7 +255,7 @@ function IPBTemplateDiff()
/* Not a JSON response? */ /* Not a JSON response? */
if ( ! t.responseText.match( /^(\s+?)?\{/ ) ) if ( ! t.responseText.match( /^(\s+?)?\{/ ) )
{ {
alert( "Ошибка:\n" + t.responseText ); alert( "Error:\n" + t.responseText );
Debug.write( t ); Debug.write( t );
return; return;
} }
@@ -265,7 +265,7 @@ function IPBTemplateDiff()
if ( json['error'] ) if ( json['error'] )
{ {
alert( "Ошибка: " . json['error'] ); alert( "An error occurred: " . json['error'] );
return false; return false;
} }
@@ -102,11 +102,11 @@ function IPBTemplateSandR()
} }
else else
{ {
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText ); alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
} }
}, },
onException: function( f,e ){ alert( "Исключение: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
}; };
@@ -161,22 +161,22 @@ function IPBTemplateSandR()
if ( json['errors'] ) if ( json['errors'] )
{ {
/* Something inline would be very nice here.. rather than this ugly alert */ /* Something inline would be very nice here.. rather than this ugly alert */
alert("Ошибка: " + json['errors'] ); alert("Message: " + json['errors'] );
} }
else else
{ {
$('replaceButton').disabled = false; $('replaceButton').disabled = false;
$('replaceButton').value = "Заменить выбранные"; $('replaceButton').value = "Replace Selected";
} }
} }
} }
else else
{ {
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText ); alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
} }
}, },
onException: function( f,e ){ alert( "Исключение: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
}; };
@@ -218,7 +218,7 @@ function IPBTemplateSandR()
if ( json['errors'] ) if ( json['errors'] )
{ {
/* Something inline would be very nice here.. rather than this ugly alert */ /* Something inline would be very nice here.. rather than this ugly alert */
alert("Ошибка: " + json['errors'] ); alert("Message: " + json['errors'] );
} }
else else
{ {
@@ -228,11 +228,11 @@ function IPBTemplateSandR()
} }
else else
{ {
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText ); alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
} }
}, },
//onException: function( f,e ){ alert( "Исключение: " + e ) }, //onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
}; };
@@ -303,7 +303,7 @@ function IPBTemplateSandR()
for( i = 0 ; i < json['templates'].length; i++ ) for( i = 0 ; i < json['templates'].length; i++ )
{ {
_output += _tplate.evaluate( json['templates'][i] ); _output += _tplate.evaluate( json['templates'][i] );
}; }
/* Clear out any current listing */ /* Clear out any current listing */
$$( '#groupRowTemplates_' + groupName + " table.ipsTable" ).each( function(elem) { $$( '#groupRowTemplates_' + groupName + " table.ipsTable" ).each( function(elem) {
@@ -328,7 +328,7 @@ function IPBTemplateSandR()
/* Checked, please? */ /* Checked, please? */
IPB3TemplatesSandR.toggleGroupBox( json['templates'][i]['template_group'] ); IPB3TemplatesSandR.toggleGroupBox( json['templates'][i]['template_group'] );
} }
}; }
}; };
/** /**
@@ -103,11 +103,11 @@ function IPBTemplates()
} }
else else
{ {
alert( "Ошибка: " + t.responseText ); alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
} }
}, },
onException: function( f,e ){ alert( "Исключение: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
}; };
@@ -169,11 +169,11 @@ function IPBTemplates()
} }
else else
{ {
alert( "Ошибка: " + t.responseText ); alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
} }
}, },
onException: function( f,e ){ alert( "Исключение: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
}; };
@@ -222,21 +222,21 @@ function IPBTemplates()
if ( json['errors'] ) if ( json['errors'] )
{ {
/* Something inline would be very nice here.. rather than this ugly alert */ /* Something inline would be very nice here.. rather than this ugly alert */
alert("Ошибка: " + json['errors'] ); alert("Error:: " + json['errors'] );
} }
else else
{ {
alert("Сохранено!"); alert("Error:: Saved!");
} }
} }
} }
else else
{ {
alert( "Ошибка: " + t.responseText ); alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
} }
}, },
onException: function( f,e ){ alert( "Исключение: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
}; };
@@ -248,14 +248,14 @@ function IPBTemplates()
/* Make sure we're mean it... */ /* Make sure we're mean it... */
if ( $('tplate_templaterow_' + template_id ).hasClassName( 'tplateRow_new') ) if ( $('tplate_templaterow_' + template_id ).hasClassName( 'tplateRow_new') )
{ {
if ( ! confirm( "Удалить шаблон?\n Произойдет удаление шаблона из ВСЕХ стилей!" ) ) if ( ! confirm( "REMOVE template bit?\n This will remove this template bit in ALL skins!" ) )
{ {
return false; return false;
} }
} }
else else
{ {
if ( ! confirm( "Откатить изменения?\n Все изменения БУДУТ УТРАЧЕНЫ!" ) ) if ( ! confirm( "Revert template bit?\n All changes WILL be lost!" ) )
{ {
return false; return false;
} }
@@ -295,17 +295,17 @@ function IPBTemplates()
if ( json['errors'] ) if ( json['errors'] )
{ {
/* Something inline would be very nice here.. rather than this ugly alert */ /* Something inline would be very nice here.. rather than this ugly alert */
alert("Ошибка: " + json['errors'] ); alert("Error:: " + json['errors'] );
} }
} }
} }
else else
{ {
alert( "Ошибка: " + t.responseText ); alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
} }
}, },
onException: function( f,e ){ alert( "Исключение: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
}; };
@@ -338,11 +338,11 @@ function IPBTemplates()
} }
else else
{ {
alert( "Ошибка: " + t.responseText ); alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
} }
}, },
onException: function( f,e ){ alert( "Исключение: " + e ); }, onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} ); } );
}; };
@@ -499,7 +499,7 @@ function IPBTemplates()
} }
_output += _tplate.evaluate( json['templates'][i] ); _output += _tplate.evaluate( json['templates'][i] );
}; }
/* Write it out */ /* Write it out */
$('tplate_bitList').update( _output ); $('tplate_bitList').update( _output );
@@ -124,11 +124,11 @@ function IPBUAgents()
if ( json['errors'] ) if ( json['errors'] )
{ {
/* Something inline would be very nice here.. rather than this ugly alert */ /* Something inline would be very nice here.. rather than this ugly alert */
alert("Ошибка: " + json['errors'] ); alert("Error:: " + json['errors'] );
} }
else else
{ {
alert("Сохранено!"); alert("Error:: Saved!");
} }
} }
} }
@@ -179,7 +179,7 @@ function IPBUAgents()
if ( json['errors'] ) if ( json['errors'] )
{ {
/* Something inline would be very nice here.. rather than this ugly alert */ /* Something inline would be very nice here.. rather than this ugly alert */
alert("Ошибка: " + json['errors'] ); alert("Error:: " + json['errors'] );
} }
} }
} }
@@ -249,7 +249,7 @@ function IPBUAgents()
{ {
_box.selectedIndex = i; _box.selectedIndex = i;
} }
}; }
ipb.positionCenter( 'tplate_editor_' + uagent_id ); ipb.positionCenter( 'tplate_editor_' + uagent_id );
}; };
@@ -1,226 +1,246 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Template comparison * Template comparison
* Last Updated: $Date: 2011-07-12 10:53:25 -0400 (Tue, 12 Jul 2011) $ * Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: bfarber $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33 * @since Friday 19th May 2006 17:33
* @version $Revision: 9208 $ * @version $Revision: 10914 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class admin_core_ajax_compare extends ipsAjaxCommand class admin_core_ajax_compare extends ipsAjaxCommand
{ {
/** /**
* Skin functions object handle * Skin functions object handle
* *
* @var object * @var object
*/ */
protected $skinFunctions; protected $skinFunctions;
/** /**
* HTML Skin object * HTML Skin object
* *
* @var object * @var object
*/ */
protected $html; protected $html;
/** /**
* Main executable * Main executable
* *
* @param object registry object * @param object registry object
* @return @e void * @return @e void
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
//----------------------------------------- //-----------------------------------------
// Load functions and cache classes // Load functions and cache classes
//----------------------------------------- //-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ 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/skinCaching.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/ require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/
$this->skinFunctions = new skinDifferences( $registry ); $this->skinFunctions = new skinDifferences( $registry );
//----------------------------------------- //-----------------------------------------
// Load lang // Load lang
//----------------------------------------- //-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//----------------------------------------- //-----------------------------------------
// Load skin // Load skin
//----------------------------------------- //-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_templates'); $this->html = $this->registry->output->loadTemplate('cp_skin_templates');
//----------------------------------------- //-----------------------------------------
// What shall we do? // What shall we do?
//----------------------------------------- //-----------------------------------------
switch( $this->request['do'] ) switch( $this->request['do'] )
{ {
case 'css': case 'css':
$this->_getCssDifferences(); $this->_getCssDifferences();
break; break;
default: default:
case 'differences': case 'differences':
$this->_getDifferences(); $this->_getDifferences();
break; break;
} }
} }
/** /**
* Get differences of a CSS file * Get differences of a CSS file
* *
* @return @e void * @return @e void
*/ */
protected function _getCssDifferences() protected function _getCssDifferences()
{ {
//----------------------------------------- //-----------------------------------------
// Init // Init
//----------------------------------------- //-----------------------------------------
$setID = intval($this->request['setID']); $setID = intval($this->request['setID']);
$fileID = intval($this->request['file_id']); $fileID = intval($this->request['file_id']);
//----------------------------------------- //-----------------------------------------
// Get requested // Get requested
//----------------------------------------- //-----------------------------------------
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => 'css_id=' . $fileID ) ); $current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => 'css_id=' . $fileID ) );
if( $current['css_id'] ) if( $current['css_id'] )
{ {
//----------------------------------------- //-----------------------------------------
// Get the original // Get the original
//----------------------------------------- //-----------------------------------------
$set = $this->DB->buildAndFetch( array( 'select' => 'set_master_key', 'from' => 'skin_collections', 'where' => 'set_id=' . $current['css_set_id'] ) ); $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'; $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']}'" ) ); $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 else
{ {
$original['css_content'] = $current['css_content']; $original['css_content'] = $current['css_content'];
} }
//----------------------------------------- //-----------------------------------------
// Get Diff library // Get Diff library
//----------------------------------------- //-----------------------------------------
require_once( IPS_KERNEL_PATH . 'classDifference.php' );/*noLibHook*/ require_once( IPS_KERNEL_PATH . 'classDifference.php' );/*noLibHook*/
$classDifference = new classDifference(); $classDifference = new classDifference();
$classDifference->method = 'PHP'; $classDifference->method = 'PHP';
$difference = $classDifference->getDifferences( $original['css_content'], $current['css_content'] );
$difference = $classDifference->getDifferences( $original['css_content'], $current['css_content'] );
if( $classDifference->diff_found )
if( $classDifference->diff_found ) {
{ $difference = str_replace( "\n", "<br>", $difference );
$difference = str_replace( "\n", "<br>", $difference ); $difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference );
$difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference ); $difference = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", "&nbsp;" ,$difference );
$difference = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", "&nbsp;" ,$difference ); $difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference );
$difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference ); }
} else
else {
{ $difference = htmlspecialchars($current['css_content']);
$difference = htmlspecialchars($current['css_content']); $difference = str_replace( ' ', '&nbsp;', $difference );
$difference = str_replace( ' ', '&nbsp;', $difference ); $difference = str_replace( "\r", '<br />', $difference );
$difference = str_replace( "\r", '<br />', $difference ); $difference = str_replace( "\n", '<br />', $difference );
$difference = str_replace( "\n", '<br />', $difference ); $difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference );
$difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference ); $difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference );
$difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference ); }
}
$this->returnHtml( $this->html->differenceResult( $difference ) );
$this->returnHtml( $this->html->differenceResult( $difference ) ); }
}
/**
/** * Get differences of a template
* Get differences of a template *
* * @return @e void
* @return @e void */
*/ protected function _getDifferences()
protected function _getDifferences() {
{ //-----------------------------------------
//----------------------------------------- // Init
// Init //-----------------------------------------
//-----------------------------------------
$setID = intval($this->request['setID']);
$setID = intval($this->request['setID']); $templateID = intval($this->request['template_id']);
$templateID = intval($this->request['template_id']);
//-----------------------------------------
//----------------------------------------- // Get requested
// Get requested //-----------------------------------------
//-----------------------------------------
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => 'template_id=' . $templateID ) );
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => 'template_id=' . $templateID ) );
if( $current['template_set_id'] )
if( $current['template_set_id'] ) {
{ //-----------------------------------------
//----------------------------------------- // Get the original
// Get the original //-----------------------------------------
//-----------------------------------------
$set = $this->DB->buildAndFetch( array( 'select' => 'set_master_key', 'from' => 'skin_collections', 'where' => 'set_id=' . $current['template_set_id'] ) );
$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';
$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']}'" ) );
$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
else {
{ $original['template_content'] = $current['template_content'];
$original['template_content'] = $current['template_content']; }
}
//-----------------------------------------
//----------------------------------------- // Get Diff library
// Get Diff library //-----------------------------------------
//-----------------------------------------
require_once( IPS_KERNEL_PATH . 'classDifference.php' );/*noLibHook*/
require_once( IPS_KERNEL_PATH . 'classDifference.php' );/*noLibHook*/ $classDifference = new classDifference();
$classDifference = new classDifference(); $classDifference->method = 'PHP';
$classDifference->method = 'PHP';
$difference = $classDifference->getDifferences( $original['template_content'], $current['template_content'], 'unified' );
$difference = $classDifference->getDifferences( $original['template_content'], $current['template_content'] );
if ( 1 == 1 )
if( $classDifference->diff_found ) {
{ $difference = str_replace( array( "\r\n", "\r" ), "\n", $difference );
$difference = str_replace( "\n", "<br>", $difference );
$difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference ); $difference = preg_replace( '#(^|\n)(\-|\+)([^\n]+?)\n#', "\n\\1\\2\\3\n\n", $difference );
$difference = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", "&nbsp;" ,$difference );
$difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference ); $difference = htmlspecialchars( $difference );
} $difference = preg_replace( '#^@@([^@]+?)@@#m', '', $difference );
else $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 = htmlspecialchars($current['template_content']);
$difference = str_replace( ' ', '&nbsp;', $difference ); $difference = str_replace( "</ins>\n\n", "</ins>\n", $difference );
$difference = str_replace( "\r", '<br />', $difference ); $difference = str_replace( "</del>\n", '</del>', $difference );
$difference = str_replace( "\n", '<br />', $difference ); $difference = str_replace( "\n\n<ins>", "\n<ins>", $difference );
$difference = str_replace( "&gt;&lt;", "&gt;\n&lt;" ,$difference ); $difference = str_replace( "\n\n<del>", "\n<del>", $difference );
$difference = str_replace( "\t", "&nbsp; &nbsp; ", $difference );
} $difference = '<pre>' . $difference . '</pre>';
}
$this->returnHtml( $this->html->differenceResult( $difference ) ); 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 <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* AJAX Functions For applications/core/js/ipb3CSS.js file * 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> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33 * @since Friday 19th May 2006 17:33
* @version $Revision: 8644 $ * @version $Revision: 10914 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class admin_core_ajax_css extends ipsAjaxCommand class admin_core_ajax_css extends ipsAjaxCommand
{ {
/** /**
* Skin functions object handle * Skin functions object handle
* *
* @var object * @var object
*/ */
protected $skinFunctions; protected $skinFunctions;
/** /**
* Main executable * Main executable
* *
* @param object registry object * @param object registry object
* @return @e void * @return @e void
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//----------------------------------------- //-----------------------------------------
// Load functions and cache classes // Load functions and cache classes
//----------------------------------------- //-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ 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/skinCaching.php' );/*noLibHook*/
$this->skinFunctions = new skinCaching( $registry ); $this->skinFunctions = new skinCaching( $registry );
/* Check... */ /* Check... */
if ( ! $registry->getClass('class_permissions')->checkPermission( 'css_manage', ipsRegistry::$current_application, 'templates' ) ) if ( ! $registry->getClass('class_permissions')->checkPermission( 'css_manage', ipsRegistry::$current_application, 'templates' ) )
{ {
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
exit(); exit();
} }
//----------------------------------------- //-----------------------------------------
// What shall we do? // What shall we do?
//----------------------------------------- //-----------------------------------------
switch( $this->request['do'] ) switch( $this->request['do'] )
{ {
case 'getCSSGroups': case 'getCSSGroups':
$this->_getCSSGroups(); $this->_getCSSGroups();
break; break;
case 'getCSSForEdit': case 'getCSSForEdit':
$this->_getCSSForEdit(); $this->_getCSSForEdit();
break; break;
case 'saveCSS': case 'saveCSS':
$this->_saveCSS(); $this->_saveCSS();
break; break;
case 'revertCSS': case 'revertCSS':
/* Check... */ /* Check... */
if ( !$registry->getClass('class_permissions')->checkPermission( 'css_delete', ipsRegistry::$current_application, 'templates' ) ) if ( !$registry->getClass('class_permissions')->checkPermission( 'css_delete', ipsRegistry::$current_application, 'templates' ) )
{ {
$this->returnJsonError( $registry->lang->words['sk_ajax_noperm'] ); $this->returnJsonError( $registry->lang->words['sk_ajax_noperm'] );
exit(); exit();
} }
$this->_revertCSS(); $this->_revertCSS();
break; break;
} }
} }
/** /**
* Reverts CSS * Reverts CSS
* *
* @return string Json * @return string Json
*/ */
protected function _revertCSS() protected function _revertCSS()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$setID = intval( $this->request['setID'] ); $setID = intval( $this->request['setID'] );
$cssID = intval( $this->request['css_id'] ); $cssID = intval( $this->request['css_id'] );
$fromDelete = intval( $this->request['fromDelete'] ); $fromDelete = intval( $this->request['fromDelete'] );
//----------------------------------------- //-----------------------------------------
// Checks... // Checks...
//----------------------------------------- //-----------------------------------------
if ( ! $setID OR ! $cssID ) if ( ! $setID OR ! $cssID )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit(); exit();
} }
//----------------------------------------- //-----------------------------------------
// Get template data // Get template data
//----------------------------------------- //-----------------------------------------
$css = $this->skinFunctions->revertCSS( $cssID, $setID, $fromDelete ); $css = $this->skinFunctions->revertCSS( $cssID, $setID, $fromDelete );
$this->returnJsonArray( array( 'cssData' => $css, 'errors' => $this->skinFunctions->fetchErrorMessages() ) ); $this->returnJsonArray( array( 'cssData' => $css, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
} }
/** /**
* Saves the CSS * Saves the CSS
* *
* @return string Json * @return string Json
*/ */
protected function _saveCSS() protected function _saveCSS()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$setID = intval( $this->request['setID'] ); $setID = intval( $this->request['setID'] );
$cssID = intval( $this->request['css_id'] ); $cssID = intval( $this->request['css_id'] );
$type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit'; $type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit';
$css_content = $_POST['css_content']; $css_content = $_POST['css_content'];
$css_group = IPSText::alphanumericalClean( $_POST['_css_group'] ); $css_group = IPSText::alphanumericalClean( $_POST['_css_group'] );
$css_position = intval( $this->request['css_position'] ); $css_position = intval( $this->request['css_position'] );
$css_attributes = $_POST['css_attributes']; $css_attributes = $_POST['css_attributes'];
$css_app = IPSText::alphanumericalClean( $_POST['css_app'] ); $css_app = IPSText::alphanumericalClean( $_POST['css_app'] );
$css_app_hide = intval( $this->request['css_app_hide'] ); $css_app_hide = intval( $this->request['css_app_hide'] );
$css_modules = trim( $this->request['css_modules'] ); $css_modules = trim( $this->request['css_modules'] );
//----------------------------------------- //-----------------------------------------
// Checks... // Checks...
//----------------------------------------- //-----------------------------------------
if ( ! $setID OR ( $type == 'edit' AND ! $cssID ) ) if ( ! $setID OR ( $type == 'edit' AND ! $cssID ) )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit(); exit();
} }
//----------------------------------------- //-----------------------------------------
// Add checks // Add checks
//----------------------------------------- //-----------------------------------------
if ( $type == 'add' ) if ( $type == 'add' )
{ {
if ( ! $css_group ) if ( ! $css_group )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit(); exit();
} }
} }
//----------------------------------------- //-----------------------------------------
// Save it // Save it
//----------------------------------------- //-----------------------------------------
if ( $type == 'edit' ) 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 ); $css_id = $this->skinFunctions->saveCSSFromEdit( $cssID, $setID, $css_content, $css_group, $css_position, $css_attributes, $css_app, $css_app_hide, $css_modules );
} }
else else
{ {
try 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 ); $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 ) catch( Exception $err )
{ {
$this->returnJsonError( $err->getMessage() ); $this->returnJsonError( $err->getMessage() );
exit(); exit();
} }
} }
//----------------------------------------- //-----------------------------------------
// Get Data // Get Data
//----------------------------------------- //-----------------------------------------
$css = $this->skinFunctions->fetchCSSForEdit( $css_id, $setID ); $css = $this->skinFunctions->fetchCSSForEdit( $css_id, $setID );
$this->returnJsonArray( array( 'cssData' => $css, 'errors' => $this->skinFunctions->fetchErrorMessages() ) ); $this->returnJsonArray( array( 'cssData' => $css, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
} }
/** /**
* Fetch a JSON list of template data ready for editing * Fetch a JSON list of template data ready for editing
* *
* @return string Json * @return string Json
*/ */
protected function _getCSSForEdit() protected function _getCSSForEdit()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$setID = intval( $this->request['setID'] ); $setID = intval( $this->request['setID'] );
$cssID = intval( $this->request['css_id'] ); $cssID = intval( $this->request['css_id'] );
//----------------------------------------- //-----------------------------------------
// Checks... // Checks...
//----------------------------------------- //-----------------------------------------
if ( ! $setID OR ! $cssID ) if ( ! $setID OR ! $cssID )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit(); exit();
} }
//----------------------------------------- //-----------------------------------------
// Get template data // Get template data
//----------------------------------------- //-----------------------------------------
$css = $this->skinFunctions->fetchCSSForEdit( $cssID, $setID ); $css = $this->skinFunctions->fetchCSSForEdit( $cssID, $setID );
$this->returnJsonArray( array( 'cssData' => $css ) ); $this->returnJsonArray( array( 'cssData' => $css ) );
} }
/** /**
* Fetch a JSON list of CSS group names * Fetch a JSON list of CSS group names
* *
* @return string Json * @return string Json
*/ */
protected function _getCSSGroups() protected function _getCSSGroups()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$setID = intval( $this->request['setID'] ); $setID = intval( $this->request['setID'] );
//----------------------------------------- //-----------------------------------------
// Checks... // Checks...
//----------------------------------------- //-----------------------------------------
if ( ! $setID ) if ( ! $setID )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
exit(); exit();
} }
//----------------------------------------- //-----------------------------------------
// Get CSS // Get CSS
//----------------------------------------- //-----------------------------------------
$_css = $this->skinFunctions->fetchCSS( $setID ); $_css = $this->skinFunctions->fetchCSS( $setID );
//----------------------------------------- //-----------------------------------------
// Fix up positioning // Fix up positioning
//----------------------------------------- //-----------------------------------------
foreach( $_css as $_id => $_data ) foreach( $_css as $_id => $_data )
{ {
unset( $_data['css_content'] ); unset( $_data['css_content'] );
$css[ $_data['css_position'] . '.' . $_data['css_id'] ] = $_data; $css[ $_data['css_position'] . '.' . $_data['css_id'] ] = $_data;
} }
ksort( $css, SORT_NUMERIC ); ksort( $css, SORT_NUMERIC );
$this->returnJsonArray( array( 'css' => $css ) ); $this->returnJsonArray( array( 'css' => $css ) );
} }
} }
@@ -1,114 +1,115 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Login handler abstraction : AJAX Find Names functions * Login handler abstraction : AJAX Find Names functions
* 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> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52) * @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 8644 $ * @version $Revision: 10914 $
* @see public_core_ajax_findnames * @see public_core_ajax_findnames
* *
*/ */
if ( ! defined( 'IN_ACP' ) ) 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."; 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(); exit();
} }
class admin_core_ajax_findnames extends ipsAjaxCommand class admin_core_ajax_findnames extends ipsAjaxCommand
{ {
/** /**
* Class entry point * Class entry point
* *
* @param object Registry reference * @param object Registry reference
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
switch( $this->request['do'] ) switch( $this->request['do'] )
{ {
case 'get-member-names': case 'get-member-names':
$this->_getMemberNames(); $this->_getMemberNames();
break; break;
} }
} }
/** /**
* Returns possible matches for the string input * Returns possible matches for the string input
* *
* @return @e void Outputs to screen * @return @e void Outputs to screen
*/ */
protected function _getMemberNames() protected function _getMemberNames()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$name = IPSText::convertUnicode( $this->convertAndMakeSafe( ipsRegistry::$request['name'], 0 ) ); $name = IPSText::convertUnicode( $this->convertAndMakeSafe( $this->request['name'], 0 ), true );
$name = IPSText::convertCharsets( $name, 'utf-8', IPS_DOC_CHAR_SET );
//-----------------------------------------
// Check length //-----------------------------------------
//----------------------------------------- // Check length
//-----------------------------------------
if ( IPSText::mbstrlen( $name ) < 3 )
{ if ( IPSText::mbstrlen( $name ) < 3 )
$this->returnJsonError( 'requestTooShort' ); {
} $this->returnJsonError( 'requestTooShort' );
}
//-----------------------------------------
// Try query... //-----------------------------------------
//----------------------------------------- // Try query...
//-----------------------------------------
$this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id',
'from' => array( 'members' => 'm' ), $this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id',
'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( mb_strtolower( $name ) ) . "%'", 'from' => array( 'members' => 'm' ),
'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC', 'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( strtolower( $name ) ) . "%'",
'limit' => array( 0, 15 ), 'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC',
'add_join' => array( array( 'select' => 'p.*', 'limit' => array( 0, 15 ),
'from' => array( 'profile_portal' => 'p' ), 'add_join' => array( array( 'select' => 'p.*',
'where' => 'p.pp_member_id=m.member_id', 'from' => array( 'profile_portal' => 'p' ),
'type' => 'left' ) ) ) ); 'where' => 'p.pp_member_id=m.member_id',
$this->DB->execute(); 'type' => 'left' ) ) ) );
$this->DB->execute();
//-----------------------------------------
// Got any results? //-----------------------------------------
//----------------------------------------- // Got any results?
//-----------------------------------------
if ( ! $this->DB->getTotalRows() )
{ if ( ! $this->DB->getTotalRows() )
$this->returnJsonArray( array( ) ); {
} $this->returnJsonArray( array( ) );
}
$return = array();
$return = array();
while( $r = $this->DB->fetch() )
{ while( $r = $this->DB->fetch() )
if( !$r['members_display_name'] ) {
{ if( !$r['members_display_name'] )
continue; {
} continue;
}
$photo = IPSMember::buildProfilePhoto( $r );
$group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] ); $photo = IPSMember::buildProfilePhoto( $r );
$return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'], $group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] );
'showas'=> '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')', $return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'],
'img' => $photo['pp_mini_photo'], 'showas'=> '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')',
'img_w' => $photo['pp_mini_width'], 'img' => $photo['pp_mini_photo'],
'img_h' => $photo['pp_mini_height'] 'img_w' => $photo['pp_mini_width'],
); 'img_h' => $photo['pp_mini_height']
} );
}
$this->returnJsonArray( $return );
} $this->returnJsonArray( $return );
}
} }
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
File diff suppressed because it is too large. Load diff
@@ -3,21 +3,21 @@
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* AJAX Functions For applications/core/js/ipb3CSS.js file * 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> * </pre>
* *
* Author: Matt Mecham * Author: Matt Mecham
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33 * @since Friday 19th May 2006 17:33
* @version $Revision: 8644 $ * @version $Revision: 10914 $
*/ */
@@ -1,84 +1,84 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* AJAX Functions For applications/core/js/ipb3CSS.js file * AJAX Functions For applications/core/js/ipb3CSS.js file
* Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $ * Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
* </pre> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33 * @since Friday 19th May 2006 17:33
* @version $Revision: 8644 $ * @version $Revision: 8644 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class admin_core_ajax_skinsets extends ipsAjaxCommand class admin_core_ajax_skinsets extends ipsAjaxCommand
{ {
/** /**
* Skin functions object handle * Skin functions object handle
* *
* @var object * @var object
*/ */
protected $skinFunctions; protected $skinFunctions;
/** /**
* Main executable * Main executable
* *
* @param object registry object * @param object registry object
* @return @e void * @return @e void
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
$this->html = $this->registry->output->loadTemplate('cp_skin_templates'); $this->html = $this->registry->output->loadTemplate('cp_skin_templates');
$this->form_code = $this->html->form_code = 'module=templates&amp;section=skinsets'; $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'; $this->form_code_js = $this->html->form_code_js = 'module=templates&section=skinsets';
//----------------------------------------- //-----------------------------------------
// Load functions and cache classes // Load functions and cache classes
//----------------------------------------- //-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ 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/skinCaching.php' );/*noLibHook*/
$this->skinFunctions = new skinCaching( $registry ); $this->skinFunctions = new skinCaching( $registry );
//----------------------------------------- //-----------------------------------------
// What shall we do? // What shall we do?
//----------------------------------------- //-----------------------------------------
switch( $this->request['do'] ) switch( $this->request['do'] )
{ {
default: default:
case 'showAddDialogue': case 'showAddDialogue':
$this->_showAddDialogue(); $this->_showAddDialogue();
break; break;
} }
} }
/** /**
* Displays the add dialogue * Displays the add dialogue
* *
* @return string Json * @return string Json
*/ */
protected function _showAddDialogue() protected function _showAddDialogue()
{ {
$this->returnHtml( $this->html->newSkinSetPopUp( IPSLib::hasActiveLicense( false ) ) ); $this->returnHtml( $this->html->newSkinSetPopUp( IPSLib::hasActiveLicense( false ) ) );
} }
} }
@@ -3,11 +3,11 @@
* @file tabs.php AJAX storage of tab order preference * @file tabs.php AJAX storage of tab order preference
*~TERABYTE_DOC_READY~ *~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED! * $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $ * $Author: bfarber $
* @since 8th Feb 2011 * @since 8th Feb 2011
* $LastChangedDate: 2011-03-10 16:00:38 -0500 (Thu, 10 Mar 2011) $ * $LastChangedDate: 2011-03-10 16:00:38 -0500 (Thu, 10 Mar 2011) $
* @version v3.2.3 * @version v3.3.4
* $Revision: 8021 $ * $Revision: 8021 $
*/ */
File diff suppressed because it is too large. Load diff
@@ -1,319 +1,319 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* AJAX Functions For applications/core/js/ipb3Templates.js file * AJAX Functions For applications/core/js/ipb3Templates.js file
* Last Updated: $Date: 2011-07-12 17:54:40 -0400 (Tue, 12 Jul 2011) $ * Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* Author: Matt Mecham * Author: Matt Mecham
* *
* @author $Author: bfarber $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33 * @since Friday 19th May 2006 17:33
* @version $Revision: 9218 $ * @version $Revision: 10914 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class admin_core_ajax_templates extends ipsAjaxCommand class admin_core_ajax_templates extends ipsAjaxCommand
{ {
/** /**
* Skin functions object handle * Skin functions object handle
* *
* @var object * @var object
*/ */
protected $skinFunctions; protected $skinFunctions;
/** /**
* Main executable * Main executable
* *
* @param object registry object * @param object registry object
* @return @e void * @return @e void
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//----------------------------------------- //-----------------------------------------
// Load functions and cache classes // Load functions and cache classes
//----------------------------------------- //-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ 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/skinCaching.php' );/*noLibHook*/
$this->skinFunctions = new skinCaching( $registry ); $this->skinFunctions = new skinCaching( $registry );
/* Check... */ /* Check... */
if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_manage', ipsRegistry::$current_application, 'templates' ) ) if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_manage', ipsRegistry::$current_application, 'templates' ) )
{ {
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
} }
//----------------------------------------- //-----------------------------------------
// What shall we do? // What shall we do?
//----------------------------------------- //-----------------------------------------
switch( $this->request['do'] ) switch( $this->request['do'] )
{ {
case 'getTemplateBitList': case 'getTemplateBitList':
$this->_getTemplateBitList(); $this->_getTemplateBitList();
break; break;
case 'getTemplateGroupList': case 'getTemplateGroupList':
$this->_getTemplateGroupList(); $this->_getTemplateGroupList();
break; break;
case 'getTemplateForEdit': case 'getTemplateForEdit':
$this->_getTemplateForEdit(); $this->_getTemplateForEdit();
break; break;
case 'saveTemplateBit': case 'saveTemplateBit':
$this->_saveTemplateBit(); $this->_saveTemplateBit();
break; break;
case 'revertTemplateBit': case 'revertTemplateBit':
/* Check... */ /* Check... */
if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_delete', ipsRegistry::$current_application, 'templates' ) ) if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_delete', ipsRegistry::$current_application, 'templates' ) )
{ {
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
exit(); exit();
} }
$this->_revertTemplateBit(); $this->_revertTemplateBit();
break; break;
} }
} }
/** /**
* Reverts a template bit * Reverts a template bit
* *
* @return @e void * @return @e void
*/ */
protected function _revertTemplateBit() protected function _revertTemplateBit()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$setID = intval( $this->request['setID'] ); $setID = intval( $this->request['setID'] );
$templateID = intval( $this->request['template_id'] ); $templateID = intval( $this->request['template_id'] );
//----------------------------------------- //-----------------------------------------
// Checks... // Checks...
//----------------------------------------- //-----------------------------------------
if ( ! $setID OR ! $templateID ) if ( ! $setID OR ! $templateID )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
} }
//----------------------------------------- //-----------------------------------------
// Get template data // Get template data
//----------------------------------------- //-----------------------------------------
$template = $this->skinFunctions->revertTemplateBit( $templateID, $setID ); $template = $this->skinFunctions->revertTemplateBit( $templateID, $setID );
$this->returnJsonArray( array( 'templateData' => $template, 'errors' => $this->skinFunctions->fetchErrorMessages() ) ); $this->returnJsonArray( array( 'templateData' => $template, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
} }
/** /**
* Saves the template bit * Saves the template bit
* *
* @return @e void * @return @e void
*/ */
protected function _saveTemplateBit() protected function _saveTemplateBit()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$test = $_POST['_template_name']; $test = $_POST['_template_name'];
$setID = intval( $this->request['template_set'] ); $setID = intval( $this->request['template_set'] );
$templateID = intval( $this->request['template_id'] ); $templateID = intval( $this->request['template_id'] );
$type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit'; $type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit';
$template_content = $_POST['template_content']; $template_content = $_POST['template_content'];
$template_group = IPSText::alphanumericalClean( $_POST['template_group'] ); $template_group = IPSText::alphanumericalClean( $_POST['template_group'] );
$ent_template_group = str_replace( "skin_", "", IPSText::alphanumericalClean( $_POST['_template_group'] ) ); $ent_template_group = str_replace( "skin_", "", IPSText::alphanumericalClean( $_POST['_template_group'] ) );
$template_name = IPSText::alphanumericalClean( $_POST['_template_name'] ); $template_name = IPSText::alphanumericalClean( $_POST['_template_name'] );
$template_data = $_POST['template_data']; $template_data = $_POST['template_data'];
IPSDebug::fireBug( 'info', array( 'Template content: ' . $template_content ) ); IPSDebug::fireBug( 'info', array( 'Template content: ' . $template_content ) );
//----------------------------------------- //-----------------------------------------
// Checks... // Checks...
//----------------------------------------- //-----------------------------------------
if ( ! $setID OR ( $type == 'edit' AND ! $templateID ) ) if ( ! $setID OR ( $type == 'edit' AND ! $templateID ) )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
} }
//----------------------------------------- //-----------------------------------------
// Add checks // Add checks
//----------------------------------------- //-----------------------------------------
if ( $type == 'add' ) if ( $type == 'add' )
{ {
if ( ! $template_name ) if ( ! $template_name )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
} }
} }
//----------------------------------------- //-----------------------------------------
// Save it // Save it
//----------------------------------------- //-----------------------------------------
if ( $type == 'edit' ) if ( $type == 'edit' )
{ {
try try
{ {
$template_id = $this->skinFunctions->saveTemplateBitFromEdit( $templateID, $setID, $template_content, $template_data ); $template_id = $this->skinFunctions->saveTemplateBitFromEdit( $templateID, $setID, $template_content, $template_data );
} }
catch( Exception $err ) catch( Exception $err )
{ {
$this->returnJsonError( $this->lang->words[ 'templates_' . $err->getMessage() ] ? $this->lang->words[ 'templates_' . $err->getMessage() ] : $err->getMessage() );//. ' ' . implode( "\n", $this->skinFunctions->fetchMessages() ) ); $this->returnJsonError( $this->lang->words[ 'templates_' . $err->getMessage() ] ? $this->lang->words[ 'templates_' . $err->getMessage() ] : $err->getMessage() );//. ' ' . implode( "\n", $this->skinFunctions->fetchMessages() ) );
} }
} }
else else
{ {
$template_group = ( $ent_template_group ) ? 'skin_' . $ent_template_group : $template_group; $template_group = ( $ent_template_group ) ? 'skin_' . $ent_template_group : $template_group;
try try
{ {
$template_id = $this->skinFunctions->saveTemplateBitFromAdd( $setID, $template_content, $template_data, $template_group, $template_name ); $template_id = $this->skinFunctions->saveTemplateBitFromAdd( $setID, $template_content, $template_data, $template_group, $template_name );
} }
catch( Exception $err ) catch( Exception $err )
{ {
$this->returnJsonError( $this->lang->words[ 'templates_' . $err->getMessage() ] ? $this->lang->words[ 'templates_' . $err->getMessage() ] : $err->getMessage() );// . ' ' . implode( "\n", $this->skinFunctions->fetchMessages() ) ); $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 // Fetch new data and return
//----------------------------------------- //-----------------------------------------
$template = $this->skinFunctions->fetchTemplateBitForEdit( $template_id, $setID ); $template = $this->skinFunctions->fetchTemplateBitForEdit( $template_id, $setID );
//----------------------------------------- //-----------------------------------------
// Get Data // Get Data
//----------------------------------------- //-----------------------------------------
$this->returnJsonArray( array( 'templateData' => $template, 'errors' => $this->skinFunctions->fetchErrorMessages() ) ); $this->returnJsonArray( array( 'templateData' => $template, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
} }
/** /**
* Fetch a JSON list of template data ready for editing * Fetch a JSON list of template data ready for editing
* *
* @return @e void * @return @e void
*/ */
protected function _getTemplateForEdit() protected function _getTemplateForEdit()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$setID = intval( $this->request['setID'] ); $setID = intval( $this->request['setID'] );
$templateID = intval( $this->request['template_id'] ); $templateID = intval( $this->request['template_id'] );
//----------------------------------------- //-----------------------------------------
// Checks... // Checks...
//----------------------------------------- //-----------------------------------------
if ( ! $setID OR ! $templateID ) if ( ! $setID OR ! $templateID )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
} }
//----------------------------------------- //-----------------------------------------
// Get template data // Get template data
//----------------------------------------- //-----------------------------------------
$template = $this->skinFunctions->fetchTemplateBitForEdit( $templateID, $setID ); $template = $this->skinFunctions->fetchTemplateBitForEdit( $templateID, $setID );
$this->returnJsonArray( array( 'templateData' => $template ) ); $this->returnJsonArray( array( 'templateData' => $template ) );
} }
/** /**
* Fetch a JSON list of template groups * Fetch a JSON list of template groups
* *
* @return @e void * @return @e void
*/ */
protected function _getTemplateGroupList() protected function _getTemplateGroupList()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$setID = intval( $this->request['setID'] ); $setID = intval( $this->request['setID'] );
//----------------------------------------- //-----------------------------------------
// Checks... // Checks...
//----------------------------------------- //-----------------------------------------
if ( ! $setID ) if ( ! $setID )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
} }
//----------------------------------------- //-----------------------------------------
// Get templates // Get templates
//----------------------------------------- //-----------------------------------------
$templateGroups = $this->skinFunctions->fetchTemplates( $setID, 'groupNames' ); $templateGroups = $this->skinFunctions->fetchTemplates( $setID, 'groupNames' );
//----------------------------------------- //-----------------------------------------
// Add in group counts // Add in group counts
//----------------------------------------- //-----------------------------------------
foreach( $templateGroups as $name => $data ) foreach( $templateGroups as $name => $data )
{ {
$templateGroups[ $name ]['_modCount'] = $this->skinFunctions->fetchModifiedTemplateCount( $setID, $name ); $templateGroups[ $name ]['_modCount'] = $this->skinFunctions->fetchModifiedTemplateCount( $setID, $name );
unset( $templateGroups[ $name ]['template_name'] ); unset( $templateGroups[ $name ]['template_name'] );
unset( $templateGroups[ $name ]['template_data'] ); unset( $templateGroups[ $name ]['template_data'] );
unset( $templateGroups[ $name ]['template_content'] ); unset( $templateGroups[ $name ]['template_content'] );
} }
$this->returnJsonArray( array( 'groups' => $templateGroups ) ); $this->returnJsonArray( array( 'groups' => $templateGroups ) );
} }
/** /**
* Fetch a JSON list of template bits for the template group * Fetch a JSON list of template bits for the template group
* *
* @return @e void * @return @e void
*/ */
protected function _getTemplateBitList() protected function _getTemplateBitList()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$setID = intval( $this->request['setID'] ); $setID = intval( $this->request['setID'] );
$templateGroup = IPSText::alphanumericalClean( $this->request['templateGroup'] ); $templateGroup = IPSText::alphanumericalClean( $this->request['templateGroup'] );
//----------------------------------------- //-----------------------------------------
// Checks... // Checks...
//----------------------------------------- //-----------------------------------------
if ( ! $setID OR ! $templateGroup ) if ( ! $setID OR ! $templateGroup )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
} }
//----------------------------------------- //-----------------------------------------
// Get templates // Get templates
//----------------------------------------- //-----------------------------------------
$templates = $this->skinFunctions->fetchTemplates( $setID, 'groupTemplatesNoContent', $templateGroup ); $templates = $this->skinFunctions->fetchTemplates( $setID, 'groupTemplatesNoContent', $templateGroup );
$this->returnJsonArray( array( 'templates' => array_values( $templates ), $this->returnJsonArray( array( 'templates' => array_values( $templates ),
'groupData' => array( '_modCount' => $this->skinFunctions->fetchModifiedTemplateCount( $setID, $templateGroup ) ) ) ); 'groupData' => array( '_modCount' => $this->skinFunctions->fetchModifiedTemplateCount( $setID, $templateGroup ) ) ) );
} }
} }
@@ -1,217 +1,217 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* AJAX Functions For applications/core/js/ipb3Templates.js file * AJAX Functions For applications/core/js/ipb3Templates.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> * </pre>
* *
* Author: Matt Mecham * Author: Matt Mecham
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33 * @since Friday 19th May 2006 17:33
* @version $Revision: 8644 $ * @version $Revision: 10914 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class admin_core_ajax_templatesandr extends ipsAjaxCommand class admin_core_ajax_templatesandr extends ipsAjaxCommand
{ {
/** /**
* Skin functions object handle * Skin functions object handle
* *
* @var object * @var object
*/ */
protected $skinFunctions; protected $skinFunctions;
/** /**
* Main executable * Main executable
* *
* @param object registry object * @param object registry object
* @return @e void * @return @e void
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//----------------------------------------- //-----------------------------------------
// Load functions and cache classes // Load functions and cache classes
//----------------------------------------- //-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ 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/skinCaching.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/ require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/
$this->skinFunctions = new skinDifferences( $registry ); $this->skinFunctions = new skinDifferences( $registry );
/* Check... */ /* Check... */
if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_manage', ipsRegistry::$current_application, 'templates' ) ) if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_manage', ipsRegistry::$current_application, 'templates' ) )
{ {
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
} }
//----------------------------------------- //-----------------------------------------
// What shall we do? // What shall we do?
//----------------------------------------- //-----------------------------------------
switch( $this->request['do'] ) switch( $this->request['do'] )
{ {
default: default:
case 'getTemplateBitList': case 'getTemplateBitList':
$this->_getTemplateBitList(); $this->_getTemplateBitList();
break; break;
case 'replace': case 'replace':
$this->_replace(); $this->_replace();
break; break;
} }
} }
/** /**
* Fetch a JSON list of template bits for the template group * Fetch a JSON list of template bits for the template group
* *
* @return @e void * @return @e void
*/ */
protected function _replace() protected function _replace()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$finalIDs = array(); $finalIDs = array();
$templates = array(); $templates = array();
$sessionID = IPSText::md5Clean( $this->request['sessionID'] ); $sessionID = IPSText::md5Clean( $this->request['sessionID'] );
$sessionData = $this->DB->buildAndFetch( array( 'select' => '*', $sessionData = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'template_sandr', 'from' => 'template_sandr',
'where' => "sandr_session_id='" . addslashes( $sessionID ) ."'" ) ); 'where' => "sandr_session_id='" . addslashes( $sessionID ) ."'" ) );
$templateData = unserialize( $sessionData['sandr_results'] ); $templateData = unserialize( $sessionData['sandr_results'] );
if ( is_array( $templateData ) ) if ( is_array( $templateData ) )
{ {
foreach( $templateData as $_group => $_data ) foreach( $templateData as $_group => $_data )
{ {
if ( !empty( $_POST['groups'][ $_group ] ) ) if ( !empty( $_POST['groups'][ $_group ] ) )
{ {
foreach( $_data as $_name => $_id ) foreach( $_data as $_name => $_id )
{ {
$finalIDs[] = $_id; $finalIDs[] = $_id;
} }
} }
else else
{ {
foreach( $_data as $_name => $_id ) foreach( $_data as $_name => $_id )
{ {
if ( !empty( $_POST['templates'][ $_id ] ) ) if ( !empty( $_POST['templates'][ $_id ] ) )
{ {
$finalIDs[] = $_id; $finalIDs[] = $_id;
} }
} }
} }
} }
} }
/* Check... */ /* Check... */
if ( ! count( $finalIDs ) ) if ( ! count( $finalIDs ) )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
} }
/* Load templates */ /* Load templates */
$this->DB->build( array( 'select' => '*', $this->DB->build( array( 'select' => '*',
'from' => 'skin_templates', 'from' => 'skin_templates',
'where' => 'template_id IN ('. implode( ',', $finalIDs ) . ')' ) ); 'where' => 'template_id IN ('. implode( ',', $finalIDs ) . ')' ) );
$this->DB->execute(); $this->DB->execute();
while( $row = $this->DB->fetch() ) while( $row = $this->DB->fetch() )
{ {
$templates[ $row['template_id'] ] = $row; $templates[ $row['template_id'] ] = $row;
} }
/* Perform the replacement */ /* Perform the replacement */
foreach( $templates as $template_id => $template ) foreach( $templates as $template_id => $template )
{ {
if ( $sessionData['sandr_is_regex'] ) if ( $sessionData['sandr_is_regex'] )
{ {
$before = str_replace( '#', '\#', IPSText::stripslashes( $sessionData['sandr_search_for'] ) ); $before = str_replace( '#', '\#', IPSText::stripslashes( $sessionData['sandr_search_for'] ) );
$after = preg_replace( '#\\\\\\\\(\d+?)#i', '$\\1', $sessionData['sandr_replace_with'] ); $after = preg_replace( '#\\\\\\\\(\d+?)#i', '$\\1', $sessionData['sandr_replace_with'] );
$template['template_content'] = preg_replace( "#{$before}#si", $after, $template['template_content'] ); $template['template_content'] = preg_replace( "#{$before}#si", $after, $template['template_content'] );
} }
else else
{ {
$template['template_content'] = str_ireplace( $sessionData['sandr_search_for'], $sessionData['sandr_replace_with'], $template['template_content'] ); $template['template_content'] = str_ireplace( $sessionData['sandr_search_for'], $sessionData['sandr_replace_with'], $template['template_content'] );
} }
/* Save it */ /* Save it */
$this->skinFunctions->saveTemplateBitFromEdit( $template['template_id'], $sessionData['sandr_set_id'], $template['template_content'], $template['template_data'] ); $this->skinFunctions->saveTemplateBitFromEdit( $template['template_id'], $sessionData['sandr_set_id'], $template['template_content'], $template['template_data'] );
} }
/* Done */ /* Done */
$this->returnJsonArray( array( 'status' => 'ok' ) ); $this->returnJsonArray( array( 'status' => 'ok' ) );
} }
/** /**
* Fetch a JSON list of template bits for the template group * Fetch a JSON list of template bits for the template group
* *
* @return @e void * @return @e void
*/ */
protected function _getTemplateBitList() protected function _getTemplateBitList()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$setID = intval( $this->request['setID'] ); $setID = intval( $this->request['setID'] );
$templateGroup = IPSText::alphanumericalClean( $this->request['templateGroup'] ); $templateGroup = IPSText::alphanumericalClean( $this->request['templateGroup'] );
$sessionID = IPSText::md5Clean( $this->request['sessionID'] ); $sessionID = IPSText::md5Clean( $this->request['sessionID'] );
$templates = array(); $templates = array();
//----------------------------------------- //-----------------------------------------
// Checks... // Checks...
//----------------------------------------- //-----------------------------------------
if ( ! $setID OR ! $templateGroup or ! $sessionID ) if ( ! $setID OR ! $templateGroup or ! $sessionID )
{ {
$this->returnJsonError( $this->lang->words['ajax_missing_data'] ); $this->returnJsonError( $this->lang->words['ajax_missing_data'] );
} }
//----------------------------------------- //-----------------------------------------
// Get templates // Get templates
//----------------------------------------- //-----------------------------------------
$sessionData = $this->DB->buildAndFetch( array( 'select' => '*', $sessionData = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'template_sandr', 'from' => 'template_sandr',
'where' => "sandr_session_id='" . addslashes( $sessionID ) ."'" ) ); 'where' => "sandr_session_id='" . addslashes( $sessionID ) ."'" ) );
$templateIDs = unserialize( $sessionData['sandr_results'] ); $templateIDs = unserialize( $sessionData['sandr_results'] );
$this->DB->build( array( 'select' => '*', $this->DB->build( array( 'select' => '*',
'from' => 'skin_templates', 'from' => 'skin_templates',
'where' => 'template_id IN ('. implode( ',', array_values( $templateIDs[ $templateGroup] ) ) . ')' ) ); 'where' => 'template_id IN ('. implode( ',', array_values( $templateIDs[ $templateGroup] ) ) . ')' ) );
$this->DB->execute(); $this->DB->execute();
while( $row = $this->DB->fetch() ) while( $row = $this->DB->fetch() )
{ {
unset( $row['template_content'] ); unset( $row['template_content'] );
$templates[] = $row; $templates[] = $row;
} }
$this->returnJsonArray( array( 'templates' => $templates ) ); $this->returnJsonArray( array( 'templates' => $templates ) );
} }
} }
@@ -1,181 +1,181 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* AJAX Functions For applications/core/js/ipb3CSS.js file * 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> * </pre>
* *
* Author: Matt Mecham * Author: Matt Mecham
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since Friday 19th May 2006 17:33 * @since Friday 19th May 2006 17:33
* @version $Revision: 8644 $ * @version $Revision: 10914 $
*/ */
if ( ! defined( 'IN_IPB' ) ) 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."; 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(); exit();
} }
class admin_core_ajax_uagents extends ipsAjaxCommand class admin_core_ajax_uagents extends ipsAjaxCommand
{ {
/** /**
* User agent functions * User agent functions
* *
* @var object Skin templates * @var object Skin templates
*/ */
protected $userAgentFunctions; protected $userAgentFunctions;
/** /**
* Main executable * Main executable
* *
* @param object registry object * @param object registry object
* @return @e void * @return @e void
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
//----------------------------------------- //-----------------------------------------
// Load functions and cache classes // Load functions and cache classes
//----------------------------------------- //-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/useragents/userAgentFunctions.php', 'userAgentFunctions' ); $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/useragents/userAgentFunctions.php', 'userAgentFunctions' );
$this->userAgentFunctions = new $classToLoad( $registry ); $this->userAgentFunctions = new $classToLoad( $registry );
//----------------------------------------- //-----------------------------------------
// What shall we do? // What shall we do?
//----------------------------------------- //-----------------------------------------
switch( $this->request['do'] ) switch( $this->request['do'] )
{ {
case 'saveuAgent': case 'saveuAgent':
if ( !$registry->getClass('class_permissions')->checkPermission( 'ua_manage', ipsRegistry::$current_application, 'tools' ) ) if ( !$registry->getClass('class_permissions')->checkPermission( 'ua_manage', ipsRegistry::$current_application, 'tools' ) )
{ {
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
} }
$this->_saveuAgent(); $this->_saveuAgent();
break; break;
case 'removeuAgent': case 'removeuAgent':
if ( !$registry->getClass('class_permissions')->checkPermission( 'ua_remove', ipsRegistry::$current_application, 'tools' ) ) if ( !$registry->getClass('class_permissions')->checkPermission( 'ua_remove', ipsRegistry::$current_application, 'tools' ) )
{ {
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
} }
$this->_removeuAgent(); $this->_removeuAgent();
break; break;
} }
} }
/** /**
* Reverts replacement * Reverts replacement
* *
* @return @e void * @return @e void
*/ */
protected function _removeuAgent() protected function _removeuAgent()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$uagent_id = intval( $this->request['uagent_id'] ); $uagent_id = intval( $this->request['uagent_id'] );
//----------------------------------------- //-----------------------------------------
// Checks... // Checks...
//----------------------------------------- //-----------------------------------------
if ( ! $uagent_id ) if ( ! $uagent_id )
{ {
$this->returnJsonError('Missing Data'); $this->returnJsonError('Missing Data');
} }
//----------------------------------------- //-----------------------------------------
// Get template data // Get template data
//----------------------------------------- //-----------------------------------------
$userAgents = $this->userAgentFunctions->removeUserAgent( $uagent_id ); $userAgents = $this->userAgentFunctions->removeUserAgent( $uagent_id );
$this->returnJsonArray( array( 'uagents' => $userAgents, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) ); $this->returnJsonArray( array( 'uagents' => $userAgents, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) );
} }
/** /**
* Saves the user agent * Saves the user agent
* *
* @return @e void * @return @e void
*/ */
protected function _saveuAgent() protected function _saveuAgent()
{ {
//----------------------------------------- //-----------------------------------------
// INIT // INIT
//----------------------------------------- //-----------------------------------------
$uagent_id = intval( $this->request['uagent_id'] ); $uagent_id = intval( $this->request['uagent_id'] );
$uagent_key = IPSText::alphanumericalClean( $this->request['uagent_key'] ); $uagent_key = IPSText::alphanumericalClean( $this->request['uagent_key'] );
$uagent_name = $this->convertAndMakeSafe( $_POST['uagent_name'] ); $uagent_name = $this->convertAndMakeSafe( $_POST['uagent_name'] );
$uagent_regex = $this->convertUnicode( $_POST['uagent_regex'] ); $uagent_regex = $this->convertUnicode( $_POST['uagent_regex'] );
$uagent_regex_capture = intval( $this->request['uagent_regex_capture'] ); $uagent_regex_capture = intval( $this->request['uagent_regex_capture'] );
$uagent_type = IPSText::alphanumericalClean( $this->request['uagent_type'] ); $uagent_type = IPSText::alphanumericalClean( $this->request['uagent_type'] );
$uagent_position = intval( $this->request['uagent_position'] ); $uagent_position = intval( $this->request['uagent_position'] );
$type = $this->request['type']; $type = $this->request['type'];
//----------------------------------------- //-----------------------------------------
// Checks... // Checks...
//----------------------------------------- //-----------------------------------------
if ( $type == 'edit' AND ! $uagent_id ) if ( $type == 'edit' AND ! $uagent_id )
{ {
$this->returnJsonError('Missing Data'); $this->returnJsonError('Missing Data');
} }
//----------------------------------------- //-----------------------------------------
// Other checks // Other checks
//----------------------------------------- //-----------------------------------------
if ( ! $uagent_key OR ! $uagent_name OR ! $uagent_regex OR ! $uagent_type ) if ( ! $uagent_key OR ! $uagent_name OR ! $uagent_regex OR ! $uagent_type )
{ {
$this->returnJsonError('Missing Data'); $this->returnJsonError('Missing Data');
} }
//----------------------------------------- //-----------------------------------------
// Save it // Save it
//----------------------------------------- //-----------------------------------------
if ( $type == 'edit' ) if ( $type == 'edit' )
{ {
try try
{ {
$userAgentID = $this->userAgentFunctions->saveUserAgentFromEdit( $uagent_id, $uagent_key, $uagent_name, $uagent_regex, $uagent_regex_capture, $uagent_type, $uagent_position ); $userAgentID = $this->userAgentFunctions->saveUserAgentFromEdit( $uagent_id, $uagent_key, $uagent_name, $uagent_regex, $uagent_regex_capture, $uagent_type, $uagent_position );
} }
catch( Exception $err ) catch( Exception $err )
{ {
$this->returnJsonError( $err->getMessage() . ' ' . str_replace( "\n", "\\n", implode( ",", $this->userAgentFunctions->fetchMessages() ) ) ); $this->returnJsonError( $err->getMessage() . ' ' . str_replace( "\n", "\\n", implode( ",", $this->userAgentFunctions->fetchMessages() ) ) );
} }
} }
else else
{ {
try try
{ {
$userAgentID = $this->userAgentFunctions->saveUserAgentFromAdd( $uagent_key, $uagent_name, $uagent_regex, $uagent_regex_capture, $uagent_type, $uagent_position ); $userAgentID = $this->userAgentFunctions->saveUserAgentFromAdd( $uagent_key, $uagent_name, $uagent_regex, $uagent_regex_capture, $uagent_type, $uagent_position );
} }
catch( Exception $err ) catch( Exception $err )
{ {
$this->returnJsonError( $err->getMessage() ); $this->returnJsonError( $err->getMessage() );
} }
} }
//----------------------------------------- //-----------------------------------------
// Get Data // Get Data
//----------------------------------------- //-----------------------------------------
$this->returnJsonArray( array( 'uagents' => $this->userAgentFunctions->fetchAgents(), 'returnid' => $userAgentID, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) ); $this->returnJsonArray( array( 'uagents' => $this->userAgentFunctions->fetchAgents(), 'returnid' => $userAgentID, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) );
} }
} }
@@ -1,20 +1,14 @@
<?php <?php
/** /**
* <pre> * @file applications.php Applications management
* Invision Power Services *~TERABYTE_DOC_READY~
* IP.Board v3.2.3 * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* Group management * $License: http://www.invisionpower.com/company/standards.php#license$
* Last Updated: $Date: 2011-09-09 19:44:48 -0400 (Fri, 09 Sep 2011) $ * $Author: bfarber $
* </pre> * @since 15 January 2007
* * $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @author $Author: bfarber $ * @version v3.3.4
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * $Revision: 10914 $
* @license This is NULLED!
* @package IP.Board
* @subpackage Core
* @link http://hatynka.in
* @since Monday 15th January 2007 (15:01)
* @version $Revision: 9476 $
*/ */
if ( ! defined( 'IN_ACP' ) ) if ( ! defined( 'IN_ACP' ) )
@@ -23,34 +17,39 @@ if ( ! defined( 'IN_ACP' ) )
exit(); exit();
} }
/**
*
* @class admin_core_applications_applications
* @brief Applications management
*/
class admin_core_applications_applications extends ipsCommand class admin_core_applications_applications extends ipsCommand
{ {
/** /**
* Skin object * Skin object shortcut
* *
* @var object Skin templates * @var $html
*/ */
public $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 * @param object $registry Registry object
* @return @e void [Outputs to screen] * @return @e void
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
@@ -58,17 +57,11 @@ class admin_core_applications_applications extends ipsCommand
// Load skin // Load skin
//----------------------------------------- //-----------------------------------------
$this->html = $this->registry->output->loadTemplate( 'cp_skin_applications' ); $this->html = $this->registry->output->loadTemplate( 'cp_skin_applications' );
$this->registry->class_localization->loadLanguageFile( array( 'admin_applications' ) ); $this->registry->class_localization->loadLanguageFile( array( 'admin_applications' ) );
//----------------------------------------- $this->form_code = $this->html->form_code = 'module=applications&amp;section=applications&amp;';
// Set up stuff $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... // What to do...
@@ -82,6 +75,9 @@ class admin_core_applications_applications extends ipsCommand
$this->request['do'] = 'applications_overview'; $this->request['do'] = 'applications_overview';
$this->applicationsOverview(); $this->applicationsOverview();
break; break;
case 'application_details' :
$this->applicationViewDetails();
break;
case 'application_manage_position' : case 'application_manage_position' :
$this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'app_manage' ); $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'app_manage' );
$this->applicationManagePosition(); $this->applicationManagePosition();
@@ -194,17 +190,8 @@ class admin_core_applications_applications extends ipsCommand
*/ */
public function applicationToggle() public function applicationToggle()
{ {
//-------------------------------------------- /* Get application */
// INIT $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . intval( $this->request['app_id'] ) ) );
//--------------------------------------------
$app_id = intval( $this->request['app_id'] );
//-----------------------------------------
// Got an application?
//-----------------------------------------
$application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $app_id ) );
if ( ! $application['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->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 ); $this->moduleRecacheAll( 1 );
//----------------------------------------- //-----------------------------------------
@@ -360,7 +359,6 @@ class admin_core_applications_applications extends ipsCommand
// Replace out the SQL details // Replace out the SQL details
//----------------------------------------- //-----------------------------------------
$sphinxTemplate = str_replace( "<!--SPHINX_CONF_HOST-->", ipsRegistry::$settings['sql_host'], $sphinxTemplate ); $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_USER-->", ipsRegistry::$settings['sql_user'], $sphinxTemplate );
$sphinxTemplate = str_replace( "<!--SPHINX_CONF_PASS-->", ipsRegistry::$settings['sql_pass'], $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; $sphinxCompiled .= $appSphinxTemplate;
} }
} }
@@ -855,7 +855,9 @@ class admin_core_applications_applications extends ipsCommand
// Done... // Done...
//----------------------------------------- //-----------------------------------------
/* Recache menu */
$this->applicationsMenuDataRecache();
if ( $return ) if ( $return )
{ {
$this->registry->output->global_message = sprintf( $this->lang->words['a_insertupdated'], $inserted, $updated ); $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 ) if ( ! $app_id )
{ {
$ajax->returnString( $this->lang->words['postform_badmd5'] ); $ajax->returnString( $this->lang->words['postform_badmd5'] );
exit();
} }
if ( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false ) if ( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false )
{ {
$ajax->returnString( $this->lang->words['postform_badmd5'] ); $ajax->returnString( $this->lang->words['postform_badmd5'] );
exit();
} }
//----------------------------------------- //-----------------------------------------
@@ -1248,10 +1248,15 @@ class admin_core_applications_applications extends ipsCommand
//----------------------------------------- //-----------------------------------------
// Load known modules // Load known modules
//----------------------------------------- //-----------------------------------------
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'core_sys_module' => 'm' ),
$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' ) ) ) ); '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(); $this->DB->execute();
while ( $row = $this->DB->fetch() ) 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 ) ); $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']}'" ); $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 // Remove Application Caches
//----------------------------------------- //-----------------------------------------
@@ -1486,7 +1516,6 @@ class admin_core_applications_applications extends ipsCommand
//----------------------------------------- //-----------------------------------------
// Remove tables // Remove tables
//----------------------------------------- //-----------------------------------------
$_file = IPSLib::getAppDir( $application['app_directory'] ) . '/setup/versions/install/sql/' . $application['app_directory'] . '_' . ipsRegistry::dbFunctions()->getDriverType() . '_tables.php'; $_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 // Capture create tables first
//----------------------------------------- //-----------------------------------------
preg_match( "/CREATE TABLE (\S+)(\s)?\(/", $q, $match ); preg_match( "/CREATE TABLE (\S+)(\s)?\(/", $q, $match );
@@ -1513,7 +1541,6 @@ class admin_core_applications_applications extends ipsCommand
//----------------------------------------- //-----------------------------------------
// Then capture alter tables // Then capture alter tables
//----------------------------------------- //-----------------------------------------
preg_match( "/ALTER TABLE (\S+)\sADD\s(\S+)\s/i", $q, $match ); 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 // Check for uninstall sql
//----------------------------------------- //-----------------------------------------
/* Any "extra" configs required for this driver? */ /* Any "extra" configs required for this driver? */
if ( is_file( IPS_ROOT_PATH . 'setup/sql/' . $this->settings['sql_driver'] . '_install.php' ) ) 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( 'permission_index', "app='{$application['app_directory']}'" );
$this->DB->delete( 'reputation_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( '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( 'faq', "app='{$application['app_directory']}'" );
$this->DB->delete( 'custom_bbcode', "bbcode_app='{$application['app_directory']}'" ); $this->DB->delete( 'custom_bbcode', "bbcode_app='{$application['app_directory']}'" );
$this->DB->delete( 'upgrade_history', "upgrade_app='{$application['app_directory']}'" ); $this->DB->delete( 'upgrade_history', "upgrade_app='{$application['app_directory']}'" );
@@ -2036,10 +2062,12 @@ XML;
public function applicationSave( $type = 'add' ) public function applicationSave( $type = 'add' )
{ {
/* Init vars */ /* 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_directory = trim( $this->request['app_directory'] );
$app_enabled = intval( $this->request['app_enabled'] ); $app_enabled = intval( $this->request['app_enabled'] );
$application = array(); $application = array();
$sphinxRebuild = false;
/* Editing? */ /* Editing? */
if ( $type == 'edit' ) if ( $type == 'edit' )
@@ -2071,13 +2099,24 @@ XML;
return; 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 ); $this->registry->output->showError( $this->lang->words['cannot_toggle_defaults'], 111161.2 );
} }
/* $setup update array */ /* $etup 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'] ) : '' ); $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? // IN DEV?
@@ -2096,24 +2135,41 @@ XML;
if ( $type == 'add' ) if ( $type == 'add' )
{ {
$array['app_added'] = time(); $array['app_added'] = IPS_UNIX_TIME_NOW;
$array['app_location'] = 'other'; $array['app_location'] = 'other';
$max = $this->DB->buildAndFetch( array( 'select' => 'MAX(app_position) as position', 'from' => 'core_applications' ) ); $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->DB->insert( 'core_applications', $array );
$this->registry->output->global_message = $this->lang->words['a_newapp']; $this->registry->output->global_message = $this->lang->words['a_newapp'];
} }
else 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 */ /* Update the application record */
$this->DB->update( 'core_applications', $array, 'app_id=' . $application['app_id'] ); $this->DB->update( 'core_applications', $array, 'app_id=' . $application['app_id'] );
/* Update modules and tasks, if the application directory changed */ /* Update modules and tasks, if the application directory changed */
if ( $application['app_directory'] != $app_directory ) 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( '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( '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']}'" ); $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( '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', 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( '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']}'" ); $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']; $this->registry->output->global_message = $this->lang->words['a_editappdone'];
} }
/* Have we toggled this? */
if ( $app_enabled != $application['app_enabled'] )
{
$sphinxRebuild = true;
}
//----------------------------------------- //-----------------------------------------
// Recache // Recache
//----------------------------------------- //-----------------------------------------
@@ -2179,9 +2240,8 @@ XML;
//----------------------------------------- //-----------------------------------------
// Sphinx involved? // 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'] ); $this->registry->output->global_message .= sprintf( $this->lang->words['rebuild_sphinx'], $this->settings['_base_url'] );
} }
@@ -2200,13 +2260,13 @@ XML;
{ {
/* Init vars */ /* Init vars */
$application = array(); $application = array();
$form = array(); $form = array();
$defaultTab = '';
//----------------------------------------- //-----------------------------------------
// Add or edit? // Add or edit?
//----------------------------------------- //-----------------------------------------
if ( $type == 'add' ) if ( $type == 'add' )
{ {
$formcode = 'application_add_do'; $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 ); $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 */ /* 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 ) if ( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false )
{ {
$ajax->returnString( $this->lang->words['postform_badmd5'] ); $ajax->returnString( $this->lang->words['postform_badmd5'] );
exit();
} }
//----------------------------------------- //-----------------------------------------
// Save new position // Save new position
//----------------------------------------- //-----------------------------------------
$position = 1;
$position = 1;
if ( is_array($this->request['apps']) && count($this->request['apps']) )
if ( is_array( $this->request['apps'] ) and count( $this->request['apps'] ) ) {
{ /* Reset all apps to 0 temporarily */
foreach( $this->request['apps'] as $this_id ) $this->DB->update( 'core_applications', array( 'app_position' => 0 ) );
{
$location = $this->DB->buildAndFetch( array( 'select' => 'app_location', 'from' => 'core_applications', 'where' => 'app_id=' . $this_id ) ); foreach( $this->request['apps'] as $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 ); $this->DB->update( 'core_applications', array( 'app_position' => $position ), 'app_id=' . intval($this_id) );
$position ++; $position++;
} }
} }
$this->applicationsRecache(); $this->applicationsRecache();
$this->applicationsMenuDataRecache(); $this->applicationsMenuDataRecache();
$ajax->returnString( 'OK' ); $ajax->returnString('OK');
} }
/** /**
@@ -2336,20 +2401,27 @@ XML;
public function applicationsOverview() public function applicationsOverview()
{ {
/* Init vars */ /* Init vars */
$folders = array(); $folders = array();
$application = array(); $applications = array( 'enabled' => array( 'core' => array() ), 'disabled' => array() );
$_apps = array(); $_apps = array();
$uninstalled = array(); $uninstalled = array();
$appsUpdates = 0; $checkUpdates = false;
$checkUpdates = ! empty( $this->request['checkUpdates'] ) ? true : false; $appsUpdates = 0;
$message = '';
/* Get the setup class */ /* Get the setup class */
require_once ( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/ require_once ( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/
/* Get hooks file for update check */ /* Checking for updates? */
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'core' ) . '/modules_admin/applications/hooks.php', 'admin_core_applications_hooks' ); if ( !empty( $this->request['checkUpdates'] ) )
$hooksClass = new $classToLoad(); {
$hooksClass->makeRegistryShortcuts( $this->registry ); $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 // Get DB applications
@@ -2375,7 +2447,7 @@ XML;
$row['app_update_available'] = array( 0 ); $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... // Installed Loop...
//----------------------------------------- //-----------------------------------------
foreach( $_apps as $_app_path => $row ) foreach( $_apps as $_app_path => $row )
{ {
$app_dir = $row['app_directory']; $app_dir = $row['app_directory'];
//-----------------------------------------
// Enabled?
//-----------------------------------------
$row['_app_enabled'] = ( $row['app_enabled'] ) ? 'tick.png' : 'cross.png';
/* Version numbers */ /* Version numbers */
$_a = ( $app_dir == 'forums' or $app_dir == 'members' ) ? 'core' : $app_dir; $_a = ( $app_dir == 'forums' or $app_dir == 'members' ) ? 'core' : $app_dir;
$numbers = IPSSetUp::fetchAppVersionNumbers( $_a ); $numbers = IPSSetUp::fetchAppVersionNumbers( $_a );
@@ -2441,7 +2507,7 @@ XML;
$phpVersion = str_replace( substr( $phpVersion, strrpos( $phpVersion, '.' ) ), '', $phpVersion ); $phpVersion = str_replace( substr( $phpVersion, strrpos( $phpVersion, '.' ) ), '', $phpVersion );
$encoding = "Zend {$phpVersion}"; $encoding = "Zend {$phpVersion}";
} }
elseif ( substr( $file, 36, 7 ) == 'ionCube' ) elseif ( substr( $file, 36, 7 ) == 'ionCube' or substr( $file, 37, 7 ) == 'ionCube' )
{ {
$encoding = 'Ioncube'; $encoding = 'Ioncube';
} }
@@ -2449,18 +2515,16 @@ XML;
$row['_human_current'] .= " ({$encoding})"; $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 // Uninstalled
//----------------------------------------- //-----------------------------------------
@@ -2499,14 +2563,115 @@ XML;
} }
/* Got updates to show? */ /* Got updates to show? */
$message = NULL;
if ( $checkUpdates === true ) if ( $checkUpdates === true )
{ {
$message = ( $appsUpdates == 1 ) ? $this->lang->words['updates_string_single'] : sprintf( $this->lang->words['updates_string_more'], $appsUpdates ); $message = ( $appsUpdates == 1 ) ? $this->lang->words['updates_string_single'] : sprintf( $this->lang->words['updates_string_more'], $appsUpdates );
} }
/* Output */ /* 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 ) ); $this->cache->setCache( 'app_cache', $apps, array( 'array' => 1 ) );
ipsRegistry::$applications = $apps;
/* Do we have an incomingEmails extension anywhere? */ /* Do we have an incomingEmails extension anywhere? */
$systemvars = $this->cache->getCache( 'systemvars' ); $systemvars = $this->cache->getCache( 'systemvars' );
@@ -2592,11 +2758,12 @@ XML;
$tabs = array(); $tabs = array();
foreach( $apps as $dir => $data ) 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 $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'] ); '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' ) ) if ( is_file( IPSLib::getAppDir( $dir ) . '/extensions/coreVariables.php' ) )
{ {
@@ -2648,11 +2815,11 @@ XML;
*/ */
protected function _getHasExtensionItemMarking( $appDir ) 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*/ $classToLoad = IPSLib::loadLibrary( $_file, 'itemMarking__'.$appDir, $appDir );
if ( class_exists( $classToLoad ) )
if ( class_exists( 'itemMarking__' . $appDir ) )
{ {
return true; 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(); $this->DB->execute();
while ( $module = $this->DB->fetch() ) while ( $module = $this->DB->fetch() )
@@ -1,42 +1,42 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Blog Application * Blog Application
* 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> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since 27th Aug 2004 * @since 27th Aug 2004
* @version $Revision: 8644 $ * @version $Revision: 10914 $
* *
*/ */
if ( ! defined( 'IN_ACP' ) ) 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'."; print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit(); exit();
} }
class admin_core_applications_blog extends ipsCommand class admin_core_applications_blog extends ipsCommand
{ {
/** /**
* Main class entry point * Main class entry point
* *
* @param object ipsRegistry reference * @param object ipsRegistry reference
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://myipb.in/products/blog/"); $this->registry->output->showInsideIframe("http://external.ipslink.com/ipboard30/landing/?p=blog");
} }
} }
@@ -1,39 +1,39 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Blog Application * Blog Application
* 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> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @version $Revision: 8644 $ * @version $Revision: 10914 $
*/ */
if ( ! defined( 'IN_ACP' ) ) 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'."; print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit(); exit();
} }
class admin_core_applications_ccs extends ipsCommand class admin_core_applications_ccs extends ipsCommand
{ {
/** /**
* Main class entry point * Main class entry point
* *
* @param object ipsRegistry reference * @param object ipsRegistry reference
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://myipb.in/products/content/"); $this->registry->output->showInsideIframe("http://www.invisionpower.com/products/content/");
} }
} }
@@ -1,68 +1,68 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Download Manager Application * Download Manager Application
* Last Updated: $Date: 2011-05-11 12:57:46 -0400 (Wed, 11 May 2011) $ * Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since 17 February 2003 * @since 17 February 2003
* @version $Revision: 8727 $ * @version $Revision: 10914 $
* *
*/ */
if ( ! defined( 'IN_ACP' ) ) 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'."; print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit(); exit();
} }
class admin_core_applications_copyright extends ipsCommand class admin_core_applications_copyright extends ipsCommand
{ {
/** /**
* HTML skin * HTML skin
* *
* @var object Skin file * @var object Skin file
*/ */
public $html; public $html;
/** /**
* Main class entry point * Main class entry point
* *
* @param object ipsRegistry reference * @param object ipsRegistry reference
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
//----------------------------------------- //-----------------------------------------
// Load HTML // Load HTML
//----------------------------------------- //-----------------------------------------
$this->html = $this->registry->output->loadTemplate( 'cp_skin_applications' ); $this->html = $this->registry->output->loadTemplate( 'cp_skin_applications' );
$this->registry->getClass( 'class_localization' )->loadLanguageFile( array( 'admin_applications' ) ); $this->registry->getClass( 'class_localization' )->loadLanguageFile( array( 'admin_applications' ) );
//----------------------------------------- //-----------------------------------------
// Set up stuff // Set up stuff
//----------------------------------------- //-----------------------------------------
$this->form_code = $this->html->form_code = 'module=applications&amp;section=copyright'; $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'; $this->form_code_js = $this->html->form_code_js = 'module=applications&section=copyright';
//----------------------------------------- //-----------------------------------------
// Just redirect to the setting // 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' ); $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 * @file defaultSection.php Define the default section for the 'applications' module
*~TERABYTE_DOC_READY~ *~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED! * $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $ * $Author: ips_terabyte $
* @since 20th February 2002 * @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3 * @version v3.3.4
* $Revision: 8655 $ * $Revision: 8655 $
*/ */
@@ -1,42 +1,42 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Download Manager Application * Download Manager Application
* 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> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since Who knows... * @since Who knows...
* @version $Revision: 8644 $ * @version $Revision: 10914 $
* *
*/ */
if ( ! defined( 'IN_ACP' ) ) 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'."; print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit(); exit();
} }
class admin_core_applications_downloads extends ipsCommand class admin_core_applications_downloads extends ipsCommand
{ {
/** /**
* Main class entry point * Main class entry point
* *
* @param object ipsRegistry reference * @param object ipsRegistry reference
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://myipb.in/products/downloads/"); $this->registry->output->showInsideIframe("http://www.invisionpower.com/products/downloads/");
} }
} }
@@ -1,42 +1,42 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Gallery Application * Gallery Application
* 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> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since Who knows... * @since Who knows...
* @version $Revision: 8644 $ * @version $Revision: 10914 $
* *
*/ */
if ( ! defined( 'IN_ACP' ) ) 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'."; print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit(); exit();
} }
class admin_core_applications_gallery extends ipsCommand class admin_core_applications_gallery extends ipsCommand
{ {
/** /**
* Main class entry point * Main class entry point
* *
* @param object ipsRegistry reference * @param object ipsRegistry reference
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://myipb.in/products/gallery/"); $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> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -1,39 +1,39 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Nexus Application * Nexus Application
* 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> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @version $Revision: 8644 $ * @version $Revision: 10914 $
*/ */
if ( ! defined( 'IN_ACP' ) ) 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'."; print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit(); exit();
} }
class admin_core_applications_nexus extends ipsCommand class admin_core_applications_nexus extends ipsCommand
{ {
/** /**
* Main class entry point * Main class entry point
* *
* @param object ipsRegistry reference * @param object ipsRegistry reference
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
$this->registry->output->showInsideIframe("http://myipb.in/products/nexus/"); $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> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -2,10 +2,10 @@
<menu> <menu>
<tabitems> <tabitems>
<item> <item>
<title>Управление модулями</title> <title>Manage Applications &amp; Modules</title>
<subitems> <subitems>
<subitem> <subitem>
<subitemtitle>Список модулей</subitemtitle> <subitemtitle>Manage Applications &amp; Modules</subitemtitle>
<subitemlang>manage_apps_modules</subitemlang> <subitemlang>manage_apps_modules</subitemlang>
<subsection>applications</subsection> <subsection>applications</subsection>
<subitemurl>do=applications_overview</subitemurl> <subitemurl>do=applications_overview</subitemurl>
@@ -14,18 +14,17 @@
</subitem> </subitem>
</subitems> </subitems>
</item> </item>
<item>
<item> <title>Manage Hooks</title>
<title>Управление хуками (hooks)</title>
<subitems> <subitems>
<subitem> <subitem>
<subitemtitle>Список хуков</subitemtitle> <subitemtitle>Manage Hooks</subitemtitle>
<subitemlang>manage_hooks</subitemlang> <subitemlang>manage_hooks</subitemlang>
<subsection>hooks</subsection> <subsection>hooks</subsection>
<subitemurl>do=hooks_overview</subitemurl> <subitemurl>do=hooks_overview</subitemurl>
<subitemrolekey>hooks_manage</subitemrolekey> <subitemrolekey>hooks_manage</subitemrolekey>
<subisredirect>0</subisredirect> <subisredirect>0</subisredirect>
</subitem> </subitem>
</subitems> </subitems>
</item> </item>
</tabitems> </tabitems>
@@ -1,62 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<permissions> <permissions>
<group> <group>
<grouptitle>Управление приложениями</grouptitle> <grouptitle>Manage Applications</grouptitle>
<grouplang>core_manage_apps</grouplang> <grouplang>core_manage_apps</grouplang>
<items> <items>
<item> <item>
<key>app_manage</key> <key>app_manage</key>
<string>Может изменять/добавлять приложения?</string> <string>Can manage applications?</string>
</item> </item>
<item> <item>
<key>app_delete</key> <key>app_delete</key>
<string>Может удалять приложения?</string> <string>Can delete applications?</string>
</item> </item>
<item> <item>
<key>app_install</key> <key>app_install</key>
<string>Может устанавливать новые приложения?</string> <string>Can install new applications?</string>
</item> </item>
<item> <item>
<key>build_sphinx</key> <key>build_sphinx</key>
<string>Может создавать sphinx.conf? ВНИМАНИЕ: будут доступны данные для соединения с базой данных</string> <string>Can build sphinx.conf? WARNING: Exposes database login details</string>
</item> </item>
</items> </items>
</group> </group>
<group> <group>
<grouptitle>Управление модулями</grouptitle> <grouptitle>Manage Modules</grouptitle>
<grouplang>core_manage_modules</grouplang> <grouplang>core_manage_modules</grouplang>
<items> <items>
<item> <item>
<key>module_manage</key> <key>module_manage</key>
<string>Может изменять/добавлять модули?</string> <string>Can edit/add application modules?</string>
</item> </item>
<item> <item>
<key>module_delete</key> <key>module_delete</key>
<string>Может удалять модули приложений?</string> <string>Can delete application modules?</string>
</item> </item>
</items> </items>
</group> </group>
<group> <group>
<grouptitle>Покупка приложений</grouptitle> <grouptitle>Purchase Applications</grouptitle>
<grouplang>core_purchase_app</grouplang> <grouplang>core_purchase_app</grouplang>
<items> <items>
<item> <item>
<key>purchase_app</key> <key>purchase_app</key>
<string>Может просматривать страницу с платными приложениями?</string> <string>Can view pages to purchase additional applications?</string>
</item> </item>
</items> </items>
</group> </group>
<group> <group>
<grouptitle>Управление модификациями</grouptitle> <grouptitle>Manage Hooks</grouptitle>
<grouplang>core_manage_hooks</grouplang> <grouplang>core_manage_hooks</grouplang>
<items> <items>
<item> <item>
<key>hooks_manage</key> <key>hooks_manage</key>
<string>Может добавлять/изменять модификации?</string> <string>Can manage hooks?</string>
</item> </item>
<item> <item>
<key>hooks_delete</key> <key>hooks_delete</key>
<string>Может удалять модификации?</string> <string>Can remove hooks?</string>
</item> </item>
</items> </items>
</group> </group>
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'diagnostics' module * @file defaultSection.php Define the default section for the 'diagnostics' module
*~TERABYTE_DOC_READY~ *~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED! * $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $ * $Author: ips_terabyte $
* @since 20th February 2002 * @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3 * @version v3.3.4
* $Revision: 8655 $ * $Revision: 8655 $
*/ */
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -2,10 +2,10 @@
<menu> <menu>
<tabitems> <tabitems>
<item> <item>
<title>Состояние системы</title> <title>Overview</title>
<subitems> <subitems>
<subitem> <subitem>
<subitemtitle>Обзор системы</subitemtitle> <subitemtitle>Overview</subitemtitle>
<subitemlang>diag_overview</subitemlang> <subitemlang>diag_overview</subitemlang>
<subsection>diagnostics</subsection> <subsection>diagnostics</subsection>
<subitemurl></subitemurl> <subitemurl></subitemurl>
@@ -15,23 +15,10 @@
</subitems> </subitems>
</item> </item>
<item> <item>
<title>Проверка версий файлов</title> <title>Whitespace Checker</title>
<subitems> <subitems>
<subitem> <subitem>
<subitemtitle>Проверка версий файлов</subitemtitle> <subitemtitle>Whitespace Checker</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>
<subitemlang>whitespace_checker</subitemlang> <subitemlang>whitespace_checker</subitemlang>
<subsection>diagnostics</subsection> <subsection>diagnostics</subsection>
<subitemurl>do=whitespace</subitemurl> <subitemurl>do=whitespace</subitemurl>
@@ -39,12 +26,12 @@
<subisredirect>0</subisredirect> <subisredirect>0</subisredirect>
</subitem> </subitem>
</subitems> </subitems>
</item> </item>
<item> <item>
<title>Проверка прав файлов</title> <title>Permissions Checker</title>
<subitems> <subitems>
<subitem> <subitem>
<subitemtitle>Проверка прав доступа к файлам</subitemtitle> <subitemtitle>Permissions Checker</subitemtitle>
<subitemlang>permissions_checker</subitemlang> <subitemlang>permissions_checker</subitemlang>
<subsection>diagnostics</subsection> <subsection>diagnostics</subsection>
<subitemurl>do=filepermissions</subitemurl> <subitemurl>do=filepermissions</subitemurl>
@@ -54,10 +41,10 @@
</subitems> </subitems>
</item> </item>
<item> <item>
<title>Проверка сетевых соединений</title> <title>Connection Checker</title>
<subitems> <subitems>
<subitem> <subitem>
<subitemtitle>Проверка сетевых соединений</subitemtitle> <subitemtitle>Connection Checker</subitemtitle>
<subitemlang>connection_checker</subitemlang> <subitemlang>connection_checker</subitemlang>
<subsection>diagnostics</subsection> <subsection>diagnostics</subsection>
<subitemurl>do=connections</subitemurl> <subitemurl>do=connections</subitemurl>
@@ -65,12 +52,12 @@
<subisredirect>0</subisredirect> <subisredirect>0</subisredirect>
</subitem> </subitem>
</subitems> </subitems>
</item> </item>
<item> <item>
<title>Проверка структуры базы</title> <title>Database Checker</title>
<subitems> <subitems>
<subitem> <subitem>
<subitemtitle>Проверка структуры базы данных</subitemtitle> <subitemtitle>Database Checker</subitemtitle>
<subitemlang>db_checker</subitemlang> <subitemlang>db_checker</subitemlang>
<subsection>diagnostics</subsection> <subsection>diagnostics</subsection>
<subitemurl>do=dbchecker</subitemurl> <subitemurl>do=dbchecker</subitemurl>
@@ -78,12 +65,12 @@
<subisredirect>0</subisredirect> <subisredirect>0</subisredirect>
</subitem> </subitem>
</subitems> </subitems>
</item> </item>
<item> <item>
<title>Проверка индексов базы</title> <title>Database Index Checker</title>
<subitems> <subitems>
<subitem> <subitem>
<subitemtitle>Проверка индексов базы данных</subitemtitle> <subitemtitle>Database Index Checker</subitemtitle>
<subitemlang>dbi_checker</subitemlang> <subitemlang>dbi_checker</subitemlang>
<subsection>diagnostics</subsection> <subsection>diagnostics</subsection>
<subitemurl>do=dbindex</subitemurl> <subitemurl>do=dbindex</subitemurl>
@@ -91,6 +78,19 @@
<subisredirect>0</subisredirect> <subisredirect>0</subisredirect>
</subitem> </subitem>
</subitems> </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> </tabitems>
</menu> </menu>
@@ -1,32 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<permissions> <permissions>
<group> <group>
<grouptitle>Инструменты диагностики</grouptitle> <grouptitle>Diagnostic Tools</grouptitle>
<grouplang>core_diag_tools</grouplang> <grouplang>core_diag_tools</grouplang>
<items> <items>
<item> <item>
<key>index_checker</key> <key>index_checker</key>
<string>Может проверять индексы таблиц базы? Внимание: позволяет выполнять запросы к базе.</string> <string>Can use the database index checker? Warning: Allows ability to run database queries indirectly.</string>
</item> </item>
<item> <item>
<key>database_checker</key> <key>database_checker</key>
<string>Может использовать проверку базы данных? Внимание: позволяет выполнять запросы к базе.</string> <string>Can use the database checker? Warning: Allows ability to run database queries indirectly.</string>
</item> </item>
<item> <item>
<key>whitespace_checker</key> <key>whitespace_checker</key>
<string>Может проверять файлы на лишние пробелы?</string> <string>Can use the whitespace checker?</string>
</item>
<item>
<key>version_checker</key>
<string>Может проверять файлы на правильность версии?</string>
</item> </item>
<item> <item>
<key>connection_checker</key> <key>connection_checker</key>
<string>Может использовать проверку сетевых соединений?</string> <string>Can use the connection checker?</string>
</item> </item>
<item> <item>
<key>permission_checker</key> <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> </item>
</items> </items>
</group> </group>
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'help' module * @file defaultSection.php Define the default section for the 'help' module
*~TERABYTE_DOC_READY~ *~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED! * $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $ * $Author: ips_terabyte $
* @since 20th February 2002 * @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3 * @version v3.3.4
* $Revision: 8655 $ * $Revision: 8655 $
*/ */
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -1,145 +1,145 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Quick help - shows popups with help information * Quick help - shows popups with help information
* 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> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since 1st march 2002 * @since 1st march 2002
* @version $Revision: 8644 $ * @version $Revision: 10914 $
* *
*/ */
if ( ! defined( 'IN_ACP' ) ) 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'."; print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit(); exit();
} }
class admin_core_help_quickhelp extends ipsCommand class admin_core_help_quickhelp extends ipsCommand
{ {
/** /**
* Array of help text * Array of help text
* *
* @var array Help texts * @var array Help texts
*/ */
protected $help_text = array(); protected $help_text = array();
/** /**
* Initialize the help text array * Initialize the help text array
* *
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
protected function _initText() protected function _initText()
{ {
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ) ); ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ) );
return array( 'mg_dohtml' => array( 'title' => $this->lang->words['q_html'], return array( 'mg_dohtml' => array( 'title' => $this->lang->words['q_html'],
'body' => $this->lang->words['q_html_info'], 'body' => $this->lang->words['q_html_info'],
), ),
'mod_mmod' => array( 'title' => $this->lang->words['q_multi'], 'mod_mmod' => array( 'title' => $this->lang->words['q_multi'],
'body' => $this->lang->words['q_multi_info'], 'body' => $this->lang->words['q_multi_info'],
), ),
'set_spider' => array( 'title' => $this->lang->words['q_bots'], 'set_spider' => array( 'title' => $this->lang->words['q_bots'],
'body' => $this->lang->words['q_bots_info'], 'body' => $this->lang->words['q_bots_info'],
), ),
'mg_upload' => array( 'title' => $this->lang->words['q_upload'], 'mg_upload' => array( 'title' => $this->lang->words['q_upload'],
'body' => $this->lang->words['q_upload_info'], 'body' => $this->lang->words['q_upload_info'],
), ),
'mg_promote' => array( 'title' => $this->lang->words['q_promote'], 'mg_promote' => array( 'title' => $this->lang->words['q_promote'],
'body' => $this->lang->words['q_promote_info'], 'body' => $this->lang->words['q_promote_info'],
), ),
's_reg_antispam' => array ( 'title' => $this->lang->words['q_captcha'], 's_reg_antispam' => array ( 'title' => $this->lang->words['q_captcha'],
'body' => $this->lang->words['q_captcha_info'], 'body' => $this->lang->words['q_captcha_info'],
), ),
'm_bulkemail' => array ( 'title' => $this->lang->words['q_bulk'], 'm_bulkemail' => array ( 'title' => $this->lang->words['q_bulk'],
'body' => $this->lang->words['q_bulk_info'], 'body' => $this->lang->words['q_bulk_info'],
), ),
'comp_menu' => array ( 'title' => $this->lang->words['q_components'], 'comp_menu' => array ( 'title' => $this->lang->words['q_components'],
'body' => $this->lang->words['q_components_info'], 'body' => $this->lang->words['q_components_info'],
), ),
); );
} }
/** /**
* Main class entry point * Main class entry point
* *
* @param object ipsRegistry reference * @param object ipsRegistry reference
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
$id = $this->request['id']; $id = $this->request['id'];
if( $this->request['do'] == 'redirect' ) if( $this->request['do'] == 'redirect' )
{ {
$this->_redirect( $id ); $this->_redirect( $id );
} }
$this->help_text = $this->_initText(); $this->help_text = $this->_initText();
if ($this->help_text[ $id ]['title'] == "") if ($this->help_text[ $id ]['title'] == "")
{ {
$this->registry->output->showError( $this->lang->words['q_nohelp'], 11148 ); $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->html .= $this->registry->output->global_template->quickHelp( $this->help_text[$id]['title'], $this->help_text[$id]['body'] );
$this->registry->output->printPopupWindow(); $this->registry->output->printPopupWindow();
} }
/** /**
* Redirect offsite for more help/options * Redirect offsite for more help/options
* *
* @param string 'key' to redirect to * @param string 'key' to redirect to
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
private function _redirect( $id ) private function _redirect( $id )
{ {
switch( $id ) switch( $id )
{ {
case 'docs': case 'docs':
$url = "http://myipb.in/docs-ipb"; $url = "http://external.ipslink.com/ipboard30/landing/?p=docs-ipb";
break; break;
case 'resources': case 'resources':
$url = "http://myipb.in/forums"; $url = "http://external.ipslink.com/ipboard30/landing/?p=resources";
break; break;
case 'contact': case 'contact':
$url = "http://myipb.in/contact"; $url = "http://external.ipslink.com/ipboard30/landing/?p=contact";
break; break;
case 'features': case 'features':
$url = "http://myipb.in/suggestfeatures"; $url = "http://external.ipslink.com/ipboard30/landing/?p=suggestfeatures";
break; break;
case 'bugs': case 'bugs':
$url = "http://myipb.in/bugtrack"; $url = "http://external.ipslink.com/ipboard30/landing/?p=bugs";
break; break;
default: default:
case 'support': case 'support':
$url = "http://myipb.in/clientarea"; $url = "http://external.ipslink.com/ipboard30/landing/?p=support";
break; break;
} }
$this->registry->output->silentRedirect( $url ); $this->registry->output->silentRedirect( $url );
} }
} }
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -1,66 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<menu> <menu>
<tabitems> <tabitems>
<item> <item>
<title>Документация</title> <title>Documentation</title>
<subitems> <subitems>
<subitem> <subitem>
<subitemtitle>Документация</subitemtitle> <subitemtitle>Documentation</subitemtitle>
<subitemlang>help_documentation</subitemlang> <subitemlang>help_documentation</subitemlang>
<subsection>quickhelp</subsection> <subsection>quickhelp</subsection>
<subitemurl>do=redirect&amp;id=docs</subitemurl> <subitemurl>do=redirect&amp;id=docs</subitemurl>
<subisredirect>1</subisredirect> <subisredirect>1</subisredirect>
</subitem> </subitem>
</subitems> </subitems>
</item> </item>
<item>
<item> <title>Technical Support</title>
<title>Тех. поддержка</title> <subitems>
<subitems> <subitem>
<subitem> <subitemtitle>Technical Support</subitemtitle>
<subitemtitle>Техническая поддержка</subitemtitle> <subitemlang>help_support</subitemlang>
<subitemlang>help_support</subitemlang> <subsection>quickhelp</subsection>
<subsection>quickhelp</subsection> <subitemurl>do=redirect&amp;id=support</subitemurl>
<subitemurl>do=redirect&amp;id=support</subitemurl> <subisredirect>1</subisredirect>
<subisredirect>1</subisredirect> </subitem>
</subitem> </subitems>
</subitems> </item>
</item> <item>
<item> <title>Additional Resources</title>
<title>Форумы</title> <subitems>
<subitems> <subitem>
<subitem> <subitemtitle>Additional Resources</subitemtitle>
<subitemtitle>Форумы IBResource</subitemtitle> <subitemlang>help_resources</subitemlang>
<subitemlang>help_resources</subitemlang> <subsection>quickhelp</subsection>
<subsection>quickhelp</subsection> <subitemurl>do=redirect&amp;id=resources</subitemurl>
<subitemurl>do=redirect&amp;id=resources</subitemurl> <subisredirect>1</subisredirect>
<subisredirect>1</subisredirect> </subitem>
</subitem> </subitems>
</subitems> </item>
</item> <item>
<item> <title>IPS Contact Information</title>
<title>Контакты</title> <subitems>
<subitems> <subitem>
<subitem> <subitemtitle>IPS Contact Information</subitemtitle>
<subitemtitle>Контактная информация</subitemtitle> <subitemlang>help_contact</subitemlang>
<subitemlang>help_contact</subitemlang> <subsection>quickhelp</subsection>
<subsection>quickhelp</subsection> <subitemurl>do=redirect&amp;id=contact</subitemurl>
<subitemurl>do=redirect&amp;id=contact</subitemurl> <subisredirect>1</subisredirect>
<subisredirect>1</subisredirect> </subitem>
</subitem> </subitems>
</subitems> </item>
</item> <item>
<item> <title>Feature Requests</title>
<title>Сообщить об ошибке</title> <subitems>
<subitems> <subitem>
<subitem> <subitemtitle>Feature Requests</subitemtitle>
<subitemtitle>Сообщить об ошибке</subitemtitle> <subitemlang>help_features</subitemlang>
<subitemlang>help_bugs</subitemlang> <subsection>quickhelp</subsection>
<subsection>quickhelp</subsection> <subitemurl>do=redirect&amp;id=features</subitemurl>
<subitemurl>do=redirect&amp;id=bugs</subitemurl> <subisredirect>1</subisredirect>
<subisredirect>1</subisredirect> </subitem>
</subitem> </subitems>
</subitems> </item>
</item> <item>
</tabitems> <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> </menu>
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'languages' module * @file defaultSection.php Define the default section for the 'languages' module
*~TERABYTE_DOC_READY~ *~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED! * $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $ * $Author: ips_terabyte $
* @since 20th February 2002 * @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3 * @version v3.3.4
* $Revision: 8655 $ * $Revision: 8655 $
*/ */
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -> Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<menu> <menu>
<tabitems> <tabitems>
<item> <item>
<title>Языки</title> <title>Manage Languages</title>
<subitems> <subitems>
<subitem> <subitem>
<subitemtitle>Языки системы</subitemtitle> <subitemtitle>Manage Languages</subitemtitle>
<subitemlang>languages</subitemlang> <subitemlang>languages</subitemlang>
<subsection>manage_languages</subsection> <subsection>manage_languages</subsection>
<subitemurl></subitemurl> <subitemurl></subitemurl>
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<permissions> <permissions>
<group> <group>
<grouptitle>Управление языками</grouptitle> <grouptitle>Manage Languages</grouptitle>
<grouplang>core_languages</grouplang> <grouplang>core_languages</grouplang>
<items> <items>
<item> <item>
<key>lang_words</key> <key>lang_words</key>
<string>Может добавлять/изменять слова?</string> <string>Can add/edit the language bit texts?</string>
</item> </item>
<item> <item>
<key>lang_packs</key> <key>lang_packs</key>
<string>Может добавлять/изменять языковые наборы?</string> <string>Can add/edit language packs?</string>
</item> </item>
<item> <item>
<key>lang_pack_info</key> <key>lang_pack_info</key>
<string>Может изменять настройки и информацию языковых наборов?</string> <string>Can alter the language pack properties and information?</string>
</item> </item>
</items> </items>
</group> </group>
@@ -1,10 +1,10 @@
<html> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
@@ -1,408 +1,413 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* ACP Login/Logout Routines * ACP Login/Logout Routines
* 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> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since Tuesday 17th August 2004 * @since Tuesday 17th August 2004
* @version $Revision: 8644 $ * @version $Revision: 10914 $
*/ */
if ( ! defined( 'IN_ACP' ) ) 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'."; print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit(); exit();
} }
class admin_core_login_manualResolver extends ipsCommand class admin_core_login_manualResolver extends ipsCommand
{ {
/** /**
* HTML Skin object * HTML Skin object
* *
* @var object * @var object
*/ */
protected $html; protected $html;
/**#@+ /**#@+
* Registry objects * Registry objects
* *
* @var object * @var object
*/ */
public $registry; public $registry;
public $DB; public $DB;
public $settings; public $settings;
public $request; public $request;
public $lang; public $lang;
public $member; public $member;
public $memberData; public $memberData;
/**#@-*/ /**#@-*/
/** /**
* Login handler object * Login handler object
* *
* @var object * @var object
*/ */
protected $han_login; protected $han_login;
/** /**
* Initiate login handler * Initiate login handler
* *
* @return @e void * @return @e void
*/ */
public function initHanLogin() public function initHanLogin()
{ {
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$this->han_login = new $classToLoad( $this->registry ); $this->han_login = new $classToLoad( $this->registry );
$this->han_login->is_admin_auth = 1; $this->han_login->is_admin_auth = 1;
$this->han_login->init(); $this->han_login->init();
} }
/** /**
* Class entry point * Class entry point
* *
* @param object Registry reference * @param object Registry reference
* @param string Validation message * @param string Validation message
* @return @e void [Outputs to screen/redirects] * @return @e void [Outputs to screen/redirects]
*/ */
public function doExecute( ipsRegistry $registry, $validationMessage='' ) public function doExecute( ipsRegistry $registry, $validationMessage='' )
{ {
/* Make object */ /* Make object */
$this->registry = $registry; $this->registry = $registry;
$this->DB = $this->registry->DB(); $this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings(); $this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest(); $this->request =& $this->registry->fetchRequest();
$this->member = $this->registry->member(); $this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData(); $this->memberData =& $this->registry->member()->fetchMemberData();
$this->lang = $this->registry->getClass('class_localization'); $this->lang = $this->registry->getClass('class_localization');
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_login' ), 'core' ); $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_login' ), 'core' );
$this->initHanLogin(); $this->initHanLogin();
//----------------------------------------- //-----------------------------------------
// What to do? // What to do?
//----------------------------------------- //-----------------------------------------
switch( $this->request['do'] ) switch( $this->request['do'] )
{ {
case 'login': case 'login':
default: default:
$this->loginForm(); $this->loginForm();
break; break;
case 'login-complete': case 'login-complete':
$this->loginComplete(); $this->loginComplete();
break; break;
case 'login-out': case 'login-out':
$this->loginOut(); $this->loginOut();
break; break;
} }
} }
/** /**
* Check and verify the login was successful * Check and verify the login was successful
* *
* @return @e void * @return @e void
*/ */
public function loginComplete() public function loginComplete()
{ {
//----------------------------------------- /* Fetch sessions API */
// Check form details. $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/session/api.php', 'session_api' );
//----------------------------------------- $publicApi = new $classToLoad( $this->registry );
$this->request['email'] = str_replace( '|', '&#124;', $this->request['email'] ); //-----------------------------------------
// Check form details.
$username = ''; //-----------------------------------------
$email = '';
$this->request['email'] = str_replace( '|', '&#124;', $this->request['email'] );
//-----------------------------------------
// Is this a username or email address? $username = '';
//----------------------------------------- $email = '';
$_type = $this->han_login->emailOrUsername(); //-----------------------------------------
// Is this a username or email address?
switch( $_type ) //-----------------------------------------
{
case 1: $_type = $this->han_login->emailOrUsername();
$username = $this->request['username'];
break; switch( $_type )
{
case 2: case 1:
$email = $this->request['username']; $username = $this->request['username'];
break; break;
case 3: case 2:
$username = $this->request['username']; $email = $this->request['username'];
$email = $this->request['username']; break;
break;
} case 3:
$username = $this->request['username'];
//----------------------------------------- $email = $this->request['username'];
// Check auth break;
//----------------------------------------- }
$this->han_login->loginAuthenticate( $username, $email, trim($this->request['password']) ); //-----------------------------------------
// Check auth
//----------------------------------------- //-----------------------------------------
// Check return code...
//----------------------------------------- $this->han_login->loginAuthenticate( $username, $email, trim($this->request['password']) );
$mem = $this->han_login->member_data; //-----------------------------------------
// Check return code...
if ( ( ! $mem['member_id'] ) or ( $this->han_login->return_code == 'NO_USER' ) ) //-----------------------------------------
{
$this->_writeToLog( $this->request['username'], 'fail' ); $mem = $this->han_login->member_data;
$this->loginForm( $this->lang->words['bad_email_password'] );
} if ( ( ! $mem['member_id'] ) or ( $this->han_login->return_code == 'NO_USER' ) )
{
if ( $this->han_login->return_code == 'NO_ACCESS' ) $this->_writeToLog( $this->request['username'], 'fail' );
{ $this->loginForm( $this->lang->words['bad_email_password'] );
$this->_writeToLog( $this->request['username'], 'fail' ); }
$this->loginForm( $this->lang->words['no_acp_access'] );
} if ( $this->han_login->return_code == 'NO_ACCESS' )
else if ( $this->han_login->return_code != 'SUCCESS' ) {
{ $this->_writeToLog( $this->request['username'], 'fail' );
$this->_writeToLog( $this->request['username'], 'fail' ); $this->loginForm( $this->lang->words['no_acp_access'] );
$this->loginForm( $this->lang->words['bad_email_password'] ); }
} else if ( $this->han_login->return_code != 'SUCCESS' )
{
//----------------------------------------- $this->_writeToLog( $this->request['username'], 'fail' );
// And sort secondary groups... $this->loginForm( $this->lang->words['bad_email_password'] );
//----------------------------------------- }
$mem = $this->member->setUpSecondaryGroups( $mem ); //-----------------------------------------
// And sort secondary groups...
//----------------------------------------- //-----------------------------------------
// Check access...
//----------------------------------------- $mem = $this->member->setUpSecondaryGroups( $mem );
if ( $mem['g_access_cp'] != 1 ) //-----------------------------------------
{ // Check access...
$this->_writeToLog( $this->request['username'], 'fail' ); //-----------------------------------------
$this->loginForm( $this->lang->words['no_acp_access'] );
} if ( $mem['g_access_cp'] != 1 )
else {
{ $this->_writeToLog( $this->request['username'], 'fail' );
//----------------------------------------- $this->loginForm( $this->lang->words['no_acp_access'] );
// Fix up query string... }
//----------------------------------------- else
{
$extra_query = ""; //-----------------------------------------
// Fix up query string...
if ( $_POST['qstring'] ) //-----------------------------------------
{
$extra_query = stripslashes( $_POST['qstring'] ); $extra_query = "";
$extra_query = str_replace( $this->settings['_original_base_url'] , "" , $extra_query );
$extra_query = str_ireplace( "?index." . $this->settings['php_ext'] , "" , $extra_query ); if ( $_POST['qstring'] )
$extra_query = ltrim( $extra_query, '?' ); {
$extra_query = preg_replace( "!adsess=(\w){32}!" , "" , $extra_query ); $extra_query = stripslashes( $_POST['qstring'] );
$extra_query = str_replace( "adsess=x" , "" , $extra_query ); $extra_query = str_replace( $this->settings['_original_base_url'] , "" , $extra_query );
$extra_query = str_replace( array( 'old_&', 'old_&amp;' ) , "" , $extra_query ); $extra_query = str_ireplace( "?index." . $this->settings['php_ext'] , "" , $extra_query );
$extra_query = preg_replace( "!s=(\w){32}!" , "" , $extra_query ); $extra_query = ltrim( $extra_query, '?' );
$extra_query = str_replace( "module=login" , "" , $extra_query ); $extra_query = preg_replace( '!adsess=(\w){32}!' , "" , $extra_query );
$extra_query = str_replace( "do=login-complete" , "" , $extra_query ); $extra_query = str_replace( "adsess=x" , "" , $extra_query );
$extra_query = str_replace( "/admin" , "" , $extra_query ); $extra_query = str_replace( array( 'old_&', 'old_&amp;' ) , "" , $extra_query );
$extra_query = str_replace( '&amp;' , '&', $extra_query ); $extra_query = preg_replace( '!s=(\w){32}!' , "" , $extra_query );
$extra_query = preg_replace( "#&{1,}#" , "&", $extra_query ); $extra_query = str_replace( "module=login" , "" , $extra_query );
$extra_query = preg_replace( "#messageinabottleacp=(.*?)$#" , "" , $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 );
// Insert session $extra_query = preg_replace( "#messageinabottleacp=(.*?)$#" , "" , $extra_query );
//----------------------------------------- }
$sess_id = md5( uniqid( microtime() ) ); //-----------------------------------------
// Insert session
$this->DB->delete( 'core_sys_cp_sessions', 'session_member_id=' . $mem['member_id'] ); //-----------------------------------------
/* Grab user agent */ $sess_id = md5( uniqid( microtime() ) );
$uAgent = array();
$this->DB->delete( 'core_sys_cp_sessions', 'session_member_id=' . $mem['member_id'] );
$this->DB->insert( 'core_sys_cp_sessions', array (
'session_id' => $sess_id, /* Grab user agent */
'session_ip_address' => $this->member->ip_address, $uAgent = array();
'session_member_name' => $mem['members_display_name'],
'session_member_id' => $mem['member_id'], $this->DB->insert( 'core_sys_cp_sessions', array( 'session_id' => $sess_id,
'session_member_login_key' => $mem['member_login_key'], 'session_ip_address' => $this->member->ip_address,
'session_location' => 'index', 'session_member_name' => $mem['members_display_name'],
'session_log_in_time' => time(), 'session_member_id' => $mem['member_id'],
'session_running_time' => time(), 'session_member_login_key' => $mem['member_login_key'],
'session_app_data' => serialize( $uAgent ), 'session_location' => 'index',
'session_url' => '', 'session_log_in_time' => time(),
) ); 'session_running_time' => time(),
'session_app_data' => serialize( $uAgent ),
$this->request['adsess'] = $sess_id; 'session_url' => '' ) );
//----------------------------------------- $this->request['adsess'] = $sess_id;
// Redirect...
//----------------------------------------- /* Log them in public side if not already */
$publicApi->logGuestInAsMember( $mem['member_id'] );
$url = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/index.php?adsess=' . $sess_id . '&' . $extra_query;
//-----------------------------------------
$this->_writeToLog( $this->request['username'], 'ok' ); // Redirect...
//-----------------------------------------
ipsRegistry::getClass('output')->global_message = '';
ipsRegistry::getClass('output')->silentRedirect( $url ); $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 = '';
* Log the user out ipsRegistry::getClass('output')->silentRedirect( $url );
* }
* @return @e void }
*/
public function loginOut() /**
{ * Log the user out
//----------------------------------------- *
// Do it.. * @return @e void
//----------------------------------------- */
public function loginOut()
$this->DB->delete( 'core_sys_cp_sessions', "session_id='" . $this->request['adsess'] . "'" ); {
//-----------------------------------------
//----------------------------------------- // Do it..
// Redirect... //-----------------------------------------
//-----------------------------------------
$this->DB->delete( 'core_sys_cp_sessions', "session_id='" . $this->request['adsess'] . "'" );
ipsRegistry::getClass('output')->redirect( $this->settings['base_url'] . '/' . CP_DIRECTORY . '/index.php', $this->lang->words['logout_complete'] );
} //-----------------------------------------
// Redirect...
/** //-----------------------------------------
* Log the user out
* ipsRegistry::getClass('output')->silentRedirect( $this->settings['_admin_link'] );
* @param string Message to show on the form }
* @return @e void
*/ /**
public function loginForm( $message='' ) * Log the user out
{ *
//----------------------------------------- * @param string Message to show on the form
// INIT * @return @e void
//----------------------------------------- */
public function loginForm( $message='' )
$message = $message ? $message : $this->member->sessionClass()->getMessage(); {
//-----------------------------------------
//------------------------------------------------------- // INIT
// Remove all out of date sessions, like a good boy. Woof. //-----------------------------------------
//-------------------------------------------------------
$message = $message ? $message : $this->member->sessionClass()->getMessage();
$cut_off_stamp = time() - 60*60*2;
//-------------------------------------------------------
$this->DB->delete( 'core_sys_cp_sessions', "session_running_time < {$cut_off_stamp}" ); // Remove all out of date sessions, like a good boy. Woof.
//-------------------------------------------------------
//------------------------------------------------------
// Start form $cut_off_stamp = time() - 60*60*2;
//------------------------------------------------------
$this->DB->delete( 'core_sys_cp_sessions', "session_running_time < {$cut_off_stamp}" );
$qs = str_replace( '&amp;' , '&' , IPSText::parseCleanValue( urldecode( my_getenv( 'QUERY_STRING' ) ) ) );
$qs = str_replace( 'adsess=' , 'old_adsess=' , $qs ); //------------------------------------------------------
$qs = str_replace( 'module=menu', '' , $qs ); // Start form
//------------------------------------------------------
$additional_data = $this->han_login->additionalFormHTML();
$replace = false; $qs = str_replace( '&amp;' , '&' , IPSText::parseCleanValue( urldecode( my_getenv( 'QUERY_STRING' ) ) ) );
$data = array(); $qs = str_replace( 'adsess=' , 'old_adsess=' , $qs );
$qs = str_replace( 'module=menu', '' , $qs );
if( !is_null($additional_data) AND is_array($additional_data) AND count($additional_data) )
{ $additional_data = $this->han_login->additionalFormHTML();
$replace = $additional_data[0]; $replace = false;
$data = $additional_data[1]; $data = array();
}
if( !is_null($additional_data) AND is_array($additional_data) AND count($additional_data) )
$uses_name = false; {
$uses_email = false; $replace = $additional_data[0];
$data = $additional_data[1];
foreach( ipsRegistry::cache()->getCache('login_methods') as $method ) }
{
$login_methods[ $method['login_folder_name'] ] = $method['login_folder_name']; $uses_name = false;
$uses_email = false;
if( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' )
{ foreach( ipsRegistry::cache()->getCache('login_methods') as $method )
$uses_name = true; {
} $login_methods[ $method['login_folder_name'] ] = $method['login_folder_name'];
if( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' ) if( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' )
{ {
$uses_email = true; $uses_name = true;
} }
}
if( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' )
if( $uses_name AND $uses_email ) {
{ $uses_email = true;
$this->lang->words['gl_signinname'] = $this->lang->words['enter_name_and_email']; }
} }
else if( $uses_email )
{ if( $uses_name AND $uses_email )
$this->lang->words['gl_signinname'] = $this->lang->words['enter_useremail']; {
} $this->lang->words['gl_signinname'] = $this->lang->words['enter_name_and_email'];
else }
{ else if( $uses_email )
$this->lang->words['gl_signinname'] = $this->lang->words['enter_username']; {
} $this->lang->words['gl_signinname'] = $this->lang->words['enter_useremail'];
}
ipsRegistry::getClass('output')->html_title = $this->lang->words['ipb_login']; else
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 ); $this->lang->words['gl_signinname'] = $this->lang->words['enter_username'];
}
@header("Content-type: text/html");
print ipsRegistry::getClass('output')->html_main; ipsRegistry::getClass('output')->html_title = $this->lang->words['ipb_login'];
exit(); 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");
* Write to the admin log in loggy ma log print ipsRegistry::getClass('output')->html_main;
* exit();
* @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 * Write to the admin log in loggy ma log
*/ *
private function _writeToLog( $username='', $flag='fail' ) * @param string Username
{ * @param string ok/fail flag
//----------------------------------------- * @return @e void
// INIT * @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' )
$username = $username ? $username : $this->request['username']; {
$flag = ( $flag == 'ok' ) ? 1 : 0; //-----------------------------------------
$admin_post_details = array(); // INIT
//-----------------------------------------
//-----------------------------------------
// Generate POST / GET details $username = $username ? $username : $this->request['username'];
//----------------------------------------- $flag = ( $flag == 'ok' ) ? 1 : 0;
$admin_post_details = array();
foreach( $_GET as $k => $v )
{ //-----------------------------------------
$admin_post_details['get'][ $k ] = $v; // Generate POST / GET details
} //-----------------------------------------
foreach( $_POST as $k => $v ) foreach( $_GET as $k => $v )
{ {
if ( $k == 'password' AND IPSText::mbstrlen( $v ) > 1 ) $admin_post_details['get'][ $k ] = $v;
{ }
$v = $v ? ( (IPSText::mbstrlen( $v ) - 1) > 0 ? str_repeat( '*', IPSText::mbstrlen( $v ) - 1 ) : '' ) . substr( $v, -1, 1 ) : '';
} foreach( $_POST as $k => $v )
{
$admin_post_details['post'][ $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 ) : '';
//----------------------------------------- }
// Write to disk...
//----------------------------------------- $admin_post_details['post'][ $k ] = $v;
}
$this->DB->insert( 'admin_login_logs', array( 'admin_ip_address' => $this->member->ip_address,
'admin_username' => $username, //-----------------------------------------
'admin_time' => time(), // Write to disk...
'admin_success' => $flag, //-----------------------------------------
'admin_post_details' => serialize( $admin_post_details ) ) );
} $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 <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Admin logs * Admin logs
* Last Updated: $LastChangedDate: 2011-06-01 22:13:27 -0400 (Wed, 01 Jun 2011) $ * Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: bfarber $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since 27th January 2004 * @since 27th January 2004
* @version $Rev: 8938 $ * @version $Rev: 10914 $
*/ */
if ( ! defined( 'IN_ACP' ) ) 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'."; print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit(); exit();
} }
class admin_core_logs_adminlogs extends ipsCommand class admin_core_logs_adminlogs extends ipsCommand
{ {
/** /**
* Skin object * Skin object
* *
* @var object Skin templates * @var object Skin templates
*/ */
protected $html; protected $html;
/** /**
* Main class entry point * Main class entry point
* *
* @param object ipsRegistry reference * @param object ipsRegistry reference
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
//----------------------------------------- //-----------------------------------------
// Load skin // Load skin
//----------------------------------------- //-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_adminlogs'); $this->html = $this->registry->output->loadTemplate('cp_skin_adminlogs');
//----------------------------------------- //-----------------------------------------
// Set up stuff // Set up stuff
//----------------------------------------- //-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=adminlogs'; $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'; $this->form_code_js = $this->html->form_code_js = 'module=logs&section=adminlogs';
//----------------------------------------- //-----------------------------------------
// Load lang // Load lang
//----------------------------------------- //-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) ); $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
//----------------------------------------- ///----------------------------------------
// Fix up navigation bar // What to do...
//----------------------------------------- //-----------------------------------------
$this->registry->output->core_nav = array(); switch( $this->request['do'] )
$this->registry->output->ignoreCoreNav = true; {
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] ); case 'view':
$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'] );
$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;
// What to do...
//----------------------------------------- case 'remove':
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=adminlogs', $this->lang->words['alog_adminlogs'] );
switch( $this->request['do'] ) $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'adminlogs_delete' );
{ $this->_remove();
case 'view': break;
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'adminlogs_view' );
$this->_view(); default:
break; $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' );
case 'remove': $this->_listCurrent();
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'adminlogs_delete' ); break;
$this->_remove(); case 'showArchived':
break; $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs&section=adminlogs&do=showArchived', $this->lang->words['archiver_title'] );
$this->_listArchiver();
default: break;
$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();
/* 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]
* View all logs for a given admin */
* protected function _listArchiver()
* @return @e void [Outputs to screen] {
*/ $data = array();
protected function _view() $start = intval( $this->request['st'] );
{
///---------------------------------------- /* Get count */
// Basic init $count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'core_archive_log' ) );
//-----------------------------------------
$this->DB->build( array( 'select' => '*',
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; 'from' => 'core_archive_log',
'order' => 'archlog_date DESC',
///---------------------------------------- 'limit' => array( $start, 50 ) ) );
// No mid or search string? $this->DB->execute();
//-----------------------------------------
while( $row = $this->DB->fetch() )
if ( !$this->request['search_string'] AND !$this->request['mid'] ) {
{ $data[] = $row;
$this->registry->output->global_message = $this->lang->words['alog_nostring']; }
$this->_listCurrent();
return; /* Pagination */
} $links = $this->registry->output->generatePagination( array( 'totalItems' => $count['count'],
'itemsPerPage' => 50,
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid']; 'currentStartValue' => $start,
'baseUrl' => $this->settings['base_url'] . $this->form_code . '&amp;do=showArchived' ) );
///----------------------------------------
// mid? /* Show output */
//-----------------------------------------
$this->registry->output->html .= $this->html->archiverlogsView( $data, $links );
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']) ) ); /**
* View all logs for a given admin
$query = "{$this->form_code}&amp;mid=" . ( $this->request['mid'] ? $this->request['mid'] : 'zero' ) . "&amp;do=view"; *
* @return @e void [Outputs to screen]
$this->DB->build( array( 'select' => 'm.*', */
'from' => array( 'admin_logs' => 'm' ), protected function _view()
'where' => 'm.member_id=' . intval($this->request['mid']), {
'order' => 'm.ctime DESC', ///----------------------------------------
'limit' => array( $start, 20 ), // Basic init
'add_join' => array( //-----------------------------------------
array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ), $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
'where' => 'mem.member_id=m.member_id',
'type' => 'left' ///----------------------------------------
) // No mid or search string?
) //-----------------------------------------
) );
$this->DB->execute(); if ( !$this->request['search_string'] AND !$this->request['mid'] )
} {
$this->registry->output->global_message = $this->lang->words['alog_nostring'];
///---------------------------------------- $this->_listCurrent();
// search string? return;
//----------------------------------------- }
else $this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
{
$this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) ); ///----------------------------------------
// mid?
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_string'] )
} {
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'admin_logs', 'where' => "member_id=" . intval($this->request['mid']) ) );
if( $this->request['search_type'] == 'member_id' )
{ $query = "{$this->form_code}&amp;mid=" . ( $this->request['mid'] ? $this->request['mid'] : 'zero' ) . "&amp;do=view";
$dbq = "m." . $this->request['search_type'] . "='" . $this->request['search_string'] . "'";
} $this->DB->build( array( 'select' => 'm.*',
else 'from' => array( 'admin_logs' => 'm' ),
{ 'where' => 'm.member_id=' . intval($this->request['mid']),
$dbq = "m." . $this->request['search_type'] . " LIKE '%" . $this->request['search_string'] . "%'"; 'order' => 'm.ctime DESC',
} 'limit' => array( $start, 20 ),
'add_join' => array(
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'admin_logs m', 'where' => $dbq ) ); array( 'select' => 'mem.members_display_name',
'from' => array( 'members' => 'mem' ),
$query = "{$this->form_code}&amp;do=view&amp;search_type=" . $this->request['search_type'] . "&amp;search_string=" . urlencode($this->request['search_string']); 'where' => 'mem.member_id=m.member_id',
'type' => 'left'
$this->DB->build( array( 'select' => 'm.*', )
'from' => array( 'admin_logs' => 'm' ), )
'where' => $dbq, ) );
'order' => 'm.ctime DESC', $this->DB->execute();
'limit' => array( $start, 20 ), }
'add_join' => array(
array( 'select' => 'mem.members_display_name', ///----------------------------------------
'from' => array( 'members' => 'mem' ), // search string?
'where' => 'mem.member_id=m.member_id', //-----------------------------------------
'type' => 'left'
) else
) {
) ); $this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
$this->DB->execute();
} if( !$this->DB->checkForField( $this->request['search_type'], 'admin_logs' ) )
{
///---------------------------------------- $this->registry->output->showError( $this->lang->words['alog_whatfield'], 4110, true );
// Page links }
//-----------------------------------------
if( $this->request['search_type'] == 'member_id' )
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'], {
'itemsPerPage' => 20, $dbq = "m." . $this->request['search_type'] . "='" . $this->request['search_string'] . "'";
'currentStartValue' => $start, }
'baseUrl' => $this->settings['base_url'] . $query, else
) {
); $dbq = "m." . $this->request['search_type'] . " LIKE '%" . $this->request['search_string'] . "%'";
}
///----------------------------------------
// Get db results $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']);
while ( $row = $this->DB->fetch() )
{ $this->DB->build( array( 'select' => 'm.*',
if( !$row['member_id'] ) 'from' => array( 'admin_logs' => 'm' ),
{ 'where' => $dbq,
$row['member_id'] = 'zero'; 'order' => 'm.ctime DESC',
} 'limit' => array( $start, 20 ),
'add_join' => array(
if( !$row['members_display_name'] ) array( 'select' => 'mem.members_display_name',
{ 'from' => array( 'members' => 'mem' ),
$row['members_display_name'] = $this->lang->words['noname_availabl']; 'where' => 'mem.member_id=m.member_id',
} 'type' => 'left'
)
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' ); )
$rows[] = $row; ) );
} $this->DB->execute();
}
///----------------------------------------
// And output ///----------------------------------------
//----------------------------------------- // Page links
//-----------------------------------------
$this->registry->output->html .= $this->html->adminlogsView( $rows, $links );
} $links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'],
'itemsPerPage' => 20,
/** 'currentStartValue' => $start,
* Remove logs by an admin 'baseUrl' => $this->settings['base_url'] . $query,
* )
* @return @e void [Outputs to screen] );
*/
protected function _remove() ///----------------------------------------
{ // Get db results
if ( !$this->request['mid'] ) //-----------------------------------------
{
$this->registry->output->showError( $this->lang->words['alog_whoselog'], 11114 ); while ( $row = $this->DB->fetch() )
} {
if( !$row['member_id'] )
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid']; {
$row['member_id'] = 'zero';
$this->DB->delete( 'admin_logs', "member_id=" . intval($this->request['mid']) ); }
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->form_code ); if( !$row['members_display_name'] )
} {
$row['members_display_name'] = $this->lang->words['noname_availabl'];
/** }
* List the current logs with links to view per-admin
* $row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
* @return @e void [Outputs to screen] $rows[] = $row;
*/ }
protected function _listCurrent()
{ ///----------------------------------------
$rows = array(); // And output
$admins = array(); //-----------------------------------------
//----------------------------------------- $this->registry->output->html .= $this->html->adminlogsView( $rows, $links );
// LAST FIVE ACTIONS }
//-----------------------------------------
/**
$this->DB->build( array( 'select' => 'm.*', * Remove logs by an admin
'from' => array( 'admin_logs' => 'm' ), *
'order' => 'm.ctime DESC', * @return @e void [Outputs to screen]
'limit' => array( 5 ), */
'add_join' => array( protected function _remove()
array( 'select' => 'mem.members_display_name', {
'from' => array( 'members' => 'mem' ), if ( !$this->request['mid'] )
'where' => 'mem.member_id=m.member_id', {
'type' => 'left' $this->registry->output->showError( $this->lang->words['alog_whoselog'], 11114 );
) }
)
) ); $this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
$this->DB->execute();
$this->DB->delete( 'admin_logs', "member_id=" . intval($this->request['mid']) );
while ( $row = $this->DB->fetch() )
{ $this->registry->output->silentRedirect( $this->settings['base_url'] . $this->form_code );
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' ); }
$rows[] = $row;
} /**
* List the current logs with links to view per-admin
//----------------------------------------- *
// All admins * @return @e void [Outputs to screen]
//----------------------------------------- */
protected function _listCurrent()
$this->DB->build( array( {
'select' => 'count(l.member_id) as act_count, l.member_id', $rows = array();
'from' => array( 'admin_logs' => 'l' ), $admins = array();
'group' => 'l.member_id',
'order' => 'act_count DESC', //-----------------------------------------
'add_join' => array( // LAST FIVE ACTIONS
array( //-----------------------------------------
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ), $this->DB->build( array( 'select' => 'm.*',
'where' => 'm.member_id=l.member_id', 'from' => array( 'admin_logs' => 'm' ),
'type' => 'left', 'order' => 'm.ctime DESC',
), 'limit' => array( 5 ),
), 'add_join' => array(
) ); array( 'select' => 'mem.members_display_name',
$this->DB->execute(); 'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=m.member_id',
while ( $r = $this->DB->fetch() ) 'type' => 'left'
{ )
if( !$r['member_id'] ) )
{ ) );
$r['member_id'] = 'zero'; $this->DB->execute();
}
while ( $row = $this->DB->fetch() )
if( !$r['members_display_name'] ) {
{ $row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
$r['members_display_name'] = $this->lang->words['noname_availabl']; $rows[] = $row;
} }
$admins[ $r['member_id'] ] = $r; //-----------------------------------------
} // All admins
//-----------------------------------------
//-----------------------------------------
// And output $this->DB->build( array(
//----------------------------------------- 'select' => 'count(l.member_id) as act_count, l.member_id',
'from' => array( 'admin_logs' => 'l' ),
$this->registry->output->html .= $this->html->adminlogsWrapper( $rows, $admins ); '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 * @file defaultSection.php Define the default section for the 'logs' module
*~TERABYTE_DOC_READY~ *~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED! * $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $ * $Author: bfarber $
* @since 20th February 2002 * @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ * $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.2.3 * @version v3.3.4
* $Revision: 8655 $ * $Revision: 10914 $
*/ */
$DEFAULT_SECTION = 'adminlogs'; $DEFAULT_SECTION = 'logsSplash';
@@ -1,275 +1,267 @@
<?php <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Email error logs * Email error logs
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $ * Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since 27th January 2004 * @since 27th January 2004
* @version $Rev: 8644 $ * @version $Rev: 10914 $
*/ */
if ( ! defined( 'IN_ACP' ) ) 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'."; print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit(); exit();
} }
class admin_core_logs_emailerrorlogs extends ipsCommand class admin_core_logs_emailerrorlogs extends ipsCommand
{ {
/** /**
* Skin object * Skin object
* *
* @var object Skin templates * @var object Skin templates
*/ */
protected $html; protected $html;
/** /**
* Main class entry point * Main class entry point
* *
* @param object ipsRegistry reference * @param object ipsRegistry reference
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
//----------------------------------------- //-----------------------------------------
// Load skin // Load skin
//----------------------------------------- //-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_emailerrorlogs'); $this->html = $this->registry->output->loadTemplate('cp_skin_emailerrorlogs');
//----------------------------------------- //-----------------------------------------
// Set up stuff // Set up stuff
//----------------------------------------- //-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=emailerrorlogs'; $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'; $this->form_code_js = $this->html->form_code_js = 'module=logs&section=emailerrorlogs';
//----------------------------------------- //-----------------------------------------
// Load lang // Load lang
//----------------------------------------- //-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) ); $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'] );
// Fix up navigation bar
//----------------------------------------- ///----------------------------------------
// What to do...
$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'] ); switch( $this->request['do'] )
$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'] ); default:
case 'list':
///---------------------------------------- $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_view' );
// What to do... $this->_listCurrent();
//----------------------------------------- break;
switch( $this->request['do'] ) case 'remove':
{ $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_delete' );
default: $this->_remove();
case 'list': break;
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_view' );
$this->_listCurrent(); case 'viewemail':
break; $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_view' );
$this->_viewEmail();
case 'remove': break;
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_delete' ); }
$this->_remove();
break; /* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
case 'viewemail': $this->registry->output->sendOutput();
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_view' ); }
$this->_viewEmail();
break; /**
} * Remove email logs
*
/* Output */ * @return @e void [Outputs to screen]
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); */
$this->registry->output->sendOutput(); protected function _remove()
} {
if ( $this->request['type'] == 'all' )
/** {
* Remove email logs $this->DB->delete( 'mail_error_logs' );
* }
* @return @e void [Outputs to screen] else
*/ {
protected function _remove() $ids = array();
{
if ( $this->request['type'] == 'all' ) foreach ( $this->request as $k => $v )
{ {
$this->DB->delete( 'mail_error_logs' ); if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
} {
else if ($this->request[ $match[0] ] )
{ {
$ids = array(); $ids[] = $match[1];
}
foreach ( $this->request as $k => $v ) }
{ }
if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
{ $ids = IPSLib::cleanIntArray( $ids );
if ($this->request[ $match[0] ] )
{ //-----------------------------------------
$ids[] = $match[1];
} if ( count($ids) < 1 )
} {
} $this->registry->output->showError( $this->lang->words['erlog_noneselected'], 11115 );
}
$ids = IPSLib::cleanIntArray( $ids );
$this->DB->delete( 'mail_error_logs', "mlog_id IN (" . implode( ',', $ids ) . ")" );
//----------------------------------------- }
if ( count($ids) < 1 ) $this->registry->getClass('adminFunctions')->saveAdminLog( $this->lang->words['erlog_removed'] );
{
$this->registry->output->showError( $this->lang->words['erlog_noneselected'], 11115 ); $this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
} }
$this->DB->delete( 'mail_error_logs', "mlog_id IN (" . implode( ',', $ids ) . ")" ); /**
} * List the current logs
*
$this->registry->getClass('adminFunctions')->saveAdminLog( $this->lang->words['erlog_removed'] ); * @return @e void [Outputs to screen]
*/
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" ); protected function _listCurrent()
} {
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
/**
* List the current logs //-----------------------------------------
* // Check URL parameters
* @return @e void [Outputs to screen] //-----------------------------------------
*/
protected function _listCurrent() $url_query = array();
{ $db_query = array();
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
if ( $this->request['type'] AND $this->request['type'] != "" )
//----------------------------------------- {
// Check URL parameters $string = IPSText::parseCleanValue( urldecode($this->request['string']) );
//-----------------------------------------
if ( $string == "" )
$url_query = array(); {
$db_query = array(); $this->registry->output->showError( $this->lang->words['erlog_enter_sumthang_yo'], 11116 );
}
if ( $this->request['type'] AND $this->request['type'] != "" )
{ $url_query[] = 'type=' . $this->request['type'];
$string = IPSText::parseCleanValue( urldecode($this->request['string']) ); $url_query[] = 'string=' . urlencode($string);
if ( $string == "" ) switch( $this->request['type'] )
{ {
$this->registry->output->showError( $this->lang->words['erlog_enter_sumthang_yo'], 11116 ); 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;
$url_query[] = 'type=' . $this->request['type'];
$url_query[] = 'string=' . urlencode($string); case 'email_from':
$db_query[] = $this->request['match'] == 'loose' ? "mlog_from LIKE '%{$string}%'" : "mlog_from='{$string}'";
switch( $this->request['type'] ) break;
{ case 'email_to':
case 'subject': $db_query[] = $this->request['match'] == 'loose' ? "mlog_to LIKE '%{$string}%'" : "mlog_to='{$string}'";
$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;
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}'";
case 'email_from': break;
$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}'"; if( $this->request['match'] )
break; {
case 'error': $url_query[] = 'match=' . $this->request['match'];
$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;
} //-----------------------------------------
} // LIST 'EM
//-----------------------------------------
if( $this->request['match'] )
{ $dbe = "";
$url_query[] = 'match=' . $this->request['match']; $url = "";
}
if ( count($db_query) > 0 )
//----------------------------------------- {
// LIST 'EM $dbe = implode( ' AND ', $db_query );
//----------------------------------------- }
$dbe = ""; if ( count($url_query) > 0 )
$url = ""; {
$url = '&amp;' . implode( '&amp;', $url_query );
if ( count($db_query) > 0 ) }
{
$dbe = implode( ' AND ', $db_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'],
if ( count($url_query) > 0 ) 'itemsPerPage' => 25,
{ 'currentStartValue' => $start,
$url = '&amp;' . implode( '&amp;', $url_query ); 'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}" . $url,
} )
);
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as cnt', 'from' => 'mail_error_logs', 'where' => $dbe ) );
$this->DB->build( array( 'select' => '*', 'from' => 'mail_error_logs', 'where' => $dbe, 'order' => 'mlog_date DESC', 'limit' => array( $start, 25 ) ) );
$links = $this->registry->output->generatePagination( array( 'totalItems' => $count['cnt'], $this->DB->execute();
'itemsPerPage' => 25,
'currentStartValue' => $start, while ( $row = $this->DB->fetch() )
'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}" . $url, {
) $row['_date'] = $this->registry->class_localization->getDate( $row['mlog_date'], 'SHORT' );
);
$row['mlog_subject'] = ( empty( $row['mlog_subject'] ) ) ? '--' : $row['mlog_subject'];
$this->DB->build( array( 'select' => '*', 'from' => 'mail_error_logs', 'where' => $dbe, 'order' => 'mlog_date DESC', 'limit' => array( $start, 25 ) ) ); $row['mlog_subject'] = ( strpos( $row['mlog_subject'], "=?".IPS_DOC_CHAR_SET."?Q?" ) !== FALSE )
$this->DB->execute(); ? 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'];
while ( $row = $this->DB->fetch() )
{ $rows[] = $row;
$row['_date'] = $this->registry->class_localization->getDate( $row['mlog_date'], 'SHORT' ); }
$row['mlog_subject'] = ( empty( $row['mlog_subject'] ) ) ? '--' : $row['mlog_subject']; $this->registry->output->html .= $this->html->emailerrorlogsWrapper( $rows, $links );
$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']; /**
* View an individual email
$rows[] = $row; *
} * @return @e void [Outputs to screen]
*/
$this->registry->output->html .= $this->html->emailerrorlogsWrapper( $rows, $links ); protected function _viewEmail()
} {
if ( !$this->request['id'] )
/** {
* View an individual email $this->registry->output->showError( $this->lang->words['erlog_404'], 11117 );
* }
* @return @e void [Outputs to screen]
*/ $id = intval($this->request['id']);
protected function _viewEmail()
{ $row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'mail_error_logs', 'where' => "mlog_id={$id}" ) );
if ( !$this->request['id'] )
{ if ( ! $row['mlog_id'] )
$this->registry->output->showError( $this->lang->words['erlog_404'], 11117 ); {
} $this->registry->output->showError( $this->lang->words['erlog_404'], 11118 );
}
$id = intval($this->request['id']);
$row['_date'] = $this->registry->class_localization->getDate( $row['mlog_date'], 'LONG' );
$row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'mail_error_logs', 'where' => "mlog_id={$id}" ) ); $row['mlog_content'] = nl2br($row['mlog_content']);
if ( ! $row['mlog_id'] ) $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'] ) ) )
$this->registry->output->showError( $this->lang->words['erlog_404'], 11118 ); : $row['mlog_subject'];
}
$row['mlog_msg'] = $row['mlog_msg'] ? $row['mlog_msg'] : $this->lang->words['erlog_noinfo'];
$row['_date'] = $this->registry->class_localization->getDate( $row['mlog_date'], 'LONG' ); $row['mlog_code'] = $row['mlog_code'] ? $row['mlog_code'] : $this->lang->words['erlog_noinfo'];
$row['mlog_content'] = nl2br($row['mlog_content']); $row['mlog_smtp_error'] = $row['mlog_smtp_error'] ? $row['mlog_smtp_error'] : $this->lang->words['erlog_noinfo'];
$row['mlog_subject'] = ( strpos( $row['mlog_subject'], "=?".IPS_DOC_CHAR_SET."?Q?" ) !== FALSE ) $this->registry->output->html .= $this->html->emailerrorlogsEmail( $row );
? 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']; $this->registry->output->printPopupWindow();
}
$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 <?php
/** /**
* <pre> * <pre>
* Invision Power Services * Invision Power Services
* IP.Board v3.2.3 * IP.Board v3.3.4
* Error logs * Error logs
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $ * Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre> * </pre>
* *
* @author $Author: ips_terabyte $ * @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED! * @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board * @package IP.Board
* @subpackage Core * @subpackage Core
* @link http://hatynka.in * @link http://www.invisionpower.com
* @since 27th January 2004 * @since 27th January 2004
* @version $Rev: 8644 $ * @version $Rev: 10914 $
*/ */
if ( ! defined( 'IN_ACP' ) ) 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'."; print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit(); exit();
} }
class admin_core_logs_errorlogs extends ipsCommand class admin_core_logs_errorlogs extends ipsCommand
{ {
/** /**
* Skin object * Skin object
* *
* @var object Skin templates * @var object Skin templates
*/ */
protected $html; protected $html;
/** /**
* Main class entry point * Main class entry point
* *
* @param object ipsRegistry reference * @param object ipsRegistry reference
* @return @e void [Outputs to screen] * @return @e void [Outputs to screen]
*/ */
public function doExecute( ipsRegistry $registry ) public function doExecute( ipsRegistry $registry )
{ {
//----------------------------------------- //-----------------------------------------
// Load skin // Load skin
//----------------------------------------- //-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_errorlogs'); $this->html = $this->registry->output->loadTemplate('cp_skin_errorlogs');
//----------------------------------------- //-----------------------------------------
// Set up stuff // Set up stuff
//----------------------------------------- //-----------------------------------------
$this->form_code = $this->html->form_code = 'module=logs&amp;section=errorlogs'; $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'; $this->form_code_js = $this->html->form_code_js = 'module=logs&section=errorlogs';
//----------------------------------------- //-----------------------------------------
// Load lang // Load lang
//----------------------------------------- //-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) ); $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'] );
// Fix up navigation bar
//----------------------------------------- ///----------------------------------------
// What to do...
$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'] ); switch( $this->request['do'] )
$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'] ); default:
case 'list':
///---------------------------------------- $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'errorlogs_view' );
// What to do... $this->_listCurrent();
//----------------------------------------- break;
switch( $this->request['do'] ) case 'remove':
{ $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'errorlogs_delete' );
default: $this->_remove();
case 'list': break;
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'errorlogs_view' ); }
$this->_listCurrent();
break; /* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
case 'remove': $this->registry->output->sendOutput();
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'errorlogs_delete' ); }
$this->_remove();
break; /**
} * Remove email logs
*
/* Output */ * @return @e void [Outputs to screen]
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); */
$this->registry->output->sendOutput(); protected function _remove()
} {
if( $this->request['type'] == 'all' )
/** {
* Remove email logs $this->DB->delete( 'error_logs' );
* }
* @return @e void [Outputs to screen] else
*/ {
protected function _remove() $ids = array();
{
if( $this->request['type'] == 'all' ) foreach( $this->request as $k => $v )
{ {
$this->DB->delete( 'error_logs' ); if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
} {
else if ($this->request[ $match[0] ] )
{ {
$ids = array(); $ids[] = $match[1];
}
foreach( $this->request as $k => $v ) }
{ }
if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
{ $ids = IPSLib::cleanIntArray( $ids );
if ($this->request[ $match[0] ] )
{ //-----------------------------------------
$ids[] = $match[1];
} if( count($ids) < 1 )
} {
} $this->registry->output->showError( $this->lang->words['erlog_noneselected'], 11115 );
}
$ids = IPSLib::cleanIntArray( $ids );
$this->DB->delete( 'error_logs', "log_id IN (" . implode( ',', $ids ) . ")" );
//----------------------------------------- }
if( count($ids) < 1 ) $this->registry->adminFunctions->saveAdminLog( $this->lang->words['error_log_removed'] );
{
$this->registry->output->showError( $this->lang->words['erlog_noneselected'], 11115 ); $this->registry->output->silentRedirect( $this->settings['base_url'] . "&{$this->form_code}" );
} }
$this->DB->delete( 'error_logs', "log_id IN (" . implode( ',', $ids ) . ")" ); /**
} * List the current logs
*
$this->registry->adminFunctions->saveAdminLog( $this->lang->words['error_log_removed'] ); * @return @e void [Outputs to screen]
*/
$this->registry->output->silentRedirect( $this->settings['base_url'] . "&{$this->form_code}" ); protected function _listCurrent()
} {
$start = intval( $this->request['st'] ) >= 0 ? intval( $this->request['st'] ) : 0;
/**
* List the current logs /* Check URL parameters */
* $url_query = array();
* @return @e void [Outputs to screen] $db_query = array();
*/
protected function _listCurrent() if( $this->request['type'] )
{ {
$start = intval( $this->request['st'] ) >= 0 ? intval( $this->request['st'] ) : 0; $string = IPSText::parseCleanValue( urldecode( $this->request['string'] ) );
/* Check URL parameters */ if( $string == "" )
$url_query = array(); {
$db_query = array(); $this->registry->output->showError( $this->lang->words['erlog_enter_sumthang_yo'], 11116 );
}
if( $this->request['type'] )
{ $url_query[] = 'type=' . $this->request['type'];
$string = IPSText::parseCleanValue( urldecode( $this->request['string'] ) ); $url_query[] = 'string=' . urlencode( $string );
if( $string == "" ) switch( $this->request['type'] )
{ {
$this->registry->output->showError( $this->lang->words['erlog_enter_sumthang_yo'], 11116 ); case 'log_error':
} $db_query[] = $this->request['match'] == 'loose' ? "e.log_error LIKE '%{$string}%'" : "e.log_error='{$string}'";
break;
$url_query[] = 'type=' . $this->request['type'];
$url_query[] = 'string=' . urlencode( $string ); case 'log_error_code':
$db_query[] = $this->request['match'] == 'loose' ? "e.log_error_code LIKE '%{$string}%'" : "e.log_error_code='{$string}'";
switch( $this->request['type'] ) break;
{
case 'log_error': case 'log_request_uri':
$db_query[] = $this->request['match'] == 'loose' ? "e.log_error LIKE '%{$string}%'" : "e.log_error='{$string}'"; $db_query[] = $this->request['match'] == 'loose' ? "e.log_request_uri LIKE '%{$string}%'" : "e.log_request_uri='{$string}'";
break; break;
case 'log_error_code': case 'members_display_name':
$db_query[] = $this->request['match'] == 'loose' ? "e.log_error_code LIKE '%{$string}%'" : "e.log_error_code='{$string}'"; $db_query[] = $this->request['match'] == 'loose' ? "m.members_display_name LIKE '%{$string}%'" : "m.members_display_name='{$string}'";
break; break;
}
case 'log_request_uri': }
$db_query[] = $this->request['match'] == 'loose' ? "e.log_request_uri LIKE '%{$string}%'" : "e.log_request_uri='{$string}'";
break; /* Build extra query stuff */
$dbe = '';
case 'members_display_name': $url = '';
$db_query[] = $this->request['match'] == 'loose' ? "m.members_display_name LIKE '%{$string}%'" : "m.members_display_name='{$string}'";
break; if( count( $db_query ) )
} {
} $dbe = implode( ' AND ', $db_query );
}
/* Build extra query stuff */
$dbe = ''; if( count( $url_query ) )
$url = ''; {
$url = '&amp;' . implode( '&amp;', $url_query );
if( count( $db_query ) ) }
{
$dbe = implode( ' AND ', $db_query ); /* Pagination */
} $count = $this->DB->buildAndFetch( array(
'select' => 'count(*) as cnt',
if( count( $url_query ) ) 'from' => array( 'error_logs' => 'e' ),
{ 'where' => $dbe,
$url = '&amp;' . implode( '&amp;', $url_query ); 'add_join' => array(
} array(
'from' => array( 'members' => 'm' ),
/* Pagination */ 'where' => 'e.log_member=m.member_id',
$count = $this->DB->buildAndFetch( array( 'type' => 'left',
'select' => 'count(*) as cnt', )
'from' => array( 'error_logs' => 'e' ), )
'where' => $dbe, ) );
'add_join' => array(
array( $links = $this->registry->output->generatePagination( array(
'from' => array( 'members' => 'm' ), 'totalItems' => $count['cnt'],
'where' => 'e.log_member=m.member_id', 'itemsPerPage' => 25,
'type' => 'left', 'currentStartValue' => $start,
) 'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}" . $url,
) )
) ); );
$links = $this->registry->output->generatePagination( array( /* Query the logs */
'totalItems' => $count['cnt'], $this->DB->build( array(
'itemsPerPage' => 25, 'select' => 'e.*',
'currentStartValue' => $start, 'from' => array( 'error_logs' => 'e' ),
'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}" . $url, 'where' => $dbe,
) 'order' => 'e.log_date DESC',
); 'limit' => array( $start, 25 ),
'add_join' => array(
/* Query the logs */ array(
$this->DB->build( array( 'select' => 'm.members_display_name',
'select' => 'e.*', 'from' => array( 'members' => 'm' ),
'from' => array( 'error_logs' => 'e' ), 'where' => 'e.log_member=m.member_id',
'where' => $dbe, 'type' => 'left',
'order' => 'e.log_date DESC', )
'limit' => array( $start, 25 ), )
'add_join' => array( ) );
array( $this->DB->execute();
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ), while( $row = $this->DB->fetch() )
'where' => 'e.log_member=m.member_id', {
'type' => 'left', $row['_date'] = $this->registry->class_localization->getDate( $row['log_date'], 'SHORT' );
)
) $rows[] = $row;
) ); }
$this->DB->execute();
$this->registry->output->html .= $this->html->errorlogsWrapper( $rows, $links );
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> <html>
<head><title>IP.Board - Bulletin Board System</title></head> <head><title>IP.Board - Bulletin Board System</title></head>
<body> <body>
<h1>403: IP.Board -&gt; Forbidden</h1> <h1>403: IP.Board -&gt; Forbidden</h1>
<hr> <hr>
You have reached this page in error, please use your back button to return to the forum. You have reached this page in error, please use your back button to return to the forum.
<hr> <hr>
<a href="http://www.invisionpower.com">IP.Board</a> <a href="http://www.invisionpower.com">IP.Board</a>
</body> </body>
</html> </html>
Loaded 100 of 2206 files, more files were not shown because too many files have changed in this diff. Show more