Version 3.1.4

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

No files matched your search

@@ -1,62 +1,64 @@
<?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 );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Update captcha image
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 2.3
* @version $Revision: 5713 $
*
*/
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,242 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Image Ajax
* Last Updated: $LastChangedDate: 2010-08-18 16:55:30 +0100 (Wed, 18 Aug 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Gallery
* @link http://www.invisionpower.com
* @version $Rev: 6767 $
*/
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_comments extends ipsAjaxCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* From App */
$fromApp = trim( $this->request['fromApp'] );
/* Init some data */
require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );
$this->_comments = classes_comments_bootstrap::controller( $fromApp );
/* What to do? */
switch( $this->request['do'] )
{
case 'add':
$this->_add();
break;
case 'delete':
$this->_delete();
break;
case 'showEdit':
$this->_showEdit();
break;
case 'saveEdit':
$this->_saveEdit();
break;
case 'fetchReply':
$this->_fetchReply();
break;
case 'moderate':
$this->_moderate();
break;
}
}
/**
* Moderate
*
* @return void
*/
protected function _moderate()
{
$parentId = intval( $this->request['parentId'] );
$commentIds = ( is_array( $_POST['commentIds'] ) ) ? IPSLib::cleanIntArray( $_POST['commentIds'] ) : array();
$modact = trim( $this->request['modact'] );
if ( count( $commentIds ) )
{
try
{
$this->_comments->moderate( $modact, $parentId, $commentIds, $this->memberData );
$this->returnJsonArray( array( 'msg' => 'ok' ) );
}
catch( Exception $error )
{
$this->returnJsonError( 'Error ' . $error->getMessage() . ' line: ' . $error->getFile() . '.' . $error->getLine() );
}
}
}
/**
* Reply
*
* @return void
*/
protected function _fetchReply()
{
/* INIT */
$commentId = intval( $this->request['comment_id'] );
$parentId = intval( $this->request['parentId'] );
/* Quick error checko */
if ( ! $commentId OR ! $parentId )
{
$this->returnString( 'error' );
}
# Get Edit form
try
{
$html = $this->_comments->fetchReply( $parentId, $commentId, $this->memberData );
$this->returnString( $html );
}
catch ( Exception $error )
{
$this->returnString( 'Error ' . $error->getMessage() );
}
}
/**
* Deletes a comment
*
* @return void
*/
protected function _delete()
{
/* INIT */
$commentId = intval( $this->request['comment_id'] );
$parentId = intval( $this->request['parentId'] );
/* Quick error checko */
if ( ! $commentId OR ! $parentId )
{
$this->returnJsonError( 'error' );
}
try
{
$this->_comments->delete( $parentId, $commentId, $this->memberData );
$this->returnJsonArray( array( 'msg' => 'ok' ) );
}
catch ( Exception $error )
{
$this->returnJsonError( 'Error ' . $error->getMessage() );
}
}
/**
* Shows the edit box
*
* @return void
*/
protected function _showEdit()
{
/* INIT */
$commentId = intval( $this->request['comment_id'] );
$parentId = intval( $this->request['parentId'] );
/* Quick error checko */
if ( ! $commentId OR ! $parentId )
{
$this->returnString( 'error' );
}
# Get Edit form
try
{
$html = $this->_comments->displayAjaxEditForm( $parentId, $commentId, $this->memberData );
$html = $this->registry->output->replaceMacros( $html );
$this->returnHtml( $html );
}
catch ( Exception $error )
{
$this->returnString( 'Error ' . $error->getMessage() );
}
}
/**
* Saves the post
*
* @return void
*/
protected function _saveEdit()
{
/* INIT */
$commentId = intval( $this->request['comment_id'] );
$parentId = intval( $this->request['parentId'] );
$post = IPSText::parseCleanValue( $_POST['Post'] );
/* Quick error checko */
if ( ! $parentId OR ! $commentId )
{
$this->returnString( 'error' );
}
/* Edit */
try
{
$output = $this->_comments->edit( $parentId, $commentId, $_POST['Post'], $this->memberData );
$this->returnJsonArray( array( 'successString' => $this->registry->output->replaceMacros( $output ) ) );
}
catch ( Exception $error )
{
$this->returnJsonError( $error->getMessage() );
}
}
/**
* Add a comment via the magic and mystery of ajax
*
* @return void
*/
protected function _add()
{
/* init */
$post = IPSText::parseCleanValue( $_POST['Post'] );
$parentId = intval( $this->request['parentId'] );
if ( $post AND $parentId )
{
try
{
$newCommentId = $this->_comments->add( $parentId, $_POST['Post'] );
return $this->returnHtml( $this->_comments->fetchFormattedSingle( $parentId, $newCommentId ) );
}
catch( Exception $e )
{
$this->returnJsonError( 'no_permission: ' . $e->getMessage() . var_export( $e, true ) );
}
}
else
{
$this->returnJsonError( 'no_permission');
}
}
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Define the default ajax section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*
*/
@@ -1,154 +0,0 @@
<?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 );
}
}
@@ -1,116 +1,97 @@
<?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 );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Login handler abstraction : AJAX login
* Last Updated: $Date: 2010-01-25 11:58:04 -0500 (Mon, 25 Jan 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 5747 $
*
*/
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;
}
/* Output */
$this->returnHtml( $return );
}
/**
* 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 );
}
}
@@ -1,108 +1,111 @@
<?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 );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Login handler abstraction : AJAX Find Names functions
* Last Updated: $Date: 2010-04-14 19:25:27 -0400 (Wed, 14 Apr 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 6118 $
* @see admin_core_ajax_findnames
*
*/
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 = IPSText::convertUnicode( $this->convertAndMakeSafe( ipsRegistry::$request['name'], 0 ) );
//-----------------------------------------
// Check length
//-----------------------------------------
if ( IPSText::mbstrlen( $name ) < 3 )
{
$this->returnJsonError( 'requestTooShort' );
}
//-----------------------------------------
// Try query...
//-----------------------------------------
$this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id',
'from' => array( 'members' => 'm' ),
'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( mb_strtolower( $name ) ) . "%'",
'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC',
'limit' => array( 0, 15 ),
'add_join' => array( array( 'select' => 'p.*',
'from' => array( 'profile_portal' => 'p' ),
'where' => 'p.pp_member_id=m.member_id',
'type' => 'left' ) ) ) );
$this->DB->execute();
//-----------------------------------------
// Got any results?
//-----------------------------------------
if ( ! $this->DB->getTotalRows() )
{
$this->returnJsonArray( array( ) );
}
$return = array();
while( $r = $this->DB->fetch() )
{
$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 );
}
}
@@ -1 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -0,0 +1,151 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Like Ajax
* Last Updated: $LastChangedDate: 2010-08-18 16:55:30 +0100 (Wed, 18 Aug 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Gallery
* @link http://www.invisionpower.com
* @version $Rev: 6767 $
*
*/
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_like extends ipsAjaxCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* From App */
$app = trim( $this->request['f_app'] );
$area = trim( $this->request['f_area'] );
$relid = intval( $this->request['f_relid'] );
if ( ! $app OR ! $area OR empty( $relid ) )
{
trigger_error( "Missing data in " . __FILE__ . ' ' . __LINE__ );
}
/* Init some data */
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );
$this->_like = classes_like::bootstrap( $app, $area );
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_like' ), 'core' );
/* What to do? */
switch( $this->request['do'] )
{
case 'setDialogue':
$this->_setDialogue( $app, $area, $relid );
break;
case 'save':
$this->_save( $app, $area, $relid );
break;
case 'unset':
$this->_unset( $app, $area, $relid );
break;
case 'more':
$this->_more( $app, $area, $relid );
break;
}
}
/**
* Show more dialogue
*
* @param string App
* @param string Area
* @param int Relationship ID
* @return void
*/
protected function _more( $app, $area, $relid )
{
/* Fetch data */
return $this->returnHtml( $this->_like->render( 'more', $relid ) );
}
/**
* Do unset
*
* @param string App
* @param string Area
* @param int Relationship ID
* @return void
*/
protected function _unset( $app, $area, $relid )
{
if( !$this->memberData['member_id'] )
{
return $this->returnNull();
}
/* Set data */
$this->_like->remove( $relid, $this->memberData['member_id'] );
/* Fetch data */
return $this->returnHtml( $this->_like->render( 'summary', $relid ) );
}
/**
* Save form
*
* @param string App
* @param string Area
* @param int Relationship ID
* @return void
*/
protected function _save( $app, $area, $relid )
{
if( !$this->memberData['member_id'] )
{
return $this->returnNull();
}
$like_notify = intval( $this->request['like_notify'] );
$like_freq = trim( $this->request['like_freq'] );
$like_anon = intval( $this->request['like_anon'] );
/* Set data */
$this->_like->add( $relid, $this->memberData['member_id'], array( 'like_notify_do' => $like_notify, 'like_notify_freq' => $like_freq ), $like_anon );
/* Fetch data */
return $this->returnHtml( $this->_like->render( 'summary', $relid ) );
}
/**
* Show set form
*
* @param string App
* @param string Area
* @param int Relationship ID
* @return void
*/
protected function _setDialogue( $app, $area, $relid )
{
if( !$this->memberData['member_id'] )
{
return $this->returnNull();
}
$data = $this->_like->getDataForSetDialogue( $relid );
return $this->returnHtml( $this->registry->getClass('output')->getTemplate('global_other')->likeSetDialogue( $app, $area, $relid, $data ) );
}
}
@@ -1,144 +1,139 @@
<?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] ) );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Login handler abstraction : AJAX login
* Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 6995 $
*/
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
*
* @var object
*/
protected $han_login;
/**
* Flag : Logged in
*
* @var boolean
*/
protected $logged_in = false;
/**
* Class entry point
*
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load handler...
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$this->han_login = new $classToLoad( $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
*
* @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
*
* @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,180 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Notification AJAX methods
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 5713 $
*
*/
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_notifications 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 'getlatest':
default:
$this->getMyNotifications();
break;
case 'getNextNotification':
$this->getMoreNotifications( 'DESC' );
break;
case 'getLastNotification':
$this->getMoreNotifications( 'ASC' );
break;
}
}
/**
* Retrieve next notification for user
*
* @access protected
* @param string Database order (asc/desc)
* @return void [Outputs JSON to browser AJAX call]
*/
protected function getMoreNotifications( $dir='DESC' )
{
//-----------------------------------------
// We logged in?
//-----------------------------------------
if( !$this->memberData['member_id'] )
{
$this->returnJsonError( $this->lang->words['notifylogin_error'] );
}
//-----------------------------------------
// Retrieve notifications
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
$notifyLibrary = new $classToLoad( $this->registry );
$notifyLibrary->setMember( $this->memberData );
$_data = $notifyLibrary->fetchUnreadNotifications( 50, 'notify_sent', $dir );
//-----------------------------------------
// Now we loop through and set has previous,
// has more, and get "next" notification
//-----------------------------------------
$_hasPrevious = false;
$_hasNext = false;
$_hitId = false;
$_gotNext = false;
$_thisNotify = array();
foreach( $_data as $k => $v )
{
if( !$_hitId )
{
if( $v['notify_id'] == $this->request['last'] )
{
$_hitId = true;
}
$_hasPrevious = true;
continue;
}
if( !$_gotNext )
{
$_gotNext = true;
$_thisNotify = $v;
continue;
}
$_hasNext = true;
break;
}
if( count($_thisNotify) )
{
$_thisNotify['notify_date_formatted'] = $this->registry->class_localization->getDate( $_thisNotify['notify_sent'], 'short' );
$_thisNotify['has_more'] = $_hasNext;
$_thisNotify['has_previous'] = $_hasPrevious;
}
else
{
$_thisNotify['error'] = $this->lang->words['nomore_notifications_4u'];
}
if( !$_thisNotify['notify_url'] )
{
$_thisNotify['notify_url'] = $this->registry->output->buildSEOUrl( "app=core&module=usercp&area=viewNotification&do=view&view={$_thisNotify['notify_id']}", 'public' );
}
$this->returnJsonArray( $_thisNotify );
}
/**
* Retrieve user's last x notifications
*
* @access protected
* @return void [Outputs JSON to browser AJAX call]
*/
protected function getMyNotifications()
{
//-----------------------------------------
// We logged in?
//-----------------------------------------
if( !$this->memberData['member_id'] )
{
$this->returnJsonError( $this->lang->words['notifylogin_error'] );
}
//-----------------------------------------
// Retrieve notifications
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
$notifyLibrary = new $classToLoad( $this->registry );
$notifyLibrary->setMember( $this->memberData );
$_data = $notifyLibrary->fetchUnreadNotifications( 10, 'notify_sent', 'DESC', false );
//-----------------------------------------
// Now mark them all read
//-----------------------------------------
$this->DB->update( 'inline_notifications', array( 'notify_read' => 1 ), 'notify_to_id=' . $this->memberData['member_id'] );
$notifyLibrary->rebuildUnreadCount();
//-----------------------------------------
// Return results
//-----------------------------------------
$this->returnJsonArray( array( 'html' => $this->registry->output->getTemplate('global_other')->notificationsList( $_data ) ) );
}
}
@@ -1,183 +1,194 @@
<?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');
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Registration AJAX routines
* Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Who knows...
* @version $Revision: 6995 $
*/
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
*
* @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
*
* @return void [Outputs to screen]
*/
public function checkEmail()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$email = '';
$banfilters = array();
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...
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$han_login = new $classToLoad( $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
*
* @return void [Outputs to screen]
*/
public function checkDisplayName( $field='members_display_name' )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile( array( 'public_register' ) );
$name = '';
$member = array();
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'] ) );
}
/* Bug where Twitter sets a username but you can't use it when you try and sign up with a new account using username as display name */
if ( ! $this->memberData['member_id'] AND $this->request['mpid'] )
{
$reg = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'members_partial',
'where' => "partial_member_id=" . intval( $this->request['mpid'] ) ) );
if ( $reg['partial_member_id'] )
{
$member = IPSMember::load( $reg['partial_member_id'], 'all' );
}
}
/* Check the username */
$user_check = IPSMember::getFunction()->cleanAndCheckName( $name, $member, $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( ipsRegistry::getClass( 'class_localization' )->words[ $user_check['errors'][ $errorField ][0] ] ? ipsRegistry::getClass( 'class_localization' )->words[ $user_check['errors'][ $errorField ][0] ] : $user_check['errors'][ $errorField ][0] );
return;
}
else if( $user_check['errors'][ $errorField ] )
{
$this->returnString( ipsRegistry::getClass( 'class_localization' )->words[ $user_check['errors'][ $errorField ] ] ? ipsRegistry::getClass( 'class_localization' )->words[ $user_check['errors'][ $errorField ] ] : $user_check['errors'][ $errorField ] );
}
else
{
$this->returnString('notfound');
}
}
}
@@ -1,137 +1,135 @@
<?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' );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Reports AJAX options
* Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @version $Rev: 6995 $
*/
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
*
* @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' );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') .'/sources/classes/reportLibrary.php', 'reportLibrary' );
$this->registry->setClass( 'reportLibrary', new $classToLoad( $this->registry ) );
/* What to do */
switch( $this->request['do'] )
{
case 'change_status':
$this->output = $this->_changeStatus();
break;
}
}
/**
* Adds a rating to the index
*
* @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' );
}
}
}
@@ -1,82 +1,79 @@
<?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' );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Reputation
* Last Updated: $Date: 2010-10-14 17:24:55 -0400 (Thu, 14 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @version $Rev: 6982 $
*/
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
*
* @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;
}
exit();
}
/**
* Adds a rating to the index
*
* @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 */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php', 'classReputationCache' );
$repCache = new $classToLoad();
/* 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,231 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* AJAX Sharelinks
* Last Updated: $Date: 2010-10-19 11:56:25 -0400 (Tue, 19 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @version $Revision: 6997 $
*/
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_sharelinks extends ipsAjaxCommand
{
/**
* Class entry point
*
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* load language */
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_emails' ), 'core' );
/* Do it */
switch( $this->request['do'] )
{
case 'twitterForm':
return $this->_twitterForm();
break;
case 'twitterGo':
return $this->_twitterGo();
break;
case 'facebookForm':
return $this->_facebookForm();
break;
case 'facebookGo':
return $this->_facebookGo();
break;
}
}
/**
* Displays a form of facebook stuff. It's really that exciting.
*
* @return void [Outputs HTML to browser AJAX call]
*/
private function _facebookForm()
{
/* Ensure we have a twitter account and that */
if ( $this->memberData['member_id'] AND $this->memberData['fb_uid'] AND $this->memberData['fb_token'] )
{
/* Connect to the Facebook */
require_once( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php' );
$connect = new facebook_connect( $this->registry );
try
{
$userData = $connect->fetchUserData();
$this->returnHtml( $this->registry->output->getTemplate('global_other')->facebookPop( $userData ) );
}
catch( Exception $e )
{
$this->returnHtml( '.' );
}
}
else
{
/* Bog off @todo probably grab the URL and doc title and forward to normal twitter.com/submit link */
$this->returnHtml( 'x' );
}
}
/**
* Go go Facebook go
*
* @return void [Outputs HTML to browser AJAX call]
*/
private function _facebookGo()
{
/* INIT */
$comment = trim( urldecode( $_POST['comment'] ) );
$url = trim( urldecode( $_POST['url'] ) );
$title = trim( urldecode( $_POST['title'] ) );
/* Ensure title is correctly de-html-ized */
$title = IPSText::UNhtmlspecialchars( $title );
/* Ensure we have a twitter account and that */
if ( $this->memberData['member_id'] AND $this->memberData['fb_uid'] AND $this->memberData['fb_token'] )
{
/* Connect to the Facebook */
require_once( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php' );
$connect = new facebook_connect( $this->registry );
try
{
$userData = $connect->fetchUserData();
if ( $userData['first_name'] )
{
/* Log it */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/share/links.php', 'share_links' );
$share = new $classToLoad( $this->registry, 'facebook' );
$share->log( $url, $title );
$connect->postLinkToWall( $url, $comment );
$this->returnHtml( $this->registry->output->getTemplate('global_other')->facebookDone( $userData ) );
}
else
{
$this->returnHtml( 'finchersaysno' );
}
}
catch( Exception $e )
{
$this->returnHtml( 'finchersaysno' );
}
}
else
{
/* Bog off */
$this->returnString( 'finchersaysno' );
}
}
/**
* Go go twitter go
*
* @return void [Outputs HTML to browser AJAX call]
*/
private function _twitterGo()
{
/* INIT */
$tweet = trim( urldecode( $_POST['tweet'] ) );
$url = trim( urldecode( $_POST['url'] ) );
$title = trim( urldecode( $_POST['title'] ) );
/* Ensure title is correctly de-html-ized */
$title = IPSText::UNhtmlspecialchars( $title );
/* Ensure we have a twitter account and that */
if ( $this->memberData['member_id'] AND $this->memberData['twitter_id'] AND $this->memberData['twitter_token'] AND $this->memberData['twitter_secret'] )
{
/* Connect to the twitter */
require_once( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php' );
$connect = new twitter_connect( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] );
$user = $connect->fetchUserData();
if ( $user['id'] )
{
$sid = $connect->updateStatusWithUrl( $tweet, $url );
if ( $sid )
{
/* Log it */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/share/links.php', 'share_links' );
$share = new $classToLoad( $this->registry, 'twitter' );
$share->log( $url, $title );
$user['status']['id'] = $sid;
$this->returnHtml( $this->registry->output->getTemplate('global_other')->twitterDone( $user ) );
}
else
{
/* Bog off */
$this->returnString( 'failwhale' );
}
}
else
{
/* Bog off */
$this->returnString( 'failwhale' );
}
}
else
{
/* Bog off */
$this->returnString( 'failwhale' );
}
}
/**
* Displays a form of twitter stuff. It's really that exciting.
*
* @return void [Outputs HTML to browser AJAX call]
*/
private function _twitterForm()
{
/* Ensure we have a twitter account and that */
if ( $this->memberData['member_id'] AND $this->memberData['twitter_id'] AND $this->memberData['twitter_token'] AND $this->memberData['twitter_secret'] )
{
/* Connect to the twitter */
require_once( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php' );
$connect = new twitter_connect( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] );
$user = $connect->fetchUserData();
if ( $user['id'] )
{
$this->returnHtml( $this->registry->output->getTemplate('global_other')->twitterPop( $user ) );
}
else
{
/* Bog off @todo probably grab the URL and doc title and forward to normal twitter.com/submit link */
$this->returnHtml( '.' );
}
}
else
{
/* Bog off @todo probably grab the URL and doc title and forward to normal twitter.com/submit link */
$this->returnHtml( 'x' );
}
}
}
@@ -1,111 +1,113 @@
<?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' );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Login handler abstraction : AJAX UserCP functions
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 5713 $
*
*/
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,121 @@
<?php
/**
* Invision Power Services
* IP.Board v3.1.0
* Vkontakte auth : AJAX
*
* @author $Author: giv $
* @copyright (c) 2010 IBResource, LTD.
* @license http://www.ibresource.ru/products/ipboard/
* @package IP.Board
* @subpackage Core
* @since 1st June 2010
* @link http://www.ibresource.ru
* @version $Rev: 6242 $
*/
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_vkontakte 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 'getUserByVkId':
$return = $this->_getUserByVkId();
break;
}
/* Output */
$this->returnHtml( $return );
}
/**
* Main AJAX log in routine
*
* @access private
* @return void [Outputs JSON to browser AJAX call]
*/
private function _getUserByVkId()
{
require_once( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php' );
$vk = new Vkontakte_Request_Validator( $this->settings['vk_api_id'], $this->settings['vk_secret'] );
//-----------------------------------------
// INIT
//-----------------------------------------
$vkUid = is_numeric( $vk->mid ) ? $vk->mid : -1;
$member = array( 'member_id' => 0 );
if ( $vkUid )
{
$_mid = $this->DB->buildAndFetch( array( 'select' => 'member_id',
'from' => 'members',
'where' => 'vk_uid=' . $vkUid ) );
if ( $_mid['member_id'] )
{
$member = IPSMember::load( $_mid['member_id'], 'all' );
}
}
/* Create validating account for the member */
$key = md5( uniqid( microtime() ) );
$member['key'] = $key;
if ( $vkUid == $this->request['id'] )
{
$this->DB->delete( 'vkontakte_connect', 'v_id = ' . $vkUid );
$name = IPSMember::getFunction()->cleanAndCheckName( $this->request['name'], array(), 'name' );
$photo = '';
if ( IPSText::xssCheckUrl( $this->request['photo'] ) && preg_match('~^http://.+?\.vkontakte\.ru/u' . $vkUid. '~is', $this->request['photo']))
{
$photo = $this->request['photo'];
}
$this->DB->insert( 'vkontakte_connect', array( 'v_key' => $key,
'v_user' => $name['username'],
'v_data' => $photo,
'v_id' => $vkUid ) );
}
$this->returnJsonArray( $member );
}
}
@@ -1,353 +1,345 @@
<?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 ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Attachment Poster
* Last Updated: $Date: 2010-10-19 11:56:25 -0400 (Tue, 19 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @version $Rev: 6997 $
*/
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
*
* @var object class_attach
*/
public $class_attach;
/**
* AJAX Library
*
* @var object classAjax
*/
public $ajax;
/**
* Class entry point
*
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
/* AJAX Class */
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
$this->ajax = new $classToLoad();
/* Attachment Class */
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
$this->class_attach = new $classToLoad( $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
*
* @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
*
* @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
*
* @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
*
* @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
*
* @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
*
* @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 ) );
}
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Define the default attachments section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*
*/
@@ -1 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,93 +1,91 @@
<?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;
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Captcha
* Last Updated: $Date: 2010-10-19 11:56:25 -0400 (Tue, 19 Oct 2010) $
* </pre>
*
* @author $Author $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 6997 $
*/
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
*
* @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
*
* @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.
*
* @return void
*/
public function refreshImage()
{
/* INIT */
$captcha_unique_id = trim( $this->request['captcha_unique_id'] );
/* Throw away */
$blah = $this->class_captcha->getTemplate();
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
$ajax = new $classToLoad();
/* Show Image... */
$ajax->returnString( $this->class_captcha->captchaKey );
exit;
}
}
@@ -0,0 +1,322 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Image Ajax
* Last Updated: $LastChangedDate: 2010-08-18 16:55:30 +0100 (Wed, 18 Aug 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Gallery
* @link http://www.invisionpower.com
* @version $Rev: 6767 $
*
*/
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_comments extends ipsCommand
{
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* From App */
$fromApp = trim( $this->request['fromApp'] );
/* Init some data */
require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );
$this->_comments = classes_comments_bootstrap::controller( $fromApp );
/* What to do? */
switch( $this->request['do'] )
{
case 'add':
$this->_add();
break;
case 'delete':
$this->_delete();
break;
case 'showEdit':
$this->_showEdit();
break;
case 'saveEdit':
$this->_saveEdit();
break;
case 'fetchReply':
$this->_fetchReply();
break;
case 'moderate':
$this->_moderate();
break;
case 'findLastComment':
$this->_findLastComment();
break;
case 'findComment':
$this->_findComment();
break;
}
}
/**
* Find last page of comments
*
* @access protected
* @return void [Redirects]
*/
protected function _findLastComment()
{
/* Init */
$parentId = intval( $this->request['parentId'] );
$this->_comments->redirectToComment( 'last', $parentId );
}
/**
* Find last page of comments
*
* @access protected
* @return void [Redirects]
*/
protected function _findComment()
{
/* Init */
$parentId = intval( $this->request['parentId'] );
$comment_id = intval( $this->request['comment_id'] );
$this->_comments->redirectToComment( $comment_id, $parentId );
}
/**
* Moderate
*
* @access protected
* @return void
*/
protected function _moderate()
{
$parentId = intval( $this->request['parentId'] );
$commentIds = ( is_array( $_POST['commentIds'] ) ) ? IPSLib::cleanIntArray( $_POST['commentIds'] ) : array();
$modact = trim( $this->request['modact'] );
if ( count( $commentIds ) )
{
try
{
$this->_comments->moderate( $modact, $parentId, $commentIds, $this->memberData );
$this->returnJsonArray( array( 'msg' => 'ok' ) );
}
catch( Exception $error )
{
$this->returnJsonError( 'Error ' . $error->getMessage() . ' line: ' . $error->getFile() . '.' . $error->getLine() );
}
}
}
/**
* Reply
*
* @access public
* @return void
*/
protected function _fetchReply()
{
/* INIT */
$commentId = intval( $this->request['comment_id'] );
$parentId = intval( $this->request['parentId'] );
/* Quick error checko */
if ( ! $commentId OR ! $parentId )
{
$this->returnString( 'error' );
}
# Get Edit form
try
{
$html = $this->_comments->fetchReply( $parentId, $commentId, $this->memberData );
$this->returnString( $html );
}
catch ( Exception $error )
{
$this->returnString( 'Error ' . $error->getMessage() );
}
}
/**
* Deletes a comment
*
* @access public
* @return void
*/
protected function _delete()
{
/* INIT */
$commentId = intval( $this->request['comment_id'] );
$parentId = intval( $this->request['parentId'] );
/* Perm check (looks nice) */
if ( $this->request['auth_key'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_delete-0', null, null, 403 );
}
/* Quick error checko */
if ( ! $commentId OR ! $parentId )
{
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_delete-2', null, null, 403 );
}
try
{
$this->_comments->delete( $parentId, $commentId, $this->memberData );
/* Redirect to find latest */
$this->_comments->redirectToComment( 'last', $parentId );
}
catch ( Exception $error )
{
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_delete-2', null, null, 403 );
}
}
/**
* Shows the edit box
*
* @access public
* @return void
*/
protected function _showEdit()
{
/* INIT */
$commentId = intval( $this->request['comment_id'] );
$parentId = intval( $this->request['parentId'] );
/* Quick error checko */
if ( ! $commentId OR ! $parentId )
{
$this->returnString( 'error' );
}
array( 'parent_id' => 'id',
'parent_owner_id' => 'member_id',
'parent_parent_id' => 'img_album_id',
'parent_title' => 'caption',
'parent_seo_title' => 'caption_seo',
'parent_date' => 'idate' );
# Get Edit form
try
{
$html = $this->_comments->displayEditForm( $parentId, $commentId, $this->memberData );
/* Get nav */
$parent = $this->_comments->remapFromLocal( $this->_comments->fetchParent( $parentId ), 'parent' );
/* Output */
$this->registry->getClass('output')->setTitle( $this->title );
$this->registry->getClass('output')->addContent( $html );
$this->registry->getClass('output')->addNavigation( $this->lang->words['edit_comment'] . $parent['parent_title'], sprintf( $this->_comments->fetchSetting('urls-showParent'), $parentId ), $parent['parent_seo_title'] );
$this->registry->getClass('output')->sendOutput();
}
catch ( Exception $error )
{
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_showEdit-0', null, null, 403 );
}
}
/**
* Saves the post
*
* @access public
* @return void
*/
protected function _saveEdit()
{
/* INIT */
$commentId = intval( $this->request['comment_id'] );
$parentId = intval( $this->request['parentId'] );
$post = IPSText::parseCleanValue( $_POST['Post'] );
/* Perm check (looks nice) */
if ( $this->request['auth_key'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_saveEdit-0', null, null, 403 );
}
/* Quick error checko */
if ( ! $parentId OR ! $commentId )
{
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_saveEdit-1', null, null, 403 );
}
/* Edit */
try
{
$this->_comments->edit( $parentId, $commentId, $_POST['Post'], $this->memberData );
$this->_comments->redirectToComment( $commentId, $parentId );
}
catch ( Exception $error )
{
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_saveEdit-2', null, null, 403 );
}
}
/**
* Add a comment via the magic and mystery of NORMAL POSTING FOOL
*
* @access protected
* @return void
*/
protected function _add()
{
/* init */
$post = IPSText::parseCleanValue( $_POST['Post'] );
$parentId = intval( $this->request['parentId'] );
/* Perm check (looks nice) */
if ( $this->request['auth_key'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_add-0', null, null, 403 );
}
if ( $post AND $parentId )
{
try
{
$newCommentId = $this->_comments->add( $parentId, $_POST['Post'] );
/* Redirect to find latest */
$this->_comments->redirectToComment( 'last', $parentId );
}
catch( Exception $e )
{
$this->registry->output->showError( 'no_permission', '1-global-comments-_add-1', null, null, 403 );
}
}
else
{
$this->registry->output->showError( 'no_permission', '1-global-comments-_add-2', null, null, 403 );
}
}
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Define the default global section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*
*/
@@ -0,0 +1,322 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Image Ajax
* Last Updated: $LastChangedDate: 2010-08-18 16:55:30 +0100 (Wed, 18 Aug 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Gallery
* @link http://www.invisionpower.com
* @version $Rev: 6767 $
*
*/
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_comments extends ipsCommand
{
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* From App */
$fromApp = trim( $this->request['fromApp'] );
/* Init some data */
require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );
$this->_comments = classes_comments_bootstrap::controller( $fromApp );
/* What to do? */
switch( $this->request['do'] )
{
case 'add':
$this->_add();
break;
case 'delete':
$this->_delete();
break;
case 'showEdit':
$this->_showEdit();
break;
case 'saveEdit':
$this->_saveEdit();
break;
case 'fetchReply':
$this->_fetchReply();
break;
case 'moderate':
$this->_moderate();
break;
case 'findLastComment':
$this->_findLastComment();
break;
case 'findComment':
$this->_findComment();
break;
}
}
/**
* Find last page of comments
*
* @access protected
* @return void [Redirects]
*/
protected function _findLastComment()
{
/* Init */
$parentId = intval( $this->request['parentId'] );
$this->_comments->redirectToComment( 'last', $parentId );
}
/**
* Find last page of comments
*
* @access protected
* @return void [Redirects]
*/
protected function _findComment()
{
/* Init */
$parentId = intval( $this->request['parentId'] );
$comment_id = intval( $this->request['comment_id'] );
$this->_comments->redirectToComment( $comment_id, $parentId );
}
/**
* Moderate
*
* @access protected
* @return void
*/
protected function _moderate()
{
$parentId = intval( $this->request['parentId'] );
$commentIds = ( is_array( $_POST['commentIds'] ) ) ? IPSLib::cleanIntArray( $_POST['commentIds'] ) : array();
$modact = trim( $this->request['modact'] );
if ( count( $commentIds ) )
{
try
{
$this->_comments->moderate( $modact, $parentId, $commentIds, $this->memberData );
$this->returnJsonArray( array( 'msg' => 'ok' ) );
}
catch( Exception $error )
{
$this->returnJsonError( 'Error ' . $error->getMessage() . ' line: ' . $error->getFile() . '.' . $error->getLine() );
}
}
}
/**
* Reply
*
* @access public
* @return void
*/
protected function _fetchReply()
{
/* INIT */
$commentId = intval( $this->request['comment_id'] );
$parentId = intval( $this->request['parentId'] );
/* Quick error checko */
if ( ! $commentId OR ! $parentId )
{
$this->returnString( 'error' );
}
# Get Edit form
try
{
$html = $this->_comments->fetchReply( $parentId, $commentId, $this->memberData );
$this->returnString( $html );
}
catch ( Exception $error )
{
$this->returnString( 'Error ' . $error->getMessage() );
}
}
/**
* Deletes a comment
*
* @access public
* @return void
*/
protected function _delete()
{
/* INIT */
$commentId = intval( $this->request['comment_id'] );
$parentId = intval( $this->request['parentId'] );
/* Perm check (looks nice) */
if ( $this->request['auth_key'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_delete-0', null, null, 403 );
}
/* Quick error checko */
if ( ! $commentId OR ! $parentId )
{
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_delete-2', null, null, 403 );
}
try
{
$this->_comments->delete( $parentId, $commentId, $this->memberData );
/* Redirect to find latest */
$this->_comments->redirectToComment( 'last', $parentId );
}
catch ( Exception $error )
{
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_delete-2', null, null, 403 );
}
}
/**
* Shows the edit box
*
* @access public
* @return void
*/
protected function _showEdit()
{
/* INIT */
$commentId = intval( $this->request['comment_id'] );
$parentId = intval( $this->request['parentId'] );
/* Quick error checko */
if ( ! $commentId OR ! $parentId )
{
$this->returnString( 'error' );
}
array( 'parent_id' => 'id',
'parent_owner_id' => 'member_id',
'parent_parent_id' => 'img_album_id',
'parent_title' => 'caption',
'parent_seo_title' => 'caption_seo',
'parent_date' => 'idate' );
# Get Edit form
try
{
$html = $this->_comments->displayEditForm( $parentId, $commentId, $this->memberData );
/* Get nav */
$parent = $this->_comments->remapFromLocal( $this->_comments->fetchParent( $parentId ), 'parent' );
/* Output */
$this->registry->getClass('output')->setTitle( $this->title );
$this->registry->getClass('output')->addContent( $html );
$this->registry->getClass('output')->addNavigation( $this->lang->words['edit_comment'] . $parent['parent_title'], sprintf( $this->_comments->fetchSetting('urls-showParent'), $parentId ), $parent['parent_seo_title'] );
$this->registry->getClass('output')->sendOutput();
}
catch ( Exception $error )
{
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_showEdit-0', null, null, 403 );
}
}
/**
* Saves the post
*
* @access public
* @return void
*/
protected function _saveEdit()
{
/* INIT */
$commentId = intval( $this->request['comment_id'] );
$parentId = intval( $this->request['parentId'] );
$post = IPSText::parseCleanValue( $_POST['Post'] );
/* Perm check (looks nice) */
if ( $this->request['auth_key'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_saveEdit-0', null, null, 403 );
}
/* Quick error checko */
if ( ! $parentId OR ! $commentId )
{
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_saveEdit-1', null, null, 403 );
}
/* Edit */
try
{
$this->_comments->edit( $parentId, $commentId, $_POST['Post'], $this->memberData );
$this->_comments->redirectToComment( $commentId, $parentId );
}
catch ( Exception $error )
{
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_saveEdit-2', null, null, 403 );
}
}
/**
* Add a comment via the magic and mystery of NORMAL POSTING FOOL
*
* @access protected
* @return void
*/
protected function _add()
{
/* init */
$post = IPSText::parseCleanValue( $_POST['Post'] );
$parentId = intval( $this->request['parentId'] );
/* Perm check (looks nice) */
if ( $this->request['auth_key'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_add-0', null, null, 403 );
}
if ( $post AND $parentId )
{
try
{
$newCommentId = $this->_comments->add( $parentId, $_POST['Post'] );
/* Redirect to find latest */
$this->_comments->redirectToComment( 'last', $parentId );
}
catch( Exception $e )
{
$this->registry->output->showError( 'no_permission', '1-global-comments-_add-1', null, null, 403 );
}
}
else
{
$this->registry->output->showError( 'no_permission', '1-global-comments-_add-2', null, null, 403 );
}
}
}
@@ -1 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -1,490 +1,498 @@
<?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'], '' );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Recover Lost Password
* Last Updated: $Date: 2010-09-06 12:10:04 -0400 (Mon, 06 Sep 2010) $
* </pre>
*
* @author $Author $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 6832 $
*
*/
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' );
//-----------------------------------------
// Meta tags
//-----------------------------------------
$this->registry->output->addMetaTag( 'robots', 'noindex' );
/* 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_type'] != 'none' )
{
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...
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$this->han_login = new $classToLoad( $this->registry );
$this->han_login->init();
$this->han_login->changePass( $member['email'], md5( $new_pass ), $new_pass, $member );
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'] . ' - ' . ipsRegistry::$settings['board_name'] );
$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 */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$this->han_login = new $classToLoad( $this->registry );
$this->han_login->init();
$this->han_login->changePass( $member['email'], md5( $new_pass ), $new_pass, $member );
//-----------------------------------------
// 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_type'] != 'none' )
{
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'] . ' - ' . ipsRegistry::$settings['board_name'] );
}
/**
* Displays the lost password form
*
* @access public
* @param string $errors
* @return void
*/
public function lostPasswordForm( $errors="" )
{
//-----------------------------------------
// Do we have another URL for password resets?
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$han_login = new $classToLoad( $this->registry );
$han_login->init();
$han_login->checkMaintenanceRedirect();
/* CAPTCHA */
if( $this->settings['bot_antispam_type'] != 'none' )
{
$captchaHTML = $this->registry->getClass('class_captcha')->getTemplate();
}
$this->registry->output->setTitle( $this->lang->words['lost_pass_form'] . ' - ' . ipsRegistry::$settings['board_name'] );
$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_type'] != 'none' )
{
$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_type'] != 'none' )
{
$this->output = str_replace( "<!--{REG.ANTISPAM}-->", $this->registry->getClass('class_captcha')->getTemplate(), $this->output );
}
$this->registry->output->setTitle( $this->lang->words['activation_form'] . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->output->addNavigation( $this->lang->words['activation_form'], '' );
}
}
File diff suppressed because it is too large. Load diff
@@ -1,101 +1,103 @@
<?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 );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Reputation
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @version $Rev: 5713 $
*
*/
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 */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php', 'classReputationCache' );
$repCache = new $classToLoad();
/* 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 );
}
}
}
@@ -1,19 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* RSS output functionality
* Last Updated: $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since Friday 18th March 2005
* @version $Revision: 3887 $
* @version $Revision: 7003 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -27,7 +28,6 @@ class public_core_global_rss extends ipsCommand
/**
* XML document content
*
* @access private
* @var string XML document content
*/
private $to_print = '';
@@ -35,7 +35,6 @@ class public_core_global_rss extends ipsCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
@@ -56,7 +55,15 @@ class public_core_global_rss extends ipsCommand
if( $this->settings['board_offline'] )
{
header("HTTP/1.1 503 Service Temporarily Unavailable");
if ( isset( $_SERVER['SERVER_PROTOCOL'] ) AND strstr( $_SERVER['SERVER_PROTOCOL'], '/1.0' ) )
{
header("HTTP/1.0 503 Service Temporarily Unavailable");
}
else
{
header("HTTP/1.1 503 Service Temporarily Unavailable");
}
print $this->lang->words['rss_board_offline'];
exit();
}
@@ -69,22 +76,46 @@ class public_core_global_rss extends ipsCommand
if( $this->request['type'] )
{
if( file_exists( IPSLib::getAppDir( IPSText::alphanumericalClean( $this->request['type'] ) ) . '/extensions/rssOutput.php' ) )
if( IPSLib::appIsInstalled( IPSText::alphanumericalClean( $this->request['type'] ) ) )
{
$type = IPSText::alphanumericalClean( $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 );
if( IPSLib::appIsInstalled($type) )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $type ) . '/extensions/rssOutput.php', 'rss_output_'.$type, $type );
$rss_library = new $classToLoad( $this->registry );
$this->to_print = $rss_library->returnRSSDocument();
$expires = $rss_library->grabExpiryDate();
}
$this->to_print = $rss_library->returnRSSDocument();
$expires = $rss_library->grabExpiryDate();
//-----------------------------------------
// No output?
//-----------------------------------------
if( !$this->to_print )
{
if ( isset( $_SERVER['SERVER_PROTOCOL'] ) AND strstr( $_SERVER['SERVER_PROTOCOL'], '/1.0' ) )
{
header("HTTP/1.0 503 Service Temporarily Unavailable");
}
else
{
header("HTTP/1.1 503 Service Temporarily Unavailable");
}
print $this->lang->words['rssappoffline'];
exit();
}
//-----------------------------------------
// Then output
@@ -0,0 +1,47 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Captcha
* Last Updated: $Date: 2010-01-15 15:18:44 +0000 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 5713 $
*/
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_share extends ipsCommand
{
/**
* Class entry point
*
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
$url = IPSText::base64_decode_urlSafe( $this->request['url'] );
$title = IPSText::base64_decode_urlSafe( $this->request['title'] );
$key = trim( $this->request['key'] );
/* Get the lib */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/share/links.php', 'share_links' );
$share = new $classToLoad( $registry, $key );
/* Share! */
$share->share( $title, $url );
}
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Define the default help section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*
*/
@@ -1,18 +1,19 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Help File System
* Last Updated: $Date: 2009-04-24 08:15:53 -0400 (Fri, 24 Apr 2009) $
* Last Updated: $Date: 2010-10-19 11:56:25 -0400 (Tue, 19 Oct 2010) $
* </pre>
*
* @author $Author: matt $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @version $Rev: 4544 $
*
* @link http://www.invisionpower.com
* @version $Rev: 6997 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -26,7 +27,6 @@ class public_core_help_help extends ipsCommand
/**
* HTML to output
*
* @access private
* @var string HTML
*/
public $output = "";
@@ -34,7 +34,6 @@ class public_core_help_help extends ipsCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
@@ -63,7 +62,6 @@ class public_core_help_help extends ipsCommand
/**
* Show help topics
*
* @access public
* @return void
*/
public function helpShowTitles()
@@ -103,14 +101,13 @@ class public_core_help_help extends ipsCommand
);
/* Navigation */
$this->registry->output->setTitle( $this->lang->words['page_title'] );
$this->registry->output->setTitle( $this->lang->words['page_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->output->addNavigation( $this->lang->words['page_title'], '' );
}
/**
* Displays a help file
*
* @access public
* @return void
*/
public function helpShowSection()
@@ -159,14 +156,14 @@ class public_core_help_help extends ipsCommand
);
/* Navigation */
$this->registry->output->setTitle( $this->lang->words['help_topic'] );
$this->registry->output->setTitle( $this->lang->words['help_topic'] . ' - ' . ipsRegistry::$settings['board_name'] );
$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();
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
$classAjax = new $classToLoad();
$classAjax->returnHtml( $this->output );
}
}
@@ -1 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Define the default reports section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*
*/
@@ -1 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Define the default section section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*
*/
@@ -1 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -1 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,17 +1,19 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Task Manager
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-07-12 18:26:09 -0400 (Mon, 12 Jul 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.iinvisionpower.com
* @version $Rev: 4948 $
* @link http://www.invisionpower.com
* @version $Rev: 6635 $
*
*/
@@ -32,14 +34,12 @@ class public_core_task_manualResolver extends ipsCommand
*/
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 );
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_taskmanager.php', 'class_taskmanager' );
$functions = new $classToLoad( $registry );
//-----------------------------------------
// Check shutdown functions
@@ -1 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,367 +1,300 @@
<?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();
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* User control panel resolver
* Last Updated: $Date: 2010-10-21 14:02:34 -0400 (Thu, 21 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 1st march 2002
* @version $Revision: 7011 $
*/
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?
//-----------------------------------------
IPSLib::loadInterface( 'interface_usercp.php' );
$EXT_DIR = IPSLib::getAppDir( $_TAB ) . '/extensions';
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;
}
$__class = IPSLib::loadLibrary( $ext_dir . '/usercpForms.php', 'usercpForms_' . $app_dir, $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
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( $EXT_DIR . '/usercpForms.php', 'usercpForms_' . $_TAB, $_TAB );
$usercp_module = new $classToLoad();
$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
//-----------------------------------------
$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();
}
}