Change password through api

nieuwhier

Verified User
Joined
Sep 8, 2005
Messages
280
Location
Netherlands
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

Verified User
Joined
Dec 25, 2004
Messages
8
Location
RU, Lipetsk
nieuwhier said:
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:
PHP:
print $user;
print "<br />";
$Socket->query('/CMD_USER_PASSWD',
  array('username' => $user,
        'passwd'   => $passwd,
        'passwd2'  => $passwd2));
$result = $Socket->fetch_body();
 

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
26,119
Location
California
Is there a difference (other than spacing)? I don't see any difference.

Jeff
 

nieuwhier

Verified User
Joined
Sep 8, 2005
Messages
280
Location
Netherlands
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
 
Last edited:

nieuwhier

Verified User
Joined
Sep 8, 2005
Messages
280
Location
Netherlands
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.
 
Top