vBulletin Version: 5.44
PHP: 7.23
MySQL: 5.6.19
I use the API to create users and to login from an external site, but I can't change the password of an existing account. I would like to do this to share the same password on the vbulletin board and the external site.
My code for the existing Testuser "Test", Userid: 12345, Email "[email protected]", Password: "test1234"
The error msg is always "Enter_Current_Password". Some ideas?
PHP: 7.23
MySQL: 5.6.19
I use the API to create users and to login from an external site, but I can't change the password of an existing account. I would like to do this to share the same password on the vbulletin board and the external site.
My code for the existing Testuser "Test", Userid: 12345, Email "[email protected]", Password: "test1234"
PHP Code:
<?php
define('CSRF_PROTECTION', false);
require_once('includes/vb5/autoloader.php');
vB5_Autoloader::register(__DIR__);
vB5_Frontend_Application::init('config.php');
$userid = "12345";
$username= "Test";
$pw = "test1234";
$email = "[email protected]";
$user = array(
'username' => $username;
'email' => $email;
);
$extra = array(
'newpass' => "4321test" //new password
);
$api = Api_InterfaceAbstract::instance();
$loginInfo = $api->callApi('user', 'save', array($userid,$pw, $user, $options, $adminoptions, $userfield,$notificationOptions,$hvinput,$extra));
if (empty($loginInfo['errors']))
{
echo "Success.";
}
else
{
// there was a problem.
print_r($loginInfo);
// Result: "Array ( [errors] => Array ( [0] => Array ( [0] => enter_current_password ) ) [userid] => 1 )"
}
?>
The error msg is always "Enter_Current_Password". Some ideas?
Comment