View Single Post
  #28  
Old 30th October 2008, 05:24
dayjahone dayjahone is offline
Senior Member
 
Join Date: Jan 2007
Posts: 421
Thanks: 31
Thanked 0 Times in 0 Posts
Default

Wow! So, it worked. The problem must have been that I installed the package after installing ISPConfig. So, I am still having problems with the form that I used on my old system. I am trying to check for a user and if the username doesn't exist, create it. If I just have the add user script, it works, but if it's already there, it doesn't give me an error, but echos the following:

Code:
Error: Response not of type text/xml: text/html
When I have both scripts, I get that error regardless and it doesn't create a user. Here are the functions I am using:

Code:
// Get a User
$params = array ( 'sid' => $session_id,
'module' => 'web',
'function' => 'user_get',
'params' => array ( user_username => $new_username_field // user_username or user_id
));

$user = $nusoap_client->call('service',$params);
if($err = $nusoap_client->getError()) die("Error: ".$err);
Code:
// Add User
$params = array (         'sid'        => $session_id,
                                        'module'         => 'web',
                                        'function'         => 'user_add',
                                        'params'        => array ( web_title => 'mydomain.com',  // web_title or web_id
                                        user_username => $new_username_field,
                                        user_name => $first_name,
                                        user_email => $new_username_field,
                                        user_passwort => $new_password_field,
                                        user_speicher => 0,
                                        user_mailquota => 1000,
                                        user_admin => 0
                                        ));

$user_id = $nusoap_client->call('service',$params);
if($err = $nusoap_client->getError()) die("Error: ".$err);

// 42go Server logout
$nusoap_client->call('logout',array('sid' => $session_id));

// Error Check
if($err = $nusoap_client->getError()) die("Error: ".$err);
This same code worked fine on the old system. I'm not sure what's wrong.

Last edited by dayjahone; 30th October 2008 at 14:01.
Reply With Quote