Ini module bisa jalan di whmcs gk?

Discussion in 'Software Hosting dan Control Panel' started by Naufal budiono, 9 Jan 2017.

  1. Naufal budiono

    Naufal budiono Apprentice 2.0

    Messages:
    426
    Likes Received:
    8
    Trophy Points:
    18
    Mau tanya, saya download module centos webpanel untuk whmcs di situsnya cwp. Nah yg saya tanyakan module ini bisa jalan gk di whmcs? apa harus ditambahkan?
    PHP:
    <?php
    // whmcs module for cwp ver 1.0

    function centoswebpanel_ConfigOptions() {
      
    $configarray = array(
        
    "PACKAGE-NUMBER" => array( "Type" => "text""Description" => "Package ID""Default" => "1"),
        
    "inode" => array( "Type" => "text" "Description" => "Max of inode""Default" => "0",),
        
    "nofile" => array( "Type" => "text""Description" => "Max of nofile""Default" => "100", ),
        
    "nproc" => array( "Type" => "text" "Description" => "Nproc limit - 40 suggested""Default" => "40",),
      );
      return 
    $configarray;
    }

    function 
    centoswebpanel_CreateAccount($params) {
      if (
    $params["server"] == 1) {
        
    $postvars = array(
          
    'package' => $params["configoption1"],
          
    'domain' => $params["domain"],
          
    'key' => $params["serveraccesshash"],
          
    'api' => 'account_new',
          
    'username' => $params["username"],
          
    'password' => $params["password"],
          
    'email' => $params["clientsdetails"]["email"],
          
    'inode' => $params["configoption2"],
          
    'nofile' => $params["configoption3"],
          
    'nproc' => $params["configoption4"],
        );
        
    $postdata http_build_query($postvars);

        
    $curl curl_init();
        
    curl_setopt($curlCURLOPT_URL'https://' $params["serverhostname"] . ':2031/api/');
        
    curl_setopt($curlCURLOPT_RETURNTRANSFER,true);
        
    curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);
        
    curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
        
    curl_setopt($curlCURLOPT_POSTtrue);
        
    curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
        
    $answer curl_exec($curl);

        
    logModuleCall('centoswebpanel','CreateAccount_UserAccount','https://' $params["serverhostname"] . ':2031/api/'.$postdata,$answer);
      }

      if(
    $answer == 'OK') {
        
    $result "success";
      } else {
        
    $result $answer;
      }
      return 
    $result;

    }

    function 
    centoswebpanel_TerminateAccount($params) {
      if (
    $params["server"] == 1) {
          
    $postvars = array('key' => $params["serveraccesshash"],'api' => 'account_remove','username' => $params["username"]);
          
    $postdata http_build_query($postvars);

          
    $curl curl_init();
          
    curl_setopt($curlCURLOPT_URL'https://' $params["serverhostname"] . ':2031/api/');
          
    curl_setopt($curlCURLOPT_RETURNTRANSFER,true);
          
    curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);
          
    curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
          
    curl_setopt($curlCURLOPT_POSTtrue);
          
    curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
          
    $answer curl_exec($curl);

          
    logModuleCall('centoswebpanel','TerminateAccount','https://' $params["serverhostname"] . ':2031/api/'.$postdata,$answer);
      }

      if(
    $answer == 'OK') {
        
    $result "success";
      } else {
        
    $result $answer;
      }
      return 
    $result;
    }

    function 
    centoswebpanel_SuspendAccount($params) {
      if (
    $params["server"] == 1) {
        
    $postvars = array('key' => $params["serveraccesshash"],'api' => 'account_suspend','username' => $params["username"]);
        
    $postdata http_build_query($postvars);

        
    $curl curl_init();
        
    curl_setopt($curlCURLOPT_URL'https://' $params["serverhostname"] . ':2031/api/');
        
    curl_setopt($curlCURLOPT_RETURNTRANSFER,true);
        
    curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);
        
    curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
        
    curl_setopt($curlCURLOPT_POSTtrue);
        
    curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
        
    $answer curl_exec($curl);

        
    logModuleCall('centoswebpanel','SuspendAccount','https://' $params["serverhostname"] . ':2031/api/'.$postdata,$answer);
      }

      if(
    $answer == 'OK') {
        
    $result "success";
      } else {
        
    $result $answer;
      }
      return 
    $result;
    }

    function 
    centoswebpanel_UnsuspendAccount($params) {
      if (
    $params["server"] == 1) {     
        
    $postvars = array('key' => $params["serveraccesshash"],'api' => 'account_unsuspend','username' => $params["username"]);
        
    $postdata http_build_query($postvars);

        
    $curl curl_init();
        
    curl_setopt($curlCURLOPT_URL'https://'$params["serverhostname"] . ':2031/api/');
        
    curl_setopt($curlCURLOPT_RETURNTRANSFER,true);
        
    curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);
        
    curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
        
    curl_setopt($curlCURLOPT_POSTtrue);
        
    curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
        
    $answer curl_exec($curl);

        
    logModuleCall('centoswebpanel','UnsuspendAccount','https://' $params["serverhostname"] . ':2031/api/'.$postdata,$answer);
      }

      if(
    $answer == 'OK') {
          
    $result "success";
      } else {
          
    $result $answer;
      }
      return 
    $result;
    }

    function 
    centoswebpanel_ClientArea($params) {
        
    $code '<form action="https://'.$params["serverhostname"].':2031/login.php" method="post" target="_blank">
            <input type="hidden" name="user" value="'
    .$params["username"].'" />
            <input type="hidden" name="password" value="'
    .$params["password"].'" />
            <input type="submit" value="Login to Control Panel" />
            <input type="button" value="Login to Webmail" onClick="window.open(\'http://'
    .$serverhostname.'/webmail\')" />
            </form>'
    ;
        return 
    $code;
    }

    function 
    centoswebpanel_AdminLink($params) {
        
    $code '<form action="https://'.$params["serverhostname"].':2031/login.php" method="post" target="_blank">
            <input type="hidden" name="user" value="'
    .$params["serverusername"].'" />
            <input type="hidden" name="password" value="'
    .$params["serverpassword"].'" />
            <input type="submit" value="Login to Control Panel" />
            </form>'
    ;
        return 
    $code;
    }

    function 
    centoswebpanel_LoginLink($params) {
        echo 
    "<a href=\"https://".$params["serverhostname"].":2031/login.php\" target=\"_blank\" style=\"color:#cc0000\">Control Panel</a>";
    }

    ?>
     
  2. hendranata

    hendranata Hosting Guru

    Messages:
    1,283
    Likes Received:
    99
    Trophy Points:
    48
    Musti dicoba dulu. Kalo itu resmi untk whmcs ya bisa harusnya
     
  3. Naufal budiono

    Naufal budiono Apprentice 2.0

    Messages:
    426
    Likes Received:
    8
    Trophy Points:
    18
    ini saya dapat di cwpnya langsung
     
  4. el_makong

    el_makong Hosting Guru

    Messages:
    1,152
    Likes Received:
    113
    Trophy Points:
    63
    itu buat provisioning ya?
     
  5. Galaxy Hosting

    Galaxy Hosting Apprentice 2.0

    Messages:
    489
    Likes Received:
    72
    Trophy Points:
    28
    masternya Module WHMCS datang nih, tapi TS gk muncul" :attention:
     
  6. el_makong

    el_makong Hosting Guru

    Messages:
    1,152
    Likes Received:
    113
    Trophy Points:
    63
    walah....masih nubi bang...mananya master..
     
Loading...

Share This Page

Loading...