Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - xotabu4

Pages: [1]
1
CentOS 7 Problems / CWP7 account creation issue
« on: April 20, 2018, 09:48:23 AM »
Hi everyone,
while trying to add new accounts in CWP7 something strange is going on:)
First of all while you are adding new account you need to fill all fields in:
Quote
Domain name:
Username:
Password:
Admin Email:
...
:
Domain name field at this page isn't "working" as it should be or it is very confusing. After you will fill all filed and click create account you will be able to login into this account, but amount of available domains stays same accordingly to you package. When you will navigate to Domain link it would be empty (without any records)...hmmm that's stange isn't it?
Maybe it would be nice to fix this, or replace this field with some other name?
And also it would be nice to reconfigure default domain directory accordingly to domain name, cause right now for more convenient usage you need to fill Domain name filed with any data which isn't connected to your real domain name and after that in Client area create real domain records, only after that whole folder structure will be right and easy to use and understand.

2
CentOS 7 Problems / CWP 7 WHMCS API error
« on: April 20, 2018, 09:37:44 AM »
Hi everyone,
I've installed fresh version of the CWP 7, added new CWP7 module to WHMCS and while trying to create account from WHMCS in CWP panel getting error. After turning on Debug in WHMCS, I've got such error:
Code: [Select]
<html><head><title>Slim Application Error</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{display:inline-block;width:65px;}</style></head><body><h1>Slim Application Error</h1><p>The application could not run because of the following error:</p><h2>Details</h2><div><strong>Type:</strong> ErrorException</div><div><strong>Code:</strong> 2</div><div><strong>Message:</strong> mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given</div><div><strong>File:</strong> /usr/local/cwpsrv/var/services/api/v1/index.php</div><h2>Trace</h2><pre><div>#0 [internal function]: Slim\Slim::handleErrors(2, 'mysqli_fetch_as...', '/usr/local/cwps...', 0, Array)
<div>#1 /usr/local/cwpsrv/var/services/api/v1/index.php(0): mysqli_fetch_assoc(false)
<div>#2 [internal function]: {closure}()
<div>#3 /usr/local/cwpsrv/var/services/api/v1/Slim/Route.php(0): call_user_func_array(Object(Closure), Array)
<div>#4 /usr/local/cwpsrv/var/services/api/v1/Slim/Slim.php(0): Slim\Route->dispatch()
<div>#5 /usr/local/cwpsrv/var/services/api/v1/Slim/Middleware/Flash.php(0): Slim\Slim->call()
<div>#6 /usr/local/cwpsrv/var/services/api/v1/Slim/Middleware/MethodOverride.php(0): Slim\Middleware\Flash->call()
<div>#7 /usr/local/cwpsrv/var/services/api/v1/Slim/Middleware/PrettyExceptions.php(0): Slim\Middleware\MethodOverride->call()
<div>#8 /usr/local/cwpsrv/var/services/api/v1/Slim/Slim.php(0): Slim\Middleware\PrettyExceptions->call()
<div>#9 /usr/local/cwpsrv/var/services/api/v1/index.php(0): Slim\Slim->run()
<div>#10 {main}</pre></body></html>

3
Also this part should be changed:
Code: [Select]
function cwp7_AdminLink($params) {
    // $code = '<form action="http://'.$params["serverhostname"].':2030/login.php" method="post" target="_blank">
$code = '<form action="http://'.$params["serverhostname"].':2030/login/index.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;
}
Code: [Select]
function cwp7_SuspendAccount($params) {
    if ($params["server"] == 1) {
        $postvars = array('key' => $params["serveraccesshash"],'action' => 'susp','user' => $params["username"]);
        $postdata = http_build_query($postvars);
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':2304/v1/account');
        curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
        $answer = curl_exec($curl);
        [b]logModuleCall('cwpwhmcs','SuspendAccount','https://' . $params["serverhostname"] . ':2304/v1/account/'.$postdata,$answer);[/b]
    }

Pages: [1]