Version 3.0.5

This commit is contained in:
Neo committed 2025-12-19 00:31:03 -08:00
1 parent 19b38c7c74
commit 1d4720f3e2
3755 files changed
+508378 -664541

No files matched your search

@@ -0,0 +1,62 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Update captcha image
* Last Updated: $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since 2.3
* @version $Revision: 3887 $
*
*/
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 public_core_ajax_captcha extends ipsAjaxCommand
{
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
switch( ipsRegistry::$request['do'] )
{
default:
case 'refresh':
$this->refresh();
break;
}
}
/**
* Refresh the captcha image
*
* @access public
* @return void [Outputs to screen]
*/
public function refresh()
{
$captcha_unique_id = trim( IPSText::alphanumericalClean( ipsRegistry::$request['captcha_unique_id'] ) );
$template = $this->registry->getClass('class_captcha')->getTemplate( $captcha_unique_id );
$newUniqueID = $this->registry->getClass('class_captcha')->captchaKey;
$this->returnString( $newUniqueID );
}
}
@@ -0,0 +1,30 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Define the default ajax section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
*
*/
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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'login';
@@ -0,0 +1,154 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* AJAX Switch Editor
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 4948 $
* @deprecated We no longer support AJAX switching of editor type. This file is not likely up to date as a result.
*
*/
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 public_core_ajax_editor extends ipsAjaxCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$to_rte = intval( $this->request['to_rte'] );
$post = $this->convertUnicode( $_POST['Post'] );
$post = IPSText::stripslashes($post);
//$post = $this->convertHtmlEntities( $post );
//-----------------------------------------
// Load BBCode
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/bbcode/core.php' );
require_once( IPS_ROOT_PATH . 'sources/classes/bbcode/normal.php' );
$bbcode = new class_bbcode_normal( $this->registry );
$bbcode->parse_bbcode = 1;
$bbcode->parse_html = 0;
$bbcode->parse_nl2br = 1;
$bbcode->parse_smilies = 1;
$bbcode->parsing_section = 'topics';
//-----------------------------------------
// Converting from STD to RTE?
//-----------------------------------------
if ( $to_rte )
{
//-----------------------------------------
// Ensure no slashy slashy
//-----------------------------------------
$post = str_replace( '"','&quot;', $post );
$post = str_replace( "'",'&apos;', $post );
//-----------------------------------------
// Convert <>
//-----------------------------------------
$post = str_replace( '<', '&lt;', $post );
$post = str_replace( '>', '&gt;', $post );
$post = $bbcode->convertForRTE( $bbcode->preDbParse( $post ) );
//-----------------------------------------
// Convert <>
//-----------------------------------------
$post = str_replace( '&#60;', '&lt;', $post );
$post = str_replace( '&#62;', '&gt;', $post );
//-----------------------------------------
// Fix up...
//-----------------------------------------
$post = $this->registry->output->replaceMacros( $post );
//-----------------------------------------
// Make sure no nasty HTML entities show
//-----------------------------------------
$post = IPSText::htmlspecialchars( $post );
}
//-----------------------------------------
// Converting from RTE to STD
//-----------------------------------------
else
{
require_once( IPS_ROOT_PATH . 'sources/classes/editor/class_editor.php' );
require_once( IPS_ROOT_PATH . 'sources/classes/editor/class_editor_rte.php' );
//-----------------------------------------
// Ok, now, apparently, for SOME reason, IE
// strips SOME comments but not others...
// this causes font/span stuff to break.
// Let's just strip all the comments
//-----------------------------------------
if ( $this->member->browser['browser'] == "ie" OR $this->member->browser['browser'] == "opera" )
{
$post = preg_replace( "#<\!--(.*?)-->#is", "" , $post );
}
//-----------------------------------------
// IE has this thing where <b>[center]text[/center]</b>
// Becomes [b][center][b]text[/b][/center][/b]
//-----------------------------------------
$rte = new class_editor_module( $this->registry );
$post = $bbcode->preEditParse( $post );
$post = $rte->processAfterForm( $post );
//-----------------------------------------
// Fix up...
//-----------------------------------------
$post = preg_replace( "/<br>|<br \/>/", "\n", $post );
}
//-----------------------------------------
// Member? Store choice...
//-----------------------------------------
if ( $this->memberData['member_id'] )
{
$_choice = ( $to_rte ) ? 'rte' : 'std';
IPSMember::save( $this->memberData['member_id'], array( 'members' => array( 'members_editor_choice' => $_choice ) ) );
}
$post = trim( html_entity_decode($post) );
$this->returnHtml( $post );
}
}
@@ -0,0 +1,116 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Login handler abstraction : AJAX login
* Last Updated: $Date: 2009-01-05 22:21:54 +0000 (Mon, 05 Jan 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 3572 $
*
*/
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 public_core_ajax_facebook extends ipsAjaxCommand
{
/**
* Login handler object
*
* @access protected
* @var object
*/
protected $han_login;
/**
* Flag : Logged in
*
* @access protected
* @var boolean
*/
protected $logged_in = false;
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* What to do */
switch( $this->request['do'] )
{
case 'getUserByFbId':
$return = $this->_getUserByFbId();
break;
case 'setAllowEmailAccess':
$return = $this->_setAllowEmailAccess();
break;
}
/* Output */
$this->returnHtml( $return );
}
/**
* Allow facebook email access set
*
* @access private
* @return void [Outputs JSON to browser AJAX call]
*/
private function _setAllowEmailAccess()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$memberID = intval( $this->memberData['member_id'] );
IPSMember::update( $memberID, array( 'core' => array( 'fb_emailallow' => 1 ) ) );
$this->returnJsonArray( array( 'status' => 'ok' ) );
}
/**
* Main AJAX log in routine
*
* @access private
* @return void [Outputs JSON to browser AJAX call]
*/
private function _getUserByFbId()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$fbUid = is_numeric( $this->request['fbid'] ) ? $this->request['fbid'] : 0;
$member = array( 'member_id' => 0 );
if ( $fbUid )
{
$_mid = $this->DB->buildAndFetch( array( 'select' => 'member_id',
'from' => 'members',
'where' => 'fb_uid=' . $fbUid ) );
if ( $_mid['member_id'] )
{
$member = IPSMember::load( $_mid['member_id'], 'all' );
}
}
$this->returnJsonArray( $member );
}
}
@@ -0,0 +1,108 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Login handler abstraction : AJAX Find Names functions
* Last Updated: $Date: 2009-09-29 07:24:38 -0400 (Tue, 29 Sep 2009) $
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 5173 $
*
*/
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 public_core_ajax_findnames extends ipsAjaxCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
switch( $this->request['do'] )
{
case 'get-member-names':
$this->_getMemberNames();
break;
}
}
/**
* Returns possible matches for the string input
*
* @access private
* @return void Outputs to screen
*/
private function _getMemberNames()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$name = $this->convertAndMakeSafe( ipsRegistry::$request['name'], 0 );
//-----------------------------------------
// Check length
//-----------------------------------------
if ( IPSText::mbstrlen( $name ) < 3 )
{
$this->returnJsonError( 'requestTooShort' );
}
//-----------------------------------------
// Try query...
//-----------------------------------------
$this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id',
'from' => array( 'members' => 'm' ),
'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( strtolower( $name ) ) . "%'",
'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC',
'limit' => array( 0, 15 ),
'add_join' => array( array( 'select' => 'p.*',
'from' => array( 'profile_portal' => 'p' ),
'where' => 'p.pp_member_id=m.member_id',
'type' => 'left' ) ) ) );
$this->DB->execute();
//-----------------------------------------
// Got any results?
//-----------------------------------------
if ( ! $this->DB->getTotalRows() )
{
$this->returnJsonArray( array( ) );
}
$return = array();
while( $r = $this->DB->fetch() )
{
$photo = IPSMember::buildProfilePhoto( $r );
$group = IPSLib::makeNameFormatted( '' , $r['member_group_id'] );
$return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'],
'showas'=> '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')',
'img' => $photo['pp_thumb_photo'],
'img_w' => $photo['pp_mini_width'],
'img_h' => $photo['pp_mini_height']
);
}
$this->returnJsonArray( $return );
}
}
@@ -0,0 +1 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
@@ -0,0 +1,144 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Login handler abstraction : AJAX login
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 4948 $
*
*/
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 public_core_ajax_login extends ipsAjaxCommand
{
/**
* Login handler object
*
* @access protected
* @var object
*/
protected $han_login;
/**
* Flag : Logged in
*
* @access protected
* @var boolean
*/
protected $logged_in = false;
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load handler...
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );
$this->han_login = new han_login( $this->registry );
$this->han_login->init();
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_login' ), 'core' );
//-----------------------------------------
// Show form or process login?
//-----------------------------------------
if ( $this->request['do'] == 'showForm' )
{
$additional_data = $this->han_login->additionalFormHTML();
$replace = false;
$data = array();
if( !is_null($additional_data) AND is_array($additional_data) AND count($additional_data) )
{
$replace = $additional_data[0];
$data = $additional_data[1];
}
$this->returnHtml( $this->registry->getClass('output')->getTemplate('global')->loginForm( $replace == 'replace' ? true : false, $data ) );
}
else if ( $this->request['do'] == 'authenticateUser' )
{
return $this->_authenticateUser();
}
else
{
return $this->_doLogIn();
}
}
/**
* Authenticate a user, returns a JSON array
*
* @access private
* @return void [Outputs JSON to browser AJAX call]
*/
private function _authenticateUser()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$email = $this->request['emailaddress'];
$password = $this->request['password'];
/* Force email check */
$this->han_login->setForceEmailCheck( TRUE );
$return = $this->han_login->loginPasswordCheck( '', $email, $password );
if ( $return !== TRUE )
{
$this->returnJsonArray( array( 'status' => 'error' ) );
}
else
{
$this->returnJsonArray( array( 'status' => 'ok', 'memberData' => $this->han_login->member_data ) );
}
}
/**
* Main AJAX log in routine
*
* @access private
* @return void [Outputs JSON to browser AJAX call]
*/
private function _doLogIn()
{
//-----------------------------------------
// Use central method
//-----------------------------------------
$return = $this->han_login->verifyLogin();
if( is_array($return[2]) AND count($return[2]) )
{
$this->returnJsonArray( array( 'error' => $return[2]['MSG'] ) );
}
else
{
$this->returnJsonArray( array( 'message' => $return[0], 'url' => $return[1] ) );
}
}
}
@@ -0,0 +1,183 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Registration AJAX routines
* Last Updated: $Date: 2009-08-25 16:41:08 -0400 (Tue, 25 Aug 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since Who knows...
* @version $Revision: 5045 $
*
*/
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 public_core_ajax_register extends ipsAjaxCommand
{
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
switch( ipsRegistry::$request['do'] )
{
case 'check-display-name':
$this->checkDisplayName( 'members_display_name' );
break;
case 'check-user-name':
$this->checkDisplayName( 'name' );
break;
case 'check-email-address':
$this->checkEmail();
break;
}
}
/**
* Check the email address
*
* @access public
* @return void [Outputs to screen]
*/
public function checkEmail()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$email = '';
if( is_string($_REQUEST['email']) )
{
$email = mb_strtolower( IPSText::parseCleanValue( rawurldecode( $_REQUEST['email'] ) ) );
}
if( !$email )
{
$this->returnString('found');
}
if( !IPSText::checkEmailAddress( $email ) )
{
$this->returnString('found');
}
//-----------------------------------------
// Got the member?
//-----------------------------------------
if ( ! IPSMember::checkByEmail( $email ) )
{
//-----------------------------------------
// Load ban filters
//-----------------------------------------
$this->DB->build( array( 'select' => '*', 'from' => 'banfilters' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$banfilters[ $r['ban_type'] ][] = $r['ban_content'];
}
//-----------------------------------------
// Are they banned [EMAIL]?
//-----------------------------------------
if ( is_array( $banfilters['email'] ) and count( $banfilters['email'] ) )
{
foreach ( $banfilters['email'] as $memail )
{
$memail = str_replace( "\*", '.*' , preg_quote($memail, "/") );
if ( preg_match( "/$memail/", $email ) )
{
$this->returnString('banned');
break;
}
}
}
//-----------------------------------------
// Load handler...
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );
$han_login = new han_login( $this->registry );
$han_login->init();
if( $han_login->emailExistsCheck( $email ) )
{
$this->returnString('found');
}
$this->returnString('notfound');
}
else
{
$this->returnString('found');
}
}
/**
* Check the name or display name
*
* @access public
* @return void [Outputs to screen]
*/
public function checkDisplayName( $field='members_display_name' )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile( array( 'public_register' ) );
$name = '';
if( is_string($_POST['name']) )
{
$name = mb_strtolower( trim( rawurldecode( $_POST['name'] ) ) );
}
if( !$name )
{
$this->returnString( sprintf( ipsRegistry::getClass( 'class_localization' )->words['reg_error_no_name'], ipsRegistry::$settings['max_user_name_length'] ) );
}
/* Check the username */
$user_check = IPSMember::getFunction()->cleanAndCheckName( $name, array(), $field );
$errorField = $field == 'members_display_name' ? 'dname' : 'username';
$nameField = $field == 'members_display_name' ? 'members_display_name' : 'username';
if( is_array( $user_check['errors'][ $errorField ] ) && count( $user_check['errors'][ $errorField ] ) )
{
$this->returnString( $user_check['errors'][ $errorField ][0] );
return;
}
else if( $user_check['errors'][ $errorField ] )
{
$this->returnString( $user_check['errors'][ $errorField ] );
}
else
{
$this->returnString('notfound');
}
}
}
@@ -0,0 +1,137 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Reports AJAX options
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @version $Rev: 4948 $
*
*/
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 public_core_ajax_reports extends ipsAjaxCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->class_localization->loadLanguageFile( array( 'public_reports' ) );
$this->DB->loadCacheFile( IPSLib::getAppDir('core') . '/sql/' . ips_DBRegistry::getDriverType() . '_report_queries.php', 'report_sql_queries' );
require_once( IPSLib::getAppDir('core') .'/sources/classes/reportLibrary.php' );
$this->registry->setClass( 'reportLibrary', new reportLibrary( $this->registry ) );
/* What to do */
switch( $this->request['do'] )
{
case 'change_status':
$this->output = $this->_changeStatus();
break;
}
}
/**
* Adds a rating to the index
*
* @access private
* @return void
*/
private function _changeStatus()
{
//-----------------------------------------
// Get status's and flags
//-----------------------------------------
$this->registry->getClass('reportLibrary')->buildStatuses( true );
$COM_PERM = $this->registry->getClass('reportLibrary')->buildQueryPermissions();
//-----------------------------------------
// Process changes if info is correct
//-----------------------------------------
if( is_numeric($this->request['id']) && $this->request['id'] > 0 )
{
$the_id = intval( $this->request['id'] );
$return = array('id' => $the_id);
$this->DB->buildFromCache( 'grab_report', array( 'COM' => $COM_PERM, 'rid' => $the_id ), 'report_sql_queries' );
$res = $this->DB->execute();
if( $this->DB->getTotalRows() > 0 )
{
$report = $this->DB->fetch();
$old_status = $report['status'];
$new_status = $this->request['status'];
if( $old_status != $new_status )
{
$build_update = array(
'status' => $new_status,
'date_updated' => time(),
'updated_by' => $this->memberData['member_id'],
);
$this->DB->update( 'rc_reports_index', $build_update, "id=".$the_id );
}
$this->registry->getClass('reportLibrary')->updateCacheTime();
$this->registry->getClass('reportLibrary')->rebuildMemberCacheArray();
//-----------------------------------------
// Need to reload data to get right "points" :(
//-----------------------------------------
$this->DB->buildFromCache( 'grab_report', array( 'COM' => $COM_PERM, 'rid' => $the_id ), 'report_sql_queries' );
$res = $this->DB->execute();
$report = $this->DB->fetch();
//-----------------------------------------
// Pick the right flag.. or else!
//-----------------------------------------
$return['img'] = str_replace( '<#IMG_DIR#>', $this->registry->output->skin['set_image_dir'], $this->registry->getClass('reportLibrary')->flag_cache[ $report['status'] ][ $report['points'] ]['img'] );
$return['width'] = $this->registry->getClass('reportLibrary')->flag_cache[ $report['status'] ][ $report['points'] ]['width'];
$return['height'] = $this->registry->getClass('reportLibrary')->flag_cache[ $report['status'] ][ $report['points'] ]['height'];
$return['is_png'] = $this->registry->getClass('reportLibrary')->flag_cache[ $report['status'] ][ $report['points'] ]['is_png'];
//-----------------------------------------
// Image? PNG? Using 'Is-Evil' machine?
//-----------------------------------------
if( $return['img'] != '' )
{
$this->returnJsonArray( array( 'img' => $this->registry->getClass('output')->getTemplate('reports')->statusIcon( $return['img'], $return['width'], $return['height'] ) ) );
}
else
{
$this->returnString( '&nbsp;' );
}
}
}
else
{
$this->returnString( 'error' );
}
}
}
@@ -0,0 +1,82 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Reputation
* Last Updated: $Date: 2009-07-30 19:17:45 -0400 (Thu, 30 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @version $Rev: 4955 $
*
*/
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 public_core_ajax_reputation extends ipsAjaxCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* What to do */
switch( $this->request['do'] )
{
case 'add_rating':
$this->doRating();
break;
}
/* Output */
$this->returnHtml( $this->output );
}
/**
* Adds a rating to the index
*
* @access public
* @return void
*/
public function doRating()
{
/* INIT */
$app = $this->request['app_rate'];
$type = $this->request['type'];
$type_id = intval( $this->request['type_id'] );
$rating = intval( $this->request['rating'] );
/* Check */
if( ! $app || ! $type || ! $type_id || ! $rating )
{
$this->returnString( $this->lang->words['ajax_incomplete_data'] );
}
/* Get the rep library */
require_once( IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php' );
$repCache = new classReputationCache();
/* Add the rating */
if( $repCache->addRate( $type, $type_id, $rating, '', 0, $app ) === false )
{
$this->returnString( $repCache->error_message );
}
else
{
$this->returnString( 'done' );
}
}
}
@@ -0,0 +1,111 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Login handler abstraction : AJAX UserCP functions
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 4948 $
*
*/
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 public_core_ajax_usercp extends ipsAjaxCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
switch( $this->request['do'] )
{
case 'displayNameCheck':
$this->displayNameCheck();
break;
}
}
/**
* Checks a display name
*
* @access private
* @return void [Outputs JSON to browser AJAX call]
*/
private function displayNameCheck()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$name = mb_strtolower( $this->convertAndMakeSafe( $this->request['name'], 0 ) );
$name = str_replace("&#43;", "+", $name );
$member = array();
$return = TRUE;
$id = intval( $this->request['member_id'] );
# Set member ID
$id = $this->memberData['member_id'] ? $this->memberData['member_id'] : $id;
//-----------------------------------------
// Load member if required
//-----------------------------------------
if ( $id != $this->memberData['member_id'] )
{
$member = IPSMember::load( $id, 'all' );
}
else
{
$member = $this->member->fetchMemberData();
}
//-----------------------------------------
// Test name
//-----------------------------------------
try
{
$return = IPSMember::getFunction()->checkNameExists( $name, $member );
}
catch( Exception $error )
{
$_msg = $error->getMessage();
if ( $_msg == 'NO_MORE_CHANGES' )
{
$this->returnString( 'nomorechanges' );
return;
}
# Really, we're not very interested why it didn't work at this point, so
# just return with a 'found' string which will make a nice red cross and
# force the user to choose another.
$this->returnString('found');
return;
}
//-----------------------------------------
// So, what's it to be?
//-----------------------------------------
$this->returnString( ( $return === TRUE ) ? 'found' : 'notfound' );
}
}
@@ -0,0 +1,353 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Attachment Poster
* Last Updated: $Date: 2009-11-13 08:05:12 -0500 (Fri, 13 Nov 2009) $
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @version $Rev: 5400 $
*
*/
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 public_core_attach_attach extends ipsCommand
{
/**
* Attachment Library
*
* @access public
* @var object class_attach
*/
public $class_attach;
/**
* AJAX Library
*
* @access public
* @var object classAjax
*/
public $ajax;
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
/* AJAX Class */
require_once( IPS_KERNEL_PATH . '/classAjax.php' );
$this->ajax = new classAjax();
/* Attachment Class */
require_once( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php' );
$this->class_attach = new class_attach( $registry );
/* What to do... */
switch( $this->request['do'] )
{
case 'attach_upload_show':
$this->ajax->returnHtml( $this->attachmentUploadShow() );
break;
case 'attach_upload_process':
$this->attachmentUploadProcess();
break;
case 'attach_upload_remove':
$this->attachmentUploadRemove();
break;
/* IFrame based upload */
case 'attachiFrame':
$this->attachiFrame();
break;
case 'attachUploadiFrame':
$this->attachUploadiFrame();
break;
default:
$this->showPostAttachment();
break;
}
}
/**
* View Post Attachment
*
* @access public
* @return void
*/
public function showPostAttachment()
{
/* INIT */
$attach_id = intval( $this->request['attach_id'] );
/* INIT module */
$this->class_attach->init();
/* Display */
$this->class_attach->showAttachment( $attach_id );
}
/**
* Remove an upload
*
* @access public
* @return void
*/
public function attachmentUploadRemove()
{
/* INIT */
$attach_post_key = trim( IPSText::alphanumericalClean( $this->request['attach_post_key'] ) );
$attach_rel_module = trim( IPSText::alphanumericalClean( $this->request['attach_rel_module'] ) );
$attach_rel_id = intval( $this->request['attach_rel_id'] );
$attach_id = intval( $this->request['attach_id'] );
/* Setup Module */
$this->class_attach->type = $attach_rel_module;
$this->class_attach->attach_post_key = $attach_post_key;
$this->class_attach->attach_rel_id = $attach_rel_id;
$this->class_attach->attach_id = $attach_id;
$this->class_attach->init();
/* Remove the attachment */
$removed = $this->class_attach->removeAttachment();
/* Show the form */
if( $removed )
{
$this->ajax->returnHtml( $this->attachmentUploadShow( 'attach_removed', 0 ) );
}
else
{
$this->ajax->returnHtml( $this->attachmentUploadShow( 'remove_failed', 1 ) );
}
}
/**
* Perform the actual upload
*
* @access public
* @return void
*/
public function attachmentUploadProcess()
{
/* INIT */
$attach_post_key = trim( IPSText::alphanumericalClean( $this->request['attach_post_key'] ) );
$attach_rel_module = trim( IPSText::alphanumericalClean( $this->request['attach_rel_module'] ) );
$attach_rel_id = intval( $this->request['attach_rel_id'] );
$attach_current_items = '';
/* INIT module */
$this->class_attach->type = $attach_rel_module;
$this->class_attach->attach_post_key = $attach_post_key;
$this->class_attach->attach_rel_id = $attach_rel_id;
$this->class_attach->init();
/* Process upload */
$insert_id = $this->class_attach->processUpload();
/* Got an error? */
if( $this->class_attach->error )
{
$this->ajax->returnHtml( $this->attachmentUploadShow( $this->class_attach->error, 1, $insert_id ) );
}
else
{
$this->ajax->returnHtml( $this->attachmentUploadShow( 'upload_ok', 0, $insert_id ) );
}
}
/**
* Show the attach upload field
*
* @access public
* @param string $msg
* @param bool $is_error
* @param integer $insert_id
* @return void
**/
public function attachmentUploadShow( $msg="ready", $is_error=0, $insert_id=0 )
{
/* INIT JSON */
$JSON = array();
$JSON['msg'] = $msg;
$JSON['is_error'] = $is_error;
$is_reset = 0;
/* Check the upload domain setting */
if( $this->settings['upload_domain'] )
{
$is_reset = 1;
$original = $this->settings['base_url'];
if( $this->member->session_type == 'cookie' )
{
$this->settings['base_url'] = $this->settings['upload_domain'] . '/index.' . $this->settings['php_ext'].'?';
}
else
{
$this->settings['base_url'] = $this->settings['upload_domain'] . '/index.' . $this->settings['php_ext'].'?s='.$this->member->session_id .'&amp;';
}
}
/* JSON Data */
$JSON['attach_post_key'] = $attach_post_key = trim( IPSText::alphanumericalClean( $this->request['attach_post_key'] ) );
$JSON['attach_rel_module'] = $attach_rel_module = trim( IPSText::alphanumericalClean( $this->request['attach_rel_module'] ) );
$JSON['attach_rel_id'] = $attach_rel_id = intval( $this->request['attach_rel_id'] );
if( $insert_id )
{
$JSON['insert_id'] = $insert_id;
}
/* Get extra form fields */
foreach( $_GET as $k => $v )
{
if( preg_match( "#^--ff--#", $k ) )
{
$JSON['extra_upload_form_url'] .= '&amp;' . str_replace( '--ff--', '', $k ) . '='.$v;
$JSON['extra_upload_form_url'] .= '&amp;' . $k . '='.$v;
}
}
/* INIT module */
$this->class_attach->type = $attach_rel_module;
$this->class_attach->attach_post_key = $attach_post_key;
$this->class_attach->init();
$this->class_attach->getUploadFormSettings();
/* Load Language Bits */
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'lang_post' ) );
/* Generate current items... */
$_more = ( $attach_rel_id ) ? ' OR c.attach_rel_id=' . $attach_rel_id : '';
$this->DB->build( array(
'select' => 'c.*',
'from' => array( 'attachments' => 'c' ),
'where' => "c.attach_rel_module='{$attach_rel_module}' AND c.attach_post_key='{$attach_post_key}'{$_more}",
'add_join' => array( array(
'select' => 't.*',
'from' => array( 'attachments_type' => 't' ),
'where' => 't.atype_extension=c.attach_ext',
'type' => 'left'
) )
) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
if ( $attach_rel_module != $row['attach_rel_module'] )
{
continue;
}
if( ( $insert_id && $row['attach_id'] == $insert_id ) || $this->request['fetch_all'] )
{
if ( $row['attach_is_image'] and ! $row['attach_thumb_location'] )
{
$row['attach_thumb_location'] = $row['attach_location'];
$row['attach_thumb_width'] = $row['attach_width'];
$row['attach_thumb_height'] = $row['attach_height'];
}
$JSON['current_items'][ $row['attach_id'] ] = array( $row['attach_id'] ,
str_replace( array( '[', ']' ), '', $row['attach_file'] ),
$row['attach_filesize'],
$row['attach_is_image'],
$row['attach_thumb_location'],
$row['attach_thumb_width'],
$row['attach_thumb_height'],
$row['atype_img']
);
}
}
$JSON['attach_stats'] = $this->class_attach->attach_stats;
/* Formatting nonsense for special char sets */
array_walk_recursive( $JSON, create_function( '&$value, $key', '$value = IPSText::convertCharsets($value, "' . IPS_DOC_CHAR_SET . '", "UTF-8");' ) );
$result = json_encode( $JSON );
$result = IPSText::convertCharsets( $result, "UTF-8", IPS_DOC_CHAR_SET );
IPSDebug::addLogMessage( $result, 'uploads' );
/* Return JSON */
return $result;
}
/**
* Show the attach upload field
*
* @access public
* @param string $msg
* @param bool $is_error
* @param integer $insert_id
* @return void
*/
public function attachiFrame( $msg="ready", $is_error=0, $insert_id=0 )
{
/* INIT JSON */
$JSON = $this->attachmentUploadShow( $msg, $is_error, $insert_id );
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'public_post' ), 'forums' );
$this->ajax->returnHtml( $this->registry->output->getTemplate( 'post' )->attachiFrame( $JSON, intval( $this->request['attach_rel_id'] ) ) );
}
/**
* Perform the actual upload
*
* @access public
* @return void
*/
public function attachUploadiFrame()
{
/* INIT */
$attach_post_key = trim( IPSText::alphanumericalClean( $this->request['attach_post_key'] ) );
$attach_rel_module = trim( IPSText::alphanumericalClean( $this->request['attach_rel_module'] ) );
$attach_rel_id = intval( $this->request['attach_rel_id'] );
$attach_current_items = '';
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'public_post' ), 'forums' );
/* INIT module */
$this->class_attach->type = $attach_rel_module;
$this->class_attach->attach_post_key = $attach_post_key;
$this->class_attach->attach_rel_id = $attach_rel_id;
$this->class_attach->init();
/* Process upload */
$insert_id = $this->class_attach->processUpload();
/* Got an error? */
if( $this->class_attach->error )
{
$JSON = $this->attachmentUploadShow( $this->class_attach->error, 1, $insert_id );
}
else
{
$JSON = $this->attachmentUploadShow( 'upload_ok', 0, $insert_id );
}
$this->ajax->returnHtml( $this->registry->output->getTemplate( 'post' )->attachiFrame( $JSON, $attach_rel_id ) );
}
}
@@ -0,0 +1,30 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Define the default attachments section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
*
*/
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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'attach';
@@ -0,0 +1 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
@@ -0,0 +1,93 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Captcha
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
*
*/
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 public_core_global_captcha extends ipsCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
/* Load Cpatcha Class */
$this->class_captcha = $this->registry->getClass('class_captcha');
/* What to do... */
switch( $this->request['do'] )
{
default:
case 'showimage':
$this->showImage();
break;
case 'refresh':
$this->refreshImage();
break;
}
}
/**
* Show the captcha image
* Shows the captcha image. Good god, that was a waste of time
*
* @access public
* @return void
*/
public function showImage()
{
/* INIT */
$captcha_unique_id = trim( $this->request['captcha_unique_id'] );
/* GD installed? */
$this->class_captcha->show_error_gd_img = TRUE;
/* Show Image... */
$this->class_captcha->showImage( $captcha_unique_id );
}
/**
* Show the captcha image
* Refreshes the captcha image.
*
* @access public
* @return void
*/
public function refreshImage()
{
/* INIT */
$captcha_unique_id = trim( $this->request['captcha_unique_id'] );
/* Throw away */
$blah = $this->class_captcha->getTemplate();
require_once( IPS_KERNEL_PATH . 'classAjax.php' );
$ajax = new classAjax();
/* Show Image... */
$ajax->returnString( $this->class_captcha->captchaKey );
exit;
}
}
@@ -0,0 +1,30 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Define the default global section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
*
*/
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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'login';
@@ -0,0 +1 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
@@ -0,0 +1,623 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Login handler abstraction
* Last Updated: $Date: 2009-11-11 20:48:24 -0500 (Wed, 11 Nov 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 5376 $
*
*/
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 public_core_global_login extends ipsCommand
{
/**
* Login handler object
*
* @access protected
* @var object
*/
protected $han_login;
/**
* Facebook connect class
*
* @access protected
* @var object
*/
private $_facebook;
/**
* Initiate login handler
*
* @access public
* @return void
*/
public function initHanLogin()
{
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );
$this->han_login = new han_login( $this->registry );
$this->han_login->init();
}
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
/* Make object */
$this->registry = $registry;
$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();
$this->registry->getClass( 'class_localization' )->loadLanguageFile( array( 'public_login' ), 'core' );
//-----------------------------------------
// Load handler...
//-----------------------------------------
$this->initHanLogin();
//-----------------------------------------
// INIT Facebook
//-----------------------------------------
if ( IPSLib::fbc_enabled() )
{
require_once( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php' );
$this->_facebook = new facebook_connect( $registry );
}
//-----------------------------------------
// Are we enforcing log ins?
//-----------------------------------------
$msg = "";
if ( !$this->request['do'] == 'showForm' AND $this->settings['force_login'] == 1 )
{
$msg = 'admin_force_log_in';
}
//-----------------------------------------
// What to do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'fbc_login':
$return = $this->fbcLogin();
break;
case 'fbc_loginFromLinked':
$return = $this->fbcLoginFromLinked();
break;
case 'fbc_loginWithNew':
$return = $this->fbcLoginWithNew();
break;
case 'process':
$return = $this->doLogin();
if( $return[2] )
{
//$this->registry->getClass('output')->showError( $return[2], 1014 );
$this->loginForm( $return[2], $return[3] );
}
else
{
$this->registry->getClass('output')->redirectScreen( $return[0], $return[1], 'false' );
}
break;
case 'logout':
$return = $this->doLogout();
/* URL */
$return[2] = $return[2] ? $return[2] : '';
if( $return[0] == 'immediate' )
{
$this->registry->getClass('output')->silentRedirect( $return[2] );
}
else
{
$this->registry->getClass('output')->redirectScreen( $return[1], $return[2], 'false' );
}
break;
case 'deleteCookies':
$return = $this->deleteCookies();
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] );
break;
case 'autologin':
$return = $this->autoLogin();
break;
case 'showForm':
default:
$return = $this->loginForm($msg);
break;
}
//-----------------------------------------
// If we have any HTML to print, do so...
//-----------------------------------------
$this->registry->getClass('output')->addContent("$this->output");
$this->registry->getClass('output')->sendOutput( array( 'TITLE' => $this->page_title, 'JS' => 0, 'NAV' => $this->nav ) );
}
/**
* FB Log in from a new account
* Function is called when IPB has detected a FB user that is linked to an IPB user
*
* @access public
* @return void Redirects user
*/
public function fbcLoginWithNew()
{
try
{
$result = $this->_facebook->loginWithNewAccount();
$this->registry->getClass('output')->redirectScreen( $result[0], $result[1], true );
}
catch( Exception $error )
{
$msg = $error->getMessage();
switch( $msg )
{
default:
case 'NO_FACEBOOK_USER_LOGGED_IN':
case 'NO_FB_EMAIL':
case 'CREATION_FAIL':
$this->registry->getClass('output')->showError( 'fbc_authorization_screwup', 1005 );
break;
}
}
}
/**
* FB Log in from a linked account
* Function is called when IPB has detected a FB user that is linked to an IPB user
*
* @access public
* @return void Redirects user
*/
public function fbcLoginFromLinked()
{
try
{
$result = $this->_facebook->loginWithExistingLink();
$this->registry->getClass('output')->redirectScreen( $result[0], $result[1], true );
}
catch( Exception $error )
{
$msg = $error->getMessage();
switch( $msg )
{
default:
case 'NO_FACEBOOK_USER_LOGGED_IN':
case 'NO_LINKED_MEMBER':
$this->registry->getClass('output')->showError( 'fbc_authorization_screwup', 1005 );
break;
}
}
}
/**
* FB Log in
* Function is called when IPB has detected a FB user and they've authorized by ajax.
*
* @access public
* @return void Redirects user
*/
public function fbcLogin()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$email = $this->request['emailaddress'];
$password = $this->request['password'];
try
{
$result = $this->_facebook->loginWithCreateLink( $email, $password );
$this->registry->getClass('output')->redirectScreen( $result[0], $result[1], true );
}
catch( Exception $error )
{
$msg = $error->getMessage();
switch( $msg )
{
default:
case 'NO_FACEBOOK_USER_LOGGED_IN':
case 'AUTH_FAIL':
case 'ALREADY_LINKED':
$this->registry->getClass('output')->showError( 'fbc_authorization_screwup', 1005 );
break;
}
}
}
/**
* Attempt to automatically log a user in
*
* @access public
* @return array [0=Words to display,1=URL to send to]
*/
public function autoLogin()
{
/* Verify the login */
$this->han_login->verifyLogin();
/* Lang Bits */
$true_words = $this->lang->words['logged_in'];
$false_words = $this->lang->words['not_logged_in'];
$method = 'no_show';
/* Register Redirect */
if ($this->request['fromreg'] == 1)
{
$true_words = $this->lang->words['reg_log_in'];
$false_words = $this->lang->words['reg_not_log_in'];
$method = 'show';
}
/* Email Redirect */
else if ($this->request['fromemail'] == 1)
{
$true_words = $this->lang->words['email_log_in'];
$false_words = $this->lang->words['email_not_log_in'];
$method = 'show';
}
/* Password Redirect */
else if ($this->request['frompass'] == 1)
{
$true_words = $this->lang->words['pass_log_in'];
$false_words = $this->lang->words['pass_not_log_in'];
$method = 'show';
}
if( $this->memberData[ 'member_id' ] )
{
/* Member Sync */
IPSLib::runMemberSync( 'onLogin', $this->memberData );
if ( ! $this->request['fromreg'] )
{
IPSCookie::set('session_id', '0', -1 );
}
if( $method == 'show' )
{
$this->registry->getClass('output')->redirectScreen( $true_words, $this->settings['base_url'] );
}
else
{
$this->registry->getClass('output')->silentRedirect( $this->settings['board_url'] . '/index.php' );
}
}
else
{
if( $method == 'show' )
{
$this->registry->getClass('output')->redirectScreen( $false_words, $this->settings['base_url'] . 'app=core&module=global&section=login' );
}
else
{
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=global&section=login' );
}
}
}
/**
* Delete a user's cookies
*
* @access public
* @param boolean Check the key
* @return mixed Output error page if key checking fails, else boolean true
*/
public function deleteCookies( $check_key=true )
{
//-----------------------------------------
// Check the md5 key
//-----------------------------------------
if( $check_key )
{
$key = $this->request['k'];
if ( $key != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'bad_delete_cookies_key', 2010 );
}
}
//-----------------------------------------
// Wipe out any forum password cookies
//-----------------------------------------
if ( is_array($_COOKIE) )
{
foreach( $_COOKIE as $cookie => $value )
{
if ( stripos( $cookie, $this->settings['cookie_id']."ipbforum" ) !== false )
{
IPSCookie::set( str_replace( $this->settings['cookie_id'], "", $cookie ) , '-', -1 );
}
if ( stripos( $cookie, $this->settings['cookie_id']."itemMarking_" ) !== false )
{
IPSCookie::set( str_replace( $this->settings['cookie_id'], "", $cookie ) , '-', -1 );
}
}
}
//-----------------------------------------
// And the rest of the cookies
//-----------------------------------------
IPSCookie::set('pass_hash' , '-1');
IPSCookie::set('member_id' , '-1');
IPSCookie::set('session_id', '-1');
IPSCookie::set('anonlogin' , '-1');
return true;
}
/**
* Show the login form
*
* @access public
* @param string Message to show on login form
* @return string Login form HTML
*/
public function loginForm( $message="", $replacement='' )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$extra_form = "";
$show_form = 1;
$template = '';
//-----------------------------------------
// Are they banned?
//-----------------------------------------
if ( IPSMember::isBanned( 'ip', $this->member->ip_address ) )
{
$this->registry->getClass('output')->showError( 'you_are_banned', 2011 );
}
if ( $message != "" )
{
if( $replacement )
{
$message = sprintf( $this->lang->words[ $message ], $replacement );
}
else
{
$message = $this->lang->words[ $message ];
}
$name = $this->request['UserName'] ? $this->request['UserName'] : $this->request['address'];
$message = str_replace( "<#NAME#>", "<b>" . $name . "</b>", $message );
$template .= $this->registry->getClass('output')->getTemplate('login')->errors($message);
}
//-----------------------------------------
// Using an alternate log in form?
//-----------------------------------------
$this->han_login->checkLoginUrlRedirect();
//-----------------------------------------
// Extra HTML?
//-----------------------------------------
$additionalForm = $this->han_login->additionalFormHTML();
if ( count($additionalForm[1]) )
{
if ( $additionalForm[0] == 'add' )
{
$extra_form = $additionalForm[1];
$show_form = 1;
}
else
{
$template .= $additionalForm[1];
$show_form = 0;
}
}
//-----------------------------------------
// Continue...
//-----------------------------------------
if ( $show_form )
{
if( $this->request['referer'] )
{
$http_referrer = $this->request['referer'];
}
else if ( !my_getenv('HTTP_REFERER') OR stripos( my_getenv('HTTP_REFERER'), $this->settings['board_url'] ) === false )
{
$http_referrer = ( strtolower($_SERVER['HTTPS']) == 'on' ? "https://" : "http://" ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
else
{
$http_referrer = my_getenv('HTTP_REFERER');
}
$facebookOpts = array();
$login_methods = false;
$uses_name = false;
$uses_email = false;
foreach( $this->cache->getCache('login_methods') as $method )
{
$login_methods[ $method['login_folder_name'] ] = $method['login_folder_name'];
if( $method['login_user_id'] == 'username' )
{
$uses_name = true;
}
if( $method['login_user_id'] == 'email' )
{
$uses_email = true;
}
}
if( $uses_name AND $uses_email )
{
$this->lang->words['enter_name'] = $this->lang->words['enter_name_and_email'];
}
else if( $uses_email )
{
$this->lang->words['enter_name'] = $this->lang->words['enter_useremail'];
}
else
{
$this->lang->words['enter_name'] = $this->lang->words['enter_username'];
}
$template .= $this->registry->getClass('output')->getTemplate('login')->showLogInForm( $this->lang->words['please_log_in'], htmlentities(urldecode($http_referrer)), $extra_form, $login_methods, $facebookOpts );
}
/* Work around for bug http://bugs.developers.facebook.com/show_bug.cgi?id=3237 */
if ( IPSLib::fbc_enabled() )
{
$this->_facebook->testConnectSession();
}
$this->registry->getClass('output')->addNavigation( $this->lang->words['log_in'], '' );
$this->registry->getClass('output')->setTitle( $this->lang->words['log_in'] );
$this->registry->getClass('output')->addContent( $template );
$this->registry->getClass('output')->sendOutput( );
}
/**
* Verify login form submission and log user in
*
* @access public
* @return mixed array [0=Words to show, 1=URL to send to, 2=error array]
*/
public function doLogin()
{
return $this->han_login->verifyLogin();
}
/**
* Log a user out
*
* @access public
* @param integer Flag to check md5 key
* @return mixed Error message or array [0=immediate|redirect, 1=words to show, 2=URL to send to]
*/
public function doLogout( $check_key=true )
{
//-----------------------------------------
// INIT
//-----------------------------------------
if ( $check_key )
{
$key = $this->request['k'];
# Check for funny business
if ( $key != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'bad_logout_key', 2012 );
}
}
//-----------------------------------------
// Set some cookies
//-----------------------------------------
IPSCookie::set( "member_id" , "0" );
IPSCookie::set( "pass_hash" , "0" );
IPSCookie::set( "anonlogin" , "-1" );
if( is_array( $_COOKIE ) )
{
foreach( $_COOKIE as $cookie => $value)
{
if ( stripos( $cookie, $this->settings['cookie_id'] . 'ipbforumpass' ) !== false )
{
IPSCookie::set( $cookie, '-', -1 );
}
}
}
//-----------------------------------------
// Logout callbacks...
//-----------------------------------------
$this->han_login->logoutCallback();
//-----------------------------------------
// Do it..
//-----------------------------------------
$this->member->sessionClass()->convertMemberToGuest();
list( $privacy, $loggedin ) = explode( '&', $this->memberData['login_anonymous'] );
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'login_anonymous' => "{$privacy}&0",
'last_activity' => time() ) ) );
//-----------------------------------------
// Return..
//-----------------------------------------
$url = "";
if ( $this->request['return'] AND $this->request['return'] != "" )
{
$return = urldecode($this->request['return']);
if ( strpos( $return, "http://" ) === 0 )
{
return array( 'immediate', '', $return );
}
}
return array( 'redirect', $this->lang->words['thanks_for_logout'], $this->settings['base_url'] . 'act=idx' );
}
}
@@ -0,0 +1,490 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Recover Lost Password
* Last Updated: $Date: 2009-11-09 21:06:29 -0500 (Mon, 09 Nov 2009) $
*
* @author $Author $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since 20th February 2002
* @version $Rev: 5342 $
*
*/
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 public_core_global_lostpass extends ipsCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
/* Load language */
$this->registry->class_localization->loadLanguageFile( array( 'public_register' ), 'core' );
/* What to do */
switch( $this->request['do'] )
{
case 'sendform':
$this->lostPasswordValidateForm();
break;
case '11':
$this->lostPasswordEnd();
break;
case '03':
$this->lostPasswordValidate();
break;
default:
case '10':
$this->lostPasswordForm();
break;
}
/* Output */
$this->registry->output->addContent( $this->output );
$this->registry->output->sendOutput();
}
/**
* Validates a lost password request
*
* @access public
* @return void
*/
public function lostPasswordValidate()
{
/* Check for input and it's in a valid format. */
$in_user_id = intval( trim( urldecode( $this->request['uid'] ) ) );
$in_validate_key = IPSText::md5Clean( trim( urldecode( $this->request['aid'] ) ) );
/* Check Input */
if( ! $in_validate_key )
{
$this->registry->output->showError( 'validation_key_incorrect', 1015 );
}
if( ! preg_match( "/^(?:\d){1,}$/", $in_user_id ) )
{
$this->registry->output->showError( 'uid_key_incorrect', 1016 );
}
/* Attempt to get the profile of the requesting user */
$member = IPSMember::load( $in_user_id );
if( ! $member['member_id'] )
{
$this->registry->output->showError( 'lostpass_no_member', 1017 );
}
/* Get validating info.. */
$validate = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'validating', 'where' => 'member_id=' . $in_user_id . ' and lost_pass=1' ) );
if( ! $validate['member_id'] )
{
$this->registry->output->showError( 'lostpass_not_validating', 1018 );
}
if( ( $validate['new_reg'] == 1 ) && ( $this->settings['reg_auth_type'] == "admin" ) )
{
$this->registry->output->showError( 'lostpass_new_reg', 4010, true );
}
if( $validate['vid'] != $in_validate_key )
{
$this->registry->output->showError( 'lostpass_key_wrong', 1019 );
}
else
{
/* On the same page? */
if( $validate['lost_pass'] != 1 )
{
$this->registry->output->showError( 'lostpass_not_lostpass', 4011, true );
}
/* Test GD image */
if( $this->settings['bot_antispam'] )
{
if ( $this->registry->getClass('class_captcha')->validate() !== TRUE )
{
$this->lostPasswordValidateForm( 'err_reg_code' );
return;
}
}
/* Send a new random password? */
if( $this->settings['lp_method'] == 'random' )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$save_array = array();
//-----------------------------------------
// Generate a new random password
//-----------------------------------------
$new_pass = IPSLib::makePassword();
//-----------------------------------------
// Generate a new salt
//-----------------------------------------
$salt = IPSMember::generatePasswordSalt(5);
$salt = str_replace( '\\', "\\\\", $salt );
//-----------------------------------------
// New log in key
//-----------------------------------------
$key = IPSMember::generateAutoLoginKey();
//-----------------------------------------
// Update...
//-----------------------------------------
$save_array['members_pass_salt'] = $salt;
$save_array['members_pass_hash'] = md5( md5($salt) . md5( $new_pass ) );
$save_array['member_login_key'] = $key;
$save_array['member_login_key_expire'] = $this->settings['login_key_expire'] * 60 * 60 * 24;
$save_array['failed_logins'] = null;
$save_array['failed_login_count'] = 0;
//-----------------------------------------
// Load handler...
//-----------------------------------------
require_once( IPS_ROOT_PATH.'sources/handlers/han_login.php' );
$this->han_login = new han_login( $this->registry );
$this->han_login->init();
$this->han_login->changePass( $member['email'], md5( $new_pass ) );
if ( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' )
{
$this->registry->output->showError( $this->lang->words['lostpass_external_fail'], 2013 );
}
IPSMember::save( $member['member_id'], array( 'members' => $save_array ) );
//-----------------------------------------
// Send out the email...
//-----------------------------------------
IPSText::getTextClass('email')->getTemplate("lost_pass_email_pass");
IPSText::getTextClass('email')->buildMessage( array(
'NAME' => $member['members_display_name'],
'THE_LINK' => $this->settings['base_url'] . 'app=core&module=usercp&tab=core&area=password',
'PASSWORD' => $new_pass,
'LOGIN' => $this->settings['base_url'] . 'app=core&module=global&section=login',
'USERNAME' => $member['name'],
'EMAIL' => $member['email'],
'ID' => $member['member_id'],
)
);
IPSText::getTextClass('email')->subject = $this->lang->words['lp_random_pass_subject'] . ' ' . $this->settings['board_name'];
IPSText::getTextClass('email')->to = $member['email'];
IPSText::getTextClass('email')->sendMail();
$this->registry->output->setTitle( $this->lang->words['activation_form'] );
$this->output = $this->registry->getClass('output')->getTemplate('register')->showLostPassWaitRandom( $member );
}
else
{
if( $_POST['pass1'] == "" )
{
$this->registry->output->showError( 'pass_blank', 10184 );
}
if( $_POST['pass2'] == "" )
{
$this->registry->output->showError( 'pass_blank', 10185 );
}
$pass_a = trim( $this->request['pass1'] );
$pass_b = trim( $this->request['pass2'] );
if( strlen( $pass_a ) < 3 )
{
$this->registry->output->showError( 'pass_too_short', 10186 );
}
if( $pass_a != $pass_b )
{
$this->registry->output->showError( 'pass_no_match', 10187 );
}
$new_pass = md5( $pass_a );
/* Update Member Array */
$save_array = array();
/* Generate a new salt */
$salt = IPSMember::generatePasswordSalt(5);
$salt = str_replace( '\\', "\\\\", $salt );
/* New log in key */
$key = IPSMember::generateAutoLoginKey();
/* Update Array */
$save_array['members_pass_salt'] = $salt;
$save_array['members_pass_hash'] = md5( md5($salt) . $new_pass );
$save_array['member_login_key'] = $key;
$save_array['member_login_key_expire'] = $this->settings['login_key_expire'] * 60 * 60 * 24;
$save_array['failed_logins'] = null;
$save_array['failed_login_count'] = 0;
/* Change the password */
require_once( IPS_ROOT_PATH.'sources/handlers/han_login.php' );
$this->han_login = new han_login( $this->registry );
$this->han_login->init();
$this->han_login->changePass( $member['email'], md5( $new_pass ) );
//-----------------------------------------
// We'll ignore any remote errors
//-----------------------------------------
if( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' )
{
// Pass not changed remotely
}
/* Update the member */
IPSMember::save( $member['member_id'], array( 'members' => $save_array ) );
/* Remove "dead" validation */
$this->DB->delete( 'validating', "vid='{$validate['vid']}' OR (member_id={$member['member_id']} AND lost_pass=1)" );
$this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=core&module=global&section=login&do=autologin&frompass=1' );
}
}
}
/**
* Completes the lost password request form
*
* @access public
* @return void
*/
public function lostPasswordEnd()
{
if( $this->settings['bot_antispam'] )
{
if( !$this->registry->getClass('class_captcha')->validate( $this->request['regid'], $this->request['reg_code'] ) )
{
$this->lostPasswordForm( 'err_reg_code' );
return;
}
}
/* Back to the usual programming! :o */
if( $this->request['member_name'] == "" AND $this->request['email_addy'] == "" )
{
$this->registry->output->showError( 'lostpass_name_email', 10110 );
}
/* Check for input and it's in a valid format. */
$member_name = trim( mb_strtolower( $this->request['member_name'] ) );
$email_addy = trim( mb_strtolower( $this->request['email_addy'] ) );
if( $member_name == "" AND $email_addy == "" )
{
$this->registry->output->showError( 'lostpass_name_email', 10111 );
}
/* Attempt to get the user details from the DB */
if( $member_name )
{
$this->DB->build( array( 'select' => 'members_display_name, name, member_id, email, member_group_id', 'from' => 'members', 'where' => "members_l_username='{$member_name}'" ) );
$this->DB->execute();
}
else if( $email_addy )
{
$this->DB->build( array( 'select' => 'members_display_name, name, member_id, email, member_group_id', 'from' => 'members', 'where' => "email='{$email_addy}'" ) );
$this->DB->execute();
}
if ( ! $this->DB->getTotalRows() )
{
$this->registry->output->showError( 'lostpass_no_user', 10112 );
}
else
{
$member = $this->DB->fetch();
/* Is there a validation key? If so, we'd better not touch it */
if( $member['member_id'] == "" )
{
$this->registry->output->showError( 'lostpass_no_mid', 2014 );
}
$validate_key = md5( IPSLib::makePassword() . uniqid( mt_rand(), TRUE ) );
/* Get rid of old entries for this member */
$this->DB->delete( 'validating', "member_id={$member['member_id']} AND lost_pass=1" );
/* Update the DB for this member. */
$db_str = array(
'vid' => $validate_key,
'member_id' => $member['member_id'],
'temp_group' => $member['member_group_id'],
'entry_date' => time(),
'coppa_user' => 0,
'lost_pass' => 1,
'ip_address' => $this->member->ip_address,
);
/* Are they already in the validating group? */
if( $member['member_group_id'] != $this->settings['auth_group'] )
{
$db_str['real_group'] = $member['member_group_id'];
}
$this->DB->insert( 'validating', $db_str );
/* Send out the email. */
IPSText::getTextClass('email')->getTemplate( 'lost_pass' );
IPSText::getTextClass('email')->buildMessage( array(
'NAME' => $member['members_display_name'],
'THE_LINK' => $this->settings['base_url']."app=core&module=global&section=lostpass&do=sendform&uid=".$member['member_id']."&aid=".$validate_key,
'MAN_LINK' => $this->settings['base_url']."app=core&module=global&section=lostpass&do=sendform",
'EMAIL' => $member['email'],
'ID' => $member['member_id'],
'CODE' => $validate_key,
'IP_ADDRESS' => $this->member->ip_address,
)
);
IPSText::getTextClass('email')->subject = $this->lang->words['lp_subject'] . ' ' . $this->settings['board_name'];
IPSText::getTextClass('email')->to = $member['email'];
IPSText::getTextClass('email')->sendMail();
$this->output = $this->registry->getClass('output')->getTemplate('register')->lostPasswordWait( $member );
}
$this->registry->output->setTitle( $this->lang->words['lost_pass_form'] );
}
/**
* Displays the lost password form
*
* @access public
* @param string $errors
* @return void
*/
public function lostPasswordForm( $errors="" )
{
//-----------------------------------------
// Do we have another URL for password resets?
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );
$han_login = new han_login( $this->registry );
$han_login->init();
$han_login->checkMaintenanceRedirect();
/* CAPTCHA */
if( $this->settings['bot_antispam'] )
{
$captchaHTML = $this->registry->getClass('class_captcha')->getTemplate();
}
$this->registry->output->setTitle( $this->lang->words['lost_pass_form'] );
$this->registry->output->addNavigation( $this->lang->words['lost_pass_form'], '' );
$this->output .= $this->registry->output->getTemplate('register')->lostPasswordForm( $this->lang->words[ $errors ] );
if ( $this->settings['bot_antispam'] )
{
$this->output = str_replace( "<!--{REG.ANTISPAM}-->", $captchaHTML, $this->output );
}
}
/**
* Shows the form for validating a lost password request
*
* @access public
* @param string $msg
* @return void
*/
public function lostPasswordValidateForm( $msg='' )
{
$this->output .= $this->registry->getClass('output')->getTemplate('register')->showLostpassForm( $this->lang->words[$msg] );
/* Check for input and it's in a valid format. */
if( $this->request['uid'] AND $this->request['aid'] )
{
$in_user_id = intval( trim( urldecode( $this->request['uid'] ) ) );
$in_validate_key = IPSText::md5Clean( trim( urldecode( $this->request['aid'] ) ) );
$in_type = trim( $this->request['type'] );
if ($in_type == "")
{
$in_type = 'reg';
}
/* Check and test input */
if ( ! $in_validate_key )
{
$this->registry->output->showError( 'validation_key_incorrect', 10113 );
}
if (! preg_match( "/^(?:\d){1,}$/", $in_user_id ) )
{
$this->registry->output->showError( 'uid_key_incorrect', 10114 );
}
/* Attempt to get the profile of the requesting user */
$member = IPSMember::load( $in_user_id );
if( ! $member['member_id'] )
{
$this->registry->output->showError( 'lostpass_no_member', 10115 );
}
/* Get validating info.. */
$validate = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'validating', 'where' => "member_id={$in_user_id} and vid='{$in_validate_key}' and lost_pass=1" ) );
if( ! $validate['member_id'] )
{
$this->registry->output->showError( 'validation_key_incorrect', 10116 );
}
$this->output = str_replace( "<!--IBF.INPUT_TYPE-->", $this->registry->output->getTemplate('register')->show_lostpass_form_auto( $in_validate_key, $in_user_id ), $this->output );
}
else
{
$this->output = str_replace( "<!--IBF.INPUT_TYPE-->", $this->registry->output->getTemplate('register')->show_lostpass_form_manual(), $this->output );
}
/* CAPTCHA */
if( $this->settings['bot_antispam'] )
{
$this->output = str_replace( "<!--{REG.ANTISPAM}-->", $this->registry->getClass('class_captcha')->getTemplate(), $this->output );
}
$this->registry->output->setTitle( $this->lang->words['activation_form'] );
$this->registry->output->addNavigation( $this->lang->words['activation_form'], '' );
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,101 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Reputation
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @version $Rev: 4948 $
*
*/
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 public_core_global_reputation extends ipsCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
/* What to do... */
switch( $this->request['do'] )
{
case 'add_rating':
$this->doRating();
break;
}
}
/**
* Adds a rating to the index
*
* @access public
* @return void
*/
public function doRating()
{
/* INIT */
$app = $this->request['app_rate'];
$type = $this->request['type'];
$type_id = intval( $this->request['type_id'] );
$rating = intval( $this->request['rating'] );
/* Check */
if( ! $app || ! $type || ! $type_id || ! $rating )
{
$this->registry->output->showError( 'reputation_missing_data', 10126 );
}
/* Check the secure key. Needed here to prevent direct URLs from increasing reps */
if ( $this->request['secure_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'reputation_missing_data', 10126 );
}
/* Get the rep library */
require_once( IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php' );
$repCache = new classReputationCache();
/* Add the rating */
if( ! $repCache->addRate( $type, $type_id, $rating, '', 0, $app ) )
{
$this->registry->output->showError( $repCache->error_message, 10127 );
}
else
{
/* Redirect to */
$return_url = '';
if( isset( $this->request['post_return'] ) && $this->request['post_return'] )
{
$return_url = $this->settings['base_url'] . 'app=forums&module=forums&section=findpost&pid=' . intval( $this->request['post_return'] );
}
else if( $_SERVER['HTTP_REFERER'] )
{
$return_url = $_SERVER['HTTP_REFERER'];
}
else
{
$return_url = $this->settings['base_url'];
}
/* Probably Temporary :) */
$this->registry->output->silentRedirect( $return_url );
}
}
}
@@ -0,0 +1,100 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* RSS output functionality
* Last Updated: $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since Friday 18th March 2005
* @version $Revision: 3887 $
*/
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 public_core_global_rss extends ipsCommand
{
/**
* XML document content
*
* @access private
* @var string XML document content
*/
private $to_print = '';
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// INIT
//-----------------------------------------
if ( $this->request['j_do'] )
{
$this->request['do'] = $this->request['j_do'];
}
//-----------------------------------------
// We offline?
//-----------------------------------------
if( $this->settings['board_offline'] )
{
header("HTTP/1.1 503 Service Temporarily Unavailable");
print $this->lang->words['rss_board_offline'];
exit();
}
//-----------------------------------------
// Grab the plugin
//-----------------------------------------
$type = 'forums';
if( $this->request['type'] )
{
if( file_exists( IPSLib::getAppDir( IPSText::alphanumericalClean( $this->request['type'] ) ) . '/extensions/rssOutput.php' ) )
{
$type = IPSText::alphanumericalClean( $this->request['type'] );
}
}
//-----------------------------------------
// And grab the content
//-----------------------------------------
require_once( IPSLib::getAppDir( $type ) . '/extensions/rssOutput.php' );
$classname = "rss_output_" . $type;
$rss_library = new $classname( $this->registry );
$this->to_print = $rss_library->returnRSSDocument();
$expires = $rss_library->grabExpiryDate();
//-----------------------------------------
// Then output
//-----------------------------------------
@header( 'Content-Type: text/xml; charset=' . IPS_DOC_CHAR_SET );
@header( 'Expires: ' . gmstrftime( '%c', $expires ) . ' GMT' );
@header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
@header( 'Pragma: public' );
print $this->to_print;
exit();
}
}
@@ -0,0 +1,30 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Define the default help section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
*
*/
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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'help';
@@ -0,0 +1,173 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Help File System
* Last Updated: $Date: 2009-04-24 08:15:53 -0400 (Fri, 24 Apr 2009) $
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @version $Rev: 4544 $
*
*/
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 public_core_help_help extends ipsCommand
{
/**
* HTML to output
*
* @access private
* @var string HTML
*/
public $output = "";
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
/* Load Language */
$this->registry->class_localization->loadLanguageFile( array( 'public_help' ) );
/* What to do? */
switch( $this->request['do'] )
{
case '01':
$this->helpShowSection();
break;
default:
$this->helpShowTitles();
break;
}
/* Output */
$this->registry->output->addContent( $this->output );
$this->registry->output->sendOutput();
}
/**
* Show help topics
*
* @access public
* @return void
*/
public function helpShowTitles()
{
/* INI */
$seen = array();
/* Query the help topics */
$this->DB->build( array( 'select' => 'id, title, description', 'from' => 'faq', 'order' => 'position ASC' ) );
$this->DB->execute();
/* Loop through topics */
$rows = array();
while( $row = $this->DB->fetch() )
{
if( isset( $seen[ $row['title'] ] ) )
{
continue;
}
else
{
$seen[ $row['title'] ] = 1;
}
$rows[] = $row;
}
/* Output */
$this->output .= $this->registry->output->getTemplate( 'help' )->helpShowTopics(
$this->lang->words['page_title'],
$this->lang->words['help_txt'],
$this->lang->words['choose_file'],
$rows
);
/* Navigation */
$this->registry->output->setTitle( $this->lang->words['page_title'] );
$this->registry->output->addNavigation( $this->lang->words['page_title'], '' );
}
/**
* Displays a help file
*
* @access public
* @return void
*/
public function helpShowSection()
{
/* Check ID */
$id = $this->request['HID'] ? intval( $this->request['HID'] ) : 0;
if ( ! $id )
{
$this->helpShowTitles();
return;
}
/* Query the hel topic */
$topic = $this->DB->buildAndFetch( array( 'select' => 'id, title, text', 'from' => 'faq', 'where' => 'id=' . $id ) );
if ( ! $topic['id'] )
{
$this->registry->output->showError( 'help_no_id', 10128 );
}
/* Load the Parser */
IPSText::getTextClass( 'bbcode' )->bypass_badwords = 1;
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
IPSText::getTextClass( 'bbcode' )->parse_html = 1;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'help';
$topic['text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $topic['text'] );
/* Parse out board URL */
$topic['text'] = str_replace( '{board_url}', $this->settings['base_url'], $topic['text'] );
if ( $this->request['hl'] )
{
$topic['text'] = IPSText::searchHighlight( $topic['text'], $this->request['hl'] );
$topic['title'] = IPSText::searchHighlight( $topic['title'], $this->request['hl'] );
}
/* Output */
$this->output .= $this->registry->output->getTemplate( 'help' )->helpShowSection(
$this->lang->words['help_topic'],
$this->lang->words['topic_text'],
$topic['title'],
$topic['text']
);
/* Navigation */
$this->registry->output->setTitle( $this->lang->words['help_topic'] );
$this->registry->output->addNavigation( $this->lang->words['help_topics'], "app=core&amp;module=help" );
$this->registry->output->addNavigation( $this->lang->words['help_topic'], '' );
if( $this->request['xml'] == 1 )
{
require_once( IPS_KERNEL_PATH . 'classAjax.php' );
$classAjax = new classAjax();
$classAjax->returnHtml( $this->output );
}
}
}
@@ -0,0 +1 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
@@ -0,0 +1 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
@@ -0,0 +1,30 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Define the default reports section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
*
*/
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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'reports';
@@ -0,0 +1 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,30 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Define the default section section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
*
*/
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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'search';
@@ -0,0 +1 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
File diff suppressed because it is too large. Load diff
@@ -0,0 +1 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
@@ -0,0 +1,68 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Task Manager
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @version $Rev: 4948 $
*
*/
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 public_core_task_manualResolver extends ipsCommand
{
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@set_time_limit(1200);
//-----------------------------------------
// Require and run
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/class_taskmanager.php' );
$functions = new class_taskmanager( $registry );
//-----------------------------------------
// Check shutdown functions
//-----------------------------------------
if( IPS_USE_SHUTDOWN )
{
define( 'IS_SHUTDOWN', 1 );
register_shutdown_function( array( $functions, 'runTask') );
}
else
{
$functions->runTask();
}
if( $functions->type != 'cron' && ! $_SERVER['SHELL'] )
{
//-----------------------------------------
// Print out the 'blank' gif
//-----------------------------------------
@header( "Content-Type: image/gif" );
print base64_decode( "R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" );
}
}
}
@@ -0,0 +1 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
@@ -0,0 +1,367 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* User control panel resolver
* Last Updated: $Date: 2009-11-10 18:07:22 -0500 (Tue, 10 Nov 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @since 1st march 2002
* @version $Revision: 5345 $
*/
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();
}
/**
* Main loader class
*/
class public_core_usercp_manualResolver extends ipsCommand
{
/**
* Page Title set by sub classes
*
* @access protected
* @var string
*/
protected $_pageTitle;
/**
* Navigation array set by sub classes
*
* @access protected
* @var array
*/
protected $_nav = array();
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$_thisNav = array();
//-----------------------------------------
// Load language
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_usercp' ) );
//-----------------------------------------
// Logged in?
//-----------------------------------------
if ( ! $this->memberData['member_id'] )
{
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'].'&app=core&module=global&section=login&do=form' );
exit();
}
//-----------------------------------------
// Make sure they're clean
//-----------------------------------------
$this->request['tab'] = IPSText::alphanumericalClean( $this->request['tab'] );
$this->request['area'] = IPSText::alphanumericalClean( $this->request['area'] );
//-----------------------------------------
// Set up some basics...
//-----------------------------------------
$_TAB = ( $this->request['tab'] ) ? $this->request['tab'] : 'core';
$_AREA = ( $this->request['area'] ) ? $this->request['area'] : 'settings';
$_DO = ( $this->request['do'] ) ? $this->request['do'] : 'show';
$_FUNC = ( $_DO == 'show' ) ? 'showForm' : ( $_DO == 'save' ? 'saveForm' : $_DO );
$tabs = array();
$errors = array();
//-----------------------------------------
// Got a plug in?
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/interfaces/interface_usercp.php' );
$EXT_DIR = IPSLib::getAppDir( $_TAB ) . '/extensions';
$_CLASS = 'usercpForms_' . $_TAB;
if ( ! file_exists($EXT_DIR . '/usercpForms.php') )
{
$this->registry->getClass('output')->showError( 'usercp_bad_tab', 10147 );
exit();
}
//-----------------------------------------
// Cycle through applications and load
// usercpForm extensions
//-----------------------------------------
foreach( ipsRegistry::$applications as $app_dir => $app_data )
{
// Check that the application is installed.
if ( !IPSLib::appIsInstalled( $app_dir ) )
{
continue;
}
$ext_dir = IPSLib::getAppDir( $app_dir ) . '/extensions';
// Make sure the extension exists
if ( !file_exists( $ext_dir . '/usercpForms.php' ) )
{
continue;
}
require_once( $ext_dir . '/usercpForms.php' );
$__class = 'usercpForms_' . $app_dir;
//-----------------------------------------
// Support for extending usercpForms
//-----------------------------------------
if ( file_exists( $ext_dir . '/usercpFormsExt.php' ) )
{
require_once( $ext_dir . '/usercpFormsExt.php' );
//-----------------------------------------
// The class must exist and extend
// the usercpForm class to be valid.
//-----------------------------------------
if ( class_exists( 'usercpFormsExt_' . $app_dir ) )
{
$parent = get_parent_class( 'usercpFormsExt_' . $app_dir );
if ( $parent == $__class )
{
$__class = 'usercpFormsExt_' . $app_dir;
}
}
}
$_usercp_module = new $__class();
$_usercp_module->makeRegistryShortcuts( $this->registry );
if ( is_callable( array( $_usercp_module, 'init' ) ) )
{
$_usercp_module->init();
/* Set default area? */
if ( ( $_TAB == $app_dir ) AND ! isset( $_REQUEST['area'] ) )
{
if ( isset( $_usercp_module->defaultAreaCode ) )
{
$this->request['area'] = $_AREA = $_usercp_module->defaultAreaCode;
}
}
}
if ( is_callable( array( $_usercp_module, 'getLinks' ) ) )
{
$tabs[ $app_dir ]['_name'] = $_usercp_module->tab_name ? $_usercp_module->tab_name : IPSLib::getAppTitle( $app_dir );
$tabs[ $app_dir ]['_menu'] = $_usercp_module->getLinks();
if ( ! $tabs[ $app_dir ]['_menu'] )
{
unset( $tabs[ $app_dir ] );
}
/* Add in 'last' element */
$tabs[ $app_dir ]['_menu'][ count( $tabs[ $app_dir ]['_menu'] ) - 1 ]['last'] = 1;
/* This nav? */
if ( ! count( $_thisNav ) AND $app_dir == $_TAB )
{
foreach( $tabs[ $app_dir ]['_menu'] as $_navData )
{
if ( $_navData['url'] == 'area=' . $_AREA )
{
$_thisNav = array( 'app=core&amp;module=usercp&amp;tab=' . $_TAB . '&amp;area=' . $_AREA, $_navData['title'] );
}
}
}
}
}
//-----------------------------------------
// Set up basic navigation
//-----------------------------------------
$this->_nav[] = array( $this->lang->words['t_title'], '&amp;app=core&amp;module=usercp' );
$this->_nav[] = array( $this->lang->words['tab__' . $_TAB ] ? $this->lang->words['tab__' . $_TAB ] : IPSLib::getAppTitle( $_TAB ) , '&amp;app=core&amp;module=usercp&amp;tab=' . $_TAB );
if ( isset( $_thisNav[0] ) )
{
$this->_nav[] = array( $_thisNav[1], $_thisNav[0] );
}
//-----------------------------------------
// Begin initilization routine for extension
//-----------------------------------------
require_once( $EXT_DIR . '/usercpForms.php' );
//-----------------------------------------
// Support for extending usercpForms
//-----------------------------------------
if ( file_exists( $EXT_DIR . '/usercpFormsExt.php' ) )
{
require_once( $EXT_DIR . '/usercpFormsExt.php' );
//-----------------------------------------
// The class must exist and extend
// the usercpForm class to be valid.
//-----------------------------------------
if ( class_exists( 'usercpFormsExt_' . $_TAB ) )
{
$parent = get_parent_class( 'usercpFormsExt_' . $_TAB );
if ( $parent == $_CLASS )
{
$_CLASS = 'usercpFormsExt_' . $_TAB;
}
}
}
$usercp_module = new $_CLASS();
$usercp_module->makeRegistryShortcuts( $this->registry );
$usercp_module->init();
if ( ( $_DO == 'saveForm' || $_DO == 'showForm' ) AND ! is_callable( array( $usercp_module, $_FUNC ) ) )
{
$this->registry->getClass('output')->showError( 'usercp_bad_tab', 10148, true );
exit();
}
//-----------------------------------------
// Run it...
//-----------------------------------------
if ( $_FUNC == 'showForm' )
{
//-----------------------------------------
// Facebook email
//-----------------------------------------
//@facebook concession
if ( IPSLib::fbc_enabled() === TRUE )
{
if ( ! $this->memberData['fb_emailallow'] AND strstr( $this->memberData['email'], '@proxymail.facebook.com' ) )
{
require_once( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php' );
$fb = new facebook_connect( $this->registry );
try
{
$fb->testConnectSession();
$result = $fb->users_hasAppPermission( 'email' );
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'fb_emailallow' => intval( $result ) ) ) );
}
catch( Exception $error )
{
}
}
}
$html = $usercp_module->showForm( $_AREA );
}
else if ( $_FUNC == 'saveForm' )
{
//-----------------------------------------
// Check secure key...
//-----------------------------------------
if ( $this->request['secure_hash'] != $this->member->form_hash )
{
$html = $usercp_module->showForm( $_AREA );
$errors[] = $this->lang->words['securehash_not_secure'];
}
else
{
$errors = $usercp_module->saveForm( $_AREA );
$do = ( $usercp_module->do_url ) ? $usercp_module->do_url : 'show';
if ( is_array( $errors ) AND count( $errors ) )
{
$html = $usercp_module->showForm( $_AREA, $errors );
}
else if ( $usercp_module->ok_message )
{
$this->registry->getClass('output')->redirectScreen( $usercp_module->ok_message, $this->settings['base_url'] . 'app=' . IPS_APP_COMPONENT . '&module=usercp&tab=' . $_TAB . '&area=' . $_AREA . '&do='.$do.'&saved=1', 1 );
}
else
{
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url_with_app'] . 'module=usercp&tab=' . $_TAB . '&area=' . $_AREA . '&do='.$do.'&saved=1'.'&_r='.time() );
}
}
}
else
{
if ( ! is_callable( array( $usercp_module, 'runCustomEvent' ) ) )
{
$html = $usercp_module->showForm( $_AREA );
$errors[] = $this->lang->words['called_invalid_function'];
}
else
{
$html = $usercp_module->runCustomEvent( $_AREA );
}
}
//-----------------------------------------
// If you've run a custom event, may need to
// reset the "area" to highlight the menu correctly
//-----------------------------------------
if ( is_callable( array( $usercp_module, 'resetArea' ) ) )
{
$_AREA = $usercp_module->resetArea( $_AREA );
}
//-----------------------------------------
// Wrap form and show
//-----------------------------------------
$template = $this->registry->getClass('output')->getTemplate('ucp')->userCPTemplate( $_TAB, $html, $tabs, $_AREA, $errors, $usercp_module->hide_form_and_save_button, $usercp_module->uploadFormMax );
//-----------------------------------------
// Pass to CP output hander
//-----------------------------------------
$this->registry->getClass('output')->setTitle( ( $this->_pageTitle ) ? $this->settings['board_name'] . " {$this->lang->words['pagetitle_bit']} : " . $this->_pageTitle : $this->settings['board_name'] . " {$this->lang->words['pagetitle_bit']}" );
$this->registry->getClass('output')->addContent( $template );
if ( is_array( $this->_nav ) AND count( $this->_nav ) )
{
foreach( $this->_nav as $_nav )
{
$this->registry->getClass('output')->addNavigation( $_nav[0], $_nav[1] );
}
}
if ( is_array( $usercp_module->_nav ) AND count( $usercp_module->_nav ) )
{
foreach( $usercp_module->_nav as $_nav )
{
$this->registry->getClass('output')->addNavigation( $_nav[0], $_nav[1] );
}
}
$this->registry->getClass('output')->sendOutput();
}
}