Hello,
i am writing a MFC application which i want to be able to reply to a thread in my forum. Its meant as a request button which simply posts the username into a fixed ( non changing ) topic.
I've successfully done login by now. A simple php script accepts the username and pw ( both as md5 ) and checks the users details with the prebuilt vb api.
PHP Code:
// Includes
require_once('./global.php');
require_once(DIR . '/includes/functions_login.php');
// Fetch Ip
function fetch_ip()
{
return $_SERVER['REMOTE_ADDR'];
}
// Fetch Date
function fetch_date()
{
return date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm
}
// Check Request
if( $_POST['do'] == 'Login' )
{
// this fuunction parses _GET data into an array
$vbulletin->input->clean_array_gpc('p', array(
'vb_login_username' => TYPE_STR,
'vb_login_password' => TYPE_STR,
'vb_login_md5password' => TYPE_STR,
'vb_login_md5password_utf' => TYPE_STR,
'postvars' => TYPE_STR,
'cookieuser' => TYPE_BOOL,
'logintype' => TYPE_STR,
'cssprefs' => TYPE_STR,
'HWID' => TYPE_STR,
));
// can the user login?
$strikes = verify_strike_status($vbulletin->GPC['vb_login_username']);
if($vbulletin->GPC['vb_login_username'] == '')
{
echo "PW";
exit;
}
// login attempt
if(!verify_authentication($vbulletin->GPC['vb_login_username'], $vbulletin->GPC['vb_login_password'], $vbulletin->GPC['vb_login_md5password'], $vbulletin->GPC['vb_login_md5password_utf'], $vbulletin->GPC['cookieuser'], true))
{
// THIS IS THE BAD PASSWORD AUTHENTICATION SECTION
echo "PW";
exit;
}
else
{
// THIS IS THE GOOD PASSWORD AUTHENTICATION SECTION
process_new_login($vbulletin->GPC['logintype'], $vbulletin->GPC['cookieuser'], $vbulletin->GPC['cssprefs']);
// HWID check
$Transfer_Username = $vbulletin->GPC['vb_login_username'];
$cur_userid = $vbulletin->userinfo['userid'];
$Real_HwidArray = $db->query("SELECT Hwid FROM " . TABLE_PREFIX . "user WHERE userid = $cur_userid");
$Real_Hwid = "";
while ($cur = $db->fetch_array($Real_HwidArray))
{
$Real_Hwid = $cur['Hwid'];
}
$Transfer_Hwid = $vbulletin->GPC['HWID'];
if( $Real_Hwid == '' )
{
// Check if his Hwid is ok
if( strlen( $Transfer_Hwid ) < 5 )
{
// Bad hardware id
echo "HW";
exit;
}
// If the Hwid is ok, update his Hwid entry
$UpdateInfo = "UPDATE user SET Hwid = '".$Transfer_Hwid."' WHERE username = '".$Transfer_Username."'";
$db->query($UpdateInfo);
}
else if($Transfer_Hwid != $Real_Hwid)
{
// Bad hardware id
echo "HW";
exit;
}
and so on...
I havnt got any clue how i would reply a post in a thread after. Are there any experienced users who can push me in the right direction or accomblished similar tasks?
Help is greatful appreciated.
Sincerly,
Frank