Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -1,10 +0,0 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,103 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Defines blogger API parameters
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Blog
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
$_METAWEBLOG_ALLOWED_METHODS = array();
|
||||
|
||||
/**
|
||||
* getUsersBlogs
|
||||
* return basic Blog information about the users Blog
|
||||
*/
|
||||
$_METAWEBLOG_ALLOWED_METHODS['getUsersBlogs'] = array(
|
||||
'in' => array(
|
||||
'param0' => 'string',
|
||||
'param1' => 'string',
|
||||
'param2' => 'string',
|
||||
),
|
||||
'out' => array(
|
||||
'response' => 'xmlrpc'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* getUserInfo
|
||||
* return basic information about the user
|
||||
*/
|
||||
$_METAWEBLOG_ALLOWED_METHODS['getUserInfo'] = array(
|
||||
'in' => array(
|
||||
'param0' => 'string',
|
||||
'param1' => 'string',
|
||||
'param2' => 'string',
|
||||
),
|
||||
'out' => array(
|
||||
'response' => 'xmlrpc'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* deletePost
|
||||
* Deletes an entry from the Blog
|
||||
*/
|
||||
$_METAWEBLOG_ALLOWED_METHODS['deletePost'] = array(
|
||||
'in' => array(
|
||||
'param0' => 'string',
|
||||
'param1' => 'integer',
|
||||
'param2' => 'string',
|
||||
'param3' => 'string',
|
||||
'param4' => 'bool',
|
||||
),
|
||||
'out' => array(
|
||||
'response' => 'xmlrpc'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* newPost
|
||||
* Adds a new entry to the Blog
|
||||
*/
|
||||
$_METAWEBLOG_ALLOWED_METHODS['newPost'] = array(
|
||||
'in' => array(
|
||||
'param0' => 'string',
|
||||
'param1' => 'integer',
|
||||
'param2' => 'string',
|
||||
'param3' => 'string',
|
||||
'param4' => 'string',
|
||||
'param5' => 'bool',
|
||||
),
|
||||
'out' => array(
|
||||
'response' => 'xmlrpc'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* editPost
|
||||
* Edit an entry in the Blog
|
||||
*/
|
||||
$_METAWEBLOG_ALLOWED_METHODS['editPost'] = array(
|
||||
'in' => array(
|
||||
'param0' => 'string',
|
||||
'param1' => 'integer',
|
||||
'param2' => 'string',
|
||||
'param3' => 'string',
|
||||
'param4' => 'string',
|
||||
'param5' => 'bool'
|
||||
),
|
||||
'out' => array(
|
||||
'response' => 'xmlrpc'
|
||||
)
|
||||
);
|
||||
@@ -1,116 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Defines metaweblog API parameters
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Blog
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
$_METAWEBLOG_ALLOWED_METHODS = array();
|
||||
|
||||
/**
|
||||
* getCategories
|
||||
* return the categories used in the Blog
|
||||
*/
|
||||
$_METAWEBLOG_ALLOWED_METHODS['getCategories'] = array(
|
||||
'in' => array(
|
||||
'param0' => 'integer',
|
||||
'param1' => 'string',
|
||||
'param2' => 'string'
|
||||
),
|
||||
'out' => array(
|
||||
'response' => 'xmlrpc'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* getRecentPosts
|
||||
* return the most recent entries of the Blog
|
||||
*/
|
||||
$_METAWEBLOG_ALLOWED_METHODS['getRecentPosts'] = array(
|
||||
'in' => array(
|
||||
'param0' => 'integer',
|
||||
'param1' => 'string',
|
||||
'param2' => 'string',
|
||||
'param3' => 'integer'
|
||||
),
|
||||
'out' => array(
|
||||
'response' => 'xmlrpc'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* newPost
|
||||
* Post a new entry to the Blog
|
||||
*/
|
||||
$_METAWEBLOG_ALLOWED_METHODS['newPost'] = array(
|
||||
'in' => array(
|
||||
'param0' => 'integer',
|
||||
'param1' => 'string',
|
||||
'param2' => 'string',
|
||||
'param3' => 'struct',
|
||||
'param4' => 'bool'
|
||||
),
|
||||
'out' => array(
|
||||
'response' => 'xmlrpc'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* editPost
|
||||
* Edit an entry in the Blog
|
||||
*/
|
||||
$_METAWEBLOG_ALLOWED_METHODS['editPost'] = array(
|
||||
'in' => array(
|
||||
'param0' => 'integer',
|
||||
'param1' => 'string',
|
||||
'param2' => 'string',
|
||||
'param3' => 'struct',
|
||||
'param4' => 'bool'
|
||||
),
|
||||
'out' => array(
|
||||
'response' => 'xmlrpc'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* getPost
|
||||
* Get an entry from the Blog
|
||||
*/
|
||||
$_METAWEBLOG_ALLOWED_METHODS['getPost'] = array(
|
||||
'in' => array(
|
||||
'param0' => 'integer',
|
||||
'param1' => 'string',
|
||||
'param2' => 'string',
|
||||
),
|
||||
'out' => array(
|
||||
'response' => 'xmlrpc'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* newMediaObject
|
||||
* Post a media object to the Blog
|
||||
*/
|
||||
$_METAWEBLOG_ALLOWED_METHODS['newMediaObject'] = array(
|
||||
'in' => array(
|
||||
'param0' => 'integer',
|
||||
'param1' => 'string',
|
||||
'param2' => 'string',
|
||||
'param3' => 'struct',
|
||||
),
|
||||
'out' => array(
|
||||
'response' => 'xmlrpc'
|
||||
)
|
||||
);
|
||||
@@ -1,688 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Blogger API Functions
|
||||
* Last Updated: $Date: 2010-10-11 20:21:22 -0400 (Mon, 11 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Blog
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 6962 $
|
||||
*
|
||||
*/
|
||||
|
||||
class xmlrpc_server
|
||||
{
|
||||
/**
|
||||
* Defines the service for WSDL
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
public $__dispatch_map = array();
|
||||
|
||||
/**
|
||||
* IPS API SERVER Class
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
public $classApiServer;
|
||||
|
||||
/**
|
||||
* Error string
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $error = "";
|
||||
|
||||
/**
|
||||
* Global registry
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $registry;
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void
|
||||
**/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Set IPS CLASS
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->request = $this->registry->fetchRequest();
|
||||
|
||||
/* Load the Blog functions library */
|
||||
require_once( IPS_ROOT_PATH . 'applications_addon/ips/blog/sources/classes/blogFunctions.php' );
|
||||
$registry->setClass( 'blogFunctions', new blogFunctions( $registry ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load allowed methods and build dispatch
|
||||
// list
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( DOC_IPS_ROOT_PATH . 'interface/blog/apis/methods_blogger.php' );
|
||||
|
||||
if ( is_array( $_METAWEBLOG_ALLOWED_METHODS ) and count( $_METAWEBLOG_ALLOWED_METHODS ) )
|
||||
{
|
||||
foreach( $_METAWEBLOG_ALLOWED_METHODS as $_method => $_data )
|
||||
{
|
||||
$this->__dispatch_map[ $_method ] = $_data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLRPC_server::getUsersBlogs()
|
||||
*
|
||||
* Retrieves a user's blog entries
|
||||
*
|
||||
* This will return a param "response" with either
|
||||
* - FAILED (Unknown failure)
|
||||
* - SUCCESS (Added OK)
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @param string $appkey Application key
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @return string xml document
|
||||
**/
|
||||
public function getUsersBlogs( $appkey, $username, $password )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$return = 'FAILED';
|
||||
|
||||
//-----------------------------------------
|
||||
// Authenticate
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->_authenticate( $username, $password ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// return
|
||||
//-----------------------------------------
|
||||
|
||||
$return = 'SUCCESS';
|
||||
$blog_url = substr( str_replace( "&", "&", $this->registry->blogFunctions->getBlogUrl( $this->blog['blog_id'] ) ), 0, -1 );
|
||||
$this->classApiServer->apiSendReply( array( array( 'url' => $blog_url,
|
||||
'blogid' => $this->blog['blog_id'],
|
||||
'blogName' => IPSText::UNhtmlspecialchars( $this->blog['blog_name'] )
|
||||
) ) );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLRPC_server::getUserInfo()
|
||||
*
|
||||
* Retrieve user info
|
||||
*
|
||||
* This will return a param "response" with either
|
||||
* - FAILED (Unknown failure)
|
||||
* - SUCCESS (Added OK)
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @param string $appkey Appkey (ignored)
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @return string xml
|
||||
**/
|
||||
public function getUserInfo( $appkey, $username, $password )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Authenticate
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->_authenticate( $username, $password ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// return
|
||||
//-----------------------------------------
|
||||
$this->classApiServer->apiSendReply( array( 'nickname' => $this->memberData['members_display_name'],
|
||||
'userid' => $this->memberData['member_id'],
|
||||
'url' => ipsRegistry::$settings['board_url'].'/index.'.ipsRegistry::$settings['php_ext'].'?showuser='.$this->memberData['member_id'],
|
||||
'email' => $this->memberData['email']
|
||||
) );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLRPC_server::deletePost()
|
||||
*
|
||||
* Deletes a Blog entry.
|
||||
*
|
||||
* @access public
|
||||
* @param string $appkey Appkey (ignored)
|
||||
* @param int $postid Entry ID
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @param bool $publish Publish (ignored)
|
||||
* @return string xml
|
||||
**/
|
||||
public function deletePost( $appkey, $postid, $username, $password, $publish )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_portal' ), 'blog' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Authenticate
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->_authenticate( $username, $password ) )
|
||||
{
|
||||
if (!$this->registry->blogFunctions->allowDelEntry( $this->blog ) )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->registry->class_localization->words['blogger_error_1'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// find the entry
|
||||
//-----------------------------------------
|
||||
$eid = intval($postid);
|
||||
$entry = $this->registry->DB()->buildAndFetch( array ( 'select' => '*',
|
||||
'from' => 'blog_entries',
|
||||
'where' => "entry_id = ".$eid
|
||||
) );
|
||||
if ( ! $entry['entry_id'] )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, sprintf( $this->registry->class_localization->words['blogger_error_2'], $eid ) );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// delete the entry
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->blogFunctions->deleteEntries( array( $eid ) );
|
||||
|
||||
$this->addModlog( $this->registry->class_localization->words['blogger_blog_prefix'] . "({$this->blog['blog_id']}) '{$this->blog['blog_name']}': {$this->registry->class_localization->words['blogger_deleted_log']} '{$entry['entry_name']}'" );
|
||||
|
||||
//-------------------------------------------------
|
||||
// Return
|
||||
//-------------------------------------------------
|
||||
$this->classApiServer->apiSendReply();
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLRPC_server::newPost()
|
||||
*
|
||||
* Adds a new post to the Blog.
|
||||
*
|
||||
* @access public
|
||||
* @param string $appkey Appkey (ignored)
|
||||
* @param int $blogid Blog ID
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @param string $contentd Content
|
||||
* @param bool $publish Publish (ignored)
|
||||
* @return string xml
|
||||
**/
|
||||
public function newPost( $appkey, $blogid, $username, $password, $content, $publish )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_portal' ), 'blog' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Authenticate
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->_authenticate( $username, $password ) )
|
||||
{
|
||||
if ( $this->blog['blog_id'] != $blogid )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->registry->class_localization->words['blogger_error_3'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* External blog? */
|
||||
if ( $this->blog['blog_type'] != 'local' )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, 'Cannot post to external blog' );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// return
|
||||
//-----------------------------------------
|
||||
if ( ! $this->_compilePost( $content['description'], $publish ) )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
|
||||
$this->registry->DB()->insert( 'blog_entries', $this->entry );
|
||||
$entry_id = $this->registry->DB()->getInsertId();
|
||||
|
||||
$this->registry->blogFunctions->rebuildBlog( $this->blog['blog_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load and config POST class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( BLOG_PATH . "sources/classes/post/blogPost.php" );
|
||||
require_once( BLOG_PATH . "sources/classes/post/entry_new_entry.php" );
|
||||
|
||||
$this->lib_post = new postFunctions( $this->registry );
|
||||
$this->lib_post->blog = & $this->blog;
|
||||
|
||||
//-------------------------------------------------
|
||||
// If the entry is published, run the Blog tracker and pings
|
||||
//-------------------------------------------------
|
||||
|
||||
$this->lib_post->blogTracker( $entry_id, $this->entry['entry_name'], $this->entry['entry'] );
|
||||
$this->lib_post->blogPings ( $entry_id, $this->entry );
|
||||
|
||||
//-------------------------------------------------
|
||||
// Update the Blog stats
|
||||
//-------------------------------------------------
|
||||
$r = $this->registry->cache()->getCache( 'blog_stats' );
|
||||
|
||||
$r['blog_stats']['stats_num_entries']++;
|
||||
$this->registry->cache()->setCache( 'blog_stats', $r, array( 'array' => 1, 'donow' => 1 ) );
|
||||
|
||||
$this->classApiServer->apiSendReply( $entry_id );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLRPC_server::editPost()
|
||||
*
|
||||
* Edit the entry.
|
||||
*
|
||||
* @access public
|
||||
* @param string $appkey Appkey (ignored)
|
||||
* @param int $postid Entry ID
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @param string $content Post content
|
||||
* @param bool $publish Publish?
|
||||
* @return string xml
|
||||
**/
|
||||
public function editPost( $appkey, $postid, $username, $password, $content, $publish )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_portal' ), 'blog' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Authenticate
|
||||
//-----------------------------------------
|
||||
if ( $this->_authenticate( $username, $password ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// find the entry
|
||||
//-----------------------------------------
|
||||
$entry = $this->registry->DB()->buildAndFetch( array ( 'select' => '*',
|
||||
'from' => 'blog_entries',
|
||||
'where' => "entry_id = ".intval($postid)
|
||||
) );
|
||||
if ( ! $entry['entry_id'] )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, sprintf( $this->registry->class_localization->words['blogger_error_3'], intval($postid) ) );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// return
|
||||
//-----------------------------------------
|
||||
if ( ! $this->_compilePost( $content['description'], $publish ) )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
|
||||
$this->entry['blog_id'] = $entry['blog_id'];
|
||||
$this->entry['entry_author_id'] = $entry['entry_author_id'];
|
||||
$this->entry['entry_author_name'] = $entry['entry_author_name'];
|
||||
$this->entry['entry_date'] = $entry['entry_date'];
|
||||
$this->entry['entry_last_update'] = $entry['entry_last_update'];
|
||||
$this->entry['entry_edit_time'] = time();
|
||||
$this->entry['entry_edit_name'] = $this->memberData['members_display_name'];
|
||||
$this->entry['entry_poll_state'] = $entry['entry_poll_state'];
|
||||
|
||||
//-------------------------------------------------
|
||||
// Update entry in DB
|
||||
//-------------------------------------------------
|
||||
$this->registry->DB()->update( 'blog_entries', $this->entry, 'entry_id='.$entry['entry_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Rebuild the Blog
|
||||
//-----------------------------------------
|
||||
$this->registry->blogFunctions->rebuildBlog ( $this->blog['blog_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return true
|
||||
//-----------------------------------------
|
||||
$this->classApiServer->apiSendReply();
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _authenticate()
|
||||
*
|
||||
* Authenticates the username and password
|
||||
*
|
||||
* This will return
|
||||
* - false (Failed)
|
||||
* - true (Succes)
|
||||
*
|
||||
* @access private
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @return boolean
|
||||
**/
|
||||
private function _authenticate( $username, $password )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_portal' ), 'blog' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Are they banned?
|
||||
//-----------------------------------------
|
||||
if ( is_array( $this->caches['banfilters'] ) and count( $this->caches['banfilters'] ) )
|
||||
{
|
||||
foreach ($this->caches['banfilters'] as $ip)
|
||||
{
|
||||
$ip = str_replace( '\*', '.*', preg_quote($ip, "/") );
|
||||
|
||||
if ( preg_match( "/^$ip$/", $this->member->ip_address ) )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_banned_msg'];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// load the member
|
||||
//-----------------------------------------
|
||||
$member = IPSMember::load( IPSText::parseCleanValue( $username ), 'extendedProfile', 'username' );
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_unknown_user'];
|
||||
return false;
|
||||
}
|
||||
|
||||
ips_MemberRegistry::setMember( $member['member_id'] );
|
||||
|
||||
//--------------------------------
|
||||
// Is the board offline?
|
||||
//--------------------------------
|
||||
|
||||
if (ipsRegistry::$settings['board_offline'] == 1)
|
||||
{
|
||||
if ($this->memberData['g_access_offline'] != 1)
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_board_offline'];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Temporarely banned?
|
||||
//-----------------------------------------
|
||||
if ( $member['temp_ban'] )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_suspended'];
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load the Blog
|
||||
//-----------------------------------------
|
||||
$this->registry->blogFunctions->buildPerms();
|
||||
|
||||
//-----------------------------------------
|
||||
// Users can have more than one blog - just
|
||||
// grab first one mysql returns
|
||||
//-----------------------------------------
|
||||
|
||||
$blog = $this->registry->DB()->buildAndFetch( array(
|
||||
'select' => 'blog_id, blog_name',
|
||||
'from' => 'blog_blogs',
|
||||
'where' => "member_id={$member['member_id']}"
|
||||
) );
|
||||
|
||||
if ( ! $blog['blog_id'] )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_noblog'];
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $this->blog = $this->registry->blogFunctions->loadBlog( $blog['blog_id'], 1 ) )
|
||||
{
|
||||
$this->error = $this->blogFunctions->error;
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Blog post permissions?
|
||||
//-----------------------------------------
|
||||
if ( !$this->blog['allow_entry'] )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_nopost'];
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Validate password?
|
||||
//-----------------------------------------
|
||||
if ( !ipsRegistry::$settings['blog_allow_xmlrpc'] or !$this->blog['blog_settings']['enable_xmlrpc'] )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_noxmlrpc'];
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( $this->blog['blog_settings']['xmlrpc_password'] != md5( IPSText::parseCleanValue( $password ) ) )
|
||||
{
|
||||
if ( isset( $this->blog['blog_settings']['xmlrpc_failedattempts'] ) && $this->blog['blog_settings']['xmlrpc_failedattempts'] > 5 )
|
||||
{
|
||||
$this->blog['blog_settings']['enable_xmlrpc'] = 0;
|
||||
$this->blog['blog_settings']['xmlrpc_failedattempts'] = 0;
|
||||
$blog_settings = serialize ( $this->blog['blog_settings'] );
|
||||
$this->registry->DB()->update( 'blog_blogs', array( 'blog_settings' => $blog_settings ), "blog_id = {$this->blog['blog_id']}" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->blog['blog_settings']['xmlrpc_failedattempts'] = isset( $this->blog['blog_settings']['xmlrpc_failedattempts'] ) ? intval($this->blog['blog_settings']['xmlrpc_failedattempts'])+1 : 1;
|
||||
$blog_settings = serialize ( $this->blog['blog_settings'] );
|
||||
$this->registry->DB()->update( 'blog_blogs', array( 'blog_settings' => $blog_settings ), "blog_id = {$this->blog['blog_id']}" );
|
||||
}
|
||||
|
||||
$this->error = $this->registry->class_localization->words['blogger_inv_pass'];
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isset( $this->blog['blog_settings']['xmlrpc_failedattempts'] ) && $this->blog['blog_settings']['xmlrpc_failedattempts'] > 0 )
|
||||
{
|
||||
$this->blog['blog_settings']['xmlrpc_failedattempts'] = 0;
|
||||
$blog_settings = serialize ( $this->blog['blog_settings'] );
|
||||
$this->registry->DB()->update( 'blog_blogs', array( 'blog_settings' => $blog_settings ), "blog_id = {$this->blog['blog_id']}" );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set the member data
|
||||
//-----------------------------------------
|
||||
|
||||
$this->memberData = $member;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Add an entry to the Mod log
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
public function addModlog( $mod_title )
|
||||
{
|
||||
$this->registry->DB()->insert( 'moderator_logs', array (
|
||||
'member_id' => $this->memberData['member_id'],
|
||||
'member_name' => $this->memberData['members_display_name'],
|
||||
'ip_address' => $this->member->ip_address,
|
||||
'http_referer'=> htmlspecialchars( my_getenv('HTTP_REFERER') ),
|
||||
'ctime' => time(),
|
||||
'action' => $mod_title,
|
||||
'query_string'=> htmlspecialchars( my_getenv('QUERY_STRING') ),
|
||||
) );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Compile the entry content
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
private function _compilePost( & $content, $publish )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_portal' ), 'blog' );
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// Do we have a valid post?
|
||||
//----------------------------------------------------------------
|
||||
ipsRegistry::$settings['blog_max_entry_length'] = ipsRegistry::$settings['blog_max_entry_length'] ? ipsRegistry::$settings['blog_max_entry_length'] : 2140000;
|
||||
|
||||
if (strlen( trim( IPSText::br2nl( $content['description'] ) ) ) < 1)
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_emptypost'];
|
||||
return false;
|
||||
}
|
||||
|
||||
if (strlen( $content ) > (ipsRegistry::$settings['blog_max_entry_length']*1024))
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_toolong'];
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// check to make sure we have a valid entry title
|
||||
//-------------------------------------------------
|
||||
$title = $content['title'];
|
||||
|
||||
# Fix &
|
||||
$title = str_replace( '&', '&', $title );
|
||||
$title = IPSText::parseCleanValue( $title );
|
||||
|
||||
# Fix up &reg;
|
||||
$title = str_replace( '&reg;', '®', $title );
|
||||
$title = IPSText::getTextClass('parser')->stripBadWords( $title );
|
||||
$title = str_replace( "<br>", "", $title );
|
||||
$title = trim($title);
|
||||
|
||||
//-------------------------------------------------
|
||||
// More unicode..
|
||||
//-------------------------------------------------
|
||||
$temp = IPSText::stripslashes($title);
|
||||
$temp = preg_replace("/&#([0-9]+);/", "-", $temp );
|
||||
if ( strlen($temp) > 64 )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_title_toolong'];
|
||||
return false;
|
||||
}
|
||||
if ( (strlen($temp) < 2) or (!$title) )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_notitle'];
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Sort post content: Convert HTML to BBCode
|
||||
//--------------------------------------------
|
||||
|
||||
IPSText::getTextClass('parser')->parse_smilies = 1;
|
||||
IPSText::getTextClass('parser')->parse_html = 0;
|
||||
IPSText::getTextClass('parser')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('parser')->parsing_section = 'blog_entry';
|
||||
|
||||
//--------------------------------------------
|
||||
// Clean up..
|
||||
//--------------------------------------------
|
||||
|
||||
$content = preg_replace( "#<br />(\r)?\n#is", "<br />", $content );
|
||||
|
||||
//-----------------------------------------
|
||||
// Post process the editor
|
||||
// Now we have safe HTML and bbcode
|
||||
//-----------------------------------------
|
||||
|
||||
$content = IPSText::getTextClass('parser')->preDbParse( IPSText::getTextClass('editor')->processRawPost( IPSText::stripslashes($content) ) );
|
||||
|
||||
$dte = time();
|
||||
|
||||
/* Build the entry array */
|
||||
$this->entry = array(
|
||||
'blog_id' => $this->blog['blog_id'],
|
||||
'entry_author_id' => $this->memberData['member_id'],
|
||||
'entry_author_name' => $this->memberData['members_display_name'],
|
||||
'entry_date' => $dte,
|
||||
'entry_name' => $title,
|
||||
'entry_name_seo' => IPSText::makeSeoTitle($title),
|
||||
'entry' => $content,
|
||||
'entry_short' => $this->registry->blogFunctions->getEntryExcerpt( array( 'entry_short' => '', 'entry_id' => null, 'entry' => $content ) ),
|
||||
'entry_status' => ($publish ? 'published' : 'draft'),
|
||||
'entry_post_key' => md5(microtime()),
|
||||
'entry_html_state' => 0,
|
||||
'entry_use_emo' => 1,
|
||||
'entry_last_update' => $dte,
|
||||
'entry_gallery_album' => 0,
|
||||
'entry_poll_state' => 0,
|
||||
);
|
||||
|
||||
// If we had any errors, parse them back to this class
|
||||
// so we can track them later.
|
||||
if ( is_array(IPSText::getTextClass('parser')->error) && count(IPSText::getTextClass('parser')->error) > 0 )
|
||||
{
|
||||
$this->error = implode( " : ", IPSText::getTextClass('parser')->error );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,932 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Metaweblog API Functions
|
||||
* Last Updated: $Date: 2010-07-07 05:53:45 -0400 (Wed, 07 Jul 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mark $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Blog
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 6607 $
|
||||
*
|
||||
*/
|
||||
|
||||
class xmlrpc_server
|
||||
{
|
||||
/**
|
||||
* Defines the service for WSDL
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
public $__dispatch_map = array();
|
||||
|
||||
/**
|
||||
* IPS API SERVER Class
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
public $classApiServer;
|
||||
|
||||
/**
|
||||
* Error string
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $error = "";
|
||||
|
||||
/**
|
||||
* Global registry
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $registry;
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
/* Load the Blog functions library */
|
||||
$registry->DB()->loadCacheFile( BLOG_PATH . 'sql/' . ips_DBRegistry::getDriverType() . '_blog_queries.php', 'sql_blog_queries' );
|
||||
require_once( IPS_ROOT_PATH . 'applications_addon/ips/blog/sources/classes/blogFunctions.php' );
|
||||
$registry->setClass( 'blogFunctions', new blogFunctions( $registry ) );
|
||||
|
||||
/* Language */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_portal' ), 'blog' );
|
||||
|
||||
/* Allowed Methods and Dispatch Map */
|
||||
require_once( DOC_IPS_ROOT_PATH . 'interface/blog/apis/methods_metaweblog.php' );
|
||||
|
||||
if ( is_array( $_METAWEBLOG_ALLOWED_METHODS ) and count( $_METAWEBLOG_ALLOWED_METHODS ) )
|
||||
{
|
||||
foreach( $_METAWEBLOG_ALLOWED_METHODS as $_method => $_data )
|
||||
{
|
||||
$this->__dispatch_map[ $_method ] = $_data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLRPC_server::getCategories()
|
||||
*
|
||||
* Returns a list of the Blogs categories.
|
||||
*
|
||||
* @access public
|
||||
* @param string $blogid Application key
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @return string xml document
|
||||
**/
|
||||
public function getCategories( $blogid, $username, $password )
|
||||
{
|
||||
/* Authenticate the request */
|
||||
if ( $this->_authenticate( $username, $password ) )
|
||||
{
|
||||
if ( $this->blog['blog_id'] != $blogid )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->registry->class_localization->words['blogger_error_3'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Query tags */
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'tags_index',
|
||||
'where' => "app='blog' AND type='category' AND type_id_2={$blogid}"
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through tags and build array */
|
||||
$return_array = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return_array[] = array(
|
||||
'description' => $r['tag'],
|
||||
'htmlUrl' => "{$this->settings['base_url']}app=blog&module=display§ion=blog&blogid={$this->blog['blog_id']}&tag={$r['tag']}",
|
||||
'rssUrl' => ''
|
||||
);
|
||||
}
|
||||
|
||||
/* Send response */
|
||||
$this->classApiServer->apiSendReply( $return_array );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLRPC_server::getRecentPosts()
|
||||
*
|
||||
* Returns a list of the Blogs categories.
|
||||
*
|
||||
* @access public
|
||||
* @param int $blogid Blog ID
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @param int $numberOfPosts Number of posts
|
||||
* @return string xml
|
||||
**/
|
||||
public function getRecentPosts( $blogid, $username, $password, $numberOfPosts )
|
||||
{
|
||||
/* INIT */
|
||||
$return_array = array();
|
||||
|
||||
/* Authenticate */
|
||||
if( $this->_authenticate( $username, $password ) )
|
||||
{
|
||||
/* Check the blog id */
|
||||
if ( $this->blog['blog_id'] != $blogid )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->registry->class_localization->words['blogger_error_3'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Blog URL */
|
||||
$blog_url = str_replace( "&", "&", $this->registry->blogFunctions->getBlogUrl( $this->blog['blog_id'] ) );
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'e.*',
|
||||
'from' => array( 'blog_entries' => 'e' ),
|
||||
'where' => "e.blog_id={$this->blog['blog_id']}",
|
||||
'order' => 'e.entry_date DESC',
|
||||
'limit' => array( 0, intval( $numberOfPosts ) ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'm.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=e.entry_author_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
$q = $this->DB->execute();
|
||||
|
||||
while( $entry = $this->DB->fetch( $q ) )
|
||||
{
|
||||
/* Setup Parser */
|
||||
IPSText::getTextClass('parser')->parse_html = $entry['entry_html_state'] ? 1 : 0;
|
||||
IPSText::getTextClass('parser')->parse_wordwrap = $this->settings['post_wordwrap'];
|
||||
IPSText::getTextClass('parser')->parse_nl2br = $entry['entry_html_state'] == 2 ? 1 : 0;
|
||||
IPSText::getTextClass('parser')->parse_smilies = $entry['entry_use_emo'] ? 1: 0;
|
||||
IPSText::getTextClass('parser')->parsing_section = 'blog_entry';
|
||||
IPSText::getTextClass('parser')->parsing_mgroup = $entry['member_group_id'];
|
||||
IPSText::getTextClass('parser')->parsing_mgroup_others = $entry['member_group_id'];
|
||||
|
||||
/* Parse */
|
||||
$entry['entry'] = IPSText::getTextClass('parser')->preDisplayParse( $entry['entry'] );
|
||||
|
||||
/* Tags */
|
||||
$this->DB->build( array( 'select' => 'tag', 'from' => 'tags_index', 'where' => "app='blog' AND type_id={$entry['entry_id']} AND type_id_2={$entry['blog_id']}" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$tags = array();
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$tags[] = $r['tag'];
|
||||
}
|
||||
|
||||
/* Add to output */
|
||||
$return_array[] = array(
|
||||
'categories' => $tags,
|
||||
'dateCreated' => gmdate("Ymd\TH:i:s",$entry['entry_date']),
|
||||
'description' => $entry['entry'],
|
||||
'link' => $blog_url.'showentry='.$entry['entry_id'],
|
||||
'postid' => $entry['entry_id'],
|
||||
'title' => $entry['entry_name']
|
||||
);
|
||||
}
|
||||
$force_array = array( 'dateCreated' => 'dateTime.iso8601' );
|
||||
|
||||
$this->classApiServer->apiSendReply( $return_array, 0, $force_array );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLRPC_server::newPost()
|
||||
*
|
||||
* Post a new entry.
|
||||
*
|
||||
* @access public
|
||||
* @param int $blogid Blog ID
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @param array $content Post content
|
||||
* @param bool $publish Publish?
|
||||
* @return string xml
|
||||
**/
|
||||
public function newPost( $blogid, $username, $password, $content, $publish )
|
||||
{
|
||||
/* Authenticate */
|
||||
if ( $this->_authenticate( $username, $password ) )
|
||||
{
|
||||
/* Check the ID */
|
||||
if ( $this->blog['blog_id'] != $blogid )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->registry->class_localization->words['blogger_error_3'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* External blog? */
|
||||
if ( $this->blog['blog_type'] != 'local' )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, 'Cannot post to external blog' );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Compile the post */
|
||||
if ( ! $this->_compilePost( $content, $publish ) )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Insert the blog */
|
||||
$this->DB->insert( 'blog_entries', $this->entry );
|
||||
$entry_id = $this->DB->getInsertId();
|
||||
|
||||
/* Rebuild teh blog stats */
|
||||
$this->registry->blogFunctions->rebuildBlog( $this->blog['blog_id'] );
|
||||
|
||||
/* If the entry is published, do tracker and pings */
|
||||
if( $publish )
|
||||
{
|
||||
$this->blogTracker( $entry_id, $this->entry['entry_name'], $this->entry['entry'] );
|
||||
$this->blogPings ( $entry_id, $this->entry );
|
||||
}
|
||||
|
||||
/* Update Blog Stats */
|
||||
$r = $this->registry->cache()->getCache( 'blog_stats' );
|
||||
|
||||
$r['blog_stats']['stats_num_entries']++;
|
||||
$this->registry->cache()->setCache( 'blog_stats', $r, array( 'array' => 1, 'donow' => 1 ) );
|
||||
|
||||
$this->classApiServer->apiSendReply( $entry_id );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLRPC_server::editPost()
|
||||
*
|
||||
* Edit the entry.
|
||||
*
|
||||
* @access public
|
||||
* @param int $postid Entry ID
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @param string $content Post content
|
||||
* @param bool $publish Publish?
|
||||
* @return string xml
|
||||
**/
|
||||
public function editPost( $postid, $username, $password, $content, $publish )
|
||||
{
|
||||
/* Authenticate request */
|
||||
if( $this->_authenticate( $username, $password ) )
|
||||
{
|
||||
/* Query the entry */
|
||||
$entry = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'blog_entries',
|
||||
'where' => 'entry_id = ' . intval( $postid )
|
||||
) );
|
||||
|
||||
/* Make sure we have an entry */
|
||||
if( ! $entry['entry_id'] )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, sprintf( $this->registry->class_localization->words['blogger_error_2'], intval( $postid ) ) );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Compile the post */
|
||||
if ( ! $this->_compilePost( $content, $publish ) )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Setup the new entry data */
|
||||
$this->entry['blog_id'] = $entry['blog_id'];
|
||||
$this->entry['entry_author_id'] = $entry['entry_author_id'];
|
||||
$this->entry['entry_author_name'] = $entry['entry_author_name'];
|
||||
$this->entry['entry_date'] = $entry['entry_date'];
|
||||
$this->entry['entry_last_update'] = $entry['entry_last_update'];
|
||||
$this->entry['entry_edit_time'] = time();
|
||||
$this->entry['entry_edit_name'] = $this->memberData['members_display_name'];
|
||||
$this->entry['entry_poll_state'] = $entry['entry_poll_state'];
|
||||
|
||||
/* Update the entry */
|
||||
$this->DB->update( 'blog_entries', $this->entry, 'entry_id='.$entry['entry_id'] );
|
||||
|
||||
/* Rebuild the blog */
|
||||
$this->registry->blogFunctions->rebuildBlog ( $this->blog['blog_id'] );
|
||||
|
||||
/* Send Response */
|
||||
$this->classApiServer->apiSendReply();
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLRPC_server::getPost()
|
||||
*
|
||||
* Get an entry.
|
||||
*
|
||||
* @access public
|
||||
* @param int $postid Entry ID
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @return string xml
|
||||
**/
|
||||
public function getPost( $postid, $username, $password )
|
||||
{
|
||||
/* Authenticate the request */
|
||||
if( $this->_authenticate( $username, $password ) )
|
||||
{
|
||||
/* Query the blog entry */
|
||||
$entry = $this->DB->buildAndFetch( array(
|
||||
'select' => 'e.*',
|
||||
'from' => array( 'blog_entries' => 'e' ),
|
||||
'where' => 'e.entry_id = ' . intval( $postid ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'm.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=e.entry_author_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
/* Make sure we found an entry */
|
||||
if( ! $entry['entry_id'] )
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, sprintf( $this->registry->class_localization->words['blogger_error_2'], intval($postid) ) );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Tags */
|
||||
$this->DB->build( array( 'select' => 'tag', 'from' => 'tags_index', 'where' => "app='blog' AND type_id={$entry['entry_id']} AND type_id_2={$entry['blog_id']}" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$tags = array();
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$tags[] = $r['tag'];
|
||||
}
|
||||
|
||||
/* Setup the parser */
|
||||
IPSText::getTextClass('parser')->parse_html = $entry['entry_html_state'] ? 1 : 0;
|
||||
IPSText::getTextClass('parser')->parse_wordwrap = $this->settings['post_wordwrap'];
|
||||
IPSText::getTextClass('parser')->parse_nl2br = $entry['entry_html_state'] == 2 ? 1 : 0;
|
||||
IPSText::getTextClass('parser')->parse_smilies = $entry['entry_use_emo'] ? 1: 0;
|
||||
IPSText::getTextClass('parser')->parsing_section = 'blog_entry';
|
||||
IPSText::getTextClass('parser')->parsing_mgroup = $entry['member_group_id'];
|
||||
IPSText::getTextClass('parser')->parsing_mgroup_others = $entry['member_group_id'];
|
||||
|
||||
/* Parse the entry */
|
||||
$entry['entry'] = IPSText::getTextClass('parser')->preDisplayParse( $entry['entry'] );
|
||||
|
||||
/* Build the return array */
|
||||
$return_array = array(
|
||||
'postid' => $entry['entry_id'],
|
||||
'dateCreated' => gmdate("Ymd\TH:i:s",$entry['entry_date']),
|
||||
'title' => $entry['entry_name'],
|
||||
'description' => $entry['entry'],
|
||||
'categories' => $tags
|
||||
);
|
||||
|
||||
$force_array = array( 'dateCreated' => 'dateTime.iso8601' );
|
||||
|
||||
/* Send Post */
|
||||
$this->classApiServer->apiSendReply( $return_array, 0, $force_array );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->classApiServer->apiSendError( 100, $this->error );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLRPC_server::newMediaObject()
|
||||
*
|
||||
* Post a new entry.
|
||||
*
|
||||
* @access public
|
||||
* @param int $blogid Blog ID
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @param array $file Uploaded file details
|
||||
* @return string xml
|
||||
**/
|
||||
public function newMediaObject( $blogid, $username, $password, $file )
|
||||
{
|
||||
/* We don't support this yet, just send a response */
|
||||
$this->classApiServer->apiSendReply();
|
||||
}
|
||||
|
||||
/**
|
||||
* _authenticate()
|
||||
*
|
||||
* Authenticates the username and password
|
||||
*
|
||||
* This will return
|
||||
* - false (Failed)
|
||||
* - true (Succes)
|
||||
*
|
||||
* @access private
|
||||
* @param string $username Username
|
||||
* @param string $password Password
|
||||
* @return boolean
|
||||
**/
|
||||
private function _authenticate( $username, $password )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Are they banned?
|
||||
//-----------------------------------------
|
||||
if ( is_array( $this->caches['banfilters'] ) and count( $this->caches['banfilters'] ) )
|
||||
{
|
||||
foreach ($this->caches['banfilters'] as $ip)
|
||||
{
|
||||
$ip = str_replace( '\*', '.*', preg_quote($ip, "/") );
|
||||
|
||||
if ( preg_match( "/^$ip$/", $this->member->ip_address ) )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_banned_msg'];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// load the member
|
||||
//-----------------------------------------
|
||||
$member = IPSMember::load( IPSText::parseCleanValue( $username ), 'extendedProfile', 'username' );
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_unknown_user'];
|
||||
return false;
|
||||
}
|
||||
|
||||
ips_MemberRegistry::setMember( $member['member_id'] );
|
||||
|
||||
//--------------------------------
|
||||
// Is the board offline?
|
||||
//--------------------------------
|
||||
|
||||
if ($this->settings['board_offline'] == 1)
|
||||
{
|
||||
if ($member['g_access_offline'] != 1)
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_board_offline'];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Temporarely banned?
|
||||
//-----------------------------------------
|
||||
if ( $member['temp_ban'] )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_suspended'];
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load the Blog
|
||||
//-----------------------------------------
|
||||
$this->registry->blogFunctions->buildPerms();
|
||||
|
||||
//-----------------------------------------
|
||||
// Users can have more than one blog - just
|
||||
// grab first one mysql returns
|
||||
//-----------------------------------------
|
||||
|
||||
$blog = $this->DB->buildAndFetch( array(
|
||||
'select' => 'blog_id, blog_name',
|
||||
'from' => 'blog_blogs',
|
||||
'where' => "member_id={$member['member_id']}"
|
||||
) );
|
||||
|
||||
if ( ! $blog['blog_id'] )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_noblog'];
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $this->blog = $this->registry->blogFunctions->loadBlog( $blog['blog_id'], 1 ) )
|
||||
{
|
||||
$this->error = $this->blog_std->error;
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Blog post permissions?
|
||||
//-----------------------------------------
|
||||
if ( !$this->blog['allow_entry'] )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_nopost'];
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Validate password?
|
||||
//-----------------------------------------
|
||||
if ( !$this->settings['blog_allow_xmlrpc'] or !$this->blog['blog_settings']['enable_xmlrpc'] )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_noxmlrpc'];
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( $this->blog['blog_settings']['xmlrpc_password'] != md5( IPSText::parseCleanValue( $password ) ) )
|
||||
{
|
||||
if ( isset( $this->blog['blog_settings']['xmlrpc_failedattempts'] ) && $this->blog['blog_settings']['xmlrpc_failedattempts'] > 5 )
|
||||
{
|
||||
$this->blog['blog_settings']['enable_xmlrpc'] = 0;
|
||||
$this->blog['blog_settings']['xmlrpc_failedattempts'] = 0;
|
||||
$blog_settings = serialize ( $this->blog['blog_settings'] );
|
||||
$this->DB->update( 'blog_blogs', array( 'blog_settings' => $blog_settings ), "blog_id = {$this->blog['blog_id']}" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->blog['blog_settings']['xmlrpc_failedattempts'] = isset( $this->blog['blog_settings']['xmlrpc_failedattempts'] ) ? intval($this->blog['blog_settings']['xmlrpc_failedattempts'])+1 : 1;
|
||||
$blog_settings = serialize ( $this->blog['blog_settings'] );
|
||||
$this->DB->update( 'blog_blogs', array( 'blog_settings' => $blog_settings ), "blog_id = {$this->blog['blog_id']}" );
|
||||
}
|
||||
$this->error = $this->registry->class_localization->words['blogger_inv_pass'];
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isset( $this->blog['blog_settings']['xmlrpc_failedattempts'] ) && $this->blog['blog_settings']['xmlrpc_failedattempts'] > 0 )
|
||||
{
|
||||
$this->blog['blog_settings']['xmlrpc_failedattempts'] = 0;
|
||||
$blog_settings = serialize ( $this->blog['blog_settings'] );
|
||||
$this->DB->update( 'blog_blogs', array( 'blog_settings' => $blog_settings ), "blog_id = {$this->blog['blog_id']}" );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set the member data
|
||||
//-----------------------------------------
|
||||
|
||||
$this->memberData = $member;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* _compilePost()
|
||||
*
|
||||
* Compiles a blog entry for inserting to the database
|
||||
*
|
||||
* @access private
|
||||
* @param array $content
|
||||
* @param bool $password
|
||||
* @return bool
|
||||
**/
|
||||
private function _compilePost( $content, $publish )
|
||||
{
|
||||
/* Set a default max post length, if we don't have one */
|
||||
$this->settings['blog_max_entry_length'] = $this->settings['blog_max_entry_length'] ? $this->settings['blog_max_entry_length'] : 2140000;
|
||||
|
||||
/* Check to make sure we have text for this entry */
|
||||
if( strlen( trim( IPSText::br2nl( $content['description'] ) ) ) < 1 )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_emptypost'];
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Check to make sure that the entry is not too long */
|
||||
if( strlen( $content['description'] ) > ( $this->settings['blog_max_entry_length'] * 1024 ) )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_toolong'];
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Check the title */
|
||||
$title = $this->pfCleanTopicTitle( $content['title'] );
|
||||
$title = IPSText::getTextClass( 'bbcode' )->stripBadWords( $title );
|
||||
|
||||
if( ! $title )
|
||||
{
|
||||
$this->error = $this->registry->class_localization->words['blogger_notitle'];
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Setup the parser */
|
||||
IPSText::getTextClass('parser')->parse_smilies = 1;
|
||||
IPSText::getTextClass('parser')->parse_html = 0;
|
||||
IPSText::getTextClass('parser')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('parser')->parsing_section = 'blog_entry';
|
||||
|
||||
/* Cleanup and parse the entry */
|
||||
$description = preg_replace( "#<br />(\r)?\n#is", "<br />", $content['description'] );
|
||||
|
||||
/* Time */
|
||||
$dte = time();
|
||||
|
||||
/* Set the entry */
|
||||
$this->entry = array(
|
||||
'blog_id' => $this->blog['blog_id'],
|
||||
'entry_author_id' => $this->memberData['member_id'],
|
||||
'entry_author_name' => $this->memberData['members_display_name'],
|
||||
'entry_date' => $dte,
|
||||
'entry_name' => $title,
|
||||
'entry' => IPSText::getTextClass('bbcode')->preDbParse( $description ),
|
||||
'entry_status' => ($publish ? 'published' : 'draft'),
|
||||
'entry_post_key' => md5(microtime()),
|
||||
'entry_html_state' => 0,
|
||||
'entry_use_emo' => 1,
|
||||
'entry_last_update' => $dte,
|
||||
'entry_gallery_album' => 0,
|
||||
'entry_poll_state' => 0,
|
||||
);
|
||||
|
||||
/* Check for parser errors */
|
||||
$testParse = IPSText::getTextClass('parser')->preDisplayParse( $description );
|
||||
|
||||
/* Set any parser errors */
|
||||
if( is_array( IPSText::getTextClass('parser')->error ) && count( IPSText::getTextClass('parser')->error ) > 0 )
|
||||
{
|
||||
$this->error = implode( " : ", IPSText::getTextClass('parser')->error );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean topic title
|
||||
*
|
||||
* @param string $title
|
||||
* @return string
|
||||
**/
|
||||
public function pfCleanTopicTitle($title="")
|
||||
{
|
||||
if( $this->settings['etfilter_shout'] )
|
||||
{
|
||||
if( function_exists('mb_convert_case') )
|
||||
{
|
||||
if( in_array( strtolower( $this->settings['gb_char_set'] ), array_map( 'strtolower', mb_list_encodings() ) ) )
|
||||
{
|
||||
$title = mb_convert_case( $title, MB_CASE_TITLE, $this->settings['gb_char_set'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$title = ucwords( mb_strtolower($title) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$title = ucwords( mb_strtolower($title) );
|
||||
}
|
||||
}
|
||||
|
||||
$title = IPSText::parseCleanValue( $title );
|
||||
|
||||
if( $this->settings['etfilter_punct'] )
|
||||
{
|
||||
$title = preg_replace( "/\?{1,}/" , "?" , $title );
|
||||
$title = preg_replace( "/(!){1,}/" , "!", $title );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// The DB column is 250 chars, so we need to do true mb_strcut, then fix broken HTML entities
|
||||
// This should be fine, as DB would do it regardless (cept we can fix the entities)
|
||||
//-----------------------------------------
|
||||
|
||||
$title = preg_replace( "/&(#{0,}([a-zA-Z0-9]+?)?)?$/", '', IPSText::mbsubstr( $title, 0, 250 ) );
|
||||
|
||||
$title = IPSText::stripAttachTag( $title );
|
||||
$title = str_replace( "<br />", "", $title );
|
||||
$title = trim( $title );
|
||||
|
||||
//$title = IPSText::getTextClass( 'bbcode' )->stripBadWords( $title );
|
||||
|
||||
return $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Blog tracker
|
||||
*
|
||||
* @param integer $entry_id
|
||||
* @param string $entry_name
|
||||
* @param string $entry
|
||||
* @return bool
|
||||
**/
|
||||
public function blogTracker( $entry_id="", $entry_name="", $entry="" )
|
||||
{
|
||||
if( $entry_id == "" )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// We will send these out immediatly (if published)
|
||||
//-----------------------------------------
|
||||
|
||||
$count = 0;
|
||||
$gotem = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'bt.tracker_id',
|
||||
'from' => array( 'blog_tracker' => 'bt' ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'm.name, m.email, m.member_id, m.language, m.last_activity, m.members_display_name, m.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "bt.member_id=m.member_id AND m.member_id <> {$this->memberData['member_id']}",
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'p.perm_type_id as auth_blog_id',
|
||||
'from' => array( 'permission_index' => 'p' ),
|
||||
'where' => "p.perm_type='blog' AND p.perm_type_id=bt.blog_id AND p.authorized_users LIKE '%,{$this->memberData['member_id']},%'",
|
||||
'type' => 'left'
|
||||
)
|
||||
),
|
||||
'where' => 'bt.blog_id=' . intval( $this->blog['blog_id'] ) . ' AND m.member_id IS NOT NULL'
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$gotem[ $r['member_id'] ] = $r;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Row, row and parse, parse
|
||||
//-----------------------------------------
|
||||
|
||||
if( count( $gotem ) )
|
||||
{
|
||||
/* Load teh blog templates */
|
||||
$this->lang->loadLanguageFile( array( 'public_emails' ), 'blog' );
|
||||
|
||||
foreach( $gotem as $r )
|
||||
{
|
||||
if( $this->blog['blog_view_level'] == 'private' || $this->blog['blog_settings']['category_cache'][$this->entry['category_id']]['category_type'] != 'public' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Mod?
|
||||
//-----------------------------------------
|
||||
$mod_canviewprivate = 0;
|
||||
if( count( $this->caches['blogmods'] ) )
|
||||
{
|
||||
$mgroups = explode( ',', $r['mgroup_others'] );
|
||||
foreach( $this->caches['blogmods'] as $i => $m )
|
||||
{
|
||||
if( ( $m['moderate_mg_id'] == $r['member_id'] && $m['moderate_type'] == 'member' ) or
|
||||
( $m['moderate_mg_id'] == $r['member_group_id'] && $m['moderate_type'] == 'group' ) or
|
||||
( in_array($m['moderate_mg_id'], $mgroups) && $m['moderate_type'] == 'group' ) )
|
||||
{
|
||||
$mod_canviewprivate = $m['moderate_can_view_private'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $this->blog['blog_view_level'] == 'private' && $r['member_id'] != $this->blog['member_id'] && $this->blog['blog_id'] != $r['auth_blog_id'] && ! $mod_canviewprivate )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( $this->blog['blog_view_level'] == 'privateclub' && $r['member_id'] != $this->blog['member_id'] && $this->blog['blog_id'] != $r['auth_blog_id'] && ! $mod_canviewprivate )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$r['language'] = $r['language'] ? $r['language'] : 'en';
|
||||
|
||||
IPSText::getTextClass('email')->getTemplate( 'subs_new_entry' );
|
||||
|
||||
IPSText::getTextClass('email')->buildMessage( array(
|
||||
'BLOG_ID' => $this->blog['blog_id'],
|
||||
'BLOG_NAME' => $this->blog['blog_name'],
|
||||
'ENTRY_ID' => $entry_id,
|
||||
'ENTRY_NAME' => $entry_name,
|
||||
'NAME' => $r['members_display_name'],
|
||||
'POSTER' => $this->memberData['members_display_name'],
|
||||
'ENTRY' => $entry,
|
||||
) );
|
||||
|
||||
//-----------------------------------------
|
||||
// If it is published, mail now, else put it in the tracker queue
|
||||
//-----------------------------------------
|
||||
if( $this->entry['entry_status'] == 'published' )
|
||||
{
|
||||
$this->DB->insert( 'mail_queue', array( 'mail_to' => $r['email'], 'mail_from' => '', 'mail_date' => time(), 'mail_subject' => $this->lang->words['bt_subject'], 'mail_content' => IPSText::getTextClass('email')->message ) );
|
||||
$count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->insert( 'blog_tracker_queue', array( 'blog_id' => $this->blog['blog_id'], 'entry_id' => $entry_id, 'tq_to' => $r['email'], 'tq_subject' => $this->lang->words['bt_subject'], 'tq_content' => IPSText::getTextClass('email')->message ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $count > 0 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Update cache with remaning email count
|
||||
//-----------------------------------------
|
||||
$cache = $this->caches['systemvars'];
|
||||
$cache['mail_queue'] += $count;
|
||||
$this->cache->setCache( 'systemvars', $cache, array( 'array' => 1 ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ping-e-dee-doo
|
||||
*
|
||||
* @param integer $entry_id
|
||||
* @param array $entry
|
||||
* @return void
|
||||
**/
|
||||
public function blogPings( $entry_id, $entry )
|
||||
{
|
||||
if ( $this->settings['blog_allow_pingblogs'] && is_array( $this->blog['blog_settings']['pings'] ) && count( $this->blog['blog_settings']['pings'] ) > 0 )
|
||||
{
|
||||
$ping_added = 0;
|
||||
foreach( $this->blog['blog_settings']['pings'] as $service => $enabled )
|
||||
{
|
||||
if( $enabled )
|
||||
{
|
||||
$updateping['ping_active'] = ( $entry['entry_status']=='published' ? 1 : 0 );
|
||||
$updateping['ping_time'] = time();
|
||||
$updateping['blog_id'] = $this->blog['blog_id'];
|
||||
$updateping['entry_id'] = $entry_id;
|
||||
$updateping['ping_service'] = $service;
|
||||
$this->DB->insert( 'blog_updatepings', $updateping );
|
||||
$ping_added = $updateping['ping_active'] ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
if( $ping_added )
|
||||
{
|
||||
// activate task
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/class_taskmanager.php' );
|
||||
$task = new class_taskmanager( $this->registry );
|
||||
|
||||
$this_task = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'task_manager', 'where' => "task_key='blogpings'" ) );
|
||||
$newdate = $task->generateNextRun($this_task);
|
||||
$this->DB->update( 'task_manager', array( 'task_next_run' => $newdate, 'task_enabled' => 1 ), "task_id=".$this_task['task_id'] );
|
||||
$task->saveNextRunStamp();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,111 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Blog XMLRPC Interface
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Blog
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Script type
|
||||
*
|
||||
*/
|
||||
define( 'IPB_THIS_SCRIPT', 'api' );
|
||||
define( 'IPB_LOAD_SQL' , 'queries' );
|
||||
|
||||
/**
|
||||
* Matches IP address of requesting API
|
||||
* Set to 0 to not match with IP address
|
||||
*/
|
||||
define( 'CVG_IP_MATCH', 1 );
|
||||
|
||||
require_once( '../../initdata.php' );
|
||||
|
||||
//===========================================================================
|
||||
// MAIN PROGRAM
|
||||
//===========================================================================
|
||||
|
||||
define( 'IPS_CLASS_PATH', IPS_ROOT_PATH . 'sources/classes/' );
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up cookie stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$registry = ipsRegistry::instance();
|
||||
$registry->init();
|
||||
|
||||
IPSCookie::$sensitive_cookies = array( 'session_id', 'ipb_admin_session_id', 'member_id', 'pass_hash' );
|
||||
|
||||
//--------------------------------
|
||||
// Set up our vars
|
||||
//--------------------------------
|
||||
|
||||
$registry->DB()->obj['use_shutdown'] = 0;
|
||||
|
||||
//--------------------------------
|
||||
// Set debug mode
|
||||
//--------------------------------
|
||||
|
||||
$registry->DB()->setDebugMode( ipsRegistry::$settings['sql_debug'] == 1 ? intval($_GET['debug']) : 0 );
|
||||
|
||||
//===========================================================================
|
||||
// Create the XML-RPC Server
|
||||
//===========================================================================
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classApiServer.php' );
|
||||
$server = new classApiServer();
|
||||
$api = $server->decodeRequest();
|
||||
|
||||
//===========================================================================
|
||||
// Define Service
|
||||
//===========================================================================
|
||||
|
||||
$valid_api = 0;
|
||||
|
||||
switch( $api )
|
||||
{
|
||||
case 'blogger':
|
||||
$valid_api = 1;
|
||||
break;
|
||||
|
||||
case 'wp':
|
||||
case 'metaWeblog':
|
||||
$api = 'metaWeblog';
|
||||
$valid_api = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if( $valid_api )
|
||||
{
|
||||
require_once( DOC_IPS_ROOT_PATH . 'interface/blog/apis/server_' . strtolower( $api ) . '.php' );
|
||||
|
||||
$webservice = new xmlrpc_server( $registry );
|
||||
$webservice->classApiServer =& $server;
|
||||
|
||||
$server->addObjectMap( $webservice, 'UTF-8' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Process....
|
||||
//-----------------------------------------
|
||||
$server->getXmlRpc();
|
||||
}
|
||||
else
|
||||
{
|
||||
$server->apiSendError( 100, "Requested API not found" );
|
||||
}
|
||||
|
||||
exit;
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------
|
||||
// Get stuff we need
|
||||
//-----------------------------------------
|
||||
|
||||
define( 'IPB_THIS_SCRIPT', 'api' );
|
||||
define( 'IPB_LOAD_SQL' , 'queries' );
|
||||
|
||||
require_once( '../../initdata.php' );
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
|
||||
$registry = ipsRegistry::instance();
|
||||
$registry->init();
|
||||
|
||||
$id = intval(ipsRegistry::$request['id']);
|
||||
$member = IPSMember::load( $id );
|
||||
$avatar = IPSMember::buildAvatar( $member );
|
||||
|
||||
//-----------------------------------------
|
||||
// Print avatar
|
||||
//-----------------------------------------
|
||||
|
||||
print <<<HTML
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
</head>
|
||||
<body>{$avatar}</body>
|
||||
</html>
|
||||
HTML;
|
||||
|
||||
exit;
|
||||
@@ -3,17 +3,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Remote API integration gateway file
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-03-11 12:41:48 -0500 (Fri, 11 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8042 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,14 +30,14 @@ define( 'IPB_LOAD_SQL' , 'queries' );
|
||||
*/
|
||||
define( 'CVG_IP_MATCH', 1 );
|
||||
|
||||
require_once( '../../initdata.php' );
|
||||
require_once( '../../initdata.php' );/*noLibHook*/
|
||||
|
||||
//===========================================================================
|
||||
// MAIN PROGRAM
|
||||
//===========================================================================
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up cookie stuff
|
||||
@@ -95,7 +95,7 @@ if ( ! ipsRegistry::$settings['xmlrpc_enable'] )
|
||||
// Define Service
|
||||
//===========================================================================
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classApiServer.php' );
|
||||
require_once( IPS_KERNEL_PATH . 'classApiServer.php' );/*noLibHook*/
|
||||
|
||||
//===========================================================================
|
||||
// Create the XML-RPC Server
|
||||
@@ -110,9 +110,9 @@ $user = IPSText::md5Clean( $server->params['api_key']);
|
||||
// Check for module
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $module AND file_exists( DOC_IPS_ROOT_PATH . 'interface/board/modules/' . $module . '/api.php' ) )
|
||||
if ( $module AND is_file( DOC_IPS_ROOT_PATH . 'interface/board/modules/' . $module . '/api.php' ) )
|
||||
{
|
||||
require_once( DOC_IPS_ROOT_PATH . 'interface/board/modules/' . $module . '/api.php' );
|
||||
require_once( DOC_IPS_ROOT_PATH . 'interface/board/modules/' . $module . '/api.php' );/*noLibHook*/
|
||||
|
||||
$webservice = new API_Server( $registry );
|
||||
$webservice->classApiServer =& $server;
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Remote API integration gateway file
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-03-11 12:41:48 -0500 (Fri, 11 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8042 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -25,14 +25,14 @@ define( 'IPB_THIS_SCRIPT', 'api' );
|
||||
define( 'IPB_LOAD_SQL' , 'queries' );
|
||||
define( 'IPS_PUBLIC_SCRIPT', 'index.php' );
|
||||
|
||||
require_once( '../../initdata.php' );
|
||||
require_once( '../../initdata.php' );/*noLibHook*/
|
||||
|
||||
//===========================================================================
|
||||
// MAIN PROGRAM
|
||||
//===========================================================================
|
||||
//-----------------------------------------
|
||||
// Main code
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
$_GET['app'] = 'core';
|
||||
$_REQUEST['app'] = 'core';
|
||||
@@ -40,6 +40,12 @@ $_GET['module'] = 'global';
|
||||
$_GET['section'] = 'login';
|
||||
$_GET['do'] = 'process';
|
||||
|
||||
//-----------------------------------------
|
||||
// Ignore auth key for live requests
|
||||
//-----------------------------------------
|
||||
|
||||
define( 'IGNORE_AUTH_KEY', true );
|
||||
|
||||
ipsController::run();
|
||||
|
||||
exit();
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,17 +3,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Remote API Server
|
||||
* Last Updated: $Date: 2010-10-23 08:40:34 -0400 (Sat, 23 Oct 2010) $
|
||||
* 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 http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7023 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -22,7 +22,6 @@ class API_Server
|
||||
/**
|
||||
* Defines the service for WSDL
|
||||
*
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $__dispatch_map = array();
|
||||
@@ -30,15 +29,13 @@ class API_Server
|
||||
/**
|
||||
* IPS Global Class
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $registry;
|
||||
protected $registry;
|
||||
|
||||
/**
|
||||
* IPS API SERVER Class
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
public $classApiServer;
|
||||
@@ -46,9 +43,8 @@ class API_Server
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
@@ -62,7 +58,7 @@ class API_Server
|
||||
// list
|
||||
//-----------------------------------------
|
||||
$ALLOWED_METHODS = array();
|
||||
require_once( DOC_IPS_ROOT_PATH . 'interface/board/modules/ipb/methods.php' );
|
||||
require_once( DOC_IPS_ROOT_PATH . 'interface/board/modules/ipb/methods.php' );/*noLibHook*/
|
||||
|
||||
if ( is_array( $ALLOWED_METHODS ) and count( $ALLOWED_METHODS ) )
|
||||
{
|
||||
@@ -76,12 +72,11 @@ class API_Server
|
||||
/**
|
||||
* Returns the list of online users
|
||||
*
|
||||
* @access public
|
||||
* @param string $api_key Authentication Key
|
||||
* @param string $api_module Module
|
||||
* @param string $sep_character Separator character
|
||||
* @return string xml
|
||||
**/
|
||||
*/
|
||||
public function fetchOnlineUsers( $api_key, $api_module, $sep_character=',' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
@@ -97,9 +92,9 @@ class API_Server
|
||||
|
||||
if ( $this->__authenticate( $api_key, $api_module, 'fetchOnlineUsers' ) !== FALSE )
|
||||
{
|
||||
if ( !$this->settings['au_cutoff'] )
|
||||
if ( !ipsRegistry::$settings['au_cutoff'] )
|
||||
{
|
||||
$this->settings[ 'au_cutoff'] = 15 ;
|
||||
ipsRegistry::$settings[ 'au_cutoff'] = 15 ;
|
||||
}
|
||||
|
||||
$cut_off = ipsRegistry::$settings['au_cutoff'] * 60;
|
||||
@@ -148,18 +143,7 @@ class API_Server
|
||||
|
||||
if ( ! $cached[ $result['member_name'] ] )
|
||||
{
|
||||
if ( ipsRegistry::$settings['spider_anon'] )
|
||||
{
|
||||
if ( $this->registry->member()->getProperty('g_access_cp') )
|
||||
{
|
||||
$active['NAMES'][] = $result['member_name'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$active['NAMES'][] = $result['member_name'];
|
||||
}
|
||||
|
||||
$active['NAMES'][] = $result['member_name'];
|
||||
$cached[ $result['member_name'] ] = 1;
|
||||
}
|
||||
else
|
||||
@@ -191,11 +175,11 @@ class API_Server
|
||||
{
|
||||
$cached[ $result['member_id'] ] = 1;
|
||||
|
||||
$result['member_name'] = IPSLib::makeNameFormatted( $result['member_name'], $result['member_group'] );
|
||||
$result['member_name'] = IPSMember::makeNameFormatted( $result['member_name'], $result['member_group'] );
|
||||
|
||||
if ( ! ipsRegistry::$settings['disable_anonymous'] AND $result['login_type'] )
|
||||
{
|
||||
if ( $this->registry->member()->getProperty('g_access_cp') and (ipsRegistry::$settings['disable_admin_anon'] != 1) )
|
||||
if ( $this->registry->member()->getProperty('g_access_cp') )
|
||||
{
|
||||
$active['NAMES'][] = "<a href='" . $this->registry->getClass('output')->buildSEOUrl( "showuser={$result['member_id']}", 'public', $result['seo_name'], 'showuser' ) . "' title='$last_date'>{$result['member_name']}</a>*";
|
||||
$active['ANON']++;
|
||||
@@ -228,7 +212,6 @@ class API_Server
|
||||
/**
|
||||
* Returns details about the board
|
||||
*
|
||||
* @access public
|
||||
* @param string $api_key Authentication Key
|
||||
* @param string $api_module Module
|
||||
* @return string xml
|
||||
@@ -278,7 +261,6 @@ class API_Server
|
||||
/**
|
||||
* Returns hello board test
|
||||
*
|
||||
* @access public
|
||||
* @param string $api_key Authentication Key
|
||||
* @param string $api_module Module
|
||||
* @return string xml
|
||||
@@ -320,7 +302,7 @@ class API_Server
|
||||
'upload_url' => ipsRegistry::$settings['upload_url'],
|
||||
'ipb_img_url' => ipsRegistry::$settings['ipb_img_url'],
|
||||
'board_human_version' => $latest_version['upgrade_version_human'],
|
||||
'board_long_version' => ( isset($latest_version['upgrade_notes']) AND $latest_version['upgrade_notes'] ) ? $latest_version['upgrade_notes'] : ipsRegistry::$vn_full ) );
|
||||
'board_long_version' => !empty($latest_version['upgrade_notes']) ? $latest_version['upgrade_notes'] : ipsRegistry::$vn_full ) );
|
||||
|
||||
exit();
|
||||
}
|
||||
@@ -329,7 +311,6 @@ class API_Server
|
||||
/**
|
||||
* Posts a topic to the board remotely
|
||||
*
|
||||
* @access public
|
||||
* @param string $api_key Authentication Key
|
||||
* @param string $api_module Module
|
||||
* @param string $member_field Member field to check (valid: "id", "email", "username", "displayname")
|
||||
@@ -351,7 +332,6 @@ class API_Server
|
||||
$member_field = IPSText::parseCleanValue( $member_field );
|
||||
$member_key = IPSText::parseCleanValue( $member_key );
|
||||
$topic_title = IPSText::parseCleanValue( $topic_title );
|
||||
$topic_description = IPSText::parseCleanValue( $topic_description );
|
||||
$forum_id = intval( $forum_id );
|
||||
$UNCLEANED_post_content = $post_content;
|
||||
|
||||
@@ -393,10 +373,9 @@ class API_Server
|
||||
// Get some classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php' );
|
||||
$appClass = new app_class_forums( $this->registry );
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPost.php' );
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPost.php' );/*noLibHook*/
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' );
|
||||
$_postClass = new $classToLoad( $this->registry );
|
||||
|
||||
@@ -419,8 +398,7 @@ class API_Server
|
||||
'post_htmlstatus' => 0,
|
||||
'enableTracker' => 0 ) );
|
||||
$_postClass->setTopicTitle( $topic_title );
|
||||
$_postClass->setTopicDescription( $topic_description );
|
||||
|
||||
|
||||
# Switch off perm checks
|
||||
$_postClass->setBypassPermissionCheck(true);
|
||||
/**
|
||||
@@ -449,7 +427,6 @@ class API_Server
|
||||
/**
|
||||
* Posts a topic reply
|
||||
*
|
||||
* @access public
|
||||
* @param string $api_key Authentication Key
|
||||
* @param string $api_module Module
|
||||
* @param string $member_field Member field to check (valid: "id", "email", "username", "displayname")
|
||||
@@ -509,10 +486,9 @@ class API_Server
|
||||
// Get some classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php' );
|
||||
$appClass = new app_class_forums( $this->registry );
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPost.php' );
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPost.php' );/*noLibHook*/
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' );
|
||||
$_postClass = new $classToLoad( $this->registry );
|
||||
|
||||
@@ -569,7 +545,6 @@ class API_Server
|
||||
/**
|
||||
* Returns a member
|
||||
*
|
||||
* @access public
|
||||
* @param string $api_key Authentication Key
|
||||
* @param string $api_module Module
|
||||
* @param string $search_type Member field to check (valid: "id", "email", "username", "displayname")
|
||||
@@ -629,7 +604,6 @@ class API_Server
|
||||
/**
|
||||
* Check if a member exists
|
||||
*
|
||||
* @access public
|
||||
* @param string $api_key Authentication Key
|
||||
* @param string $api_module Module
|
||||
* @param string $search_type Member field to check (valid: "id", "email", "username", "displayname")
|
||||
@@ -681,7 +655,6 @@ class API_Server
|
||||
* Fetch the forum options list.
|
||||
* WARNING: Last two options are deprecated and no longer supported. All viewable forums returned. User is automatically treated like a guest.
|
||||
*
|
||||
* @access public
|
||||
* @param string $api_key Authentication Key
|
||||
* @param string $api_module Module
|
||||
* @param string $selected_forum_ids Comma separated list of forum ids
|
||||
@@ -720,8 +693,7 @@ class API_Server
|
||||
// Get some classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php' );
|
||||
$appClass = new app_class_forums( $this->registry );
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Fetch forum list
|
||||
@@ -742,7 +714,6 @@ class API_Server
|
||||
* Returns the board's forums.
|
||||
* WARNING: Last option is deprecated and no longer supported. User is automatically treated like a guest.
|
||||
*
|
||||
* @access public
|
||||
* @param string $api_key Authentication Key
|
||||
* @param string $api_module Module
|
||||
* @param string $forum_ids Comma separated list of forum ids
|
||||
@@ -783,8 +754,7 @@ class API_Server
|
||||
// Get some classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php' );
|
||||
$appClass = new app_class_forums( $this->registry );
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Fetch forum list
|
||||
@@ -809,7 +779,6 @@ class API_Server
|
||||
/**
|
||||
* Returns topics based on request params
|
||||
*
|
||||
* @access public
|
||||
* @param string $api_key Authentication Key
|
||||
* @param string $api_module Module
|
||||
* @param string $forum_ids Comma separated list of forum ids
|
||||
@@ -858,8 +827,8 @@ class API_Server
|
||||
// Get API classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . '/api/forums/api_topic_view.php' );
|
||||
$topic_view = new apiTopicView();
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/api/forums/api_topic_view.php', 'apiTopicView' );
|
||||
$topic_view = new $classToLoad();
|
||||
|
||||
//-----------------------------------------
|
||||
// Fetch topic list
|
||||
@@ -881,26 +850,10 @@ class API_Server
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Has to return at least the member ID, member log in key and session ID
|
||||
*
|
||||
* @access private
|
||||
* @param array $member Array of member information
|
||||
* @return array $session Session information
|
||||
* @deprecated Session is automatically created via instantiating ipsRegistry
|
||||
*/
|
||||
private function __create_user_session( $member )
|
||||
{
|
||||
return $this->registry->member()->fetchMemberData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Routine to create a local user account
|
||||
*
|
||||
* @access protected
|
||||
* @param string $email_address Email address of user logged in
|
||||
* @param string $md5_once_password The plain text password, hashed once
|
||||
* @param string $ip_address IP Address of registree
|
||||
@@ -950,7 +903,6 @@ class API_Server
|
||||
/**
|
||||
* Checks to see if the request is allowed
|
||||
*
|
||||
* @access protected
|
||||
* @param string $api_key Authenticate Key
|
||||
* @param string $api_module Module
|
||||
* @param string $api_function Function
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Remote API Server configuration
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2010-12-17 08:16:34 -0500 (Fri, 17 Dec 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 7447 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,17 +3,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Defines the allowed methods a remote server may request and the in/out parameters
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2010-12-17 08:16:34 -0500 (Fri, 17 Dec 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 7447 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,39 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
</head>
|
||||
<body id="parentBody"></body>
|
||||
<script type='text/javascript'>
|
||||
var localLastMessage = '';
|
||||
|
||||
function localForwardMessage( data )
|
||||
{
|
||||
var message = data ? data : document.location.hash;
|
||||
|
||||
if (message.length > 0)
|
||||
{
|
||||
message = message.substr(1);
|
||||
top.ipb.chat.handleMessageFromChild(message);
|
||||
}
|
||||
}
|
||||
|
||||
function checkLocalLocation()
|
||||
{
|
||||
var message = document.location.hash;
|
||||
|
||||
if( message != localLastMessage )
|
||||
{
|
||||
localLastMessage = message;
|
||||
|
||||
localForwardMessage();
|
||||
}
|
||||
|
||||
setTimeout( "checkLocalLocation()", 500 );
|
||||
}
|
||||
|
||||
setTimeout( "checkLocalLocation()", 500 );
|
||||
|
||||
//Event.observe( window, 'resize', forwardMessage );
|
||||
</script>
|
||||
</html>
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,15 +3,15 @@
|
||||
/**
|
||||
* Invision Power Services
|
||||
* Incoming Email Handler - Piping
|
||||
* Last Updated: $Date: 2010-10-13 09:41:52 -0400 (Wed, 13 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-08-23 10:24:47 -0400 (Tue, 23 Aug 2011) $
|
||||
*
|
||||
* @author $Author: mark $
|
||||
* @copyright (c) 2010 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 12th February 2010
|
||||
* @version $Revision: 6968 $
|
||||
* @version $Revision: 9404 $
|
||||
*/
|
||||
|
||||
$writeDebug = FALSE;
|
||||
@@ -20,11 +20,15 @@
|
||||
//--------------------------------------
|
||||
// Init
|
||||
//--------------------------------------
|
||||
|
||||
$root = $_SERVER['argv'][0] ? $_SERVER['argv'][0] : $_SERVER['SCRIPT_FILENAME'];
|
||||
define( 'DOC_IPS_ROOT_PATH', str_replace( 'interface/email/piping.php', '', $root ) );
|
||||
|
||||
$root = isset( $_SERVER['argv'][0] ) ? $_SERVER['argv'][0] : $_SERVER['SCRIPT_FILENAME'];
|
||||
define( '_DOC_IPS_ROOT_PATH', str_replace( 'interface/email/piping.php', '', $root ) );
|
||||
|
||||
require_once( DOC_IPS_ROOT_PATH . "initdata.php" );
|
||||
$INFO = array();
|
||||
require_once( _DOC_IPS_ROOT_PATH . 'conf_global.php' );/*noLibHook*/
|
||||
define( 'BASE_URL', $INFO['board_url'] );
|
||||
|
||||
require_once( _DOC_IPS_ROOT_PATH . 'initdata.php' );/*noLibHook*/
|
||||
define( 'IPS_ROOT_PATH', DOC_IPS_ROOT_PATH . CP_DIRECTORY . '/' );
|
||||
define( 'IPS_KERNEL_PATH', DOC_IPS_ROOT_PATH . "ips_kernel/" );
|
||||
|
||||
@@ -41,8 +45,11 @@
|
||||
file_put_contents( $debugPath, $email );
|
||||
}
|
||||
|
||||
require_once ( IPS_KERNEL_PATH . 'classIncomingEmail.php' );
|
||||
require_once ( IPS_KERNEL_PATH . 'classIncomingEmail.php' );/*noLibHook*/
|
||||
$incomingEmail = new classIncomingEmail( $email );
|
||||
$incomingEmail->route();
|
||||
if ( !$incomingEmail->ignore )
|
||||
{
|
||||
@$incomingEmail->route();
|
||||
}
|
||||
|
||||
exit();
|
||||
Whitespace-only changes.
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,33 +2,33 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Main public executable wrapper.
|
||||
* Set-up and load module to run
|
||||
* Last Updated: $Date: 2010-06-25 06:36:57 -0400 (Fri, 25 Jun 2010) $
|
||||
* Last Updated: $Date: 2011-07-27 20:58:18 -0400 (Wed, 27 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2008 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6574 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9327 $
|
||||
*
|
||||
*/
|
||||
|
||||
define( 'IPS_ENFORCE_ACCESS', TRUE );
|
||||
define( 'IPB_THIS_SCRIPT', 'public' );
|
||||
require_once( '../../initdata.php' );
|
||||
require_once( '../../initdata.php' );/*noLibHook*/
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
$registry = ipsRegistry::instance();
|
||||
$registry->init();
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php' );
|
||||
$facebook = new facebook_connect( $registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' );
|
||||
$facebook = new $classToLoad( $registry );
|
||||
|
||||
/* IPB fiddles with CODE to make it DO */
|
||||
if ( ! $_REQUEST['code'] AND $_REQUEST['do'] )
|
||||
@@ -66,12 +66,12 @@ if ( $_REQUEST['code'] )
|
||||
switch( $msg )
|
||||
{
|
||||
default:
|
||||
$registry->getClass('output')->showError( 'fb_ohnoes', 999990, null, null, 403 );
|
||||
$registry->getClass('output')->showError( 'fb_ohnoes', 1090091, null, null, 403 );
|
||||
break;
|
||||
case 'FACEBOOK_NOT_SET_UP':
|
||||
$registry->getClass('output')->showError( 'fb_not_on', 999991, null, null, 403 );
|
||||
$registry->getClass('output')->showError( 'fb_not_on', 1090092, null, null, 403 );
|
||||
case 'NOT_REMOTE_MEMBER':
|
||||
$registry->getClass('output')->showError( 'fb_not_remote', 999992, null, null, 403 );
|
||||
$registry->getClass('output')->showError( 'fb_not_remote', 1090093, null, null, 403 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* IP.Board v3.2.3
|
||||
* Last Updated: $LastChangedDate: 2011-03-31 06:17:44 -0400 (Thu, 31 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 3.0.0
|
||||
* @version $Rev: 5713 $
|
||||
* @version $Rev: 8229 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* IP.Board v3.2.3
|
||||
* Last Updated: $LastChangedDate: 2011-03-31 06:17:44 -0400 (Thu, 31 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 3.0.0
|
||||
* @version $Rev: 5713 $
|
||||
* @version $Rev: 8229 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
+204
-222
@@ -2,32 +2,33 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Mobile API
|
||||
* Last Updated: $Date: 2010-08-11 11:54:57 -0400 (Wed, 11 Aug 2010) $
|
||||
* Last Updated: $Date: 2011-07-07 16:40:12 -0400 (Thu, 07 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: mat $
|
||||
* @copyright (c) 2001 - 2008 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6743 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9182 $
|
||||
*
|
||||
*/
|
||||
|
||||
define( 'IPS_IS_MOBILE_APP', true );
|
||||
define( 'IPB_THIS_SCRIPT', 'public' );
|
||||
require_once( '../../initdata.php' );
|
||||
|
||||
require_once( '../../initdata.php' );/*noLibHook*/
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
class mobileApiRequest
|
||||
{
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
@@ -43,9 +44,8 @@ class mobileApiRequest
|
||||
/**
|
||||
* Make the registry shortcuts
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -64,8 +64,7 @@ class mobileApiRequest
|
||||
/**
|
||||
* Figure out what api is being called
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function dispatch()
|
||||
{
|
||||
@@ -103,6 +102,14 @@ class mobileApiRequest
|
||||
$this->_handlePostStatus();
|
||||
break;
|
||||
|
||||
case 'postTopic':
|
||||
$this->_handlePostTopic();
|
||||
break;
|
||||
|
||||
case 'postReply':
|
||||
$this->_handlePostReply();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->_invalidApi();
|
||||
break;
|
||||
@@ -140,7 +147,7 @@ class mobileApiRequest
|
||||
$_data = $notifyLibrary->fetchUnreadNotifications( 10, 'notify_sent', 'DESC', $unreadOnly, true );
|
||||
|
||||
/* XML Parser */
|
||||
require_once( IPS_KERNEL_PATH . 'classXML.php' );
|
||||
require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/
|
||||
$xml = new classXML( 'utf-8' );
|
||||
$xml->newXMLDocument();
|
||||
|
||||
@@ -192,7 +199,7 @@ class mobileApiRequest
|
||||
$notifyLibrary->setMember( $this->memberData );
|
||||
|
||||
/* Notifications Data */
|
||||
$_notifyConfig = $notifyLibrary->getMemberNotificationConfig();
|
||||
$_notifyConfig = $notifyLibrary->getMemberNotificationConfig( $this->memberData );
|
||||
|
||||
if( $notifyStatus )
|
||||
{
|
||||
@@ -241,7 +248,7 @@ class mobileApiRequest
|
||||
}
|
||||
|
||||
/* Check to see if notifications are enabled */
|
||||
if( ! IPSLib::canReceiveMobileNotifications() )
|
||||
if( ! IPSMember::canReceiveMobileNotifications() )
|
||||
{
|
||||
$this->_returnError( "You are not authorized to receive mobile notifications" );
|
||||
}
|
||||
@@ -261,7 +268,7 @@ class mobileApiRequest
|
||||
protected function _handleNotificationTypes()
|
||||
{
|
||||
/* Check to see if notifications are enabled */
|
||||
if( ! IPSLib::canReceiveMobileNotifications() )
|
||||
if( ! IPSMember::canReceiveMobileNotifications() )
|
||||
{
|
||||
$this->_returnError( "You are not authorized to receive mobile notifications" );
|
||||
}
|
||||
@@ -277,7 +284,7 @@ class mobileApiRequest
|
||||
/* Options */
|
||||
$_basicOptions = array( array( 'email', $this->lang->words['notopt__email'] ), array( 'pm', $this->lang->words['notopt__pm'] ), array( 'inline', $this->lang->words['notopt__inline'] ), array( 'mobile', $this->lang->words['notopt__mobile'] ) );
|
||||
$_configOptions = $notifyLibrary->getNotificationData( TRUE );
|
||||
$_notifyConfig = $notifyLibrary->getMemberNotificationConfig();
|
||||
$_notifyConfig = $notifyLibrary->getMemberNotificationConfig( $this->memberData );
|
||||
$_defaultConfig = $notifyLibrary->getDefaultNotificationConfig();
|
||||
$_formOptions = array();
|
||||
|
||||
@@ -326,7 +333,7 @@ class mobileApiRequest
|
||||
|
||||
//$_formOptions[ $option['key'] ]['options'] = $_available;
|
||||
|
||||
$_formOptions[ $option['key'] ]['defaults'] = $_thisConfig['selected'];
|
||||
$_formOptions[ $option['key'] ]['defaults'] = is_array($_thisConfig['selected']) ? $_thisConfig['selected'] : array();
|
||||
$_formOptions[ $option['key'] ]['disabled'] = 0;
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -337,7 +344,7 @@ class mobileApiRequest
|
||||
if( $_defaultConfig[ $option['key'] ]['disable_override'] )
|
||||
{
|
||||
$_formOptions[ $option['key'] ]['disabled'] = 1;
|
||||
$_formOptions[ $option['key'] ]['defaults'] = $_defaultConfig[ $option['key'] ]['selected'];
|
||||
$_formOptions[ $option['key'] ]['defaults'] = is_array($_defaultConfig[ $option['key'] ]['selected']) ? $_defaultConfig[ $option['key'] ]['selected'] : array();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,7 +357,7 @@ class mobileApiRequest
|
||||
);
|
||||
|
||||
/* XML Parser */
|
||||
require_once( IPS_KERNEL_PATH . 'classXML.php' );
|
||||
require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/
|
||||
$xml = new classXML( 'utf-8' );
|
||||
$xml->newXMLDocument();
|
||||
|
||||
@@ -423,6 +430,12 @@ class mobileApiRequest
|
||||
*/
|
||||
protected function _handleLogin()
|
||||
{
|
||||
/* 3.2 upwards renames these fields, but since we do this prior to getting capabilities, we don't know version yet */
|
||||
$this->request['ips_username'] = ipsRegistry::$request['ips_username'] = $this->request['username'];
|
||||
$_REQUEST['ips_username'] = $_REQUEST['username'];
|
||||
$this->request['ips_password'] = ipsRegistry::$request['ips_password'] = $this->request['password'];
|
||||
$_REQUEST['ips_password'] = $_REQUEST['password'];
|
||||
|
||||
/* Load the login handler */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
|
||||
$this->han_login = new $classToLoad( $this->registry );
|
||||
@@ -447,6 +460,8 @@ class mobileApiRequest
|
||||
'facebook' => IPSLib::fbc_enabled() && $this->han_login->member_data['fb_uid'] ? '1' : '0',
|
||||
'twitter' => IPSLib::twitter_enabled() && $this->han_login->member_data['twitter_id'] ? '1' : '0',
|
||||
'albums' => $this->_userAlbums( $this->han_login->member_data ),
|
||||
'version_id' => ipsRegistry::$vn_full,
|
||||
'version_text' => ipsRegistry::$version,
|
||||
'form_hash' => md5( $this->han_login->member_data['email'].'&'.$this->han_login->member_data['member_login_key'].'&'.$this->han_login->member_data['joined'] )
|
||||
) );
|
||||
}
|
||||
@@ -460,7 +475,7 @@ class mobileApiRequest
|
||||
protected function _userEnabledNotifications( $memberData )
|
||||
{
|
||||
/* Check to see if notifications are enabled */
|
||||
if( ! IPSLib::canReceiveMobileNotifications( $memberData ) )
|
||||
if( ! IPSMember::canReceiveMobileNotifications( $memberData ) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -507,8 +522,8 @@ class mobileApiRequest
|
||||
/* Load status class */
|
||||
if ( ! $this->registry->isClassLoaded( 'memberStatus' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/member/status.php' );
|
||||
$this->registry->setClass( 'memberStatus', new memberStatus( ipsRegistry::instance() ) );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' );
|
||||
$this->registry->setClass( 'memberStatus', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
return $this->registry->getClass('memberStatus')->canCreate( $memberData ) ? '1' : '0';
|
||||
@@ -522,41 +537,25 @@ class mobileApiRequest
|
||||
*/
|
||||
protected function _userAlbums( $memberData )
|
||||
{
|
||||
$albums = array();
|
||||
|
||||
/* Make sure we have gallery */
|
||||
if( ! IPSLib::appIsInstalled( 'gallery' ) )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/* Libs */
|
||||
define( 'GALLERY_LIBS', IPS_ROOT_PATH . '/applications_addon/ips/gallery/sources/libs/' );
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('gallery') . '/sources/classes/gallery.php', 'ipsGallery', 'gallery' );
|
||||
$this->registry->setClass( 'gallery', new $classToLoad( $this->registry ) );
|
||||
|
||||
/* Gallery Object */
|
||||
require_once( GALLERY_LIBS . 'lib_gallery.php' );
|
||||
$this->registry->setClass( 'glib', new lib_gallery( $this->registry ) );
|
||||
/* Fetch albums */
|
||||
$_albums = $this->registry->gallery->helper('albums')->fetchAlbumsByOwner( $memberData['member_id'] );
|
||||
|
||||
/* Load the category object */
|
||||
require_once( GALLERY_LIBS . 'lib_categories.php' );
|
||||
$this->registry->setClass( 'category', new lib_categories( $this->registry ) );
|
||||
$this->registry->category->normalInit();
|
||||
|
||||
$this->registry->glib->category = $this->registry->category;
|
||||
|
||||
/* Album Library */
|
||||
require_once( GALLERY_LIBS . 'lib_albums.php' );
|
||||
$this->albums = new lib_albums( $this->registry );
|
||||
|
||||
/* Get a list of user albums */
|
||||
$this->albums->fetchAlbumsByOwner( $memberData['member_id'] );
|
||||
|
||||
/* Build Albums */
|
||||
$albums = array();
|
||||
|
||||
foreach( $this->albums->album_lookup as $r )
|
||||
foreach( $_albums as $id => $data )
|
||||
{
|
||||
$albums[] = array( 'id' => $r['id'], 'name' => $r['name'] );
|
||||
$albums[] = array( 'id' => $id, 'name' => $data['album_name'] );
|
||||
}
|
||||
|
||||
|
||||
return $albums;
|
||||
}
|
||||
|
||||
@@ -585,129 +584,26 @@ class mobileApiRequest
|
||||
$this->_returnError( "Gallery has been disabled" );
|
||||
}
|
||||
|
||||
/* Libs */
|
||||
define( 'GALLERY_LIBS', IPS_ROOT_PATH . '/applications_addon/ips/gallery/sources/libs/' );
|
||||
|
||||
/* Gallery Object */
|
||||
require_once( GALLERY_LIBS . 'lib_gallery.php' );
|
||||
$this->registry->setClass( 'glib', new lib_gallery( $this->registry ) );
|
||||
|
||||
/* Load the category object */
|
||||
require_once( GALLERY_LIBS . 'lib_categories.php' );
|
||||
$this->registry->setClass( 'category', new lib_categories( $this->registry ) );
|
||||
$this->registry->category->normalInit();
|
||||
|
||||
$this->registry->glib->category = $this->registry->category;
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('gallery') . '/sources/classes/gallery.php', 'ipsGallery', 'gallery' );
|
||||
$this->registry->setClass( 'gallery', new $classToLoad( $this->registry ) );
|
||||
|
||||
/* Get the album */
|
||||
$albumId = intval( $this->request['album'] );
|
||||
|
||||
$this->album = $this->registry->glib->fetchAlbumInfo( $albumId );
|
||||
$album = $this->registry->gallery->helper('albums')->fetchAlbumsById( $albumId );
|
||||
|
||||
/* Check the album owner */
|
||||
if( $this->album['member_id'] != $this->memberData['member_id'] )
|
||||
if ( ! $this->registry->gallery->helper('albums')->isUploadable( $album ) )
|
||||
{
|
||||
$this->_returnError( "You are not allowed to upload images to that album" );
|
||||
}
|
||||
|
||||
/* Check album limits */
|
||||
if( $this->memberData['g_img_album_limit'] )
|
||||
{
|
||||
$count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) AS total', 'from' => 'gallery_images', 'where' => "album_id={$albumId}" ) );
|
||||
|
||||
if( $count['total'] >= $this->memberData['g_img_album_limit'] )
|
||||
{
|
||||
$this->_returnError( "You can not upload any more images to that album" );
|
||||
}
|
||||
}
|
||||
|
||||
if( empty( $this->request['caption'] ) )
|
||||
{
|
||||
$this->request['caption'] = IPSText::parseCleanValue( $_FILES['image']['name'] );
|
||||
}
|
||||
|
||||
/* Get upload settings */
|
||||
$settings = $this->getUploadSettings();
|
||||
$settings = $this->getUploadSettings( $album );
|
||||
|
||||
/* Process the file */
|
||||
$new_file_info = $this->registry->glib->processUploadedFile( 'image', $settings['thumb'], $settings['watermark'], $settings['container'], $settings['allow_media'], $settings['allow_images'] );
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Insert information into the database
|
||||
//-------------------------------------------------------------
|
||||
|
||||
$insert = array( 'member_id' => $this->memberData['member_id'],
|
||||
'category_id' => 0,
|
||||
'album_id' => $albumId,
|
||||
'caption' => $this->request['caption'],
|
||||
'description' => $this->request['description'],
|
||||
'approved' => $settings['approve'],
|
||||
'thumbnail' => $settings['thumbnail'],
|
||||
'views' => 0,
|
||||
'comments' => 0,
|
||||
'idate' => time(),
|
||||
'ratings_total' => 0,
|
||||
'ratings_count' => 0,
|
||||
'caption_seo' => IPSText::makeSeoTitle( $this->request['caption'] ),
|
||||
'image_notes' => '',
|
||||
);
|
||||
|
||||
$insert = array_merge( $insert, $new_file_info );
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Check copyright data
|
||||
//-------------------------------------------------------------
|
||||
|
||||
if( $this->settings['gallery_allow_usercopyright'] != 'disabled' )
|
||||
{
|
||||
$insert['copyright'] = $this->settings['gallery_allow_usercopyright'] == '1' ? ( $this->request['copyright'] ? $this->request['copyright'] : $this->settings['gallery_copyright_default'] ) : $this->settings['gallery_copyright_default'];
|
||||
}
|
||||
|
||||
//-------------------------------------------------------
|
||||
// Do the insert
|
||||
//-------------------------------------------------------
|
||||
|
||||
$this->DB->insert( 'gallery_images', $insert );
|
||||
|
||||
if( ! $this->memberData['has_gallery'] )
|
||||
{
|
||||
$this->DB->update( 'members', array( 'has_gallery' => 1 ), "member_id={$this->memberData['member_id']}" );
|
||||
}
|
||||
|
||||
$pid = $this->DB->getInsertId();
|
||||
|
||||
if( $this->request['notify'] )
|
||||
{
|
||||
$this->DB->insert( 'gallery_subscriptions', array(
|
||||
'sub_mid' => $this->memberData['member_id'],
|
||||
'sub_type' => 'image',
|
||||
'sub_toid' => $pid,
|
||||
'sub_added' => time()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Need to update the parents, if they exist and this is a category
|
||||
//------------------------------------------------------------
|
||||
|
||||
$this->registry->glib->reSyncEverything( $insert['category_id'], $insert['album_id'] );
|
||||
|
||||
if( $insert['approved'] )
|
||||
{
|
||||
require_once( GALLERY_LIBS . 'lib_notifications.php' );
|
||||
$notify = new lib_notifications( $this->registry );
|
||||
$notify->category = $this->category;
|
||||
|
||||
if( $insert['album_id'] )
|
||||
{
|
||||
$notify->sendAlbumNotifications( $insert['album_id'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$notify->sendCatNotifications( $insert['category_id'] );
|
||||
}
|
||||
}
|
||||
/* Upload it */
|
||||
$this->registry->gallery->helper('upload')->addImage( 'image', $albumId, array( 'title' => $this->request['caption'],
|
||||
'description' => $this->request['description'],
|
||||
'approved' => $settings['approved'] ) );
|
||||
|
||||
exit();
|
||||
}
|
||||
@@ -733,12 +629,12 @@ class mobileApiRequest
|
||||
/* Load status class */
|
||||
if ( ! $this->registry->isClassLoaded( 'memberStatus' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/member/status.php' );
|
||||
$this->registry->setClass( 'memberStatus', new memberStatus( ipsRegistry::instance() ) );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' );
|
||||
$this->registry->setClass( 'memberStatus', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classAjax.php' );
|
||||
$this->ajax = new classAjax();
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
|
||||
$this->ajax = new $classToLoad();
|
||||
|
||||
/* Got content? */
|
||||
if( !trim( $this->ajax->convertAndMakeSafe( $_POST['content'] ) ) )
|
||||
@@ -772,6 +668,129 @@ class mobileApiRequest
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle posting a new topic
|
||||
*
|
||||
* @return string XML
|
||||
*/
|
||||
protected function _handlePostTopic()
|
||||
{
|
||||
/* Check the form hash */
|
||||
if( $this->member->form_hash != $this->request['form_hash'] )
|
||||
{
|
||||
$this->_returnError( "Invalid Request" );
|
||||
}
|
||||
|
||||
$topic_forum = intval( $this->request['f'] );
|
||||
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/post/classPost.php', 'classPost' );
|
||||
$this->registry->setClass( 'classPost', new $classToLoad( ipsRegistry::instance() ) );
|
||||
|
||||
$this->registry->getClass('class_forums')->strip_invisible = true;
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
|
||||
$this->registry->classPost->setIsPreview( false );
|
||||
$this->registry->classPost->setForumData( $this->registry->getClass('class_forums')->forum_by_id[ $topic_forum ] );
|
||||
$this->registry->classPost->setForumID( $topic_forum );
|
||||
$this->registry->classPost->setTopicTitle( $_POST['title'] );
|
||||
$this->registry->classPost->setPostContent( $_POST['body'] );
|
||||
$this->registry->classPost->setAuthor( $this->memberData['member_id'] );
|
||||
$this->registry->classPost->setPublished( true );
|
||||
$this->registry->classPost->setSettings( array( 'enableSignature' => 1,
|
||||
'enableEmoticons' => 1,
|
||||
'post_htmlstatus' => 0,
|
||||
'enableTracker' => 0 ) );
|
||||
|
||||
try {
|
||||
if ( $this->registry->classPost->addTopic() === FALSE ) {
|
||||
$this->_returnError( "Topic could not be posted: " . $this->registry->classPost->getPostError() );
|
||||
} else {
|
||||
$topic_id = $this->registry->classPost->getTopicData( 'tid' );
|
||||
}
|
||||
} catch ( Exception $ex ) {
|
||||
$this->_returnError( "Error posting topic: " . $ex->getMessage() );
|
||||
}
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/
|
||||
$xml = new classXML( 'utf-8' );
|
||||
$xml->newXMLDocument();
|
||||
|
||||
$xml->addElement( 'topic' );
|
||||
$xml->addElementAsRecord( 'topic', 'info', array( 'topic_id' => $topic_id ) );
|
||||
|
||||
echo $xml->fetchDocument();
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle posting a new reply
|
||||
*
|
||||
* @return string XML
|
||||
*/
|
||||
protected function _handlePostReply()
|
||||
{
|
||||
/* Check the form hash */
|
||||
if( $this->member->form_hash != $this->request['form_hash'] )
|
||||
{
|
||||
$this->_returnError( "Invalid Request" );
|
||||
}
|
||||
|
||||
$topic_forum = intval( $this->request['f'] );
|
||||
$topic_topic = intval( $this->request['t'] );
|
||||
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/post/classPost.php', 'classPost' );
|
||||
$this->registry->setClass( 'classPost', new $classToLoad( ipsRegistry::instance() ) );
|
||||
|
||||
$this->registry->getClass('class_forums')->strip_invisible = true;
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
|
||||
//-----------------------------------------
|
||||
// Need the topic...
|
||||
//-----------------------------------------
|
||||
|
||||
$topic = $this->registry->DB()->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => 'tid=' . $topic_topic ) );
|
||||
|
||||
$this->registry->classPost->setIsPreview( false );
|
||||
$this->registry->classPost->setForumData( $this->registry->getClass('class_forums')->forum_by_id[ $topic_forum ] );
|
||||
$this->registry->classPost->setForumID( $topic_forum );
|
||||
$this->registry->classPost->setTopicID( $topic_topic );
|
||||
$this->registry->classPost->setTopicData( $topic );
|
||||
$this->registry->classPost->setTopicTitle( $_POST['title'] );
|
||||
$this->registry->classPost->setPostContent( $_POST['body'] );
|
||||
$this->registry->classPost->setAuthor( $this->memberData['member_id'] );
|
||||
$this->registry->classPost->setPublished( true );
|
||||
$this->registry->classPost->setSettings( array( 'enableSignature' => 1,
|
||||
'enableEmoticons' => 1,
|
||||
'post_htmlstatus' => 0,
|
||||
'enableTracker' => 0 ) );
|
||||
|
||||
try {
|
||||
if ( $this->registry->classPost->addReply() === FALSE ) {
|
||||
$this->_returnError( "Reply could not be posted: " . $this->registry->classPost->getPostError() );
|
||||
} else {
|
||||
$topic_id = $this->registry->classPost->getTopicData( 'tid' );
|
||||
$post_id = $this->registry->classPost->getPostData( 'pid' );
|
||||
}
|
||||
} catch ( Exception $ex ) {
|
||||
$this->_returnError( "Error posting reply: " . $ex->getMessage() );
|
||||
}
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/
|
||||
$xml = new classXML( 'utf-8' );
|
||||
$xml->newXMLDocument();
|
||||
|
||||
$xml->addElement( 'topic' );
|
||||
$xml->addElementAsRecord( 'topic', 'info', array( 'topic_id' => $topic_id ) );
|
||||
$xml->addElementAsRecord( 'topic', 'info', array( 'post_id' => $post_id ) );
|
||||
|
||||
echo $xml->fetchDocument();
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Send an error about the selected api
|
||||
*
|
||||
@@ -786,12 +805,12 @@ class mobileApiRequest
|
||||
* Sends an error message in xml
|
||||
*
|
||||
* @param string $msg
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _returnError( $msg )
|
||||
{
|
||||
/* XML Parser */
|
||||
require_once( IPS_KERNEL_PATH . 'classXML.php' );
|
||||
require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/
|
||||
$xml = new classXML( 'utf-8' );
|
||||
$xml->newXMLDocument();
|
||||
|
||||
@@ -808,12 +827,12 @@ class mobileApiRequest
|
||||
* Sends forum data in xml format
|
||||
*
|
||||
* @param array $dataArray
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _returnXml( $dataArray )
|
||||
{
|
||||
/* XML Parser */
|
||||
require_once( IPS_KERNEL_PATH . 'classXML.php' );
|
||||
require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/
|
||||
$xml = new classXML( 'utf-8' );
|
||||
$xml->newXMLDocument();
|
||||
|
||||
@@ -837,6 +856,9 @@ class mobileApiRequest
|
||||
}
|
||||
}
|
||||
|
||||
$xml->addElementAsRecord( 'forum', 'version', array( 'version_id' => $dataArray['version_id'] ) );
|
||||
$xml->addElementAsRecord( 'forum', 'version', array( 'version_text' => $dataArray['version_text'] ) );
|
||||
|
||||
/* Output */
|
||||
echo $xml->fetchDocument();
|
||||
exit();
|
||||
@@ -845,62 +867,22 @@ class mobileApiRequest
|
||||
/**
|
||||
* Returns settings used for uploading images
|
||||
*
|
||||
* @access protected
|
||||
* @param array Album array
|
||||
* @return array
|
||||
*/
|
||||
protected function getUploadSettings()
|
||||
protected function getUploadSettings( $album=array() )
|
||||
{
|
||||
//-----------------------------------
|
||||
// Category Settings
|
||||
//-----------------------------------
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('gallery') . '/sources/classes/gallery.php', 'ipsGallery', 'gallery' );
|
||||
$this->registry->setClass( 'gallery', new $classToLoad( $this->registry ) );
|
||||
|
||||
if( $this->cat )
|
||||
{
|
||||
$thumb = ( $this->cat['thumbnail'] && $this->settings['gallery_create_thumbs'] ) ? 1 : 0;
|
||||
$watermark = $this->cat['watermark_images'];
|
||||
|
||||
if ( !$this->memberData['g_movies'] OR !$this->cat['allow_movies'] )
|
||||
{
|
||||
$allow_media = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$allow_media = 1;
|
||||
}
|
||||
|
||||
$container = $this->cat['id'];
|
||||
$html = ( $this->cat['allow_html'] AND $this->memberData['g_dohtml'] ) ? 1 : 0 ;
|
||||
$approve_images = $this->cat['approve_images'] ? 0 : 1;
|
||||
$code = $this->cat['allow_ibfcode'];
|
||||
$allow_images = $this->cat['allow_images'];
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Album Settings
|
||||
//-----------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
$cat = $this->registry->category->cat_lookup[ $this->album['category_id'] ];
|
||||
|
||||
$thumb = ( $cat['thumbnail'] && $this->settings['gallery_create_thumbs'] ) ? 1 : 0;
|
||||
$watermark = ( $cat['watermark_images'] && $this->settings['gallery_watermark_path'] ) ? 1 : 0;
|
||||
$allow_media = ( $cat['allow_movies'] && $this->memberData['g_movies'] ) ? 1 : 0;
|
||||
$container = $this->album['id'];
|
||||
$html = ( $cat['allow_html'] && $this->memberData['g_dohtml'] ) ? 1 : 0 ;
|
||||
$approve_images = ( $cat['approve_images'] ) ? 0 : 1;
|
||||
$code = ( $cat['allow_ibfcode'] ) ? 1 : 0;
|
||||
$allow_images = $cat['allow_images'] ? 1 : 0;
|
||||
}
|
||||
|
||||
return array( 'thumb' => $thumb,
|
||||
'watermark' => $watermark,
|
||||
'html' => $html,
|
||||
'code' => $code,
|
||||
'allow_media' => $allow_media,
|
||||
'approve' => $approve_images,
|
||||
'container' => $container,
|
||||
'allow_images' => $allow_images,
|
||||
return array( 'thumb' => 1,
|
||||
'watermark' => ( $this->settings['gallery_watermark_path'] ) ? 1 : 0,
|
||||
'html' => 0,
|
||||
'code' => 1,
|
||||
'allow_media' => $this->registry->gallery->helper('media')->allow( $this->memberData['member_id'] ),
|
||||
'approve' => ( $this->registry->gallery->helper('albums')->isGlobal( $album ) && $album['album_g_approve_img'] ) ? 1 : 0,
|
||||
'container' => $album['album_id'],
|
||||
'allow_images' => 1,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,33 +2,33 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Main public executable wrapper.
|
||||
* Set-up and load module to run
|
||||
* Last Updated: $Date: 2010-06-16 04:32:48 -0400 (Wed, 16 Jun 2010) $
|
||||
* Last Updated: $Date: 2011-07-27 20:58:18 -0400 (Wed, 27 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2008 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6540 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9327 $
|
||||
*
|
||||
*/
|
||||
|
||||
define( 'IPS_ENFORCE_ACCESS', TRUE );
|
||||
define( 'IPB_THIS_SCRIPT', 'public' );
|
||||
require_once( '../../initdata.php' );
|
||||
require_once( '../../initdata.php' );/*noLibHook*/
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
$registry = ipsRegistry::instance();
|
||||
$registry->init();
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php' );
|
||||
$twitter = new twitter_connect( $registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' );
|
||||
$twitter = new $classToLoad( $registry );
|
||||
|
||||
if ( $_REQUEST['oauth_token'] )
|
||||
{
|
||||
@@ -53,12 +53,12 @@ if ( $_REQUEST['oauth_token'] )
|
||||
switch( $msg )
|
||||
{
|
||||
default:
|
||||
$registry->getClass('output')->showError( 'twit_ohnoes', 99999, null, null, 403 );
|
||||
$registry->getClass('output')->showError( 'twit_ohnoes', 1090094, null, null, 403 );
|
||||
break;
|
||||
case 'TWITTER_NOT_SET_UP':
|
||||
$registry->getClass('output')->showError( 'twit_not_on', 99999, null, null, 403 );
|
||||
$registry->getClass('output')->showError( 'twit_not_on', 1090095, null, null, 403 );
|
||||
case 'NOT_REMOTE_MEMBER':
|
||||
$registry->getClass('output')->showError( 'twit_not_remote', 99999, null, null, 403 );
|
||||
$registry->getClass('output')->showError( 'twit_not_remote', 1090096, null, null, 403 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,60 +2,75 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.0 Beta 2
|
||||
* IP.Board v3.2.0 Beta 1
|
||||
* Main public executable wrapper.
|
||||
* Set-up and load module to run
|
||||
* Last Updated: $Date: 2010-01-22 03:41:36 -0500 (Fri, 22 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-03-11 12:41:48 -0500 (Fri, 11 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2008 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5738 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8042 $
|
||||
*
|
||||
*/
|
||||
|
||||
define( 'IPS_ENFORCE_ACCESS', TRUE );
|
||||
define( 'IPB_THIS_SCRIPT', 'public' );
|
||||
require_once( '../../initdata.php' );
|
||||
require_once( '../../initdata.php' );/*noLibHook*/
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
$registry = ipsRegistry::instance();
|
||||
$registry->init();
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php' );
|
||||
$vk = new vkontakte_connect( $registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php', 'vkontakte_connect' );
|
||||
$vkontakte = new $classToLoad( $registry );
|
||||
|
||||
if ( $_REQUEST['key'] )
|
||||
if ( $_REQUEST['code'] )
|
||||
{
|
||||
try
|
||||
/* From the log in page */
|
||||
if ( $_REQUEST['key'] )
|
||||
{
|
||||
$vk->finishLogin();
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
|
||||
switch( $msg )
|
||||
try
|
||||
{
|
||||
default:
|
||||
$registry->getClass('output')->showError( 'twit_ohnoes', 99999, null, null, 403 );
|
||||
break;
|
||||
case 'TWITTER_NOT_SET_UP':
|
||||
$registry->getClass('output')->showError( 'twit_not_on', 99999, null, null, 403 );
|
||||
case 'NOT_REMOTE_MEMBER':
|
||||
$registry->getClass('output')->showError( 'twit_not_remote', 99999, null, null, 403 );
|
||||
break;
|
||||
if ( ! intval( $_REQUEST['m'] ) )
|
||||
{
|
||||
$vkontakte->finishLogin();
|
||||
}
|
||||
else
|
||||
{
|
||||
$vkontakte->finishConnection();
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
|
||||
switch( $msg )
|
||||
{
|
||||
default:
|
||||
$registry->getClass('output')->showError( 'twit_ohnoes', 99999, null, null, 403 );
|
||||
break;
|
||||
case 'TWITTER_NOT_SET_UP':
|
||||
$registry->getClass('output')->showError( 'twit_not_on', 99999, null, null, 403 );
|
||||
case 'NOT_REMOTE_MEMBER':
|
||||
$registry->getClass('output')->showError( 'twit_not_remote', 99999, null, null, 403 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$vkontakte->finishConnection();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$vk->redirectToConnectPage();
|
||||
$vkontakte->redirectToConnectPage();
|
||||
}
|
||||
|
||||
exit();
|
||||
@@ -1,10 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Open API XD Receiver</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="http://vkontakte.ru/js/api/xd_receiver.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user