PDA

View Full Version : Change password through api



nieuwhier
11-18-2005, 05:52 AM
Hi,

I am trying to change the user password through the API.
This is part of the code:

$Socket->query('/CMD_USER_PASSWD',
array('username' => $user,
'passwd' => $passwd,
'passwd2' => $passwd2));
$result = $Socket->fetch_body();

The result is:
Unable to change password
Details
"" is an invalid username

I don't see the light.....

Michel.

kolobok
11-19-2005, 05:52 PM
Originally posted by nieuwhier
Hi,

I am trying to change the user password through the API.
This is part of the code:

$Socket->query('/CMD_USER_PASSWD',
array('username' => $user,
'passwd' => $passwd,
'passwd2' => $passwd2));
$result = $Socket->fetch_body();

The result is:
Unable to change password
Details
"" is an invalid username

I don't see the light.....

Michel.

please, try this code:


print $user;
print "<br />";
$Socket->query('/CMD_USER_PASSWD',
array('username' => $user,
'passwd' => $passwd,
'passwd2' => $passwd2));
$result = $Socket->fetch_body();

nobaloney
11-19-2005, 07:00 PM
Is there a difference (other than spacing)? I don't see any difference.

Jeff

nieuwhier
11-20-2005, 10:08 AM
No change when I add
print $user;
print "<br />";

Btw; user and both password fields are correctly filled. I have checked that.

The login I use is $Socket->set_login("admin","****");

I have used lots of DA functions that works correctly.

When I change to login to: "admin|" . $user,"****");

Than I get (wich I understand):
You cannot execute that command
Details
The request you've made cannot be executed because it does not exist in your authority level

nieuwhier
12-05-2005, 03:10 AM
Noboddy has an answer for me ?

nieuwhier
12-05-2005, 03:33 AM
Yesssssssssssssssssssssssss :D :D :D

Found the answer;
$Socket->set_method("POST");

Although the description says(I think) that GET and POST should work it only works with POST.

problem solved for me.