2013-06-10, 06:04 AM
I've searched the forum but have been unable to get it to work for me. Just so you know, I'm using curl to manage account creation and logging in and stuff remotely, and this page is basically designed to allow one to remotely call MyBB Integrator functions via POST. But that's not where the trouble is; even when I load this page directly with test values for the variables, it still doesn't log me out. Here's the relevant code:
This next part probably isn't relevant but here it is anyways:
This is where I think the problem is:
Any input would be great!
Also, I can post/upload the curl helper functions and everything if anybody needs/wants to see them...
// Initialize MyBB Integrator extension
// Main globals file
require_once("${_SERVER['DOCUMENT_ROOT']}/filepath/globals.inc.php");
global $mybb, $db, $cache, $plugins, $lang, $config;
define('IN_MYBB', NULL);
// MyBB Integrator globals file
require_once "$ForumFolder/global.php";
require_once "$ForumFolder/class.MyBBIntegrator.php";
global $MyBBI;
$MyBBI = new MyBBIntegrator($mybb, $db, $cache, $plugins, $lang, $config);
This next part probably isn't relevant but here it is anyways:
// Calls requested function from post
$FunctionName = $_POST['FunctionName'];
$Params = array();
foreach($_POST as $Key=>$Value)
{
if(substr($Key, 0, 5) == 'Param')
{
$Params[] = unserialize($Value); // Serialized in case param is actually an array itself
}
}
This is where I think the problem is:
// Debug
// Forcing values for testing
$_GET['sid'] = $MyBBI->mybb->session->sid;
$_GET['logoutkey'] = $MyBBI->mybb->user['logoutkey'];
$FunctionName = 'logout';
$Success = call_user_func_array(array($MyBBI, $FunctionName), $Params);
// I've taken to setting cookies to display error messages
// Because I'm still learning curl and this way just works the way it's set up...
setcookie("Success", $Success, $DefaultCookieExpire, '/', $Domain);
Any input would be great!
Also, I can post/upload the curl helper functions and everything if anybody needs/wants to see them...