Automate user signup.

Discussion in 'Tips/Tricks/Mods' started by Tommahawk, Aug 15, 2007.

  1. grandpagenocide

    grandpagenocide ISPConfig Developer ISPConfig Developer

    krakoukas
    yes i used the patched kunde lib, I am using fedora core 6, and the patch worked perfect
     
  2. krakoukas

    krakoukas New Member

    Which soap client are you using? Did you installed 2.2.17 release?
    Knowing that you succeed gives me hope... I am reseting my server now. I'll let you now (finger crossed)
     
  3. grandpagenocide

    grandpagenocide ISPConfig Developer ISPConfig Developer

    krakoukas,
    I have it working on 2.2.17, I am still having problems with getting it to work on 2.3.3 dev. I dont know if this will make a difference but I have php enabled globally
     
  4. krakoukas

    krakoukas New Member

    Damned!!

    I have just installed from scratch a new ispconfig server using 2.2.18 (that says correcting a remoting issue).
    By the way, following howto http://www.howtoforge.com/perfect_setup_ubuntu_6.06_p7, you must add libxml2-dev package to succeed installation if you remove the disabled xml compilation directives for "remoting" use.

    On the first test of remoting, my client script didn't gave me Client ID, but Web and user was created! Looking in db, I found that a double Client entry is in isp_isp_kunde not displayed in ISPconfig admin interface...

    I used trash for created web site and emptied it. All db records went off.
    Now trying again this infamous "No data present..." comes again.

    I tried replacing ispconfig_kunde.lib.php with your patched one Tommahawk, but still the same problem.

    I would like to make a clean install of ispconfig without starting from scratch.
    If I drop the database, remove /root/ispconfig and /home/admispconfig is it clean enough and can I consider that I can start from there?
     
  5. krakoukas

    krakoukas New Member

    I am getting mad!!! I've started a from scratch installation with 2.2.18 release.
    Following Perfect Setup Howto for Ubuntu 6.06_LTS, changing compile options, installing remoting and user... Carefully, step by step.

    And again: "No data present after HTTP header" message when I use autosignup.php

    I think I will stop installing again ISPconfig and try to make a new client script from test.php to see where things breaks...
    I really need to have remoting work as I cannot make manual inscription of users!
     
  6. krakoukas

    krakoukas New Member

    PHP:
    function client_add($user_id$user_email$user_password$user_IP)
    {
    $server_url "https://www.myserver.com:81";
    $login_parameters = array('user' => 'admin''pass' =>  'password');
    $soap_client = new soap_client($server_url.'/remote/index.php');

    $session_id $soap_client->call('login',$login_parameters);
    if(
    $err $soap_client->getError()) print("Error open session: ".$err);
    else print 
    $server_url."<br>Session soap_client: ".$session_id;

    $client_params = array ( 'sid' => $session_id,
    'module' => 'kunde',
    'function' => 'kunde_add',
    'params' => array (    reseller_title => 'admin',
                    
    kunde_title => $user_id,
                    
    kunde_anrede => 'Herr',  // Herr, Frau, Firma
                    
    kunde_firma => 'Free User',
                    
    kunde_vorname => 'prenom',
                    
    kunde_name => 'nom',
                    
    kunde_strasse => '00 adresse',
                    
    kunde_plz => '00000',
                    
    kunde_ort => 'ville',
                    
    kunde_land => 'FR',
                    
    kunde_telefon => '0102030405',
                    
    kunde_fax => '0607080900',
                    
    kunde_email => $user_email,
                    
    kunde_internet => 'http://'.$user_id.'.mydomain.com',
                    
    webadmin_user => $user_id,
                    
    webadmin_passwort => $user_password,
                    
    kunde_province => $user_IP
                    
    )
    );
                            
    $client_id $soap_client->call('service',$client_params);
    if(
    $err $soap_client->getError()) die("Error client_add: ".$err);
    print_r("ID  ".$client_id."<br>");

    $soap_client->call('logout',array('sid' => $session_id));
    }

    client_add("userid""[email protected]""9237"$_SERVER['REMOTE_ADDR']);


    This code returns me a valid $session_id but no $err nor $client_id during 'kunde_add' call

    What is wrong? How could I be sure that remoting is OK if nothing returns from it?
    How could I debug it and find what is wrong?
     
  7. TexasTaz

    TexasTaz New Member

    Re: Auto Signup

    I noticed in the autosignup.php there where about 8 packages already there do we need to have those hosting plans/packages created or can we do our own?

    What else do we have to edit to make this work?
     
  8. mumbly

    mumbly Member

  9. krakoukas

    krakoukas New Member

    Attached Files:

  10. mumbly

    mumbly Member

    error ...

    I run ISPConfig 2.2.18 ...
    I've recompiled with xml and installed ispconfig-remoting tool with libxml2-dev on my Ubuntu 7.10 Gutsy Gibbon system.

    I've "included" the auto-signup.php file in my sign-up web-site page but all i have is a "weird" error :

    Code:
    Warning: SoapClient::SoapClient(https://arakis.s2ii.com:81/remote/index.php) [function.SoapClient-SoapClient]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in /var/www/web1/web/inscriptions/autosignup.php on line 119
    
    Warning: SoapClient::SoapClient() [function.SoapClient-SoapClient]: I/O warning : failed to load external entity "https://arakis.s2ii.com:81/remote/index.php" in /var/www/web1/web/inscriptions/autosignup.php on line 119
    
    Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://arakis.s2ii.com:81/remote/index.php' in /var/www/web1/web/inscriptions/autosignup.php:119 Stack trace: #0 /var/www/web1/web/inscriptions/autosignup.php(119): SoapClient->SoapClient('https://arakis....') #1 /var/www/web1/web/inscriptions.php(173): include('/var/www/web1/w...') #2 {main} thrown in /var/www/web1/web/inscriptions/autosignup.php on line 119
    
    I've tried several things (http://www.howtoforge.com/forums/showthread.php?t=17281) with no success ...
    Curl is part of my php (http://www.s2ii.com/tec1.php?phpinfo)

    Any idea ?

    My subscription page (in a beta state !) is here : http://www.s2ii.com/inscriptions.php
     
  11. mumbly

    mumbly Member

    Sorry ... my fault ... it works like a charm ! ;o)
    It was a soapclient error ... as i was forced to convert each "soapclient" word in "soap_client" in order to get the soap fonction working ... and i forgot ONE !
    Then i used SED to convert the whole file ... and it did the trick ! :eek:)

    Just one thing : I can't get the option 'mail user login' to work with th autosignup ...
    I mean, i'd like to enable it when signing in !

    I've tried to add :
    'web_mailuser_login' => '1',
    But it does not work ...
    any idea ???

    This "autosignup" script is awesome !
    Thanx a lot !
     
    Last edited: Dec 13, 2007
  12. grandpagenocide

    grandpagenocide ISPConfig Developer ISPConfig Developer

    Tommahawk,
    Hope you dont mind I posted up a copy of your script with a billing api for authorize.net and edited it as well for a resellerss autosignup
    Thanks for the help, your script is actually helping me bring in business, I owe u one
     
  13. Rockdrala

    Rockdrala New Member

    erm

    Why not just write a script in php that performs mysql updates to the ispconfig database through the php-mysql server connector instead of going through all the trouble to use the remoting connector just for this feature.
    *blinks*

    Or im missing something here?
     
  14. falko

    falko Super Moderator ISPConfig Developer

    That's possible - if you know how the database works. And the ISPConfig database structure is a little bit complex...
     
  15. Rockdrala

    Rockdrala New Member

    Well

    This is just my opinion but probably since i spent 8 years on making php installs work good on windows servers.

    But it would have seem to me if one knows a little a php and understands mysql it would have been a little more easy then adapating a xml plugin to a remote authentication.

    And it would seem more logical as a php written page can be ssl secured as well as have a login system on its own.

    Just my opinion though. Im not trying to undermine anyones work.

    Unless the sql server was modified by the ISPconfig install to not allow certain fields to be updated, browsed or changed i dont see any problem with writing a script to do the work. And even give the a scrip login access of its own.

    Php is a very powerful tool. One should learn it well, it can connect to remote mysql databases, integrate other emdedded langauges and rewrite urls. It brings a lot of things in one place leaving other langauges in the dust.

    It also seems unreasonable to use XML like this to make up dates. With a modified RSS news feeder someone can easily snatch all and see all the xml transmissions fed into your network which seems impractible for this type of security.

    Which is why XML is mainly used for broadcasting news and product listings becuase people dont care if they see them.

    Where a php, mysql script can be much more secure.

    May the force be with you....
     
    Last edited: Dec 27, 2007
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats not correct in my opinion because many actions depend on the inserted records and you would have to rebuild these cations exactly in your code as ISPConfig does. These actions can change from version to version of ISPConfig and it is always better to use a clean API then trying to modify the internal structures of ISPConfig directly. You would have to rebuild a lot of ISPConfig code to create all the depending records. Additionally, a soap interface is programming language independant. Who says that everyone wants to use PHP? There is even a guy working on a windows desktop application that allows the remote management of ISPConfig servers and you want to open up your mysql databse server with write permissions to all your customers?

    Then he must be able to break the SSL encryption of the communication first ;)

    Did you ever hear of SOAP and XMLRPC which are common XML based communication protocols? These protocols are implemented in most programming languages to allow different computer architectures and languages to communicate with ecah other in a secure manner over the internet.
     
  17. Rockdrala

    Rockdrala New Member

    erm

    Yes the Authentication maybe ssl encoded however the XML broadcast packets itself is not transmitted encoded. In fact weve done this test 2 years ago in our lab with a modifed rss news feeder. XML communications sent are not encoded.

    This is why (people use them mainly to broadcast news feeds and product listings.)

    XML is useful in its purposes.

    Its lightwieght and used in video games a file manager. You can almost find XML as the file manager on all new gaming system games becuase its compatibility with directx api's
    Its useful for setting up feeds that are public so you can send your news to another sites auto feed readers.
    Its useful for database engine searches that need public listings of site directories and product listings.

    But when it comes to data security and accesing databases, updating fields, i would not recommend using this as your solution. Its a very open transmission thats seeable by even elementary school hackers.
     
    Last edited: Dec 27, 2007
  18. Rockdrala

    Rockdrala New Member


    If you write it right. There only to privy to there own records that you give them permission to update. Which is no different from the ISPconfig interface. They would not have permission to "other customers records" providing you know what your doing. Im not sure where you getting this information about php. but php is is a very versatile langauge that can do just about anything you want.

    on Another note. Other main stream web hosters. Godaddy, Yahoo, many others use php for there customers to interface with there information because of the security and how highley dynamic it is.

    Im afraid putting down php is not a good thing mate :/ A lot of developers i work with feel that php will most likely replace java in the forseeable future and we may be seeing php driven cell phones soon.

    If you dont understand how the XML is sent un encoded i wont post how to get the transmissions on here but if you give me your email ill give you the directions on how you can sniff and get completley un encoded XML transmissions and youll see what im talking about. Just give me your email and you can try it in your lab.

    Its a real eye opener.
     
    Last edited: Dec 27, 2007
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    The XML communication that ISPConfig uses is completely SSL encoded, there are no additional broadcasts used. If you can sniff the data of the SSL encoded ISPConfig remoting connection, please send me the results to dev [at] ispconfig [dot] org
     
  20. Gimly

    Gimly Member

    Hi all :),

    I've problem with remote framework, I use the script autosignup on this topic. I've correctly added user remote(script & ispconfig), server and co on this. I test the script and I viewing the result :"Congratulation, your account is enable" and they are no error on script, but when I go on ISPConfig, the account doesn't exist, no user, no domain, etc ...

    I can see the index.php in the /remote/ dir

    I don't understand where the problem come from.
    How can I test my remote user correctly for know if it work good ?

    Do you have any idea ?
    Thank you in advance for your answers :)

    -- edit : you can find here the phpinfo() for the server and phpinfo() for ispconfig. suPHP and mod_security are enable.
    Php script are here --
    -- edit 2 : software version : debian etch updated, php 5.2.5 with xml, ispconfig 2.2.19 --
     
    Last edited: Feb 7, 2008

Share This Page