Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
@@ -3,11 +3,11 @@
|
||||
* @file attach.php Provides ajax methods to switch uploader type
|
||||
*
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-05-25 10:30:28 -0400 (Wed, 25 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8887 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,62 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Update captcha image
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since 2.3
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_captcha extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( ipsRegistry::$request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'refresh':
|
||||
$this->refresh();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the captcha image
|
||||
*
|
||||
* @return @e 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.3.4
|
||||
* Update captcha image
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 2.3
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_captcha extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( ipsRegistry::$request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'refresh':
|
||||
$this->refresh();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the captcha image
|
||||
*
|
||||
* @return @e 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 );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,256 +1,254 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Image Ajax
|
||||
* Last Updated: $LastChangedDate: 2011-09-21 05:45:37 -0400 (Wed, 21 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Gallery
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9521 $
|
||||
*/
|
||||
|
||||
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 @e 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' );/*noLibHook*/
|
||||
$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 @e 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 @e 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' );
|
||||
}
|
||||
|
||||
/* Load editor stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$this->editor = new $classToLoad();
|
||||
|
||||
# Get Edit form
|
||||
try
|
||||
{
|
||||
$html = $this->_comments->fetchReply( $parentId, $commentId, $this->memberData );
|
||||
|
||||
$this->editor->setContent( $html, 'topics', true );
|
||||
|
||||
$this->returnHtml( $this->editor->getContent() );
|
||||
}
|
||||
catch ( Exception $error )
|
||||
{
|
||||
$this->returnString( 'Error ' . $error->getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a comment
|
||||
*
|
||||
* @return @e 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 @e 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 @e 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 @e void
|
||||
*/
|
||||
protected function _add()
|
||||
{
|
||||
/* init */
|
||||
$post = IPSText::parseCleanValue( $_POST['Post'] );
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
|
||||
if ( $post AND $parentId )
|
||||
{
|
||||
try
|
||||
{
|
||||
$newComment = $this->_comments->add( $parentId, $_POST['Post'] );
|
||||
|
||||
if( $newComment['comment_approved'] )
|
||||
{
|
||||
return $this->returnHtml( $this->_comments->fetchFormattedSingle( $parentId, $newComment['comment_id'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError( 'comment_requires_approval' );
|
||||
}
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
$this->returnJsonError( 'no_permission: ' . $e->getMessage() . var_export( $e, true ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError( 'no_permission' );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Image Ajax
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_comments extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e 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' );/*noLibHook*/
|
||||
$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 @e 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 @e 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' );
|
||||
}
|
||||
|
||||
/* Load editor stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$this->editor = new $classToLoad();
|
||||
|
||||
# Get Edit form
|
||||
try
|
||||
{
|
||||
$html = $this->_comments->fetchReply( $parentId, $commentId, $this->memberData );
|
||||
|
||||
$this->editor->setContent( $html, 'topics' );
|
||||
|
||||
$this->returnHtml( $this->editor->getContent() );
|
||||
}
|
||||
catch ( Exception $error )
|
||||
{
|
||||
$this->returnString( 'Error ' . $error->getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a comment
|
||||
*
|
||||
* @return @e 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 @e 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 @e void
|
||||
*/
|
||||
protected function _saveEdit()
|
||||
{
|
||||
/* INIT */
|
||||
$commentId = intval( $this->request['comment_id'] );
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
|
||||
/* 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 @e void
|
||||
*/
|
||||
protected function _add()
|
||||
{
|
||||
/* init */
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
|
||||
if ( $_POST['Post'] AND $parentId )
|
||||
{
|
||||
try
|
||||
{
|
||||
$newComment = $this->_comments->add( $parentId, $_POST['Post'] );
|
||||
|
||||
if( $newComment['comment_approved'] )
|
||||
{
|
||||
return $this->returnHtml( $this->_comments->fetchFormattedSingle( $parentId, $newComment['comment_id'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError( 'comment_requires_approval' );
|
||||
}
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
$this->returnJsonError( $e->getMessage() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError( 'no_permission' );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'ajax' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,159 +1,171 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Handles ajax functions for IP.Board Text Editor
|
||||
* Author: Matt "Matt Mecham" Mecham
|
||||
* Last Updated: $LastChangedDate: 2011-09-26 10:20:55 -0400 (Mon, 26 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Gallery
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9547 $
|
||||
*
|
||||
*/
|
||||
|
||||
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
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* From App */
|
||||
$autoSaveKey = trim( $this->request['autoSaveKey'] );
|
||||
|
||||
if ( ! $autoSaveKey )
|
||||
{
|
||||
trigger_error( "Missing data in " . __FILE__ . ' ' . __LINE__ );
|
||||
}
|
||||
|
||||
/* Load editor stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$this->editor = new $classToLoad();
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'autoSave':
|
||||
$this->_autoSave( $autoSaveKey );
|
||||
break;
|
||||
case 'switch':
|
||||
$this->_switch();
|
||||
break;
|
||||
case 'showSettings':
|
||||
$this->_showSettings();
|
||||
break;
|
||||
case 'getEmoticons':
|
||||
$this->_getEmoticons();
|
||||
break;
|
||||
case 'saveSettings':
|
||||
$this->_saveSettings();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show settings box
|
||||
*
|
||||
* @return json
|
||||
*/
|
||||
protected function _getEmoticons()
|
||||
{
|
||||
return $this->returnJsonArray( $this->editor->fetchEmoticons( 250 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show settings box
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showSettings()
|
||||
{
|
||||
$this->returnHtml( $this->registry->getClass('output')->getTemplate('editors')->editorSettings() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _saveSettings()
|
||||
{
|
||||
if( !$this->memberData['member_id'] )
|
||||
{
|
||||
$this->returnJsonError( 'nopermission' );
|
||||
}
|
||||
|
||||
$clearSavedContent = intval( $this->request['clearSavedContent'] );
|
||||
$bw_cke_contextmenu = intval( $this->request['bw_cke_contextmenu'] );
|
||||
|
||||
if ( $clearSavedContent )
|
||||
{
|
||||
$this->DB->delete( 'core_editor_autosave', 'eas_member_id=' . $this->memberData['member_id'] );
|
||||
}
|
||||
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'bw_cke_contextmenu' => $bw_cke_contextmenu ) ) );
|
||||
$member = IPSMember::load( $this->memberData['member_id'] );
|
||||
|
||||
|
||||
/* return if no errors occurred */
|
||||
return $this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch between bbcode and rte on the fly, man
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _switch()
|
||||
{
|
||||
$content = $_POST['content'];
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Content received: ' . $content ) );
|
||||
|
||||
if ( $content )
|
||||
{
|
||||
$content = $this->editor->switchContent( $content, intval( $_POST['isRte'] ) );
|
||||
}
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Content after conversion: ' . $content ) );
|
||||
|
||||
/* return if no errors occurred */
|
||||
return $this->returnString( $content );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show more dialogue
|
||||
*
|
||||
* @param string App
|
||||
* @param string Area
|
||||
* @param int Relationship ID
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _autoSave( $autoSaveKey )
|
||||
{
|
||||
if ( $_POST['content'] && $autoSaveKey )
|
||||
{
|
||||
$this->editor->autoSave( $_POST['content'], $autoSaveKey );
|
||||
}
|
||||
|
||||
/* return if no errors occurred */
|
||||
return $this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Handles ajax functions for IP.Board Text Editor
|
||||
* Author: Matt "Matt Mecham" Mecham
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_editor extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
|
||||
/* Load editor stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$this->editor = new $classToLoad();
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'autoSave':
|
||||
$this->_autoSave();
|
||||
break;
|
||||
case 'switch':
|
||||
$this->_switch();
|
||||
break;
|
||||
case 'showSettings':
|
||||
$this->_showSettings();
|
||||
break;
|
||||
case 'getEmoticons':
|
||||
$this->_getEmoticons();
|
||||
break;
|
||||
case 'saveSettings':
|
||||
$this->_saveSettings();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show settings box
|
||||
*
|
||||
* @return json
|
||||
*/
|
||||
protected function _getEmoticons()
|
||||
{
|
||||
return $this->returnJsonArray( $this->editor->fetchEmoticons( 250 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show settings box
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showSettings()
|
||||
{
|
||||
$this->returnHtml( $this->registry->getClass('output')->getTemplate('editors')->editorSettings() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _saveSettings()
|
||||
{
|
||||
if( !$this->memberData['member_id'] )
|
||||
{
|
||||
$this->returnJsonError( 'nopermission' );
|
||||
}
|
||||
|
||||
$clearSavedContent = intval( $this->request['clearSavedContent'] );
|
||||
$bw_cke_contextmenu = intval( $this->request['bw_cke_contextmenu'] );
|
||||
|
||||
if ( $clearSavedContent )
|
||||
{
|
||||
$this->DB->delete( 'core_editor_autosave', 'eas_member_id=' . $this->memberData['member_id'] );
|
||||
}
|
||||
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'bw_cke_contextmenu' => $bw_cke_contextmenu ) ) );
|
||||
$member = IPSMember::load( $this->memberData['member_id'] );
|
||||
|
||||
|
||||
/* return if no errors occurred */
|
||||
return $this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch between bbcode and rte on the fly, man
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _switch()
|
||||
{
|
||||
$content = $_POST['content'];
|
||||
$htmlStatus = intval( $_REQUEST['htmlStatus'] );
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Content received: ' . $content ) );
|
||||
|
||||
if ( $content )
|
||||
{
|
||||
if ( $htmlStatus )
|
||||
{
|
||||
$this->editor->setAllowHtml( $htmlStatus );
|
||||
}
|
||||
|
||||
$content = $this->editor->switchContent( $content, intval( $_POST['isRte'] ) );
|
||||
}
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Content after conversion: ' . $content ) );
|
||||
|
||||
/* return if no errors occurred */
|
||||
return $this->returnString( $content );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show more dialogue
|
||||
*
|
||||
* @param string App
|
||||
* @param string Area
|
||||
* @param int Relationship ID
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _autoSave()
|
||||
{
|
||||
/* From App */
|
||||
$autoSaveKey = trim( $this->request['autoSaveKey'] );
|
||||
|
||||
if ( ! $autoSaveKey )
|
||||
{
|
||||
trigger_error( "Missing data in " . __FILE__ . ' ' . __LINE__ );
|
||||
}
|
||||
|
||||
if ( ! trim( $_POST['content'] ) )
|
||||
{
|
||||
return $this->returnJsonArray( array( 'status' => 'nothingToSave' ) );
|
||||
}
|
||||
|
||||
if ( $_POST['content'] && $autoSaveKey )
|
||||
{
|
||||
$this->editor->autoSave( $_POST['content'], $autoSaveKey );
|
||||
}
|
||||
|
||||
/* return if no errors occurred */
|
||||
return $this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,93 +1,112 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Login handler abstraction : AJAX login
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $han_login;
|
||||
|
||||
/**
|
||||
* Flag : Logged in
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $logged_in = false;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e 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
|
||||
*
|
||||
* @return @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
protected 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.3.4
|
||||
* Login handler abstraction : AJAX login
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $han_login;
|
||||
|
||||
/**
|
||||
* Flag : Logged in
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $logged_in = false;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* What to do */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'getUserByFbId':
|
||||
$return = $this->_getUserByFbId();
|
||||
break;
|
||||
case 'storeFacebookAuthDetails':
|
||||
$this->_storeFacebookAuthDetails();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->returnHtml( $return );
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores main facebook data
|
||||
*
|
||||
* @return @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
protected function _storeFacebookAuthDetails()
|
||||
{
|
||||
$rToken = trim( $this->request['accessToken'] );
|
||||
$rUserId = trim( $this->request['userId'] ); # Do not INTVAL as Facebook UID > Intval() max
|
||||
|
||||
/* Store it */
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'fb_uid' => $rUserId,
|
||||
'fb_token' => $rToken ) ) );
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Main AJAX log in routine
|
||||
*
|
||||
* @return @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
protected 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,109 +1,110 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Login handler abstraction : AJAX Find Names functions
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 8644 $
|
||||
* @see 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
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'get-member-names':
|
||||
$this->_getMemberNames();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns possible matches for the string input
|
||||
*
|
||||
* @return @e void Outputs to screen
|
||||
*/
|
||||
protected function _getMemberNames()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$name = IPSText::convertUnicode( $this->convertAndMakeSafe( ipsRegistry::$request['name'], 0 ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check length
|
||||
//-----------------------------------------
|
||||
|
||||
if ( IPSText::mbstrlen( $name ) < 3 )
|
||||
{
|
||||
$this->returnJsonError( 'requestTooShort' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Try query...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( mb_strtolower( $name ) ) . "%'",
|
||||
'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC',
|
||||
'limit' => array( 0, 15 ),
|
||||
'add_join' => array( array( 'select' => 'p.*',
|
||||
'from' => array( 'profile_portal' => 'p' ),
|
||||
'where' => 'p.pp_member_id=m.member_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
//-----------------------------------------
|
||||
// Got any results?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->DB->getTotalRows() )
|
||||
{
|
||||
$this->returnJsonArray( array( ) );
|
||||
}
|
||||
|
||||
$return = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$photo = IPSMember::buildProfilePhoto( $r );
|
||||
$group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] );
|
||||
$return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'],
|
||||
'showas'=> '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')',
|
||||
'img' => $photo['pp_mini_photo'],
|
||||
'img_w' => $photo['pp_mini_width'],
|
||||
'img_h' => $photo['pp_mini_height']
|
||||
);
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Login handler abstraction : AJAX Find Names functions
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
* @see 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
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'get-member-names':
|
||||
$this->_getMemberNames();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns possible matches for the string input
|
||||
*
|
||||
* @return @e void Outputs to screen
|
||||
*/
|
||||
protected function _getMemberNames()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$name = IPSText::convertUnicode( $this->convertAndMakeSafe( $this->request['name'], 0 ), true );
|
||||
$name = IPSText::convertCharsets( $name, 'utf-8', IPS_DOC_CHAR_SET );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check length
|
||||
//-----------------------------------------
|
||||
|
||||
if ( IPSText::mbstrlen( $name ) < 3 )
|
||||
{
|
||||
$this->returnJsonError( 'requestTooShort' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Try query...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( strtolower( $name ) ) . "%'",
|
||||
'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC',
|
||||
'limit' => array( 0, 15 ),
|
||||
'add_join' => array( array( 'select' => 'p.*',
|
||||
'from' => array( 'profile_portal' => 'p' ),
|
||||
'where' => 'p.pp_member_id=m.member_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
//-----------------------------------------
|
||||
// Got any results?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->DB->getTotalRows() )
|
||||
{
|
||||
$this->returnJsonArray( array( ) );
|
||||
}
|
||||
|
||||
$return = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$photo = IPSMember::buildProfilePhoto( $r );
|
||||
$group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] );
|
||||
$return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'],
|
||||
'showas'=> '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')',
|
||||
'img' => $photo['pp_mini_photo'],
|
||||
'img_w' => $photo['pp_mini_width'],
|
||||
'img_h' => $photo['pp_mini_height']
|
||||
);
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file like.php Provides ajax methods for the central like/follow class
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-08-05 20:51:01 -0400 (Fri, 05 Aug 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 9373 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,139 +1,139 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Login handler abstraction : AJAX login
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
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 @e 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 @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
protected 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 @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
protected 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.3.4
|
||||
* Login handler abstraction : AJAX login
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
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 @e 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 @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
protected 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 @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
protected 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] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,128 +1,128 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Handles ajax functions for IP.Board Text Editor
|
||||
* Author: Matt "Matt Mecham" Mecham
|
||||
* Last Updated: $LastChangedDate: 2011-08-18 17:50:15 -0400 (Thu, 18 Aug 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Gallery
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9399 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_media extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_editors' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Route action
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'loadtab':
|
||||
$this->_showTab();
|
||||
break;
|
||||
|
||||
case 'show':
|
||||
default:
|
||||
$this->_showPane();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a tab
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showTab()
|
||||
{
|
||||
$app = trim($this->request['tabapp']);
|
||||
$plugin = trim($this->request['tabplugin']);
|
||||
$output = '';
|
||||
$string = $this->convertAndMakeSafe( $this->request['search'], TRUE );
|
||||
|
||||
if( $app AND is_file( IPSLib::getAppDir( $app ) . '/extensions/sharedmedia/plugin_' . $plugin . '.php' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/sharedmedia/plugin_' . $plugin . '.php', 'plugin_' . $app . '_' . $plugin, $app );
|
||||
$_plugin = new $classToLoad( $this->registry );
|
||||
$output = $_plugin->showTab( $string );
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = $this->registry->output->getTemplate('editors')->sharedMediaDefault();
|
||||
}
|
||||
|
||||
return $this->returnHtml( $output );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the panel to select your media
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showPane()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Loop through apps and collect tabs
|
||||
//-----------------------------------------
|
||||
|
||||
$_plugins = array();
|
||||
$_tabs = array();
|
||||
|
||||
foreach( ipsRegistry::$applications as $application )
|
||||
{
|
||||
if( is_dir( IPSLib::getAppDir( $application['app_directory'] ) . '/extensions/sharedmedia' ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach( new DirectoryIterator( IPSLib::getAppDir( $application['app_directory'] ) . '/extensions/sharedmedia' ) as $file )
|
||||
{
|
||||
if( ! $file->isDot() && $file->isFile() )
|
||||
{
|
||||
if( preg_match( '/^plugin_(.+?)\.php$/', $file->getFileName(), $matches ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( $file->getPathName(), 'plugin_' . $application['app_directory'] . '_' . $matches[1], $application['app_directory'] );
|
||||
$_plugins[ $application['app_directory'] ][ $matches[1] ] = new $classToLoad( $this->registry );
|
||||
|
||||
if( $_plugins[ $application['app_directory'] ][ $matches[1] ]->getTab() )
|
||||
{
|
||||
$_tabs[] = array( 'app' => $application['app_directory'], 'plugin' => $matches[1], 'title' => $_plugins[ $application['app_directory'] ][ $matches[1] ]->getTab() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->returnJsonArray( array( 'html' => $this->registry->output->getTemplate('editors')->sharedMedia( $_tabs ) ) );
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Handles ajax functions for IP.Board Text Editor
|
||||
* Author: Matt "Matt Mecham" Mecham
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_media extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_editors' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Route action
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'loadtab':
|
||||
$this->_showTab();
|
||||
break;
|
||||
|
||||
case 'show':
|
||||
default:
|
||||
$this->_showPane();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a tab
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showTab()
|
||||
{
|
||||
$app = trim($this->request['tabapp']);
|
||||
$plugin = trim($this->request['tabplugin']);
|
||||
$output = '';
|
||||
$string = $this->convertAndMakeSafe( $this->request['search'], TRUE );
|
||||
|
||||
if( $app AND is_file( IPSLib::getAppDir( $app ) . '/extensions/sharedmedia/plugin_' . $plugin . '.php' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/sharedmedia/plugin_' . $plugin . '.php', 'plugin_' . $app . '_' . $plugin, $app );
|
||||
$_plugin = new $classToLoad( $this->registry );
|
||||
$output = $_plugin->showTab( $string );
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = $this->registry->output->getTemplate('editors')->sharedMediaDefault();
|
||||
}
|
||||
|
||||
return $this->returnHtml( $output );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the panel to select your media
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showPane()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Loop through apps and collect tabs
|
||||
//-----------------------------------------
|
||||
|
||||
$_plugins = array();
|
||||
$_tabs = array();
|
||||
|
||||
foreach( IPSLib::getEnabledApplications() as $application )
|
||||
{
|
||||
if( is_dir( IPSLib::getAppDir( $application['app_directory'] ) . '/extensions/sharedmedia' ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach( new DirectoryIterator( IPSLib::getAppDir( $application['app_directory'] ) . '/extensions/sharedmedia' ) as $file )
|
||||
{
|
||||
if( ! $file->isDot() && $file->isFile() )
|
||||
{
|
||||
if( preg_match( '/^plugin_(.+?)\.php$/', $file->getFileName(), $matches ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( $file->getPathName(), 'plugin_' . $application['app_directory'] . '_' . $matches[1], $application['app_directory'] );
|
||||
$_plugins[ $application['app_directory'] ][ $matches[1] ] = new $classToLoad( $this->registry );
|
||||
|
||||
if( $_plugins[ $application['app_directory'] ][ $matches[1] ]->getTab() )
|
||||
{
|
||||
$_tabs[] = array( 'app' => $application['app_directory'], 'plugin' => $matches[1], 'title' => $_plugins[ $application['app_directory'] ][ $matches[1] ]->getTab() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->returnJsonArray( array( 'html' => $this->registry->output->getTemplate('editors')->sharedMedia( $_tabs ) ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,174 +1,175 @@
|
||||
<?php
|
||||
/**
|
||||
* @file modcp.php Moderator control panel AJAX retrieve tab
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 2/14/2011
|
||||
* $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class public_core_ajax_modcp
|
||||
* @brief Moderator control panel
|
||||
*
|
||||
*/
|
||||
class public_core_ajax_modcp extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load basic things
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_modcp' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Which road are we going to take?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'index':
|
||||
$this->_getTab();
|
||||
break;
|
||||
|
||||
case 'getmembers':
|
||||
$this->_getMembers();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('output')->addContent( $this->output );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns possible matches for the string input
|
||||
*
|
||||
* @return @e void Outputs to screen
|
||||
*/
|
||||
protected function _getMembers()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// 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.member_id, m.members_seo_name',
|
||||
'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() )
|
||||
{
|
||||
$url = $this->registry->output->buildSEOUrl( "app=core&module=modcp&section=editmember&mid={$r['member_id']}", 'public' );
|
||||
$photo = IPSMember::buildProfilePhoto( $r );
|
||||
$group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] );
|
||||
|
||||
$return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'],
|
||||
'showas'=> $r['members_display_name'],
|
||||
'img' => $photo['pp_thumb_photo'],
|
||||
'img_w' => $photo['pp_mini_width'],
|
||||
'img_h' => $photo['pp_mini_height'],
|
||||
'url' => $url,
|
||||
);
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve modcp tab based
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _getTab()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
$app = trim($this->request['fromapp']);
|
||||
$plugin = trim($this->request['tab']);
|
||||
$moderator = $this->registry->class_forums->getModerator();
|
||||
$_output = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Get plugin output
|
||||
//-----------------------------------------
|
||||
|
||||
if( is_file( IPSLib::getAppDir( $app ) . '/extensions/modcp/plugin_' . $app . '_' . $plugin . '.php' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/modcp/plugin_' . $app . '_' . $plugin . '.php', 'plugin_' . $app . '_' . $plugin, $app );
|
||||
$_thisPlugin = new $classToLoad( $this->registry );
|
||||
|
||||
$_output = $_thisPlugin->executePlugin( $moderator );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
if( $_output )
|
||||
{
|
||||
$this->returnJsonArray( array( 'html' => $_output ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['plugin_not_found'] );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file modcp.php Moderator control panel AJAX retrieve tab
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: mark $
|
||||
* @since 2/14/2011
|
||||
* $LastChangedDate: 2011-11-16 11:36:38 -0500 (Wed, 16 Nov 2011) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 9829 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class public_core_ajax_modcp
|
||||
* @brief Moderator control panel
|
||||
*
|
||||
*/
|
||||
class public_core_ajax_modcp extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load basic things
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_modcp' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Which road are we going to take?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'index':
|
||||
$this->_getTab();
|
||||
break;
|
||||
|
||||
case 'getmembers':
|
||||
$this->_getMembers();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('output')->addContent( $this->output );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns possible matches for the string input
|
||||
*
|
||||
* @return @e void Outputs to screen
|
||||
*/
|
||||
protected function _getMembers()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$name = IPSText::convertUnicode( $this->convertAndMakeSafe( $this->request['name'], 0 ), true );
|
||||
$name = IPSText::convertCharsets( $name, 'utf-8', IPS_DOC_CHAR_SET );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check length
|
||||
//-----------------------------------------
|
||||
|
||||
if ( IPSText::mbstrlen( $name ) < 3 )
|
||||
{
|
||||
$this->returnJsonError( 'requestTooShort' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Try query...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.members_display_name, m.member_id, m.members_seo_name, 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() )
|
||||
{
|
||||
$url = $this->registry->output->buildSEOUrl( "app=core&module=modcp&do=editmember&mid={$r['member_id']}", 'public' );
|
||||
$photo = IPSMember::buildProfilePhoto( $r );
|
||||
$group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] );
|
||||
|
||||
$return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'],
|
||||
'showas'=> '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')',
|
||||
'img' => $photo['pp_thumb_photo'],
|
||||
'img_w' => $photo['pp_mini_width'],
|
||||
'img_h' => $photo['pp_mini_height'],
|
||||
'url' => $url,
|
||||
);
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve modcp tab based
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _getTab()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
$app = trim($this->request['fromapp']);
|
||||
$plugin = trim($this->request['tab']);
|
||||
$moderator = $this->registry->class_forums->getModerator();
|
||||
$_output = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Get plugin output
|
||||
//-----------------------------------------
|
||||
|
||||
if( is_file( IPSLib::getAppDir( $app ) . '/extensions/modcp/plugin_' . $app . '_' . $plugin . '.php' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/modcp/plugin_' . $app . '_' . $plugin . '.php', 'plugin_' . $app . '_' . $plugin, $app );
|
||||
$_thisPlugin = new $classToLoad( $this->registry );
|
||||
|
||||
$_output = $_thisPlugin->executePlugin( $moderator );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
if( $_output )
|
||||
{
|
||||
$this->returnJsonArray( array( 'html' => $_output ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['plugin_not_found'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
/**
|
||||
* @file navigation.php navigation AJAX retrieve (Matt Mecham)
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 2/14/2011
|
||||
* $LastChangedDate: 2011-04-27 19:56:50 -0400 (Wed, 27 Apr 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8514 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,175 +1,175 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Notification AJAX methods
|
||||
* Last Updated: $Date: 2011-09-21 09:23:48 -0400 (Wed, 21 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 9524 $
|
||||
*
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e 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
|
||||
*
|
||||
* @param string Database order (asc/desc)
|
||||
* @return @e 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
|
||||
*
|
||||
* @return @e 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->fetchLatestNotifications( 10 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Now mark them all read
|
||||
//-----------------------------------------
|
||||
|
||||
$notifyLibrary->markNotificationsAsReadByMemberId( $this->memberData['member_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return results
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnJsonArray( array( 'html' => $this->cleanOutput( $this->registry->output->getTemplate('global_other')->notificationsList( $_data ) ) ) );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Notification AJAX methods
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e 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
|
||||
*
|
||||
* @param string Database order (asc/desc)
|
||||
* @return @e 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
|
||||
*
|
||||
* @return @e 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->fetchLatestNotifications( 10 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Now mark them all read
|
||||
//-----------------------------------------
|
||||
|
||||
$notifyLibrary->markNotificationsAsReadByMemberId( $this->memberData['member_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return results
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnJsonArray( array( 'html' => $this->cleanOutput( $this->registry->output->getTemplate('global_other')->notificationsList( $_data ) ) ) );
|
||||
}
|
||||
}
|
||||
@@ -1,194 +1,195 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Registration AJAX routines
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since Who knows...
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_register extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e 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 @e 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 @e 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');
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Registration AJAX routines
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Who knows...
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_register extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e 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 @e void [Outputs to screen]
|
||||
*/
|
||||
public function checkEmail()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$email = '';
|
||||
$banfilters = array();
|
||||
|
||||
if( is_string($_REQUEST['email']) )
|
||||
{
|
||||
$email = 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 @e 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 = trim( rawurldecode( $_POST['name'] ) );
|
||||
$name = IPSText::mbstrtolower( $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,135 +1,135 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Reports AJAX options
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_reports extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e 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 @e void
|
||||
*/
|
||||
protected 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( ' ' );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Reports AJAX options
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_reports extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e 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 @e void
|
||||
*/
|
||||
protected 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( ' ' );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,166 +1,166 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Reputation
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_reputation extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* What to do */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'add_rating':
|
||||
$this->_doRating();
|
||||
break;
|
||||
|
||||
case 'more':
|
||||
$this->_more();
|
||||
break;
|
||||
|
||||
case 'view':
|
||||
$this->_viewRep();
|
||||
break;
|
||||
}
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays reputation popup
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _viewRep()
|
||||
{
|
||||
$this->lang->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
|
||||
if ( !$this->memberData['gbw_view_reps'] )
|
||||
{
|
||||
$this->returnJsonError('no_permission');
|
||||
}
|
||||
|
||||
$repApp = $this->request['repApp'];
|
||||
$repType = $this->request['repType'];
|
||||
$repId = intval($this->request['repId']);
|
||||
|
||||
/* Get data */
|
||||
$reps = array();
|
||||
$members = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'member_id, rep_rating',
|
||||
'from' => 'reputation_index',
|
||||
'where' => "app='{$repApp}' AND type='{$repType}' AND type_id='{$repId}'",
|
||||
'order' => 'rep_date',
|
||||
) );
|
||||
$q = $this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch( $q ) )
|
||||
{
|
||||
$reps[ $r['member_id'] ] = $r;
|
||||
$members[ $r['member_id'] ] = $r['member_id'];
|
||||
}
|
||||
|
||||
if( count($members) AND count($reps) )
|
||||
{
|
||||
$_members = IPSMember::load( $members );
|
||||
|
||||
foreach( $reps as $memId => $repData )
|
||||
{
|
||||
$reps[ $memId ]['member'] = $_members[ $memId ];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->returnHtml( $this->registry->output->getTemplate('global_other')->reputationPopup( $reps ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a rating to the index
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _more()
|
||||
{
|
||||
$app = trim( $this->request['f_app'] );
|
||||
$type = trim( $this->request['f_type'] );
|
||||
$id = intval( $this->request['f_id'] );
|
||||
|
||||
/* Get the rep library */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php', 'classReputationCache' );
|
||||
$repCache = new $classToLoad();
|
||||
|
||||
/* Fetch members who have wanted to favorite this item */
|
||||
$data = $repCache->getDataByRelationshipId( array( 'app' => $app, 'type' => $type, 'id' => $id, 'rating' => 1 ) );
|
||||
|
||||
return $this->returnHtml( $this->registry->output->getTemplate( 'global_other' )->repMoreDialogue( $data, $id ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a rating to the index
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected 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 )
|
||||
{
|
||||
$formatted = $repCache->getLikeFormatted( array( 'id' => $type_id, 'app' => $app, 'type' => $type ) );
|
||||
$current = $repCache->getCurrentMemberRating( array( 'id' => $type_id, 'app' => $app, 'type' => $type, 'memberId' => $this->memberData['member_id'] ) );
|
||||
$rating = $repCache->getCurrentRating( array( 'id' => $type_id, 'app' => $app, 'type' => $type ) );
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'ok', 'rating' => $rating, 'likeData' => $formatted, 'canRepUp' => IPSMember::canRepUp( $current, $this->memberData ), 'canRepDown' => IPSMember::canRepDown( $current, $this->memberData ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $repCache->error_message )
|
||||
{
|
||||
$this->returnJsonError( $repCache->error_message );
|
||||
}
|
||||
|
||||
$this->returnString( 'done' );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Reputation
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_reputation extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* What to do */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'add_rating':
|
||||
$this->_doRating();
|
||||
break;
|
||||
|
||||
case 'more':
|
||||
$this->_more();
|
||||
break;
|
||||
|
||||
case 'view':
|
||||
$this->_viewRep();
|
||||
break;
|
||||
}
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays reputation popup
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _viewRep()
|
||||
{
|
||||
$this->lang->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
|
||||
if ( !$this->memberData['gbw_view_reps'] )
|
||||
{
|
||||
$this->returnJsonError('no_permission');
|
||||
}
|
||||
|
||||
$repApp = $this->request['repApp'];
|
||||
$repType = $this->request['repType'];
|
||||
$repId = intval($this->request['repId']);
|
||||
|
||||
/* Get data */
|
||||
$reps = array();
|
||||
$members = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'member_id, rep_rating',
|
||||
'from' => 'reputation_index',
|
||||
'where' => "app='{$repApp}' AND type='{$repType}' AND type_id='{$repId}'",
|
||||
'order' => 'rep_date',
|
||||
) );
|
||||
$q = $this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch( $q ) )
|
||||
{
|
||||
$reps[ $r['member_id'] ] = $r;
|
||||
$members[ $r['member_id'] ] = $r['member_id'];
|
||||
}
|
||||
|
||||
if( count($members) AND count($reps) )
|
||||
{
|
||||
$_members = IPSMember::load( $members );
|
||||
|
||||
foreach( $reps as $memId => $repData )
|
||||
{
|
||||
$reps[ $memId ]['member'] = $_members[ $memId ];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->returnHtml( $this->registry->output->getTemplate('global_other')->reputationPopup( $reps ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a rating to the index
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _more()
|
||||
{
|
||||
$app = trim( $this->request['f_app'] );
|
||||
$type = trim( $this->request['f_type'] );
|
||||
$id = intval( $this->request['f_id'] );
|
||||
|
||||
/* Get the rep library */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php', 'classReputationCache' );
|
||||
$repCache = new $classToLoad();
|
||||
|
||||
/* Fetch members who have wanted to favorite this item */
|
||||
$data = $repCache->getDataByRelationshipId( array( 'app' => $app, 'type' => $type, 'id' => $id, 'rating' => 1 ) );
|
||||
|
||||
return $this->returnHtml( $this->registry->output->getTemplate( 'global_other' )->repMoreDialogue( $data, $id ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a rating to the index
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected 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 )
|
||||
{
|
||||
$formatted = $repCache->getLikeFormatted( array( 'id' => $type_id, 'app' => $app, 'type' => $type ) );
|
||||
$current = $repCache->getCurrentMemberRating( array( 'id' => $type_id, 'app' => $app, 'type' => $type, 'memberId' => $this->memberData['member_id'] ) );
|
||||
$rating = $repCache->getCurrentRating( array( 'id' => $type_id, 'app' => $app, 'type' => $type ) );
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'ok', 'rating' => $rating, 'likeData' => $formatted, 'canRepUp' => IPSMember::canRepUp( $current, $this->memberData ), 'canRepDown' => IPSMember::canRepDown( $current, $this->memberData ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $repCache->error_message )
|
||||
{
|
||||
$this->returnJsonError( $repCache->error_message );
|
||||
}
|
||||
|
||||
$this->returnString( 'done' );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
/**
|
||||
* @file search.php AJAX configure VNC filters
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 2/14/2011
|
||||
* $LastChangedDate: 2011-05-25 10:30:28 -0400 (Wed, 25 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8887 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,232 +1,222 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* AJAX Sharelinks
|
||||
* Last Updated: $Date: 2011-09-08 03:56:43 -0400 (Thu, 08 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 9465 $
|
||||
*/
|
||||
|
||||
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 @e 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 @e void [Outputs HTML to browser AJAX call]
|
||||
*/
|
||||
protected 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 */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' );
|
||||
$connect = new $classToLoad( $this->registry );
|
||||
|
||||
try
|
||||
{
|
||||
$userData = $connect->fetchUserData();
|
||||
|
||||
$this->returnHtml( $this->registry->output->getTemplate('global_other')->facebookPop( $userData ) );
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
$this->returnHtml( '.' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Oh go on then */
|
||||
$this->returnHtml( $this->registry->output->getTemplate('global_other')->facebookPop( array() ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Go go Facebook go
|
||||
*
|
||||
* @return @e void [Outputs HTML to browser AJAX call]
|
||||
*/
|
||||
protected function _facebookGo()
|
||||
{
|
||||
/* INIT */
|
||||
$comment = trim( urldecode( $_POST['comment'] ) );
|
||||
$url = trim( urldecode( $_POST['url'] ) );
|
||||
$title = trim( urldecode( $_POST['title'] ) );
|
||||
$comment = ( $comment == $this->lang->words['fb_share_default'] ) ? '' : $comment;
|
||||
|
||||
/* 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 */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' );
|
||||
$connect = new $classToLoad( $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 @e void [Outputs HTML to browser AJAX call]
|
||||
*/
|
||||
protected 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 */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' );
|
||||
$connect = new $classToLoad( $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 @e void [Outputs HTML to browser AJAX call]
|
||||
*/
|
||||
protected 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 */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' );
|
||||
$connect = new $classToLoad( $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 */
|
||||
$this->returnHtml( 'x' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Bog off */
|
||||
$this->returnHtml( 'x' );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file sharelinks.php Ajax method for sharelinks
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2012 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* $LastChangedDate: 2012-06-22 07:55:48 -0400 (Fri, 22 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10969 $
|
||||
*/
|
||||
|
||||
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
|
||||
* @brief Ajax method for sharelinks
|
||||
*/
|
||||
class public_core_ajax_sharelinks extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
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;
|
||||
case 'savePostPrefs':
|
||||
return $this->_savePostPrefs();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores post prefs for share links
|
||||
*
|
||||
* @return @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
protected function _savePostPrefs()
|
||||
{
|
||||
IPSMember::setToMemberCache( $this->memberData, array( 'postSocialPrefs' => array( 'facebook' => intval( $_POST['facebook'] ), 'twitter' => intval( $_POST['twitter'] ) ) ) );
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form of facebook stuff. It's really that exciting.
|
||||
*
|
||||
* @deprecated as of 3.3 - now using Facebook standard share button
|
||||
* @return @e void [Outputs HTML to browser AJAX call]
|
||||
*/
|
||||
protected 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 */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' );
|
||||
$connect = new $classToLoad( $this->registry );
|
||||
|
||||
try
|
||||
{
|
||||
$userData = $connect->fetchUserData();
|
||||
|
||||
$this->returnHtml( $this->registry->output->getTemplate('global_other')->facebookPop( $userData ) );
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
$this->returnHtml( '.' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Oh go on then */
|
||||
$this->returnHtml( $this->registry->output->getTemplate('global_other')->facebookPop( array() ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Go go Facebook go
|
||||
*
|
||||
* @Deprecated as of 3.3 - now using Facebook standard share button
|
||||
* @return @e void [Outputs HTML to browser AJAX call]
|
||||
*/
|
||||
protected function _facebookGo()
|
||||
{
|
||||
/* INIT */
|
||||
$comment = trim( urldecode( $_POST['comment'] ) );
|
||||
$url = trim( urldecode( $_POST['url'] ) );
|
||||
$title = trim( urldecode( $_POST['title'] ) );
|
||||
$comment = ( $comment == $this->lang->words['fb_share_default'] ) ? '' : $comment;
|
||||
|
||||
/* 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 */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' );
|
||||
$connect = new $classToLoad( $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 ) );
|
||||
}
|
||||
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
// Fallsback to returnString below
|
||||
}
|
||||
}
|
||||
|
||||
/* Bog off */
|
||||
$this->returnString( 'finchersaysno' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Go go twitter go
|
||||
*
|
||||
* @return @e void [Outputs HTML to browser AJAX call]
|
||||
*/
|
||||
protected 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 */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' );
|
||||
$connect = new $classToLoad( $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 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Bog off */
|
||||
$this->returnString( 'failwhale' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form of twitter stuff. It's really that exciting.
|
||||
*
|
||||
* @return @e void [Outputs HTML to browser AJAX call]
|
||||
*/
|
||||
protected 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 */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' );
|
||||
$connect = new $classToLoad( $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 ) );
|
||||
}
|
||||
}
|
||||
|
||||
/* Bog off */
|
||||
$this->returnHtml( 'x' );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/**
|
||||
* @file skin.php Provides ajax methods for the setting a user's skin
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-08-06 01:51:01 +0100 (Sat, 06 Aug 2011) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 9373 $
|
||||
*/
|
||||
|
||||
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
|
||||
* @brief Provides ajax methods for the central like/follow class
|
||||
*/
|
||||
class public_core_ajax_skin extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'change':
|
||||
$this->_change();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show more dialogue
|
||||
*
|
||||
* @param integer $relid Relationship ID
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _change()
|
||||
{
|
||||
$skinId = $this->request['skinId'];
|
||||
|
||||
/* Make sure cookies are set */
|
||||
$this->settings['no_print_header'] = 0;
|
||||
|
||||
if ( is_numeric( $skinId ) )
|
||||
{
|
||||
/* Rudimentaty check */
|
||||
if ( $this->registry->output->allSkins[ $skinId ]['_youCanUse'] AND $this->registry->output->allSkins[ $skinId ]['_gatewayExclude'] !== TRUE )
|
||||
{
|
||||
if ( $this->memberData['member_id'] )
|
||||
{
|
||||
/* Update... */
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'skin' => $skinId ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
IPSCookie::set( 'guestSkinChoice', $skinId );
|
||||
}
|
||||
|
||||
/* Make sure mobile skin is removed */
|
||||
IPSCookie::set("mobileApp", 'false', -1);
|
||||
IPSCookie::set("mobileBrowser", 0, -1);
|
||||
|
||||
/* remove user agent bypass */
|
||||
IPSCookie::set("uagent_bypass", 0, -1);
|
||||
|
||||
/* Update member row */
|
||||
$this->memberData['skin'] = $skinId;
|
||||
}
|
||||
}
|
||||
else if ( $skinId == 'fullVersion' )
|
||||
{
|
||||
/* Set cookie */
|
||||
IPSCookie::set("uagent_bypass", 1, -1);
|
||||
IPSCookie::set("mobileBrowser", 0, -1);
|
||||
|
||||
/* Set member pref if not a mobile app */
|
||||
if ( $this->memberData['userAgentType'] != 'mobileAppLegacy' && $this->memberData['userAgentType'] != 'mobileApp' )
|
||||
{
|
||||
/* Got one set by default for this gateway? */
|
||||
foreach( $this->registry->output->allSkins as $data )
|
||||
{
|
||||
/* Can use with this output format? */
|
||||
if ( $data['_gatewayExclude'] !== FALSE )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Is default for our current gateway? */
|
||||
if ( $data['set_is_default'] && $this->caches['outputformats'][ $data['set_output_format'] ]['gateway_file'] == IPS_PUBLIC_SCRIPT )
|
||||
{
|
||||
$skinId = $data['set_id'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Update... */
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'skin' => $skinId ) ) );
|
||||
}
|
||||
}
|
||||
else if ( $skinId == 'unlockUserAgent' )
|
||||
{
|
||||
$this->member->updateMySession( array( 'uagent_bypass' => 1 ) );
|
||||
|
||||
/* Set cookie */
|
||||
IPSCookie::set("uagent_bypass", 1, -1);
|
||||
IPSCookie::set("mobileBrowser", 0, -1);
|
||||
}
|
||||
else if ( $skinId == 'setAsMobile' )
|
||||
{
|
||||
$this->member->updateMySession( array( 'uagent_bypass' => 0 ) );
|
||||
|
||||
/* Set cookie */
|
||||
IPSCookie::set("uagent_bypass", 0, -1);
|
||||
IPSCookie::set("mobileBrowser", 1, -1);
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,79 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Like Ajax
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Gallery
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_skingen extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinGenerator.php' );/*noLibHook*/
|
||||
|
||||
$this->skinFunctions = new skinGenerator( $registry );
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'save':
|
||||
$this->_save();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find tags
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _save()
|
||||
{
|
||||
/* Init */
|
||||
$storedClasses = json_decode( $_POST['storedClasses'], true );
|
||||
$storedSettings = json_decode( $_POST['storedSettings'], true );
|
||||
$css = $_POST['css'];
|
||||
|
||||
/* Build it, ship it, wiggle your hips a bit */
|
||||
try
|
||||
{
|
||||
/* Apologies for the previous comment */
|
||||
$this->skinFunctions->resetMemberAndSwitchSkin( $this->memberData['member_id'] );
|
||||
|
||||
$this->skinFunctions->save( array( 'css' => $css, 'storedSettings' => $storedSettings, 'storedClasses' => $storedClasses ), $this->memberData['member_id'] );
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
return $this->returnJsonArray( array('status' => 'error', 'msg' => $e->getMessage() ) );
|
||||
}
|
||||
|
||||
/* Done */
|
||||
return $this->returnJsonArray( array('status' => 'ok' ) );
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Like Ajax
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_skingen extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinGenerator.php' );/*noLibHook*/
|
||||
|
||||
$this->skinFunctions = new skinGenerator( $registry );
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'save':
|
||||
$this->_save();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find tags
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _save()
|
||||
{
|
||||
/* Init */
|
||||
$storedClasses = json_decode( $_POST['storedClasses'], true );
|
||||
$storedSettings = json_decode( $_POST['storedSettings'], true );
|
||||
$css = $_POST['css'];
|
||||
|
||||
/* Build it, ship it, wiggle your hips a bit */
|
||||
try
|
||||
{
|
||||
/* Apologies for the previous comment */
|
||||
$this->skinFunctions->resetMemberAndSwitchSkin( $this->memberData['member_id'] );
|
||||
|
||||
$this->skinFunctions->save( array( 'css' => $css, 'storedSettings' => $storedSettings, 'storedClasses' => $storedClasses ), $this->memberData['member_id'] );
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
return $this->returnJsonArray( array('status' => 'error', 'msg' => $e->getMessage() ) );
|
||||
}
|
||||
|
||||
/* Done */
|
||||
return $this->returnJsonArray( array('status' => 'ok' ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,95 +1,117 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Like Ajax
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Gallery
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_tags extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'find':
|
||||
$this->_find();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find tags
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _find()
|
||||
{
|
||||
/* init */
|
||||
$app = $this->request['meta_app'];
|
||||
$area = $this->request['meta_area'];
|
||||
$parentId = intval( $this->request['meta_parent_id'] );
|
||||
$metaId = intval( $this->request['meta_id'] );
|
||||
$find = trim( $this->request['find'] );
|
||||
$tags = array();
|
||||
$sort = array();
|
||||
|
||||
/* Checks */
|
||||
if ( empty( $app ) OR empty( $area ) )
|
||||
{
|
||||
return $this->returnJsonArray( array() );
|
||||
}
|
||||
|
||||
/* Init tags */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php' );/*noLibHook*/
|
||||
$tagClass = classes_tags_bootstrap::run( $app, $area );
|
||||
|
||||
/* Get tags by whut */
|
||||
if ( ! empty( $metaId ) )
|
||||
{
|
||||
$tags = $tagClass->getRawTagsByMetaId( $metaId, $find );
|
||||
}
|
||||
else if ( ! empty( $parentId ) )
|
||||
{
|
||||
$tags = $tagClass->getRawTagsByParentId( $parentId, $find );
|
||||
}
|
||||
|
||||
/* format */
|
||||
if ( is_array( $tags ) && count( $tags ) )
|
||||
{
|
||||
foreach( $tags as $id => $t )
|
||||
{
|
||||
$sort[ strlen( $t['tag_text'] ) . '.' . md5( $t['tag_text'] ) ] = $t['tag_text'];
|
||||
}
|
||||
}
|
||||
|
||||
ksort( $sort );
|
||||
|
||||
return $this->returnJsonArray( array_values( $sort ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Like Ajax
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_tags extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'find':
|
||||
$this->_find();
|
||||
break;
|
||||
case 'getTagsAsPopUp':
|
||||
$this->_getTagsAsPopUp();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags as pop-up window
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _getTagsAsPopUp()
|
||||
{
|
||||
/* init */
|
||||
$tag_aai_lookup = IPSText::md5Clean( $this->request['key'] );
|
||||
|
||||
/* Init tags */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php' );/*noLibHook*/
|
||||
$tagClass = classes_tags_bootstrap::run( $tag_aai_lookup );
|
||||
|
||||
$formatted = $tagClass->getTagsByCacheKey( $tag_aai_lookup );
|
||||
|
||||
return $this->returnHtml( $this->registry->output->getTemplate('global_other')->tagsAsPopUp( $formatted ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Find tags
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _find()
|
||||
{
|
||||
/* init */
|
||||
$app = $this->request['meta_app'];
|
||||
$area = $this->request['meta_area'];
|
||||
$parentId = intval( $this->request['meta_parent_id'] );
|
||||
$metaId = intval( $this->request['meta_id'] );
|
||||
$find = trim( $this->request['find'] );
|
||||
$tags = array();
|
||||
$sort = array();
|
||||
|
||||
/* Checks */
|
||||
if ( empty( $app ) OR empty( $area ) )
|
||||
{
|
||||
return $this->returnJsonArray( array() );
|
||||
}
|
||||
|
||||
/* Init tags */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php' );/*noLibHook*/
|
||||
$tagClass = classes_tags_bootstrap::run( $app, $area );
|
||||
|
||||
/* Get tags by whut */
|
||||
if ( ! empty( $metaId ) )
|
||||
{
|
||||
$tags = $tagClass->getRawTagsByMetaId( $metaId, $find );
|
||||
}
|
||||
else if ( ! empty( $parentId ) )
|
||||
{
|
||||
$tags = $tagClass->getRawTagsByParentId( $parentId, $find );
|
||||
}
|
||||
|
||||
/* format */
|
||||
if ( is_array( $tags ) && count( $tags ) )
|
||||
{
|
||||
foreach( $tags as $id => $t )
|
||||
{
|
||||
$sort[ strlen( $t['tag_text'] ) . '.' . md5( $t['tag_text'] ) ] = $t['tag_text'];
|
||||
}
|
||||
}
|
||||
|
||||
ksort( $sort );
|
||||
|
||||
return $this->returnJsonArray( array_values( $sort ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file templates.php Retrieve a template bit
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: mmecham $
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* $LastChangedDate: 2011-05-03 04:53:04 -0400 (Tue, 03 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8588 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,111 +1,111 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Login handler abstraction : AJAX UserCP functions
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'displayNameCheck':
|
||||
$this->displayNameCheck();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks a display name
|
||||
*
|
||||
* @return @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
protected function displayNameCheck()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$name = mb_strtolower( $this->convertAndMakeSafe( $this->request['name'], 0 ) );
|
||||
$name = str_replace("+", "+", $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.3.4
|
||||
* Login handler abstraction : AJAX UserCP functions
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'displayNameCheck':
|
||||
$this->displayNameCheck();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks a display name
|
||||
*
|
||||
* @return @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
protected function displayNameCheck()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$name = strtolower( $this->convertAndMakeSafe( $this->request['name'], 0 ) );
|
||||
$name = str_replace("+", "+", $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' );
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Retrieve member warn log
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_warn extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* System disabled? */
|
||||
if ( !$this->settings['warn_on'] )
|
||||
{
|
||||
$this->lang->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
$this->returnJsonError( $this->lang->words['ajax_no_warn'] );
|
||||
}
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'view':
|
||||
$this->_viewWarnLogs();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retieve warn logs and return them
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _viewWarnLogs()
|
||||
{
|
||||
/* Get library and load */
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('core') . '/modules_public/modcp/editmember.php', 'public_core_modcp_editmember' );
|
||||
$warn = new $classToLoad();
|
||||
$warn->makeRegistryShortcuts( $this->registry );
|
||||
$warn->loadData();
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_modcp' ), 'core' );
|
||||
|
||||
$warnHTML = $warn->viewLog( true );
|
||||
|
||||
if ( $warnHTML )
|
||||
{
|
||||
$this->returnHtml( $warnHTML );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->lang->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
$this->returnJsonError( $this->lang->words['ajax_bad_html'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,345 +1,343 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Attachment Poster
|
||||
* Last Updated: $Date: 2011-09-07 14:34:13 -0400 (Wed, 07 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9462 $
|
||||
*/
|
||||
|
||||
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 @e 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 @e 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 @e 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 @e 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 @e 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 .'&';
|
||||
}
|
||||
}
|
||||
|
||||
/* 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'] .= '&' . str_replace( '--ff--', '', $k ) . '='.$v;
|
||||
$JSON['extra_upload_form_url'] .= '&' . $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, array( 'IPSText', 'arrayWalkCallbackConvert' ) );
|
||||
$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 @e 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 @e 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.3.4
|
||||
* Attachment Poster
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class 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 @e 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 @e 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 @e 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 @e 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 @e 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 .'&';
|
||||
}
|
||||
}
|
||||
|
||||
/* 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'] .= '&' . str_replace( '--ff--', '', $k ) . '='.$v;
|
||||
$JSON['extra_upload_form_url'] .= '&' . $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 */
|
||||
$result = IPSText::jsonEncodeForTemplate( $JSON );
|
||||
|
||||
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 @e 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 @e 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 ) );
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'attach' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,88 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Captcha
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_global_captcha extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e 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 @e void
|
||||
*/
|
||||
public function showImage()
|
||||
{
|
||||
/* INIT */
|
||||
$captcha_unique_id = trim( $this->request['captcha_unique_id'] );
|
||||
|
||||
/* Show Image... */
|
||||
$this->class_captcha->showImage( $captcha_unique_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the captcha image
|
||||
* Refreshes the captcha image.
|
||||
*
|
||||
* @return @e 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;
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Captcha
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_global_captcha extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e 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 @e void
|
||||
*/
|
||||
public function showImage()
|
||||
{
|
||||
/* INIT */
|
||||
$captcha_unique_id = trim( $this->request['captcha_unique_id'] );
|
||||
|
||||
/* Show Image... */
|
||||
$this->class_captcha->showImage( $captcha_unique_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the captcha image
|
||||
* Refreshes the captcha image.
|
||||
*
|
||||
* @return @e 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;
|
||||
}
|
||||
}
|
||||
@@ -1,327 +1,453 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Image Ajax
|
||||
* Last Updated: $LastChangedDate: 2011-09-07 21:50:25 -0400 (Wed, 07 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Gallery
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9464 $
|
||||
*
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* From App */
|
||||
$fromApp = trim( $this->request['fromApp'] );
|
||||
|
||||
if( !$fromApp )
|
||||
{
|
||||
$this->registry->output->showError( 'noappcomments', 100135.8 );
|
||||
}
|
||||
|
||||
/* Init some data */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );/*noLibHook*/
|
||||
$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
|
||||
*
|
||||
* @return @e void [Redirects]
|
||||
*/
|
||||
protected function _findLastComment()
|
||||
{
|
||||
/* Init */
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
|
||||
$this->_comments->redirectToComment( 'last', $parentId );
|
||||
}
|
||||
|
||||
/**
|
||||
* Find last page of comments
|
||||
*
|
||||
* @return @e 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
|
||||
*
|
||||
* @return @e 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 @e 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->getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a comment
|
||||
*
|
||||
* @return @e 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
|
||||
*
|
||||
* @return @e 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->lang->words['edit_comment'] . ' ' . $parent['parent_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
|
||||
*
|
||||
* @return @e 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
|
||||
*
|
||||
* @return @e 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 we are a guest, verify captcha */
|
||||
if( !$this->memberData['member_id'] AND $this->settings['guest_captcha'] )
|
||||
{
|
||||
if ( !$this->registry->getClass('class_captcha')->validate() )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'posting_bad_captcha', '1-global-comments-_add-3', null, null, 403 );
|
||||
}
|
||||
}
|
||||
|
||||
/* Save the comment */
|
||||
if ( $post AND $parentId )
|
||||
{
|
||||
try
|
||||
{
|
||||
$newComment = $this->_comments->add( $parentId, $_POST['Post'] );
|
||||
|
||||
/* Redirect to find latest */
|
||||
$this->_comments->redirectToComment( 'last', $parentId, $newComment['comment_approved'] ? false : true );
|
||||
}
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Image Ajax
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_global_comments extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* From App */
|
||||
$fromApp = trim( $this->request['fromApp'] );
|
||||
|
||||
if( !$fromApp )
|
||||
{
|
||||
$this->registry->output->showError( 'noappcomments', 100135.8 );
|
||||
}
|
||||
|
||||
/* Init some data */
|
||||
try
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );/*noLibHook*/
|
||||
$this->_comments = classes_comments_bootstrap::controller( $fromApp );
|
||||
}
|
||||
catch ( Exception $e )
|
||||
{
|
||||
$this->registry->output->showError( 'nocomment_found', '1-global-comments-noapp' );
|
||||
}
|
||||
|
||||
/* Some templates/files are still using comment_id too, so let's work around it.. */
|
||||
if ( ! empty($this->request['comment_id']) )
|
||||
{
|
||||
$this->request['commentId'] = $this->request['comment_id'];
|
||||
}
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'add':
|
||||
$this->_add();
|
||||
break;
|
||||
case 'delete':
|
||||
$this->_delete();
|
||||
break;
|
||||
case 'approve':
|
||||
$this->_approve();
|
||||
break;
|
||||
case 'showEdit':
|
||||
$this->_showEdit();
|
||||
break;
|
||||
case 'saveEdit':
|
||||
$this->_saveEdit();
|
||||
break;
|
||||
case 'fetchReply':
|
||||
$this->_fetchReply();
|
||||
break;
|
||||
case 'moderate':
|
||||
$this->_moderate();
|
||||
break;
|
||||
case 'hide':
|
||||
$this->_hide();
|
||||
break;
|
||||
case 'unhide':
|
||||
$this->_unhide();
|
||||
break;
|
||||
case 'findLastComment':
|
||||
$this->_findLastComment();
|
||||
break;
|
||||
case 'findComment':
|
||||
$this->_findComment();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call
|
||||
*
|
||||
* @see http://community.invisionpower.com/tracker/issue-35002-comments-controller
|
||||
* @todo Separate out AJAX functions into a separate controller
|
||||
*/
|
||||
public function __call( $function, $args )
|
||||
{
|
||||
$this->registry->output->showError( 'nocomment_found', '1-global-comments-nomethod' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Find last page of comments
|
||||
*
|
||||
* @return @e void [Redirects]
|
||||
*/
|
||||
protected function _findLastComment()
|
||||
{
|
||||
/* Init */
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
|
||||
$this->_comments->redirectToComment( 'last', $parentId );
|
||||
}
|
||||
|
||||
/**
|
||||
* Find last page of comments
|
||||
*
|
||||
* @return @e void [Redirects]
|
||||
*/
|
||||
protected function _findComment()
|
||||
{
|
||||
/* Init */
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
$comment_id = intval( $this->request['commentId'] );
|
||||
|
||||
if ( !$comment_id )
|
||||
{
|
||||
$this->registry->output->showError( 'nocomment_found', '1-global-comments-find' );
|
||||
}
|
||||
|
||||
$this->_comments->redirectToComment( $comment_id, $parentId );
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _hide()
|
||||
{
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
$commentId = intval( $this->request['commentId'] );
|
||||
|
||||
/* 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-_hide-0', null, null, 403 );
|
||||
}
|
||||
|
||||
$return = $this->_comments->hide( $parentId, $commentId, $this->request['reason'], $this->memberData );
|
||||
|
||||
if ( $return === TRUE )
|
||||
{
|
||||
$this->_findComment();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->showError( $return );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Unhide
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _unhide()
|
||||
{
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
$commentId = intval( $this->request['commentId'] );
|
||||
|
||||
/* 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-_unhide-0', null, null, 403 );
|
||||
}
|
||||
|
||||
$return = $this->_comments->unhide( $parentId, $commentId, $this->memberData );
|
||||
|
||||
if ( $return === TRUE )
|
||||
{
|
||||
$this->_findComment();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->showError( $return );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reply
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _fetchReply()
|
||||
{
|
||||
/* INIT */
|
||||
$commentId = intval( $this->request['commentId'] );
|
||||
$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->getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a comment
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _delete()
|
||||
{
|
||||
/* INIT */
|
||||
$commentId = intval( $this->request['commentId'] );
|
||||
$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 */
|
||||
if ( $this->request['modcp'] )
|
||||
{
|
||||
$app = $this->request['fromApp'];
|
||||
$app = explode( '-', $app );
|
||||
$app = $app[0];
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=modcp&fromapp='. $app .'&tab=' . $this->request['modcp'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_comments->redirectToComment( 'last', $parentId );
|
||||
}
|
||||
}
|
||||
catch ( Exception $error )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_delete-2', null, null, 403 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Approves a comment
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _approve()
|
||||
{
|
||||
/* INIT */
|
||||
$commentId = intval( $this->request['commentId'] );
|
||||
$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-_approve-0', null, null, 403 );
|
||||
}
|
||||
|
||||
/* Quick error checko */
|
||||
if ( ! $commentId OR ! $parentId )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_approve-2', null, null, 403 );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$this->_comments->visibility( 'on', $parentId, $commentId, $this->memberData );
|
||||
|
||||
if ( $this->request['modcp'] )
|
||||
{
|
||||
$app = $this->request['fromApp'];
|
||||
$app = explode( '-', $app );
|
||||
$app = $app[0];
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=modcp&fromapp='. $app .'&tab=' . $this->request['modcp'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_comments->redirectToComment( $commentId, $parentId );
|
||||
}
|
||||
}
|
||||
catch ( Exception $error )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_approve-2', null, null, 403 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the edit box
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showEdit()
|
||||
{
|
||||
/* INIT */
|
||||
$commentId = intval( $this->request['commentId'] );
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
|
||||
/* Quick error checko */
|
||||
if ( ! $commentId OR ! $parentId )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_showEdit-11', null, null, 404 );
|
||||
}
|
||||
|
||||
# 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->lang->words['edit_comment'] . ' ' . $parent['parent_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
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _saveEdit()
|
||||
{
|
||||
/* INIT */
|
||||
$commentId = intval( $this->request['commentId'] );
|
||||
$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 );
|
||||
|
||||
if ( $this->request['modcp'] )
|
||||
{
|
||||
$app = $this->request['fromApp'];
|
||||
$app = explode( '-', $app );
|
||||
$app = $app[0];
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=modcp&fromapp='. $app .'&tab=' . $this->request['modcp'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$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
|
||||
*
|
||||
* @return @e 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 we are a guest, verify captcha */
|
||||
if ( ! $this->memberData['member_id'] AND $this->settings['guest_captcha'] AND $this->settings['bot_antispam_type'] != 'none' )
|
||||
{
|
||||
if ( !$this->registry->getClass('class_captcha')->validate() )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'posting_bad_captcha', '1-global-comments-_add-3', null, null, 403 );
|
||||
}
|
||||
}
|
||||
|
||||
/* Save the comment */
|
||||
if ( $post AND $parentId )
|
||||
{
|
||||
try
|
||||
{
|
||||
$newComment = $this->_comments->add( $parentId, $_POST['Post'] );
|
||||
|
||||
/* Redirect to find latest */
|
||||
$this->_comments->redirectToComment( 'last', $parentId, $newComment['comment_approved'] ? false : true );
|
||||
}
|
||||
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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'global' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,12 +3,12 @@
|
||||
* @file like.php Provides ajax methods for the central like/follow class
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-08-06 01:51:01 +0100 (Sat, 06 Aug 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9373 $
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -106,6 +106,14 @@ class public_core_global_like extends ipsCommand
|
||||
|
||||
list( $app, $area, $relId, $likeMemberId, $memberId, $email ) = explode( ';', $key );
|
||||
|
||||
/* Sanitize */
|
||||
$relId = intval( $relId );
|
||||
$likeMemberId = intval( $likeMemberId );
|
||||
$memberId = intval( $memberId );
|
||||
|
||||
$app = IPSText::alphanumericalClean( $app );
|
||||
$area = IPSText::alphanumericalClean( $area );
|
||||
|
||||
/* Member? */
|
||||
if ( ! $this->memberData['member_id'] )
|
||||
{
|
||||
@@ -128,7 +136,14 @@ class public_core_global_like extends ipsCommand
|
||||
}
|
||||
|
||||
/* Think we're safe... */
|
||||
$this->_like = classes_like::bootstrap( $app, $area );
|
||||
try
|
||||
{
|
||||
$this->_like = classes_like::bootstrap( $app, $area );
|
||||
}
|
||||
catch ( Exception $ex )
|
||||
{
|
||||
$this->registry->output->showError('no_permission', 'pcgl-4');
|
||||
}
|
||||
|
||||
/* Get data */
|
||||
$data = $this->_like->getDataByRelationshipId( $relId, false );
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,498 +1,499 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Recover Lost Password
|
||||
* Last Updated: $Date: 2011-07-22 20:10:44 -0400 (Fri, 22 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 9306 $
|
||||
*
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e 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
|
||||
*
|
||||
* @return @e 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 = IPSMember::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 ) );
|
||||
|
||||
/* Password has been changed! */
|
||||
IPSLib::runMemberSync( 'onPassChange', $member['member_id'], $new_pass );
|
||||
|
||||
//-----------------------------------------
|
||||
// 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->registry->getClass('output')->buildUrl( 'app=core&module=usercp&tab=core&area=password', 'publicNoSession' ),
|
||||
'PASSWORD' => $new_pass,
|
||||
'LOGIN' => $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=login', 'publicNoSession' ),
|
||||
'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'], $new_pass, $pass_a, $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 ) );
|
||||
|
||||
/* Password has been changed! */
|
||||
IPSLib::runMemberSync( 'onPassChange', $member['member_id'], $pass_a );
|
||||
|
||||
/* 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->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=login&do=autologin&frompass=1' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Completes the lost password request form
|
||||
*
|
||||
* @return @e 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( IPSMember::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->registry->getClass('output')->buildUrl( "app=core&module=global§ion=lostpass&do=sendform&uid={$member['member_id']}&aid={$validate_key}", 'publicNoSession' ),
|
||||
'MAN_LINK' => $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=lostpass&do=sendform', 'publicNoSession' ),
|
||||
'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
|
||||
*
|
||||
* @param string $errors
|
||||
* @return @e 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
|
||||
*
|
||||
* @param string $msg
|
||||
* @return @e 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'], '' );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Recover Lost Password
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_global_lostpass extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e 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
|
||||
*
|
||||
* @return @e 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 = IPSMember::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 ) );
|
||||
|
||||
/* Password has been changed! */
|
||||
IPSLib::runMemberSync( 'onPassChange', $member['member_id'], $new_pass );
|
||||
|
||||
//-----------------------------------------
|
||||
// Send out the email...
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::getTextClass('email')->getTemplate( "lost_pass_email_pass", $member['language'] );
|
||||
|
||||
IPSText::getTextClass('email')->buildMessage( array(
|
||||
'NAME' => $member['members_display_name'],
|
||||
'THE_LINK' => $this->registry->getClass('output')->buildUrl( 'app=core&module=usercp&tab=core&area=email', 'publicNoSession' ),
|
||||
'PASSWORD' => $new_pass,
|
||||
'LOGIN' => $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=login', 'publicNoSession' ),
|
||||
'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'], $new_pass, $pass_a, $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 ) );
|
||||
|
||||
/* Password has been changed! */
|
||||
IPSLib::runMemberSync( 'onPassChange', $member['member_id'], $pass_a );
|
||||
|
||||
/* 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->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=login&do=autologin&frompass=1' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Completes the lost password request form
|
||||
*
|
||||
* @return @e 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( strtolower( $this->request['member_name'] ) );
|
||||
$email_addy = trim( 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( IPSMember::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', $member['language'] );
|
||||
|
||||
IPSText::getTextClass('email')->buildMessage( array(
|
||||
'USERNAME' => $member['name'],
|
||||
'NAME' => $member['members_display_name'],
|
||||
'THE_LINK' => $this->registry->getClass('output')->buildUrl( "app=core&module=global§ion=lostpass&do=sendform&uid={$member['member_id']}&aid={$validate_key}", 'publicNoSession' ),
|
||||
'MAN_LINK' => $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=lostpass&do=sendform', 'publicNoSession' ),
|
||||
'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
|
||||
*
|
||||
* @param string $errors
|
||||
* @return @e 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
|
||||
*
|
||||
* @param string $msg
|
||||
* @return @e 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'], '' );
|
||||
}
|
||||
}
|
||||
@@ -1,50 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Captcha
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_global_navigation extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Set up */
|
||||
$inapp = trim( $this->request['inapp'] );
|
||||
|
||||
/* Load navigation stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/navigation/build.php', 'classes_navigation_build' );
|
||||
$navigation = new $classToLoad( $inapp );
|
||||
|
||||
/* Return */
|
||||
$html = $this->registry->output->getTemplate( 'global_other' )->quickNavigationWrapper( $navigation->loadApplicationTabs(), $navigation->loadNavigationData(), $inapp );
|
||||
|
||||
$this->registry->getClass('output')->setTitle( $this->lang->words['navigation_title'] );
|
||||
$this->registry->getClass('output')->addContent( $html );
|
||||
$this->registry->getClass('output')->sendOutput();
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Captcha
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_global_navigation extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Set up */
|
||||
$inapp = trim( $this->request['inapp'] );
|
||||
|
||||
/* Load navigation stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/navigation/build.php', 'classes_navigation_build' );
|
||||
$navigation = new $classToLoad( $inapp );
|
||||
|
||||
/* Return */
|
||||
$html = $this->registry->output->getTemplate( 'global_other' )->quickNavigationWrapper( $navigation->loadApplicationTabs(), $navigation->loadNavigationData(), $inapp );
|
||||
|
||||
$this->registry->getClass('output')->setTitle( $this->lang->words['navigation_title'] );
|
||||
$this->registry->getClass('output')->addContent( $html );
|
||||
$this->registry->getClass('output')->sendOutput();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Show forum rules
|
||||
* Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_global_privacy extends ipsCommand
|
||||
{
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$raw = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'core_sys_conf_settings',
|
||||
'where' => 'conf_key=\'priv_body\'' ) );
|
||||
|
||||
if ( $this->settings['priv_title'] )
|
||||
{
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'rules';
|
||||
|
||||
$policy = IPSText::getTextClass( 'bbcode' )->preDisplayParse( ( $raw['conf_value'] ) ? $raw['conf_value'] : $raw['conf_default'] );
|
||||
|
||||
$this->output .= $this->registry->getClass('output')->getTemplate('global_other')->privacyPolicy( $this->settings['priv_title'], $policy );
|
||||
|
||||
$this->registry->output->setTitle( $this->settings['priv_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->output->addContent( $this->output );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'page_doesnt_exist', 10335, null, null, 404 );
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,101 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Reputation
|
||||
* Last Updated: $Date: 2011-10-14 10:30:53 -0400 (Fri, 14 Oct 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9620 $
|
||||
*
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e 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
|
||||
*
|
||||
* @return @e 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, false, false, 403 );
|
||||
}
|
||||
|
||||
/* 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, false, false, 403 );
|
||||
}
|
||||
|
||||
/* 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, false, false, 403 );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Redirect to */
|
||||
$return_url = '';
|
||||
|
||||
if( !empty( $this->request['post_return'] ) )
|
||||
{
|
||||
$return_url = $this->settings['base_url'] . 'app=forums&module=forums§ion=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.3.4
|
||||
* Reputation
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_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
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e 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
|
||||
*
|
||||
* @return @e 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, false, false, 403 );
|
||||
}
|
||||
|
||||
/* 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, false, false, 403 );
|
||||
}
|
||||
|
||||
/* 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, false, false, 403 );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Redirect to */
|
||||
$return_url = '';
|
||||
|
||||
if( !empty( $this->request['post_return'] ) )
|
||||
{
|
||||
$return_url = $this->settings['base_url'] . 'app=forums&module=forums§ion=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,131 +1,131 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* RSS output functionality
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since Friday 18th March 2005
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_global_rss extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* XML document content
|
||||
*
|
||||
* @var string XML document content
|
||||
*/
|
||||
protected $to_print = '';
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['j_do'] )
|
||||
{
|
||||
$this->request['do'] = $this->request['j_do'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// We offline?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->settings['board_offline'] )
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab the plugin
|
||||
//-----------------------------------------
|
||||
|
||||
$type = 'forums';
|
||||
|
||||
if( $this->request['type'] )
|
||||
{
|
||||
if( IPSLib::appIsInstalled( IPSText::alphanumericalClean( $this->request['type'] ) ) )
|
||||
{
|
||||
if( is_file( IPSLib::getAppDir( IPSText::alphanumericalClean( $this->request['type'] ) ) . '/extensions/rssOutput.php' ) )
|
||||
{
|
||||
$type = IPSText::alphanumericalClean( $this->request['type'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// And grab the content
|
||||
//-----------------------------------------
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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
|
||||
//-----------------------------------------
|
||||
|
||||
@header( 'Content-Type: text/xml; charset=' . IPS_DOC_CHAR_SET );
|
||||
@header( 'Expires: ' . gmstrftime( '%c', $expires ) . ' GMT' );
|
||||
@header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
|
||||
@header( 'Pragma: public' );
|
||||
print $this->to_print;
|
||||
exit();
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* RSS output functionality
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Friday 18th March 2005
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_global_rss extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* XML document content
|
||||
*
|
||||
* @var string XML document content
|
||||
*/
|
||||
protected $to_print = '';
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['j_do'] )
|
||||
{
|
||||
$this->request['do'] = $this->request['j_do'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// We offline?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->settings['board_offline'] )
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab the plugin
|
||||
//-----------------------------------------
|
||||
|
||||
$type = 'forums';
|
||||
|
||||
if( $this->request['type'] )
|
||||
{
|
||||
if( IPSLib::appIsInstalled( IPSText::alphanumericalClean( $this->request['type'] ) ) )
|
||||
{
|
||||
if( is_file( IPSLib::getAppDir( IPSText::alphanumericalClean( $this->request['type'] ) ) . '/extensions/rssOutput.php' ) )
|
||||
{
|
||||
$type = IPSText::alphanumericalClean( $this->request['type'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// And grab the content
|
||||
//-----------------------------------------
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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
|
||||
//-----------------------------------------
|
||||
|
||||
@header( 'Content-Type: text/xml; charset=' . IPS_DOC_CHAR_SET );
|
||||
@header( 'Expires: ' . gmstrftime( '%c', $expires ) . ' GMT' );
|
||||
@header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
|
||||
@header( 'Pragma: public' );
|
||||
print $this->to_print;
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -1,59 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Captcha
|
||||
* Last Updated: $Date: 2011-06-02 18:58:10 -0400 (Thu, 02 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 8954 $
|
||||
*/
|
||||
|
||||
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 @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Disabled? */
|
||||
if ( ! $this->settings['sl_enable'] )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 100234.1, false, null, 403 );
|
||||
}
|
||||
|
||||
/* Disable for bots */
|
||||
if( $this->member->is_not_human )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 100234.2, false, null, 403 );
|
||||
}
|
||||
|
||||
$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 );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Captcha
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_global_share extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Disabled? */
|
||||
if ( ! $this->settings['sl_enable'] )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 100234.1, false, null, 403 );
|
||||
}
|
||||
|
||||
/* Disable for bots */
|
||||
if( $this->member->is_not_human )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 100234.2, false, null, 403 );
|
||||
}
|
||||
|
||||
$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 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* @file skin.php Provides methods for the setting a user's skin
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 27 March 2012
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @class public_core_global_skin
|
||||
* @brief Provides methods for the setting a user's skin
|
||||
*/
|
||||
class public_core_global_skin extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'change':
|
||||
$this->_change();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the skin ID choice for the member
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _change()
|
||||
{
|
||||
$skinId = $this->request['skinId'];
|
||||
|
||||
if ( ( $this->request['skinId'] != 'setAsMobile' ) && $this->request['k'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->output->showError('no_permission');
|
||||
}
|
||||
|
||||
if ( is_numeric( $skinId ) )
|
||||
{
|
||||
/* Rudimentaty check */
|
||||
if ( $this->registry->output->allSkins[ $skinId ]['_youCanUse'] AND $this->registry->output->allSkins[ $skinId ]['_gatewayExclude'] !== TRUE )
|
||||
{
|
||||
if ( $this->memberData['member_id'] )
|
||||
{
|
||||
/* Update... */
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'skin' => $skinId ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
IPSCookie::set( 'guestSkinChoice', $skinId );
|
||||
}
|
||||
|
||||
/* Make sure mobile skin is removed */
|
||||
IPSCookie::set("mobileApp", 'false', -1);
|
||||
IPSCookie::set("mobileBrowser", 0, -1);
|
||||
|
||||
/* remove user agent bypass */
|
||||
IPSCookie::set("uagent_bypass", 0, -1);
|
||||
|
||||
/* Update member row */
|
||||
$this->memberData['skin'] = $skinId;
|
||||
}
|
||||
}
|
||||
else if ( $skinId == 'fullVersion' )
|
||||
{
|
||||
/* Set cookie */
|
||||
IPSCookie::set("uagent_bypass", 1, -1);
|
||||
IPSCookie::set("mobileBrowser", 0, -1);
|
||||
}
|
||||
else if ( $skinId == 'unlockUserAgent' )
|
||||
{
|
||||
$this->member->updateMySession( array( 'uagent_bypass' => 1 ) );
|
||||
|
||||
/* Set cookie */
|
||||
IPSCookie::set("uagent_bypass", 1, -1);
|
||||
IPSCookie::set("mobileBrowser", 0, -1);
|
||||
}
|
||||
else if ( $skinId == 'setAsMobile' )
|
||||
{
|
||||
$this->member->updateMySession( array( 'uagent_bypass' => 0 ) );
|
||||
|
||||
/* Set cookie */
|
||||
IPSCookie::set("uagent_bypass", 0, -1);
|
||||
IPSCookie::set("mobileBrowser", 1, -1);
|
||||
}
|
||||
|
||||
/* Redirect */
|
||||
if ( $this->settings['query_string_real'] )
|
||||
{
|
||||
$url = preg_replace( '#&k=(?:\S+?)($|&)#', '\1', str_replace( '&', '&', $this->settings['query_string_real'] ) );
|
||||
$url = preg_replace( '#&settingNewSkin=(?:\S+?)($|&)#', '\1', $url );
|
||||
$url = preg_replace( '#&setAsMobile=(?:\S+?)($|&)#' , '\1', $url );
|
||||
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['board_url'] . '?' . $url, '', true );
|
||||
}
|
||||
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['board_url'], '', true );
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'help' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,174 +1,174 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Help File System
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_help_help extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* HTML to output
|
||||
*
|
||||
* @var string HTML
|
||||
*/
|
||||
public $output = "";
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Language */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_help' ) );
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case '01':
|
||||
$this->helpShowSection();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->helpShowTitles();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->addContent( $this->output );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show help topics
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function helpShowTitles()
|
||||
{
|
||||
/* INI */
|
||||
$seen = array();
|
||||
|
||||
|
||||
/* Query the help topics */
|
||||
$this->DB->build( array( 'select' => 'id, title, description, app', 'from' => 'faq', 'order' => 'position ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through topics */
|
||||
$rows = array();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
if( !IPSLib::appIsInstalled( $row['app'] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( isset( $seen[ $row['title'] ] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$seen[ $row['title'] ] = 1;
|
||||
}
|
||||
|
||||
$rows[] = $row;
|
||||
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->output .= $this->registry->output->getTemplate('help')->helpShowTopics(
|
||||
$this->lang->words['page_title'],
|
||||
$this->lang->words['help_txt'],
|
||||
$this->lang->words['choose_file'],
|
||||
$rows
|
||||
);
|
||||
|
||||
/* Navigation */
|
||||
$this->registry->output->setTitle( $this->lang->words['page_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->output->addNavigation( $this->lang->words['page_title'], '' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a help file
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function helpShowSection()
|
||||
{
|
||||
/* Check ID */
|
||||
$id = $this->request['HID'] ? intval( $this->request['HID'] ) : 0;
|
||||
|
||||
if ( ! $id )
|
||||
{
|
||||
$this->helpShowTitles();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Query the hel topic */
|
||||
$topic = $this->DB->buildAndFetch( array( 'select' => 'id, title, text', 'from' => 'faq', 'where' => 'id=' . $id ) );
|
||||
|
||||
if ( ! $topic['id'] )
|
||||
{
|
||||
$this->registry->output->showError( 'help_no_id', 10128 );
|
||||
}
|
||||
|
||||
/* Parse out board URL */
|
||||
$topic['text'] = str_replace( '{board_url}', $this->settings['base_url'], $topic['text'] );
|
||||
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'global';
|
||||
|
||||
$topic['text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $topic['text'] );
|
||||
|
||||
if ( $this->request['hl'] )
|
||||
{
|
||||
$topic['text'] = IPSText::searchHighlight( $topic['text'], $this->request['hl'] );
|
||||
$topic['title'] = IPSText::searchHighlight( $topic['title'], $this->request['hl'] );
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->output .= $this->registry->output->getTemplate( 'help' )->helpShowSection(
|
||||
$this->lang->words['help_topic'],
|
||||
$this->lang->words['topic_text'],
|
||||
$topic['title'],
|
||||
$topic['text']
|
||||
);
|
||||
|
||||
/* Navigation */
|
||||
$this->registry->output->setTitle( $this->lang->words['help_topic'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->output->addNavigation( $this->lang->words['help_topics'], "app=core&module=help" );
|
||||
$this->registry->output->addNavigation( $this->lang->words['help_topic'], '' );
|
||||
|
||||
if( $this->request['xml'] == 1 )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
|
||||
$classAjax = new $classToLoad();
|
||||
$classAjax->returnHtml( $this->output );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Help File System
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_help_help extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* HTML to output
|
||||
*
|
||||
* @var string HTML
|
||||
*/
|
||||
public $output = "";
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Language */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_help' ) );
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case '01':
|
||||
$this->helpShowSection();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->helpShowTitles();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->addContent( $this->output );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show help topics
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function helpShowTitles()
|
||||
{
|
||||
/* INI */
|
||||
$seen = array();
|
||||
|
||||
|
||||
/* Query the help topics */
|
||||
$this->DB->build( array( 'select' => 'id, title, description, app', 'from' => 'faq', 'order' => 'position ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through topics */
|
||||
$rows = array();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
if( !IPSLib::appIsInstalled( $row['app'] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( isset( $seen[ $row['title'] ] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$seen[ $row['title'] ] = 1;
|
||||
}
|
||||
|
||||
$rows[] = $row;
|
||||
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->output .= $this->registry->output->getTemplate('help')->helpShowTopics(
|
||||
$this->lang->words['page_title'],
|
||||
$this->lang->words['help_txt'],
|
||||
$this->lang->words['choose_file'],
|
||||
$rows
|
||||
);
|
||||
|
||||
/* Navigation */
|
||||
$this->registry->output->setTitle( $this->lang->words['page_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->output->addNavigation( $this->lang->words['page_title'], '' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a help file
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function helpShowSection()
|
||||
{
|
||||
/* Check ID */
|
||||
$id = $this->request['HID'] ? intval( $this->request['HID'] ) : 0;
|
||||
|
||||
if ( ! $id )
|
||||
{
|
||||
$this->helpShowTitles();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Query the hel topic */
|
||||
$topic = $this->DB->buildAndFetch( array( 'select' => 'id, title, text', 'from' => 'faq', 'where' => 'id=' . $id ) );
|
||||
|
||||
if ( ! $topic['id'] )
|
||||
{
|
||||
$this->registry->output->showError( 'help_no_id', 10128 );
|
||||
}
|
||||
|
||||
/* Parse out board URL */
|
||||
$topic['text'] = str_replace( '{board_url}', $this->settings['base_url'], $topic['text'] );
|
||||
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'global';
|
||||
|
||||
$topic['text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $topic['text'] );
|
||||
|
||||
if ( $this->request['hl'] )
|
||||
{
|
||||
$topic['text'] = IPSText::searchHighlight( $topic['text'], $this->request['hl'] );
|
||||
$topic['title'] = IPSText::searchHighlight( $topic['title'], $this->request['hl'] );
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->output .= $this->registry->output->getTemplate( 'help' )->helpShowSection(
|
||||
$this->lang->words['help_topic'],
|
||||
$this->lang->words['topic_text'],
|
||||
$topic['title'],
|
||||
$topic['text']
|
||||
);
|
||||
|
||||
/* Navigation */
|
||||
$this->registry->output->setTitle( $this->lang->words['help_topic'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->output->addNavigation( $this->lang->words['help_topics'], "app=core&module=help" );
|
||||
$this->registry->output->addNavigation( $this->lang->words['help_topic'], '' );
|
||||
|
||||
if( $this->request['xml'] == 1 )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
|
||||
$classAjax = new $classToLoad();
|
||||
$classAjax->returnHtml( $this->output );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'modcp' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 2/14/2011
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,12 +2,12 @@
|
||||
/**
|
||||
* @file modcp.php Moderator control panel
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 2/14/2011
|
||||
* $LastChangedDate: 2011-04-20 04:18:03 -0400 (Wed, 20 Apr 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8400 $
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -99,36 +99,40 @@ class public_core_modcp_modcp extends ipsCommand
|
||||
{
|
||||
if( ! $file->isDot() && $file->isFile() )
|
||||
{
|
||||
if( preg_match( "/^plugin_(.+?)\.php$/", $file->getFileName(), $matches ) )
|
||||
{
|
||||
if( preg_match( '/^plugin_(.+?)\.php$/', $file->getFileName(), $matches ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// We load each plugin so it can determine
|
||||
// if it should show based on permissions
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( $file->getPathName(), 'plugin_' . $appDir . '_' . $matches[1], $appDir );
|
||||
$_plugins[ $appDir ][ $matches[1] ] = new $classToLoad( $this->registry );
|
||||
|
||||
if( $_plugins[ $appDir ][ $matches[1] ]->canView( $moderator ) )
|
||||
if( class_exists($classToLoad) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Hacky solution - we want forum plugins to
|
||||
// come first as they're the most used
|
||||
//-----------------------------------------
|
||||
|
||||
if( $appDir == 'forums' AND !empty($_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ]) )
|
||||
{
|
||||
array_unshift( $_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ], array( $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab(), $appDir, $matches[1] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ][] = array( $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab(), $appDir, $matches[1] );
|
||||
}
|
||||
|
||||
/* Sort active tab */
|
||||
if ( $appDir == $app && $tab == $matches[1] )
|
||||
{
|
||||
$_activeNav = array( 'primary' => $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab(), 'secondary' => $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab() );
|
||||
$_plugins[ $appDir ][ $matches[1] ] = new $classToLoad( $this->registry );
|
||||
|
||||
if( $_plugins[ $appDir ][ $matches[1] ]->canView( $moderator ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Hacky solution - we want forum plugins to
|
||||
// come first as they're the most used
|
||||
//-----------------------------------------
|
||||
|
||||
if( $appDir == 'forums' AND !empty($_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ]) )
|
||||
{
|
||||
array_unshift( $_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ], array( $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab(), $appDir, $matches[1] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ][] = array( $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab(), $appDir, $matches[1] );
|
||||
}
|
||||
|
||||
/* Sort active tab */
|
||||
if ( $appDir == $app && $tab == $matches[1] )
|
||||
{
|
||||
$_activeNav = array( 'primary' => $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab(), 'secondary' => $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,6 +142,14 @@ class public_core_modcp_modcp extends ipsCommand
|
||||
}
|
||||
}
|
||||
|
||||
// Move trash can to the bottom - if available
|
||||
if ( isset($_tabs['deleted_content']) )
|
||||
{
|
||||
$trashCan = $_tabs['deleted_content'];
|
||||
unset( $_tabs['deleted_content'] );
|
||||
$_tabs['deleted_content'] = $trashCan;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// If we can't view any tabs, show an error
|
||||
//-----------------------------------------
|
||||
@@ -164,7 +176,24 @@ class public_core_modcp_modcp extends ipsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
$_output = $this->registry->output->getTemplate('modcp')->memberLookup();
|
||||
switch ( $this->request['do'] )
|
||||
{
|
||||
case 'editmember':
|
||||
$_output = $this->_editMember();
|
||||
break;
|
||||
|
||||
case 'doeditmember':
|
||||
$this->_doEditMember();
|
||||
break;
|
||||
|
||||
case 'setAsSpammer':
|
||||
$this->_setAsSpammer();
|
||||
break;
|
||||
|
||||
default:
|
||||
$_output = $this->registry->output->getTemplate('modcp')->memberLookup();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -173,4 +202,400 @@ class public_core_modcp_modcp extends ipsCommand
|
||||
|
||||
$this->output .= $this->registry->output->getTemplate('modcp')->portalPage( $_output, $_tabs, $_activeNav );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load all necessary properties
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function loadData()
|
||||
{
|
||||
|
||||
//-----------------------------------------
|
||||
// Get forum libraries
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Make sure we're a moderator...
|
||||
//-----------------------------------------
|
||||
|
||||
$pass = 0;
|
||||
|
||||
if( $this->memberData['member_id'] )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] == 1 )
|
||||
{
|
||||
$pass = 1;
|
||||
}
|
||||
else if( $this->memberData['is_mod'] )
|
||||
{
|
||||
$other_mgroups = array();
|
||||
$_other_mgroups = IPSText::cleanPermString( $this->memberData['mgroup_others'] );
|
||||
|
||||
if( $_other_mgroups )
|
||||
{
|
||||
$other_mgroups = explode( ",", $_other_mgroups );
|
||||
}
|
||||
|
||||
$other_mgroups[] = $this->memberData['member_group_id'];
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'moderators',
|
||||
'where' => "(member_id='" . $this->memberData['member_id'] . "' OR (is_group=1 AND group_id IN(" . implode( ",", $other_mgroups ) . ")))"
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $this->moderator = $this->DB->fetch() )
|
||||
{
|
||||
if ( $this->moderator['allow_warn'] )
|
||||
{
|
||||
$pass = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !$pass )
|
||||
{
|
||||
$this->registry->output->showError( 'warn_no_access', 2025, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Ensure we have a valid member
|
||||
//-----------------------------------------
|
||||
|
||||
$mid = intval($this->request['mid']);
|
||||
|
||||
if ( $mid < 1 )
|
||||
{
|
||||
$this->registry->output->showError( 'warn_no_user', 10249, null, null, 404 );
|
||||
}
|
||||
|
||||
$this->warn_member = IPSMember::load( $mid, 'all' );
|
||||
|
||||
if ( ! $this->warn_member['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( 'warn_no_user', 10250, null, null, 404 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get editor
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$this->editor = new $classToLoad();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the moderator library and return it
|
||||
*
|
||||
* @return @e object
|
||||
*/
|
||||
protected function getModLibrary()
|
||||
{
|
||||
static $modLibrary = null;
|
||||
|
||||
if( !$modLibrary )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' );
|
||||
$modLibrary = new $classToLoad( $this->registry );
|
||||
$modLibrary->init( array() );
|
||||
}
|
||||
|
||||
return $modLibrary;
|
||||
}
|
||||
|
||||
/**
|
||||
* Form to edit a member
|
||||
*
|
||||
* @return @e void
|
||||
* @todo [Future] Determine what items should be editable and allow moderators to edit them
|
||||
*/
|
||||
protected function _editMember()
|
||||
{
|
||||
$this->loadData();
|
||||
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->memberData['g_is_supmod'] )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->modcpMessage();
|
||||
}
|
||||
|
||||
if ( ! $this->memberData['g_access_cp'] AND $this->warn_member['g_access_cp'] )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->modcpMessage( $this->lang->words['mod_cannot_edit_admin'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$editable = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Show about me and signature editors
|
||||
//-----------------------------------------
|
||||
|
||||
$this->editor->setAllowBbcode( true );
|
||||
$this->editor->setAllowSmilies( false );
|
||||
$this->editor->setAllowHtml( $this->caches['group_cache'][ $this->warn_member['member_group_id'] ]['g_dohtml'] );
|
||||
$this->editor->setContent( $this->warn_member['signature'], 'signatures' );
|
||||
$editable['signature'] = $this->editor->show( 'Post', array( 'noSmilies' => true, 'height' => 100 ) );
|
||||
|
||||
$this->editor->setAllowBbcode( true );
|
||||
$this->editor->setAllowSmilies( true );
|
||||
$this->editor->setAllowHtml( $this->caches['group_cache'][ $this->warn_member['member_group_id'] ]['g_dohtml'] );
|
||||
$this->editor->setContent( $this->warn_member['pp_about_me'], 'aboutme' );
|
||||
$editable['aboutme'] = $this->editor->show( 'aboutme', array( 'height' => 100 ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Other fields
|
||||
//-----------------------------------------
|
||||
|
||||
$editable['member_id'] = $this->warn_member['member_id'];
|
||||
$editable['members_display_name'] = $this->warn_member['members_display_name'];
|
||||
$editable['title'] = $this->warn_member['title'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Profile fields
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' );
|
||||
$fields = new $classToLoad();
|
||||
$fields->member_data = $this->warn_member;
|
||||
$fields->initData( 'edit' );
|
||||
$fields->parseToEdit();
|
||||
|
||||
$editable['_parsedMember'] = IPSMember::buildDisplayData( $this->warn_member );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return the HTML
|
||||
//-----------------------------------------
|
||||
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->editUserForm( $editable, $fields );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the member updates
|
||||
*
|
||||
* @return @e void
|
||||
* @todo [Future] Determine what items should be editable and allow moderators to edit them
|
||||
*/
|
||||
protected function _doEditMember()
|
||||
{
|
||||
$this->loadData();
|
||||
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->memberData['g_is_supmod'] )
|
||||
{
|
||||
$this->registry->output->showError( 'mod_only_supermods', 10370, true, null, 403 );
|
||||
}
|
||||
|
||||
if ( ! $this->memberData['g_access_cp'] AND $this->warn_member['g_access_cp'] )
|
||||
{
|
||||
$this->registry->output->showError( 'mod_admin_edit', 3032, true, null, 403 );
|
||||
}
|
||||
|
||||
if ( $this->request['auth_key'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 3032.1, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$editable = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Signature and about me
|
||||
//-----------------------------------------
|
||||
|
||||
$signature = $this->editor->process( $_POST['Post'] );
|
||||
$aboutme = $this->editor->process( $_POST['aboutme'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse signature
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_html = $this->caches['group_cache'][ $this->warn_member['member_group_id'] ]['g_dohtml'];
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'signatures';
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup = $this->warn_member['member_group_id'];
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $this->warn_member['mgroup_others'];
|
||||
|
||||
$signature = IPSText::getTextClass('bbcode')->preDbParse( $signature );
|
||||
$signatureCache = IPSText::getTextClass('bbcode')->preDisplayParse( $signature );
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse about me
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_html = $this->caches['group_cache'][ $this->warn_member['member_group_id'] ]['g_dohtml'];
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'aboutme';
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup = $this->warn_member['member_group_id'];
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $this->warn_member['mgroup_others'];
|
||||
|
||||
$aboutme = IPSText::getTextClass('bbcode')->preDbParse( $aboutme );
|
||||
|
||||
//-----------------------------------------
|
||||
// Add to array to save
|
||||
//-----------------------------------------
|
||||
|
||||
$save['extendedProfile'] = array( 'signature' => $signature, 'pp_about_me' => $aboutme );
|
||||
$save['members'] = array( 'title' => $this->request['title'] );
|
||||
|
||||
if ( $this->request['photo'] == 1 )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' );
|
||||
$photos = new $classToLoad( $this->registry );
|
||||
$photos->remove( $this->warn_member['member_id'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Profile fields
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' );
|
||||
$fields = new $classToLoad();
|
||||
$fields->member_data = $this->warn_member;
|
||||
$fields->initData( 'edit' );
|
||||
$fields->parseToSave( $_POST );
|
||||
|
||||
if ( count( $fields->out_fields ) )
|
||||
{
|
||||
$save['customFields'] = $fields->out_fields;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Bitwise
|
||||
//-----------------------------------------
|
||||
|
||||
$bw = IPSBWOptions::thaw( $this->warn_member['members_bitoptions'], 'members' );
|
||||
$bw['bw_no_status_update'] = ( $this->request['status_updates'] ) ? 0 : 1;
|
||||
$save['core']['members_bitoptions'] = IPSBWOptions::freeze( $bw, 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Write it to the DB.
|
||||
//-----------------------------------------
|
||||
|
||||
IPSMember::save( $this->warn_member['member_id'], $save );
|
||||
|
||||
//-----------------------------------------
|
||||
// Update signature content cache
|
||||
//-----------------------------------------
|
||||
|
||||
IPSContentCache::update( $this->warn_member['member_id'], 'sig', $signatureCache );
|
||||
|
||||
//-----------------------------------------
|
||||
// Add a mod log entry and redirect
|
||||
//-----------------------------------------
|
||||
|
||||
$this->getModLibrary()->addModerateLog( 0, 0, 0, 0, $this->lang->words['acp_edited_profile'] . " " . $this->warn_member['members_display_name'] );
|
||||
|
||||
$this->_redirect( $this->lang->words['acp_edited_profile'] . " " . $this->warn_member['members_display_name'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag a user account as a spammer
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _setAsSpammer()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$toSave = array( 'core' => array( 'bw_is_spammer' => 1 ) );
|
||||
$topicId = intval($this->request['t']);
|
||||
$topic = array();
|
||||
|
||||
if( $topicId )
|
||||
{
|
||||
$topic = $this->DB->buildAndFetch( array( 'select' => 'tid, title_seo, forum_id', 'from' => 'topics', 'where' => 'tid=' . $topicId ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id );
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( 'moderate_no_permission', 10311900, true, null, 404 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->memberData['g_is_supmod'] AND !$this->memberData['forumsModeratorData'][ $topic['forum_id'] ]['bw_flag_spammers'] )
|
||||
{
|
||||
$this->registry->output->showError( 'moderate_no_permission', 103119, true, null, 403 );
|
||||
}
|
||||
|
||||
if ( IPSMember::isInGroup( $member, explode( ',', $this->settings['warn_protected'] ) ) )
|
||||
{
|
||||
$this->registry->output->showError( 'moderate_no_permission', 10311901, true, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Do it
|
||||
//-----------------------------------------
|
||||
|
||||
IPSMember::flagMemberAsSpammer( $member, $this->memberData );
|
||||
|
||||
//-----------------------------------------
|
||||
// Redirect
|
||||
//-----------------------------------------
|
||||
|
||||
if( $topicId )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['flag_spam_done'], $this->settings['base_url'] . "showtopic=" . $topic['tid'] . "&st=" . intval($this->request['st']), $topic['title_seo'], 'showtopic' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['flag_spam_done'], $this->settings['base_url'] . "showuser=" . $member['member_id'], $member['members_seo_name'], 'showuser' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect back to where we came from
|
||||
*
|
||||
* @param string $message Redirect message
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _redirect( $message )
|
||||
{
|
||||
if( $this->request['pf'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $message, $this->settings['base_url'] . "showuser=" . $this->warn_member['member_id'], $this->warn_member['members_seo_name'], 'showuser' );
|
||||
}
|
||||
else if( $this->request['t'] )
|
||||
{
|
||||
$topic = $this->DB->buildAndFetch( array( 'select' => 'tid, title_seo', 'from' => 'topics', 'where' => 'tid=' . intval($this->request['t']) ) );
|
||||
|
||||
$this->registry->output->redirectScreen( $message, $this->settings['base_url'] . "showtopic=" . $topic['tid'] . '&st=' . $this->request['_st'], $topic['title_seo'], 'showtopic' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $message, $this->settings['base_url'] . "app=core&module=modcp&do=editmember&mid={$this->warn_member['member_id']}" );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'reports' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,13 +3,13 @@
|
||||
* @file reports.php Reports content central management
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: AndyMillne $
|
||||
* @author Based on original "Report Center" by Luke Scott
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-09-26 15:52:07 -0400 (Mon, 26 Sep 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9550 $
|
||||
* $LastChangedDate: 2012-06-26 07:24:43 -0400 (Tue, 26 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10987 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -144,6 +144,14 @@ class public_core_reports_reports extends ipsCommand
|
||||
}
|
||||
}
|
||||
|
||||
// Move trash can to the bottom - if available
|
||||
if ( isset($_tabs['deleted_content']) )
|
||||
{
|
||||
$trashCan = $_tabs['deleted_content'];
|
||||
unset( $_tabs['deleted_content'] );
|
||||
$_tabs['deleted_content'] = $trashCan;
|
||||
}
|
||||
|
||||
$this->output = $this->registry->output->getTemplate('modcp')->portalPage( $this->output, $_tabs, $_activeNav );
|
||||
}
|
||||
|
||||
@@ -240,7 +248,7 @@ class public_core_reports_reports extends ipsCommand
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . "app=members&module=messaging&section=view&do=showConversation&topicID=" . $topicId . "&st=" . $this->request['st'] . "#msg" . $this->request['msg'] );
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . "app=members&module=messaging&section=view&do=findMessage&topicID=" . $topicId . "&msgID=" . $this->request['msg'] );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,8 +353,15 @@ class public_core_reports_reports extends ipsCommand
|
||||
$members = IPSMember::load( $members_to_load );
|
||||
|
||||
foreach( $reports as $id => $data )
|
||||
{
|
||||
$reports[ $id ]['member'] = IPSMember::buildDisplayData( $members[ $data['updated_by'] ] );
|
||||
{
|
||||
if( $data['updated_by'] )
|
||||
{
|
||||
$reports[ $id ]['member'] = IPSMember::buildDisplayData( $members[ $data['updated_by'] ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$reports[ $id ]['member'] = IPSMember::buildDisplayData( IPSMember::setUpGuest( '' ) );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -732,7 +747,14 @@ class public_core_reports_reports extends ipsCommand
|
||||
$row['_title'] = $row['title'];
|
||||
$row['title'] = $row['member_title'];
|
||||
|
||||
$row['author'] = IPSMember::buildDisplayData( $row );
|
||||
if( $row['member_id'] )
|
||||
{
|
||||
$row['author'] = IPSMember::buildDisplayData( $row );
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['author'] = IPSMember::buildDisplayData( IPSMember::setUpGuest( '' ) );
|
||||
}
|
||||
|
||||
$row['title'] = $row['_title'];
|
||||
$row['report'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['report'] );
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'search' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,67 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Task Manager
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_task_manualResolver extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Require and run
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_taskmanager.php', 'class_taskmanager' );/*noLibHook*/
|
||||
$functions = new $classToLoad( $registry );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check shutdown functions
|
||||
//-----------------------------------------
|
||||
|
||||
if( IPS_USE_SHUTDOWN )
|
||||
{
|
||||
define( 'IS_SHUTDOWN', 1 );
|
||||
register_shutdown_function( array( $functions, 'runTask') );
|
||||
}
|
||||
else
|
||||
{
|
||||
$functions->runTask();
|
||||
}
|
||||
|
||||
if( $functions->type != 'cron' && ! $_SERVER['SHELL'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Print out the 'blank' gif
|
||||
//-----------------------------------------
|
||||
|
||||
@header( "Content-Type: image/gif" );
|
||||
print base64_decode( "R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Task Manager
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_task_manualResolver extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Require and run
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_taskmanager.php', 'class_taskmanager' );/*noLibHook*/
|
||||
$functions = new $classToLoad( $registry );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check shutdown functions
|
||||
//-----------------------------------------
|
||||
|
||||
if( IPS_USE_SHUTDOWN )
|
||||
{
|
||||
define( 'IS_SHUTDOWN', 1 );
|
||||
register_shutdown_function( array( $functions, 'runTask') );
|
||||
}
|
||||
else
|
||||
{
|
||||
$functions->runTask();
|
||||
}
|
||||
|
||||
if( $functions->type != 'cron' && ! $_SERVER['SHELL'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Print out the 'blank' gif
|
||||
//-----------------------------------------
|
||||
|
||||
ob_start();
|
||||
@header( "Content-Type: image/gif" );
|
||||
print base64_decode( "R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,302 +1,302 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* User control panel resolver
|
||||
* Last Updated: $Date: 2011-06-09 18:03:22 -0400 (Thu, 09 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 9021 $
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_pageTitle;
|
||||
|
||||
/**
|
||||
* Navigation array set by sub classes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_nav = array();
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e 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§ion=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 ( ! is_file($EXT_DIR . '/usercpForms.php') )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'usercp_bad_tab', 10147 );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Cycle through applications and load
|
||||
// usercpForm extensions
|
||||
//-----------------------------------------
|
||||
foreach( IPSLib::getEnabledApplications() as $app_dir => $app_data )
|
||||
{
|
||||
$ext_dir = IPSLib::getAppDir( $app_dir ) . '/extensions';
|
||||
|
||||
// Make sure the extension exists
|
||||
if ( !is_file( $ext_dir . '/usercpForms.php' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$__class = IPSLib::loadLibrary( $ext_dir . '/usercpForms.php', 'usercpForms_' . $app_dir, $app_dir );
|
||||
$_usercp_module = new $__class();
|
||||
|
||||
/* Block based on version to prevent old files showing up/causing an error */
|
||||
if( !$_usercp_module->version OR $_usercp_module->version < 32 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$_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 ]['_menu'] = $_usercp_module->getLinks();
|
||||
|
||||
/* Got any links? */
|
||||
if ( !is_array($tabs[ $app_dir ]['_menu']) || !count($tabs[ $app_dir ]['_menu']) )
|
||||
{
|
||||
unset( $tabs[ $app_dir ] );
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Get title */
|
||||
$tabs[ $app_dir ]['_name'] = $_usercp_module->tab_name ? $_usercp_module->tab_name : IPSLib::getAppTitle( $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&module=usercp&tab=' . $_TAB . '&area=' . $_AREA, $_navData['title'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up basic navigation
|
||||
//-----------------------------------------
|
||||
|
||||
$this->_nav[] = array( $this->lang->words['t_title'], '&app=core&module=usercp' );
|
||||
$this->_nav[] = array( $this->lang->words['tab__' . $_TAB ] ? $this->lang->words['tab__' . $_TAB ] : IPSLib::getAppTitle( $_TAB ) , '&app=core&module=usercp&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->lang->words['pagetitle_bit']} : " . $this->_pageTitle . ' - ' . $this->settings['board_name'] : "{$this->lang->words['pagetitle_bit']} - " . $this->settings['board_name'] );
|
||||
$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.3.4
|
||||
* User control panel resolver
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_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
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_pageTitle;
|
||||
|
||||
/**
|
||||
* Navigation array set by sub classes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_nav = array();
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e 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§ion=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 ( ! is_file($EXT_DIR . '/usercpForms.php') )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'usercp_bad_tab', 10147 );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Cycle through applications and load
|
||||
// usercpForm extensions
|
||||
//-----------------------------------------
|
||||
foreach( IPSLib::getEnabledApplications() as $app_dir => $app_data )
|
||||
{
|
||||
$ext_dir = IPSLib::getAppDir( $app_dir ) . '/extensions';
|
||||
|
||||
// Make sure the extension exists
|
||||
if ( !is_file( $ext_dir . '/usercpForms.php' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$__class = IPSLib::loadLibrary( $ext_dir . '/usercpForms.php', 'usercpForms_' . $app_dir, $app_dir );
|
||||
$_usercp_module = new $__class();
|
||||
|
||||
/* Block based on version to prevent old files showing up/causing an error */
|
||||
if( !$_usercp_module->version OR $_usercp_module->version < 32 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$_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 ]['_menu'] = $_usercp_module->getLinks();
|
||||
|
||||
/* Got any links? */
|
||||
if ( !is_array($tabs[ $app_dir ]['_menu']) || !count($tabs[ $app_dir ]['_menu']) )
|
||||
{
|
||||
unset( $tabs[ $app_dir ] );
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Get title */
|
||||
$tabs[ $app_dir ]['_name'] = $_usercp_module->tab_name ? $_usercp_module->tab_name : IPSLib::getAppTitle( $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&module=usercp&tab=' . $_TAB . '&area=' . $_AREA, $_navData['title'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up basic navigation
|
||||
//-----------------------------------------
|
||||
|
||||
$this->_nav[] = array( $this->lang->words['t_title'], '&app=core&module=usercp' );
|
||||
$this->_nav[] = array( $this->lang->words['tab__' . $_TAB ] ? $this->lang->words['tab__' . $_TAB ] : IPSLib::getAppTitle( $_TAB ) , '&app=core&module=usercp&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->lang->words['pagetitle_bit']} : " . $this->_pageTitle . ' - ' . $this->settings['board_name'] : "{$this->lang->words['pagetitle_bit']} - " . $this->settings['board_name'] );
|
||||
$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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user