Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -1,17 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Remote API Server
|
||||
* Last Updated: $Date: 2009-08-03 16:11:56 -0400 (Mon, 03 Aug 2009) $
|
||||
* Last Updated: $Date: 2010-10-23 08:40:34 -0400 (Sat, 23 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 4965 $
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7023 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -59,7 +61,7 @@ class API_Server
|
||||
// Load allowed methods and build dispatch
|
||||
// list
|
||||
//-----------------------------------------
|
||||
|
||||
$ALLOWED_METHODS = array();
|
||||
require_once( DOC_IPS_ROOT_PATH . 'interface/board/modules/ipb/methods.php' );
|
||||
|
||||
if ( is_array( $ALLOWED_METHODS ) and count( $ALLOWED_METHODS ) )
|
||||
@@ -95,15 +97,19 @@ class API_Server
|
||||
|
||||
if ( $this->__authenticate( $api_key, $api_module, 'fetchOnlineUsers' ) !== FALSE )
|
||||
{
|
||||
if ( !$this->settings['au_cutoff'] )
|
||||
{
|
||||
$this->settings[ 'au_cutoff'] = 15 ;
|
||||
}
|
||||
|
||||
$cut_off = ipsRegistry::$settings['au_cutoff'] * 60;
|
||||
$time = time() - $cut_off;
|
||||
$rows = array();
|
||||
$ar_time = time();
|
||||
|
||||
$this->registry->DB()->build( array( 'select' => 'id, member_id, member_name, seo_name, login_type, running_time, member_group, uagent_type',
|
||||
'from' => 'sessions',
|
||||
'where' => "running_time > {$time}"
|
||||
) );
|
||||
$this->registry->DB()->build( array( 'select' => '*',
|
||||
'from' => 'sessions',
|
||||
'where' => "running_time > {$time}" ) );
|
||||
|
||||
|
||||
$this->registry->DB()->execute();
|
||||
@@ -391,12 +397,17 @@ class API_Server
|
||||
$appClass = new app_class_forums( $this->registry );
|
||||
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPost.php' );
|
||||
$_postClass = new classPost( $this->registry );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' );
|
||||
$_postClass = new $classToLoad( $this->registry );
|
||||
|
||||
/* reset forum list to allow all access */
|
||||
$this->registry->getClass('class_forums')->strip_invisible = false;
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set the data
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$_postClass->setIsPreview( false );
|
||||
$_postClass->setForumData( $this->registry->getClass('class_forums')->forum_by_id[ $forum_id ] );
|
||||
$_postClass->setForumID( $forum_id );
|
||||
@@ -410,6 +421,8 @@ class API_Server
|
||||
$_postClass->setTopicTitle( $topic_title );
|
||||
$_postClass->setTopicDescription( $topic_description );
|
||||
|
||||
# Switch off perm checks
|
||||
$_postClass->setBypassPermissionCheck(true);
|
||||
/**
|
||||
* And post it...
|
||||
*/
|
||||
@@ -417,7 +430,7 @@ class API_Server
|
||||
{
|
||||
if ( $_postClass->addTopic() === FALSE )
|
||||
{
|
||||
$this->classApiServer->apiSendError( '10', "IP.Board could not add the topic" );
|
||||
$this->classApiServer->apiSendError( '10', "IP.Board could not post the topic: " . $_postClass->getPostError() );
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
@@ -500,8 +513,13 @@ class API_Server
|
||||
$appClass = new app_class_forums( $this->registry );
|
||||
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPost.php' );
|
||||
$_postClass = new classPost( $this->registry );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' );
|
||||
$_postClass = new $classToLoad( $this->registry );
|
||||
|
||||
/* reset forum list to allow all access */
|
||||
$this->registry->getClass('class_forums')->strip_invisible = false;
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
|
||||
//-----------------------------------------
|
||||
// Need the topic...
|
||||
//-----------------------------------------
|
||||
|
||||
Reference in new issue
Block a user