Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 8th April 2011, 09:27
dark_stealth dark_stealth is offline
Junior Member
Join Date: Mar 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Automatic registration of users via a remoting framework

I want to create a simple auto register users. Automatically when the registration should be created a web site and ftp user with the same name, for example "legendarno".
Specially pay 5 euro ISPConfig 3 Manual (very little information about the possibilities of the remoting framework) , studied all the examples in remoting_client / examples.
ISPConfig Version:
In this forum, found the script and modified it a bit :
PHP Code:

// Configuration values
$username 'remote_user';
$password 'coolPassWORd';
$soap_location 'https://isp.tld:8080/remote/index.php';
$soap_uri 'https://isp.tld:8080/remote/';
// GET ftp_user ID
function get_ftp_user_id($db_host$db_user$db_password,$db_name,$db_table_ftp,$soap_user) {
$conn mysql_connect($db_host$db_user$db_password) or die('Error connecting to mysql');
    if (
$db_found) {
$SQL "SELECT ftp_user_id FROM $db_table_ftp WHERE username='$soap_user'";
$dbread mysql_fetch_row(mysql_query($SQL));
$primary_id_ftp $dbread[0];
    } else {
$soap_result .= 'Database Not Found ';
// GET client ID
function get_client_id($db_host$db_user$db_password,$db_name,$db_table_client,$soap_user) {
$conn mysql_connect($db_host$db_user$db_password) or die('Error connecting to mysql');
    if (
$db_found) {
$SQL "SELECT client_id FROM $db_table_client WHERE username='$soap_user'";
$dbread mysql_fetch_row(mysql_query($SQL));
$primary_id_client $dbread[0];
    } else {
$soap_result .= 'Database Not Found ';
// GET web_domain ID
function get_domain_id($db_host$db_user$db_password,$db_name,$db_table_webdomain,$soap_domains) {
$conn mysql_connect($db_host$db_user$db_password) or die('Error connecting to mysql');
    if (
$db_found) {
$SQL "SELECT domain_id FROM $db_table_webdomain WHERE domain='$soap_domains'";
$dbread mysql_fetch_row(mysql_query($SQL));
$domain_id $dbread[0];
    } else {
$soap_result .= 'Database Not Found ';

if (isset(
$soap_result 'Results: ';
$soap_function $_REQUEST['SOAP_FUNCTION'];
$soap_user $_REQUEST['SOAP_USER'];
$soap_password $_REQUEST['SOAP_PASSWORD'];
$soap_quota $_REQUEST['SOAP_QUOTA'];
$client = new SoapClient(null, array('location' => $soap_location,
'uri'      => $soap_uri));
try {
$session_id $client->login($username,$password)) {
"Logged:".$session_id."<br />\n";
switch (

// client_add
$param_client = array(        
'server_id' => 1,
'company_name' => 'Auto Registrant',
'contact_name' => 'John Doe',
'username' =>$soap_user,
'password' =>$soap_password,
'language' =>'ru',
'usertheme' =>'default',
'street' =>'mainstreet 10',
'email' =>'mail@domain.com',
'internet' =>'',
'icq' =>'',
'notes' =>'Auto register',  
'template_master' => '3',
'template_additional' =>'',
'web_php_options' =>"n",
'ssh_chsqluser' =>'n');
// send to remote
$reseller_id 0;
$domain_id $client->client_add($session_id$reseller_id$param_client);

// web_domain_add
$client2_id get_client_id($db_host$db_user$db_password,$db_name,$db_table_client,$soap_user);
$param_webdomain = array(
'server_id' => 1,
'ip_address '=>'-1',
'ip_address' =>'' );
// send to remote
$client_id get_client_id($db_host$db_user$db_password,$db_name,$db_table_client,$soap_user);
$domain_id $client->sites_web_domain_add($session_id,$client_id$param_webdomain);

// ftp_client_add
$client1_id get_domain_id($db_host$db_user$db_password,$db_name,$db_table_webdomain,$soap_domains);
$param_ftp = array(
'server_id' => '1',
'gid' => 'client'.$client1_id,
'uid' => 'web'.$client1_id,
'parent_domain_id' => $client1_id,
'quota_size' => $soap_quota,
'dir' => '/var/www/clients/client'.$client1_id.'/web'.$client1_id,
'server' => '1',
'parent_domain_id' =>$client1_id,
'domain' => '1',
'username' =>$soap_user,
'password' =>$soap_password,  
'default_webserver' =>'1');
// send to remote
$client_id get_client_id($db_host$db_user$db_password,$db_name,$db_table_client,$soap_user);
$domain_id $client->sites_ftp_user_add($session_id,$client_id,$param_ftp);
$client->logout($session_id)) {
$soap_result .= 'Logged Out!<br /><br />';

} catch (
SoapFault $e) {
'Error: '.$e->getMessage());

} else {
'Choice (Add, Update or Delete).<br><br>';

$output '
    <form action="http://reg.hosting.tld/reg/index-ftp9.php" method="post">
        <tr><td>Username:</td><td><input type="text" name="SOAP_USER" value="'
.$soap_user.'" /></td></tr>
        <tr><td>Password:</td><td><input type="text" name="SOAP_PASSWORD" value="'
.$soap_password.'"  /></td></tr>
        <tr><td>Quota:</td><td><input type="text" name="SOAP_QUOTA" value="'
.$soap_quota.'"  /></td></tr>
        <input type="radio" name="SOAP_FUNCTION" value="Add"> Add<br>
        <input type="submit" value="Submit" />
After run this script-
Results: Logged Out!

Go admin web interface on https://isp.tld:8080/
Clients page "111 Auto Registrant"
Websites page "111 legendarno"
FTP-user page "user legendarno"

HTML Code:
mysql> SELECT document_sqluser FROM web_domain WHERE domain='legendarno.hosting.tld';
| document_sqluser                   |
| /var/www/clients/client0/web111 |
mysql> SELECT dir FROM ftp_user WHERE username='legendarno';
| dir                               |
| /var/www/clients/client111/web111 |
Authorization client "legendarno" from https: / / isp.tld: 8080 / is normally
Authorization client "legendarno" from FTP failed.
User legendarno OK. Password required
PASS **********
530 Login authentication failed

Help me please-
How do I change client id in the table web_domain or report while adding web_domain current id?
Or how to properly make the automatic registration with the terms of Automatic creation of records in the table web_domain and ftp_user

Last edited by dark_stealth; 8th April 2011 at 10:13.
Reply With Quote
Sponsored Links


remoting framework

Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freebsd 6.1 support misterm Installation/Configuration 10 9th April 2009 10:29
Problem with Clamav + samba configuration wammy28 HOWTO-Related Questions 8 31st January 2009 20:12
Cacti and ISPConfig: Monitoring Tool VMartins Tips/Tricks/Mods 11 9th August 2008 19:37
Add Users with Remoting Framework dayjahone General 4 6th July 2007 12:21
Junk mail and spamassassin... sthompson Installation/Configuration 4 27th December 2006 17:11

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

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.