I installed Remoting Access, created a user, changed the server, user, and password in the test.php file. I uncommented the part to add a user. I uploaded the two php files to the /web directory. When I go to
http://mydomain.com/test.php, I get the following error?
Code:
Fatal error: Cannot redeclare class soapclient in /var/www/web1/web/soap.lib.php on line 4101
Eventually, I would like this to be a form that I can just fill out to create a user rather than changing the php file.
This is what I changed:
Code:
include("soap.lib.php");
// Insert here your 42go Server
$server_url = "https://server1.mydomain.com:81";
// creating object for SoapClient
$soapclient = new soapclient($server_url.'/remote/index.php');
// Username and Password of the remoting user (not identical
// with the user to log into the web interface!)
$parameters = array('user' => 'remotingAdmin',
'pass' => 'password');
// Login into 42go Server
$session_id = $soapclient->call('login',$parameters);
// Error Check
if($err = $soapclient->getError()) die("Error: ".$err);
/*
and this is what I uncommented:
Code:
$params = array ( 'sid' => $session_id,
'module' => 'web',
'function' => 'user_add',
'params' => array ( web_title => 'mydomain.com', // web_title or web_id
user_username => 'mydomain.com_uwe',
user_name => 'Uwe Meier',
user_email => 'uwe',
user_passwort => 'sagichnicht',
user_speicher => 10,
user_mailquota => 10,
user_admin => 0
));
$user_id = $soapclient->call('service',$params);
if($err = $soapclient->getError()) die("Error: ".$err);
print_r($user_id);
Recent comments
1 day 4 hours ago
1 day 7 hours ago
1 day 8 hours ago
1 day 10 hours ago
1 day 11 hours ago
1 day 13 hours ago
1 day 14 hours ago
2 days 6 hours ago
2 days 7 hours ago
2 days 10 hours ago