HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   A terrible thing happened with remoting client api. (http://www.howtoforge.com/forums/showthread.php?t=60232)

key 16th January 2013 13:51

A terrible thing happened with remoting client api.
 
I changed only limit_web_quota with clients_update with remoting client api.

It seemed to me that the change was successful with no problem.

But, In fact, it hasn't been successful.

Because, all client's passwords, except me, were changed.

I wrote

$record_record = $client->client_get($session_id, $record['client_id']);
$record_record['limit_web_quota'] = 10;
$client->client_update($session_id, $record['client_id'], 0, $record_record);

in this script.

I guess this api encrypt client's password again for changed passwords are also begin with $1$ salt.

This terrible problem is resolved yet.

Does anyone know a solution?

till 16th January 2013 15:58

You have to pass a empty password field if you dont want the password to be changed as the API requires that you pass either a new (cleartext) password or a empty field if you dont want to change the password.

So the corect script is:

$record_record = $client->client_get($session_id, $record['client_id']);
$record_record['limit_web_quota'] = 10;
$record_record['password'] = '';
$client->client_update($session_id, $record['client_id'], 0, $record_record);

Croydon 17th January 2013 13:27

Starting with 3.0.5 you can pass encrypted passwords, too.
You have to set an additional parameter then:

$record_record = $client->client_get($session_id, $record['client_id']);
$record_record['limit_web_quota'] = 10;
$record_record['password'] = '$1$xxxxxxxxxxxxx'; // encrypted password
$record_record['_ispconfig_pw_crypted'] = 1; // tell the api that you send encrypted pw

$client->client_update($session_id, $record['client_id'], 0, $record_record);

key 20th January 2013 11:37

Thank you till and Croydon.

I will be careful when I change client_data.


All times are GMT +2. The time now is 16:52.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.