ISPsystem.com Forums

ISPsystem.com Forums (http://forum.ispsystem.com//index.php)
-   Scripting / API (http://forum.ispsystem.com//forumdisplay.php?f=13)
-   -   PHP (http://forum.ispsystem.com//showthread.php?t=151)

raf_root4ce 02-01-2006 03:05 PM

PHP
 
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

Code:

<?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
 
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?auth...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

maillist.edit
 
other problem....

When try create a mailing list.

http://127.0.0.1/manager/ispmgr?auth...=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

%20 and %40
 
mailing list :

http://127.0.0.1/manager/ispmgr?auth...=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

<error code="3" obj="site">
 
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

Retrieving mailboxes
 
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

"helpdesk" module
 
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

Quote:

Originally Posted by slava (Post 3490)
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

Quote:

Originally Posted by slava (Post 3690)
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?au...rameter2=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


All times are GMT +2. The time now is 05:42 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.