PDA

View Full Version : Deleting a user via data manager - HELP!!


AustinKalb
08-27-2009, 04:45 AM
This script fails in the data manager delete method here (class_dm_user.php, line 1953):


if (!$this->existing['userid'])
{
return false;
}




I know there is a user with a uid 36 !!


define('THIS_SCRIPT', 'deleteVbUser.php');

require_once('./global.php');
require_once('./includes/class_dm.php');
require_once('./includes/class_dm_user.php');

$userdm = new vB_DataManager_User($vbulletin, ERRTYPE_ARRAY);

$userdm->set('userid', '36');

if (count($userdm->errors)) {
for($i=0; $i<count($userdm->errors); $i++) {
print "ERROR{$i}:{$userdm->errors[$i]}\n";
}
} else {
# If everything is OK
$result = $userdm->delete();
}

if (!$result) {
echo "result: false <br />";
} else {
echo "result: $result <br />";
}


Got to be something simple. Please - any help?

Thanks!
Austin

==================
Answered myself - following properly sets uid:


$existing = array(
'userid' => 36,
'username' => 'AAAphpNukeUser',
'usergroupid' => 9,
// ...and all the other fields related to a user
);
$userdm->set_existing(&$existing);