enkord
05-14-2010, 05:24 AM
Hi all. I have a problem with 3.8.2. There is a small script used to add user to forum.
gunroxinterface.php:
<?
define('VB_AREA', 'External');
define('SKIP_SESSIONCREATE', 1);
define('SKIP_USERINFO', 1);
define('CWD', '/home/gunrox/public_html/forum');
require_once(CWD . '/includes/init.php');
$userdata=&datamanager_init('User', $vbulletin, ERRTYPE_ARRAY);
$userdata->set("username", $_GET['login']);
$userdata->set("email", $_GET['email']);
$userdata->set("password", $_GET['password']);
$userdata->set("usergroupid", 3);
$date=date("Y-m-d", mktime(0, 0, 0, $_GET['month'], $_GET['day'], $_GET['year']));
$userdata->set("birthday", $date);
if (sizeof($userdata->errors)>0 && trim(implode("", $userdata->errors))!="") {
echo "Error: <br>";
foreach ($userdata->errors as $i)
echo $userdata->errors[$i]."<br>";
} else {
$userdata->save();
echo "success";
}
?>
It is called in GET from another script:
$result = implode("", file($url_root."forum/gunroxinterface.php?action=createaccount".
"&login=naohsons&password=naohsons&email=naohsons%40mailinator.com&day=1&month=1&year=1980"));
echo $result;The result of script
is Error: <br><br>
It is strange - $userdata->errors has empty item.
Please give me advice.
Thanks in advance!
gunroxinterface.php:
<?
define('VB_AREA', 'External');
define('SKIP_SESSIONCREATE', 1);
define('SKIP_USERINFO', 1);
define('CWD', '/home/gunrox/public_html/forum');
require_once(CWD . '/includes/init.php');
$userdata=&datamanager_init('User', $vbulletin, ERRTYPE_ARRAY);
$userdata->set("username", $_GET['login']);
$userdata->set("email", $_GET['email']);
$userdata->set("password", $_GET['password']);
$userdata->set("usergroupid", 3);
$date=date("Y-m-d", mktime(0, 0, 0, $_GET['month'], $_GET['day'], $_GET['year']));
$userdata->set("birthday", $date);
if (sizeof($userdata->errors)>0 && trim(implode("", $userdata->errors))!="") {
echo "Error: <br>";
foreach ($userdata->errors as $i)
echo $userdata->errors[$i]."<br>";
} else {
$userdata->save();
echo "success";
}
?>
It is called in GET from another script:
$result = implode("", file($url_root."forum/gunroxinterface.php?action=createaccount".
"&login=naohsons&password=naohsons&email=naohsons%40mailinator.com&day=1&month=1&year=1980"));
echo $result;The result of script
is Error: <br><br>
It is strange - $userdata->errors has empty item.
Please give me advice.
Thanks in advance!