Problems with Remoting

Discussion in 'Installation/Configuration' started by DCGWS, Dec 14, 2007.

  1. DCGWS

    DCGWS New Member

    For some reason I cannot get remoting to work. I have recompile PHP enabling xml - http://www.dcgws.com:81/phpinfo.php - Server side

    http://www.d-c-g.com/phpinfo.php - Client side

    autosignup.php

    Code:
    <? 
    	//include('nusoap.php');
    	include_once('soap.lib.php');
    
    	$e = 0;
    
    	$server = "dcgws.com"; 		//for subdomains 5s7.com
    	$serverpath = "http://www.dcgws.com:81/remote/index.php";	//soap server http://www.5s7.com:81/remote/index.php
    
    //	$server = "5s7.com"; 	//for subdomains 5s7.com
    //	$serverpath="http://www.5s7.com:81/remote/index.php";	//soap server http://www.5s7.com:81/remote/index.php
    
    	$parameters = array('user' => 'drdavisjr', 'pass' => 'xxxxxxxxxx');
    
    	if ($parameters['user'] == "") {
    		echo "Please enter your remoting framework username on line 11<br />";
    		$e = 1;
    	}
    
    	if ($parameters['pass'] == "") {
    		echo "Please enter your remoting framework password on line 11<br />";
    		$e = 1;
    	}
    
    	if ($server == "") {
    		echo "Please enter your server domain name on line 6<br />";
    		echo "e.g $server = \"dcgws.com\";<br />";
    		$e = 1;
    	}
    
    	if ($serverpath == "") {
    		echo "Please enter the path to your soap server on line 7<br />";
    		echo "e.g $serverpath=\"http://www.dcgws.com:81/remote/index.php\";<br />";	//soap server
    		$e = 1;
    	}
    
    	if ($e == 1) exit();
    
    	$id = 0;
    
    	if (isset($_GET['id'])) $id = $_GET['id'];
    
    	switch ($id) {
    		case 1:
    		    $plan = "Personal";
    		break;
    		case 2:
    		    $plan = "Standard";
    		break;
    		case 3:
    		    $plan = "Corporate";
    		break;		
    	}
    ?>
    
    <h2 class="hp"><span><? echo $plan; ?></span></h2>
    
    
    I will paste more code if I need to. Thanks in advance to anyone that replies.
     
    Last edited: Dec 14, 2007
  2. DCGWS

    DCGWS New Member

    Here's What I Have Done...

    1. I just finished re-installing ISPConfig-2.2.18
    2. Edited compile_aps/compile and deleted all references to disable xml
    3. Using Update Tool I reinstalled remoting framework
    4. created remote user

    Ran my autosignup.php script.

    Script ran successfully but not client. nor user, nor web was created.

    What am I doing wrong?
     
  3. DCGWS

    DCGWS New Member

    Problem Solved and Now Working..

    For those of you still trying to get this working, here is my fix and why it works.

    Use ISPConfig-2.2.18 with XML enabled. Do not use https (I didn't so as to prevent issues with the soap server communicating to the remoting parser.)

    Here is the working part of autosignup.php (I have left out html/css code for obvious reasons.)
    Code:
    <? 
    include_once('soap.lib.php');
    $server_url = "http://www.dcgws.com:81";
    $soapclient = new soapclient($server_url.'/remote/index.php');
    $parameters = array('user' => 'drdavisjr',
                        'pass' =>  'xxxxxxxxxxx');
    $session_id = $soapclient->call('login',$parameters);
    ?>
    <h2 class="hp"><span>Personal Plan</span></h2>
    <?
    
    if (isset($_POST['submit'])) {
    $company = $_POST['company'];
    $title = $_POST['title'];
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $address = $_POST['address'];
    $suburb = $_POST['suburb'];
    $state = $_POST['state'];
    $country = $_POST['country'];
    $postcode = $_POST['postcode'];
    $telephone = $_POST['telephone'];
    $email = $_POST['email'];
    $domain = $_POST['domain'];
    $username = $_POST['username'];
    $password = $_POST['password'];
    
    $paramA = array ('sid' => $session_id,
                     'module' => 'kunde',
                     'function' => 'kunde_add',
                     'params' => array (reseller_title => 'admin',
                                        kunde_title => $username,
                                        kunde_anrede => $title,
                                        kunde_firma => $company,
                                        kunde_vorname => $firstname,
                                        kunde_name => $lastname,
                                        kunde_strasse => $address,
                                        kunde_plz => $postcode,
                                        kunde_ort => $suburb,
    									kunde_province => $state,
                                        kunde_land => $country,
                                        kunde_telefon => $telephone,
                                        kunde_fax => '',
                                        kunde_email => $email,
                                        kunde_internet => '',
                                        webadmin_user => $username,
                                        webadmin_passwort => $password,
                                        kunde_province => $state));
    
    		$kunde_id = $soapclient->call('service', $paramA);
    		if($err = $soapclient->getError()) die("Error: ".$err);
    		echo $kunde_id;
    
    $paramB = array ('sid' => $session_id,
            	                 'module' => 'web',
                    	         'function' => 'web_add',
                            	 'params' => array (kunde_title => $username,
    	                                            web_title => $domain,
            	                                    web_host => 'www',
                    	                            web_domain => $domain,
                            	                    web_ip => '192.168.0.132',
                                    	            web_speicher => '25',
                                            	    web_dns => 1,
    	                                            web_userlimit => 5,
            	                                    web_domainlimit => 5,
                    	                            web_shell => 0,
                            	                    web_cgi => 0,
                                    	            web_standard_cgi => 0,
                                            	    web_php => 1,
    	                                            web_php_safe_mode => 0,
            	                                    web_ssi => 0,
                    	                            web_ftp => 0,
                            	                    web_frontpage => 0,
    	                                            web_mysql => 1,
            	                                    web_mysql_anzahl_dbs => 2,
                    	                            web_ssl => 0,
                            	                    web_anonftp => 1,
                                    	            web_anonftplimit => 0,
                                            	    web_wap => 0,
    	                                            web_individual_error_pages => 1));
    												
    		$web_id = $soapclient->call('service', $paramB);
    		if($err = $soapclient->getError()) die("Error: ".$err);
    		echo $web_id;
    
    		$paramC = array ('sid' => $session_id,
            	                 'module' => 'web',
                    	         'function' => 'user_add',
                            	 'params' => array (web_title => $domain,
                                    	            user_username => 'web'.$web_id.'_'.$username,
                                            	    user_name => $lastname,
    	                                            user_email => $username.'@'.$domain,
            	                                    user_passwort => $password,
                    	                            user_speicher => '10',
                            	                    user_mailquota => '10',
                                    	            user_admin => '1'));
    
            $user_id = $soapclient->call('service', $paramC);
    		if($err = $soapclient->getError()) die("Error: ".$err);
    		echo $user_id;
    		
        	$soapclient->call('logout',array('sid' => $session_id));
    		
    echo 'Welcome to DCGWS Hosting, registration is complete please <a href="http://www.dcgws.com:81/login.php">login</a> and upload your website<b>. Your account should be active immediately.';
    
    } else { ?>
    
    Here I put my form in HTML
     }?>
     
  4. DCGWS

    DCGWS New Member

    Solution Continued

    I also had to make a minor edit to /home/admispconfig/ispconfig/lib/lang/en.lng simply deleting the "Next" links since PHP was having issues parsing $s string.

    NOTE: You have to create the web before creating the user since we will be using $web_id when creating the user.
     

Share This Page