PDA

View Full Version : PHP


raf_root4ce
02-01-2006, 03:05 PM
Hi,
Where can i find more examples on how to use API output to perfom actions via PHP?

thnx in advance?

Raf@root4ce.be

Igor
02-01-2006, 03:12 PM
is ISPmanager documentation not suffice ?

raf_root4ce
02-01-2006, 03:30 PM
Yes but a few examples on how to add users and/or mail aliasses for example might be handy :)
Raf@root4ce.be

Igor
02-01-2006, 03:49 PM
<?php
$result = "";
$fh = fopen( "http://127.0.0.1/manager/ispmgr?out=xml&func=user.edit&sok=yes&name=myname&passwd=topsecret&site=mydomain.com&access=mail&disklimit=10", "r" );
while( $data = fread( $fh, 4096 ) ){
$result .= $data;
}
fclose( $fh );

// After that the variable $result contains XML document with one node <ok/> or error codes and messages
?>

this document http://ispsystem.com/docs/isp-lite-en-devel/index.html
describe all API functions and parameters.

raf_root4ce
02-03-2006, 11:45 AM
I use the code u provided but i can't get it to work.
I think it has something to do with authentication but when i Fetch the url from the shell the account is being created.

I think i'm just doing something wrong in PHP
Can you tell me the way to do authentication with PHP so i can verify if i'm doing it correct?

Thnx
Raf@root4ce.be

Igor
02-03-2006, 01:08 PM
what is in $result variable after request ?

raf_root4ce
02-03-2006, 05:40 PM
$result has
Permission denied error code

Igor
02-04-2006, 04:03 AM
are run script as user root ?

02-04-2006, 07:28 PM
It's embedded in a php-webpage with global execution permission

Igor
02-06-2006, 03:21 AM
do you want anybody may do anything on your server ?

certenly it not works.

you should run this php script from shell as user root.

or your script should have authorization information.
add parameter authinfo=root:rootpassword in the request.
but i should notice it is insecure.

raf_root4ce
02-07-2006, 10:43 AM
It was my intention to add automated Site and account creation in our PHP based order form. But I think I will leave the idea because of the security.
thanks
Raf

Igor
02-07-2006, 10:46 AM
you can create administrator, allow him to create sites only. and use his name and password in your script.

ekosnet
03-10-2006, 12:47 PM
user.mailprop dont work. the result is ok but data dont change

Igor
03-10-2006, 01:02 PM
may be something wrong in your request ?
is it has parameter sok=yes ? and parameter elid ?

show me please your request

i9
03-10-2006, 01:48 PM
http://127.0.0.1/manager/ispmgr?authinfo=user:pass&sok=yes&elid=info@i9.com&autoreply=Auto reply test&fwd=i9@i9.com&out=xml&func=user.mailprop

user = Admin user
pass = is password to this user

Igor
03-10-2006, 04:42 PM
should works

ekosnet (i9)
03-10-2006, 04:50 PM
other problem....

When try create a mailing list.

http://127.0.0.1/manager/ispmgr?authinfo=user:pass&sok=yes&name=yyy@i9.com&owner=i9@i9.com&policy=&prefix=&password=pass&info=&replyto=&out=xml&func=maillist.edit

result :

<error code="3" obj="site">

Igor
03-10-2006, 05:08 PM
about user.mailprop and other,
try to encode request
or replace all spaces by %20 and all @ by %40

ekosnet (i9)
03-10-2006, 05:31 PM
mailing list :

http://127.0.0.1/manager/ispmgr?authinfo=user:pass&sok=yes&name=test%40i9.com&owner=i9%40i9.com&policy=&prefix=&password=pass&info=&replyto=&out=xml&func=maillist.edit

result: <error code="3" obj="site">

user.mailprop :

result : ok but data in ispmanager dont change.

ekosnet (i9)
03-10-2006, 07:27 PM
maillist.edit : <error code="3" obj="site">

why error obj site ?

Igor
03-11-2006, 03:50 AM
i have no idea more.
all is correct and should works.

raf_root4ce
08-21-2006, 01:41 PM
Can anyone get me started on how to generate a list the mailboxes on a site with PHP? Is it possible to list the passwords also?

Thanks in advance

Raf Goetschalckx
RootForce-root4ce.be

Igor
08-29-2006, 05:09 AM
see documentation at http://ispsystem.com/docs/isp-lite-en-devel/index.html "ISPmanager API"
you should read topic about mailboxes.

and no way to get passwords.

raf_root4ce
09-15-2006, 01:28 PM
hello,
Is there any possibility to use the "helpdesk" module from the API, I can't find anything about this in the documentation so far?

Raf_root4ce

alons
10-03-2009, 02:18 PM
What does error code 100 imply ???

Regards,
Alons

slava
10-03-2009, 07:13 PM
See ISPmanager logs, what action you do? It possible "incorrect authorization data" for example.

alons
11-21-2009, 05:55 PM
See ISPmanager logs, what action you do? It possible "incorrect authorization data" for example.
I have PMed you please reply

slava
11-22-2009, 01:18 PM
See ISPmanager logs and also you can write ticket via our billing system
Also read examples http://en.ispdoc.com/index.php/How_to_work_with_API

alons
11-23-2009, 06:39 AM
See ISPmanager logs and also you can write ticket via our billing system
Also read examples http://en.ispdoc.com/index.php/How_to_work_with_API

I have read it and it doesnt work for sure.
Brukhanov said that it is restricted from the web :
https://IP-address/manager/ispmgr?auth=session_ID&out=xml&func=function&parameter1=value&parameter2=value

Then how should I get it to work ???

Regards,
Alons

GakcaT
11-24-2009, 04:40 AM
Please, explain your problem in details. How to make it better you can read here: http://forum.ispsystem.com/en/showthread.php?t=181