New ISPConfig module for WHMCS

Discussion in 'Tips/Tricks/Mods' started by cwispy, Dec 11, 2014.

  1. cwispy

    cwispy Active Member


    You just need to add this to your PHP.INI file on your WHMCS instance.

    error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING
     
  2. alex_xwire

    alex_xwire New Member

    Hi All, not sure anyone knows a fix for this? Looks like an ISPConfig error not a module problem... please help!

    Code:
    [Fri Jan 15 11:04:41.737638 2016] [fcgid:warn] [pid 16656] [client 10.123.1.1:55475] mod_fcgid: stderr: PHP Warning:  include(/usr/local/ispconfig/interface/lib/lang/.lng): failed to open stream: No such file or directory in /usr/local/ispconfig/interface/lib/classes/tform.inc.php on line 134
    [Fri Jan 15 11:04:41.737681 2016] [fcgid:warn] [pid 16656] [client 10.123.1.1:55475] mod_fcgid: stderr: PHP Warning:  include(/usr/local/ispconfig/interface/lib/lang/.lng): failed to open stream: No such file or directory in /usr/local/ispconfig/interface/lib/classes/tform.inc.php on line 134
    [Fri Jan 15 11:04:41.737694 2016] [fcgid:warn] [pid 16656] [client 10.123.1.1:55475] mod_fcgid: stderr: PHP Warning:  include(): Failed opening '/usr/local/ispconfig/interface/lib/lang/.lng' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /usr/local/ispconfig/interface/lib/classes/tform.inc.php on line 134
    [Fri Jan 15 11:04:41.737703 2016] [fcgid:warn] [pid 16656] [client 10.123.1.1:55475] mod_fcgid: stderr: PHP Warning:  include(lib/lang/en_dns_soa.lng): failed to open stream: No such file or directory in /usr/local/ispconfig/interface/lib/classes/tform.inc.php on line 141
    [Fri Jan 15 11:04:41.737712 2016] [fcgid:warn] [pid 16656] [client 10.123.1.1:55475] mod_fcgid: stderr: PHP Warning:  include(lib/lang/en_dns_soa.lng): failed to open stream: No such file or directory in /usr/local/ispconfig/interface/lib/classes/tform.inc.php on line 141
    [Fri Jan 15 11:04:41.737721 2016] [fcgid:warn] [pid 16656] [client 10.123.1.1:55475] mod_fcgid: stderr: PHP Warning:  include(): Failed opening 'lib/lang/en_dns_soa.lng' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /usr/local/ispconfig/interface/lib/classes/tform.inc.php on line 141
    [Fri Jan 15 11:04:41.765214 2016] [fcgid:warn] [pid 16656] (104)Connection reset by peer: [client 10.123.1.1:55475] mod_fcgid: error reading data from FastCGI server
    [Fri Jan 15 11:04:41.765281 2016] [core:error] [pid 16656] [client 10.123.1.1:55475] End of script output before headers: index.php
    Same error as Brano is getting.

    Thanks in advance.
     
  3. BenM

    BenM Member

    Hi All,
    Got a problem with up and downgrading a package. Whmcs seems to work fine, as the System Activity Log reports: Module Change Package Successful - Service ID: 26 but de module log stays empty.

    So no error ??

    Any one?

    Regards
     
    Last edited: Apr 16, 2017
  4. cwispy

    cwispy Active Member

    I have been doing some testing. I upgraded a development server from Wheezy to Jessie, and I started getting the same error. So I started digging about, and I have so far found that php5-cgi is crashing with the below error in syslog.

    kernel: [10967.876642] traps: php-cgi[13426] general protection ip:6ea19f sp:7ffdd10f4f60 error:0 in php5-cgi[400000+7e1000]

    I will continue looking into the issue. I have version php5-cgi 5.6.14+dfsg-0+deb8u1 installed.
     
  5. alex_xwire

    alex_xwire New Member

    Hi Cwispy, thanks for the update.
    Just to let you know, I've also tried it with php5.4.12 but still the same problem.
    Thanks,
    Alex
     
  6. BenM

    BenM Member

    Nobody having problems with up en downgrading a package in whmcs for ispconfig??
    Cwispy can you confirm this works in whmcs 6.2 php 5.6 ?

    Thanks,
    Ben
     
  7. cwispy

    cwispy Active Member

    Hi Ben,
    Sorry I can not confirm this as I have not upgraded to 6.2 yet.
    cwispy
     
  8. cwispy

    cwispy Active Member

    An update on this issue. I rolled back all the php5 packages on the ispconfig server from version 5.6.14+dfsg-0+deb8u1 to version 5.4.45-0+deb7u2 from the oldstable repository and things work again and the php5-cgi general protection fault is no longer present. I still have not been able to find the actual issue in php5 to report it as a bug.

    Edit: Put the wrong version numbers of the packages. Fixed now.
     
    Last edited: Jan 24, 2016
  9. BenM

    BenM Member

    Hi Cwispy,

    Any idea on how to debug this function for upgrading en downgrading packages?
    Got no error, bur its not upgrading or downgrading anything.

    Realy stuck here

    Ben
     
  10. BenM

    BenM Member

    added
    logModuleCall('ispconfig','ChangePackage', $clientsdetails, $affected_rows,'','');
    Missing info on the limits for harddisk and traffic Quota.
    Is this module design to automatic change the website setting? Ie changes only the template!
    @cwispy is that correct?

    Regards Ben
     
  11. BenM

    BenM Member

    I think this is sites_web_domain_update what i want.

    Can someone help me?
     
  12. Thaddeus

    Thaddeus New Member

    A small enhancement on the module to enable auto login by the client. This has not been thoroughly tested, but is currently working.
    As per LKTechnik's post https://www.howtoforge.com/community/threads/embedd-login-form-into-website.40459/page-2
    you must change the /usr/local/ispconfig/interface/lib/config.inc.local.php
    and add the following lines
    Code:
    header('Access-Control-Allow-Origin: http://www.yoururl.tld');
    header('Access-Control-Allow-Methods: POST');
    header('Access-Control-Allow-Credentials: true');
    
    Edit the functions in ispcfg3.php at the end of the file
    Code:
    function ispcfg3_LoginLink( $params ) {
    
        $soapsvrurl         = $params['configoption3'];
        $soapsvrssl         = $params['configoption4'];
    
        if ( $soapsvrssl == 'on' ) {
           
            $soapsvrurl = 'https://' . $soapsvrurl . '';
           
        } else {
           
            $soapsvrurl = 'http://' . $soapsvrurl . '';
           
        }
    
        return '
        <button type="button" class="btn btn-xs btn-success" onclick="$(\'#frmIspconfigLogin\').submit()">Login to Controlpanel</button>
        <script type="text/javascript">
        var ispconfigForm = "<form id=\"frmIspconfigLogin\" action=\"'.$soapsvrurl.'/index.php\" method=\"GET\" target=\"_blank\"></form>";
        $(document).ready(function(){
            $("body").append(ispconfigForm);
            $("#frmIspconfigLogin").submit(function(){
                $.ajax({ 
                    type: "POST", 
                    url: "'.$soapsvrurl.'/content.php",
                    data: "s_mod=login&s_pg=index&username='.$params['username'].'&passwort='.$params['password'].'", 
                    xhrFields: {withCredentials: true} 
                });
            });
        });
        </script>';
    }
    
    function ispcfg3_ClientArea( $params ) {
    
        $soapsvrurl         = $params['configoption3'];
        $soapsvrssl         = $params['configoption4'];
    
        if ( $soapsvrssl == 'on' ) {
           
            $soapsvrurl = 'https://' . $soapsvrurl . '';
           
        } else {
           
            $soapsvrurl = 'http://' . $soapsvrurl . '';
           
        }
    
        $code = '
        <form id="frmIspconfigLogin" action="'.$soapsvrurl.'/index.php" method="GET" target="_blank">
        <button type="submit" class="btn btn-xs btn-success">CONTROLPANEL LOGIN</button>
        </form>
    
        <script type="text/javascript">
        $("#frmIspconfigLogin").submit(function(){
            $.ajax({ 
                type: "POST", 
                url: "'.$soapsvrurl.'/content.php",
                data: "s_mod=login&s_pg=index&username='.$params['username'].'&passwort='.$params['password'].'", 
                xhrFields: {withCredentials: true} 
            });
        });
        </script>';
    
        return $code;
    }
    
    Login as client in whmcs to test. You can also autologin from the admin side when viewing client account. Not tested with client having multiple hosting accounts.
    Corrections, enhancements and ideas to make this better always appreciated.
     
    biforme, cwispy, BenM and 1 other person like this.
  13. cwispy

    cwispy Active Member

    Nice job Thaddeus. :)

    I will add it to the source.
     
  14. BenM

    BenM Member

    Work great. Indeed an issue with multiple hosting accounts. The browser hang on to the previous login so the next user get the wrong hosting info. Try some cache disabled, but that make no difference.

    It works without:
    header('Access-Control-Allow-Origin: http://www.yoururl.tld');
    header('Access-Control-Allow-Methods: POST');
    header('Access-Control-Allow-Credentials: true');

    Is that okay?
     
  15. radim_h

    radim_h Member HowtoForge Supporter

    For me it look that module stopped working under WHMCS 6.2.2
    Getting "Module Command Error
    SOAP Error: looks like we got no XML document"

    How shoudl i set some detailed logging? Module log ini_set("display_errors", 1); isn't telling much...
     
  16. radim_h

    radim_h Member HowtoForge Supporter

    You can also open hidden iframe with logout
    $code = '<a href="' . $soapsvrurl . '" target="_blank" id="login-btn"class="btn" ><b>Klikněte pro přihlášení / Click for login<br />WEBHOSTING ADMIN</b></a>';
    $code1 = "<iframe id=\"ispcLogout\" style=\"visibility: hidden; height: 0; width: 0; \" src=\"$soapsvrurl/login/logout.php\"></iframe>";
     
  17. BenM

    BenM Member

    Thank you. Maby cwispy can take this into the code.

    Regards, Ben
     
  18. ladylinux

    ladylinux New Member

    Hello,

    Likely something I am doing dimwitted but I can not get this to work and its oh so close :)

    I have a 5 server ISPCONFIG system like so

    1. One dedicated panel only server running Debian Jessie

    2. Two dedicated nameservers Debian Wheezy

    3. One dedicated mail only server running Debian Jessie

    4. One dedicated Web/Mysql only server running Centos 6.X (Had Some PHP-FPM weirdness and I went Centos because I am more comfortable with it in a Web setting)

    I have a couple accounts added manually to the "Cluster" and they are both working perfectly.

    I have the latest WHMCS 6.2.2 on the Web/Mysql server using PHP 5.6.19 and Maria DB 10 and its working great.

    The issue is that after days of trying to get this module to work I still get the dreaded "SOAP Error: no_server_error" error when and only when I have "Create DNS" checked.

    Web , Mail And FTP User Get Created Just Fine If That Is Unchecked.

    Now here is where things get weird. The DNS zone does get created just fine but the sign-up fails. I have to go in and manually remove the user created from ISPConfig and uncheck the "Create DNS" box.

    I am using a custom DNS template but even the stock template fails. The server group looks proper to me.

    So if I can get past this I can move on to tweaking other things to get these sign-ups to work.

    Error Code Sanitized:

    Thanks!!

    Francesca[/QUOTE]
     
  19. BeNeDeLuX

    BeNeDeLuX New Member

    Someone has it working with the current git-stable 3.1b1 ?
    Had not luck so far in my test for the new ispCocnfig version --> "Module Command Error SOAP Error: Could not connect to host"
    The request arrived fine on the target Server. I checkd it with tcpdump and wireshark. So it is no URL, Port or Firwall problem.
    Maybe something has changed inside the API in Version 3.1 ?
     
  20. webguyz

    webguyz Active Member HowtoForge Supporter

    Are you using SSL to connect to the ISPConfig master? I have not tried 3.1 yet but I initially set up my ISPConfig 3.0 without SSL and added SSL later and had a similar error when connecting with ispcfg3. I had to add a line (bolded text below) to all my connect code in ispcfg3 because of the SSL. Maybe your problem is the same?

    $client = new SoapClient( null,
    array( 'location' => $soap_url,
    'uri' => $soap_uri,
    'exceptions' => 1,
    'stream_context'=> stream_context_create(array('ssl'=> array('verify_peer'=>false,'verify_peer_name'=>false))),
    'trace' => false
    )
    );
     
    BeNeDeLuX likes this.

Share This Page