Go Back   ISPsystem.com Forums > Modifications / Add-ons > Scripting / API

Notices

Reply
 
Thread Tools
Old 02-01-2006, 03:05 PM   #1
Guest
 
Posts: n/a
Default 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
  Reply With Quote
Old 02-01-2006, 03:12 PM   #2
ISPsystem team
 
Join Date: Mar 2004
Posts: 98
Igor has disabled reputation
Default

is ISPmanager documentation not suffice ?
__________________
ISPsystem support team
Igor is offline   Reply With Quote
Old 02-01-2006, 03:30 PM   #3
Guest
 
Posts: n/a
Default

Yes but a few examples on how to add users and/or mail aliasses for example might be handy
Raf@root4ce.be
  Reply With Quote
Old 02-01-2006, 03:49 PM   #4
ISPsystem team
 
Join Date: Mar 2004
Posts: 98
Igor has disabled reputation
Default

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.
Igor is offline   Reply With Quote
Old 02-03-2006, 11:45 AM   #5
Guest
 
Posts: n/a
Default

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
  Reply With Quote
Old 02-03-2006, 01:08 PM   #6
ISPsystem team
 
Join Date: Mar 2004
Posts: 98
Igor has disabled reputation
Default

what is in $result variable after request ?
__________________
ISPsystem support team
Igor is offline   Reply With Quote
Old 02-03-2006, 05:40 PM   #7
Guest
 
Posts: n/a
Default

$result has
Permission denied error code
  Reply With Quote
Old 02-04-2006, 04:03 AM   #8
ISPsystem team
 
Join Date: Mar 2004
Posts: 98
Igor has disabled reputation
Default

are run script as user root ?
__________________
ISPsystem support team
Igor is offline   Reply With Quote
Old 02-04-2006, 07:28 PM   #9
Guest
 
Posts: n/a
Default

It's embedded in a php-webpage with global execution permission
  Reply With Quote
Old 02-06-2006, 03:21 AM   #10
ISPsystem team
 
Join Date: Mar 2004
Posts: 98
Igor has disabled reputation
Default

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.
__________________
ISPsystem support team
Igor is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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