api returns bad ascii codes

betz

Verified User
Joined
Jun 23, 2009
Messages
12
Greetings!

I get a bad return from the directadmin api.
The ascii codes are each missing the ; character.
Here an example of a error the directadmin api returns:

<code>error=1&text=Error deleting database&#40s&#41&details=The database drupallabo&#95tt does not belong to you&#60br&#62
</code>

As you can see,
Code:
&#40
has to be
Code:
(
etcetera.

Now i can't decode nicely, i now do it with a str_replace(), but that's really not the way it should be.

Can this be fixed?

Greetings,
Tom

PS: directadmin version 1.34.4 running on centos
 
sorry it seems the & #40; sign gets rendered here.
Hope you get the point
 
wow that was fast!

No, its not a script, i get the return when i just open this url:

Code:
example.com:2222/CMD_API_DATABASES?action=delete&select0=demo_db

So without a script, just plain return
 
I just got a confirmation from another server. Same problem, latest directadmin version.
 
Anyone picking this up?

Is there a bug issue queue or something somewhere?
 
OK, third confirmation now.

Two servers on 1.34.4 and one server on 1.34.0
 
Will there be something done for this issue?
I hope 2 extra independant confirmations is clear, no?
 
Hello,

That ascii is normal. You can use this script to decode it:
http://help.directadmin.com/item.php?id=204

Also, I have a feeling you might be logged in as some other user than the owner of the DB you're creating.

The db creation is a User Level task, so the API must login as that User.

If you don't have that User's password, and only have the Admin or Reseller's password, that's enough. You'd use a login name value of:
Code:
$loginusername = "admin|$endusername";
which implements the login-as functionality.. so you're then logged in as the $endusername, and not "admin".

John
 
Back
Top