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 - prakash7610

Pages: [1] 2
1
PHP / Re: CWP7.Pro Error | Unable to Login Admin Panel
« on: July 08, 2020, 07:14:42 PM »
Hi
Can any one suggest me which version of php is perfect for cwp right now iam using PHP version: 5.6.37 the default one and if i want use php higher version iam using PHPselector for different version in different domain and subdomains etc.. 
because i could see cwp team is updating to 7.2 is the version is perfect for cwp?

2
FTP / Re: ERROR: Connection timed out after 20 seconds of inactivity
« on: July 03, 2020, 06:54:23 PM »
Having the same issue

Already done enabling the passive ports in csf and pureftp.conf no luck again same issue.

only works with plain authentication in file zilla
implicit over tls or explicit over tls
does not work

tried everything in cwp forum no luck
if any one got the solution pls post the steps

3
Backup / Re: New Backup 2
« on: May 31, 2020, 11:35:42 AM »
now after ging to dashboard if i see again my newly created local backup disappeared

Dont know whats happening
i want 2 backup one in local and another one in a sftp server
if  run manually its working fine
noautomatic daily backups

can any one help me to solve this issue

4
Backup / Re: New Backup 2
« on: May 31, 2020, 11:25:36 AM »
Code: [Select]
| wp_eg_item_skins                  |
| wp_eg_navigation_skins            |
| wp_links                          |
| wp_options                        |
| wp_postmeta                       |
| wp_posts                          |
| wp_psninja_amdd                   |
| wp_psninja_amdd_cache             |
| wp_psninja_urls                   |
| wp_revslider_css                  |
| wp_revslider_css_bkp              |
| wp_revslider_layer_animations     |
| wp_revslider_layer_animations_bkp |
| wp_revslider_navigations          |
| wp_revslider_navigations_bkp      |
| wp_revslider_sliders              |
| wp_revslider_sliders_bkp          |
| wp_revslider_slides               |
| wp_revslider_slides_bkp           |
| wp_revslider_static_slides        |
| wp_revslider_static_slides_bkp    |
| wp_term_relationships             |
| wp_term_taxonomy                  |
| wp_termmeta                       |
| wp_terms                          |
| wp_usermeta                       |
| wp_users                          |
| wp_wpgdprc_consents               |
| wp_wpgdprc_log                    |
| wp_yoast_seo_links                |
| wp_yoast_seo_meta                 |
+-----------------------------------+

2020-05-31 07:16:46
2020-05-31 07:16:46
2020-05-31 07:16:47 mysqldump --defaults-extra-file=/root/.my.cnf --opt --add-drop-database --databases washeso\_wp611 2> /home/tmp_bak/washeso/mysql/dump.log | gzip > /home/tmp_bak/washeso/mysql/washeso\_wp611.sql.gz
2020-05-31 07:16:47 Database: washeso_wp870
+-----------------------------------+
|              Tables               |
+-----------------------------------+
| wp_commentmeta                    |
| wp_comments                       |
| wp_eg_grids                       |
| wp_eg_item_elements               |
| wp_eg_item_skins                  |
| wp_eg_navigation_skins            |
| wp_links                          |
| wp_options                        |
| wp_postmeta                       |
| wp_posts                          |
| wp_psninja_amdd                   |
| wp_psninja_amdd_cache             |
| wp_psninja_urls                   |
| wp_revslider_css                  |
| wp_revslider_css_bkp              |
| wp_revslider_layer_animations     |
| wp_revslider_layer_animations_bkp |
| wp_revslider_navigations          |
| wp_revslider_navigations_bkp      |
| wp_revslider_sliders              |
| wp_revslider_sliders_bkp          |
| wp_revslider_slides               |
| wp_revslider_slides_bkp           |
| wp_revslider_static_slides        |
| wp_revslider_static_slides_bkp    |
| wp_term_relationships             |
| wp_term_taxonomy                  |
| wp_termmeta                       |
| wp_terms                          |
| wp_tm_taskmeta                    |
| wp_tm_tasks                       |
| wp_usermeta                       |
| wp_users                          |
| wp_wpgdprc_consents               |
| wp_wpgdprc_log                    |
| wp_yoast_seo_links                |
| wp_yoast_seo_meta                 |
+-----------------------------------+

2020-05-31 07:16:47
2020-05-31 07:16:47
2020-05-31 07:16:47 mysqldump --defaults-extra-file=/root/.my.cnf --opt --add-drop-database --databases washeso\_wp870 2> /home/tmp_bak/washeso/mysql/dump.log | gzip > /home/tmp_bak/washeso/mysql/washeso\_wp870.sql.gz
2020-05-31 07:16:47 Backing users Mysql
2020-05-31 07:16:49 Backing up email accounts
2020-05-31 07:16:49 RECORDS_DNS_DOMAIN 1
2020-05-31 07:16:49 Select domain FROM domains WHERE user="washeso"
2020-05-31 07:18:19 cd /home/tmp_bak/washeso/;ionice -c 3 nice -n +19 tar -czvf washeso.tar.gz --exclude washeso.tar.gz *
2020-05-31 07:18:19 cd /home/tmp_bak/washeso/;mv washeso.tar.gz --exclude /home/tmp_bak/washeso.tar.gz
2020-05-31 07:18:19 Generating washeso.tar.gz
2020-05-31 07:18:19 Type conection cron SFTP
2020-05-31 07:18:19 connection SFTP successful
2020-05-31 07:18:19 Put file from /home/tmp_bak/washeso.tar.gz TO /home/FTP_LOGIN_USER//full/manual///accounts/washeso.tar.gz
2020-05-31 07:18:56 Put OK
2020-05-31 07:18:56 file "/home/tmp_bak/washeso.tar.gz" en /home/FTP_LOGIN_USER/full/manual//accounts/washeso.tar.gz
2020-05-31 07:18:56 Update washeso.tar.gz
2020-05-31 07:18:56 Delecte Directory
2020-05-31 07:18:56 Send email to admin@bajillionlabs.in
2020-05-31 07:18:56 Send email to admin@kpssystems.co.in
2020-05-31 07:19:00 END
2020-05-31 07:19:03 UPDATE backups SET LASTEXEC = "2020-05-31 07:19:03", STRUN ="0", BACKUP_FORCE="0" WHERE ID="1"


Also pls see the images

iam creating a backup option and saving but suddenly its disappeared


5
New Modules / Re: PFlogsumm Mail report
« on: May 26, 2020, 03:58:57 PM »
Pls use the github link

https://github.com/prakash76101/cwp-mailreport

for this plugin

6
New Modules / PFlogsumm Mail report
« on: May 26, 2020, 11:41:53 AM »
Hi

First of all Congrats and thanks for the great development of CWP team.

here i have some code translated from portyguese language to english to get  email sent and recd report from maillog
pls save the below code in /usr/local/cwpsrv/htdocs/resources/admin/modules/mailrelatorio.php

Code: [Select]
<li><a href="index.php?module=mailrelatorio"><span class="icon16 icomoon-icon-arrow-right-3"></span>Email Report</a></li>
<?php
set_time_limit
(1800);
if ( !isset( 
$include_path ) )
{
    echo 
"invalid access";
    exit( );
}
?>

<h2> Email Report </h2>


Provides the report of the emails.
<br />
<?php
if(file_exists('/tools/pflogsumm/pflogsumm.pl')){// check if the program exists
?>

    <form action="index.php?module=mailrelatorio" method="post" id="gerarelform">
    <input type="hidden" name="gerarel" value="true" />
    <table>
    <tr>
    <td>   
    <select name="parm_d">
    <option value="logcorrente" <?php if(@$_POST['parm_d'] == 'logcorrente'){ echo 'selected="selected"'; } ?> >From the current log (/var/log/mailog)</option>
    <option value="today" <?php if(@$_POST['parm_d'] == 'today'){ echo 'selected="selected"'; } ?> >Today</option>
    <option value="yesterday" <?php if(@$_POST['parm_d'] == 'yesterday'){ echo 'selected="selected"'; } ?> >Yesterday</option>
    </select>
    </td>
    <td>
    <input type="checkbox" name="extensivo" value="true" <?php if(@$_POST['extensivo'] == 'true'){ echo ' checked="checked"'; } ?> > Extensive (detailed)
    </td>
    <td>
    <input type="checkbox" name="todososlogs" value="true" <?php if(@$_POST['todososlogs'] == 'true'){ echo ' checked="checked"'; } ?> >
    Include all archived logs (use only if log churn is high)
    </td>
    </tr>
    <tr>
    <td colspan="3">
<center><button type="submit" class="btn btn-info" id="gerarrealtoriobut">Generate report</button></center>
    </td>
    </tr>
    </table>
</form>
    <p>
  <?php
if(@
$_POST['gerarel'] == true){
$param '';
if(@$_POST['parm_d'] == 'today'){
$param .= '-d today ';
}else if(@$_POST['parm_d'] == 'yesterday'){
$param .= '-d yesterday ';
}
if(@$_POST['extensivo'] == true){
$param .= '-e ';
}
$outrosarq "";
if(@$_POST['todososlogs'] == true){
$retornoprompt = array();
$outrosarq " ";// include first space
exec("ls -l /var/log/maillog-*"$retornoprompt);
for($i 0$i count($retornoprompt); $i++){
$logfile explode(' '$retornoprompt[$i]);
$outrosarq .= $logfile[8]." ";
}
}
$retornoprompt = array();
exec("/tools/pflogsumm/pflogsumm.pl ".$param."/var/log/maillog".$outrosarq$retornoprompt);
$fechatable false;
$col 0;
$pula_linha false;
echo '<pre>';
for($i 0$i count($retornoprompt); $i++){
echo $retornoprompt[$i]."<br />";
}
echo '</pre>';
}
}else{
//verifica se o programa existe
?>

O programa <b>Pflogsumm</b> not installed follow the steps below and install the program with the following directory:<br />
/tools/pflogsumm/pflogsumm.pl</p>
    <p>The <b>Pflogsumm</b> program is not installed, follow the steps below and install the program with the following directory:<br />
      /tools/pflogsumm/pflogsumm.pl<br />
    </p>
<h2>Prerequisites</h2>
<p>Make sure these prerequisites are installed:</p>
<ul>
  <li>Postfix</li>
  <li>Perl 5.004</li>
  <li>Perl&rsquo;s Date::Calc module</li>
</ul>
<p>Perl 5.004 will most likely be installed by default. Run this command to install the <strong>Date::Calc</strong> module:</p>
<div>
  <table>
    <tbody>
      <tr>
        <td><pre>1</pre></td>
        <td><pre>sudo yum install perl-Date-Calc  </pre></td>
      </tr>
    </tbody>
  </table>
</div>
<p>Finally, you will need to locate your Postfix log. On most CentOS systems, this is /var/log/maillog by default.Also to send email by cron you need to install mailx  </P><td><pre>yum install mailx</pre></td>
<h2>Installing Pflogsumm</h2>
<p>In this section, you will install and configure Pflogsumm.</p>
<ol>
  <li>
    <p>Move to the /usr/local directory:</p>
    <div>
      <table>
        <tbody>
          <tr>
            <td><pre>1</pre></td>
            <td><pre>mkdir /tools</pre></td>
          </tr>
          <tr>
            <td><pre>2</pre></td>
            <td><pre>cd /tools</pre></td>
          </tr>
        </tbody>
      </table>
    </div>
  </li>
  <li>
    <p>Use <strong>curl</strong> to download Pflogsumm:</p>
    <div>
      <table>
        <tbody>
          <tr>
            <td><pre>1</pre></td>
            <td><pre>sudo curl -O http://jimsun.linxnet.com/downloads/pflogsumm-1.1.3.tar.gz  </pre></td>
          </tr>
        </tbody>
      </table>
    </div>
  </li>
  <li>
    <p>Expand the files:</p>
    <div>
      <table>
        <tbody>
          <tr>
            <td><pre>1</pre></td>
            <td><pre>sudo tar -xzf pflogsumm-1.1.3.tar.gz  </pre></td>
          </tr>
        </tbody>
      </table>
    </div>
  </li>
  <li>
    <p>Rename the Pflogsumm directory:</p>
    <div>
      <table>
        <tbody>
          <tr>
            <td><pre>1</pre></td>
            <td><pre>sudo mv pflogsumm-1.1.3 pflogsumm  </pre></td>
          </tr>
        </tbody>
      </table>
    </div>
  </li>
  <li>
    <p>Make the Pflogsumm directory executable:</p>
    <div>
      <table>
        <tbody>
          <tr>
            <td><pre>1</pre></td>
            <td><pre>sudo chmod +x /tools/pflogsumm/pflogsumm.pl  </pre></td>
          </tr>
        </tbody>
      </table>
    </div>
  </li>
</ol>
<h2>Testing</h2>
<p>Test the script by running the following command. Make sure you substitute <strong>/var/log/maillog</strong> with your actual Postfix log location.</p>
<div>
  <table>
    <tbody>
      <tr>
        <td><pre>1</pre></td>
        <td><pre>sudo perl /tools/pflogsumm/pflogsumm.pl /var/log/maillog  </pre></td>
      </tr>
    </tbody>
  </table>
</div>
<p>You will see a large amount of information regarding your mail server, which we&rsquo;ll go over in the next section.</p>
<h2>Reading Output</h2>
<p>Your report output will contain the following information in an easy-to-read textual format perfect for email:</p>
<ul>
  <li>
    <dl>
      <dt>Total number of:</dt>
      <dd>
        <ul>
          <li>Messages received, delivered, forwarded, deferred, bounced and rejected</li>
          <li>Bytes in messages received and delivered</li>
          <li>Sending and Recipient Hosts/Domains</li>
          <li>Senders and Recipients</li>
          <li>Optional SMTPD totals for number of connections, number of hosts/domains connecting, average connect time and total connect time</li>
        </ul>
      </dd>
    </dl>
  </li>
  <li>Per-Day Traffic Summary (for multi-day logs)</li>
  <li>Per-Hour Traffic (daily average for multi-day logs)</li>
  <li>Optional Per-Hour and Per-Day SMTPD connection summaries</li>
  <li>
    <dl>
      <dt>Sorted in descending order:</dt>
      <dd>
        <ul>
          <li>
            <dl>
              <dt>Recipient Hosts/Domains by message count, including:</dt>
              <dd>
                <ul>
                  <li>Number of messages sent to recipient host/domain</li>
                  <li>Number of bytes in messages</li>
                  <li>Number of defers</li>
                  <li>Average delivery delay</li>
                  <li>Maximum delivery delay</li>
                </ul>
              </dd>
            </dl>
          </li>
          <li>Sending Hosts/Domains by message and byte count</li>
          <li>Optional Hosts/Domains SMTPD connection summary</li>
          <li>Senders by message count</li>
          <li>Recipients by message count</li>
          <li>Senders by message size</li>
          <li>Recipients by message size with an option to limit these reports to the top nn.</li>
        </ul>
      </dd>
    </dl>
  </li>
  <li>
    <dl>
      <dt>A Semi-Detailed Summary of:</dt>
      <dd>
        <ul>
          <li>Messages deferred</li>
          <li>Messages bounced</li>
          <li>Messages rejected</li>
        </ul>
      </dd>
    </dl>
  </li>
  <li>Summaries of warnings, fatal errors, and panics</li>
  <li>Summary of master daemon messages</li>
  <li>Optional detail of messages received, sorted by domain, then sender-in-domain, with a list of recipients-per-message.</li>
  <li>Optional output of &ldquo;mailq&rdquo; run</li>
</ul>
<p>This list was taken from the http://jimsun.linxnet.com/postfix_contrib.html website, where you can read additional information about the output.</p>
<h2>Scheduling Reports with Cron</h2>
<p>Now you&rsquo;ll set up a Cron job to run the Pflogsumm Perl script and   send the mail server stats to you as a daily email. This is great for   monitoring your mail server. The example below schedules the email for   1:01 PM every day. For details on how to customize the time the email is   sent, you should read the https://www.linode.com/docs/linux-tools/utilities/cron article.</p>
<ol>
  <li>
    <p>Open the <strong>root</strong> user&rsquo;s Crontab by running the following command:</p>
    <div>
      <table>
        <tbody>
          <tr>
            <td><pre>1</pre></td>
            <td><pre>sudo crontab -e  </pre></td>
          </tr>
        </tbody>
      </table>
    </div>
  </li>
  <li>
    <p>00 01 * * * perl /tools/pflogsumm/pflogsumm.pl -e -d yesterday /var/log/maillog | mail -s 'Logwatch for Postfix' root.</p>
    <p>root&rsquo;s Crontab</p>
    <blockquote>
      <p>If this is your first time using Cron, you will have to select your preferred text editor.</p>
    </blockquote>
  </li>
  <li>
    <p>Save the changes to your Cron file. For <strong>nano</strong>, this is Ctrl-x y.</p>
    <blockquote>
      <p>Non-root users will not have permission to access the mail log.</p>
    </blockquote>
  </li>
</ol>
<p>You will now receive daily emails with your Postfix mail server   stats. It&rsquo;s a great way to keep track of what your server is doing.</p>
<h1>More Information</h1>
<p>You may wish to consult the following resources for additional   information on this topic. While these are provided in the hope that   they will be useful, please note that we cannot vouch for the accuracy   or timeliness of externally hosted materials.</p>
<ul>
  <li>http://jimsun.linxnet.com/postfix_contrib.html</li>
</ul>
<ul>
  <li>Program details: http://linux.die.net/man/1/pflogsumm</li>
</ul>
<?php
}//checks if the program exists
?>

after that update the 3rdparty .php located in  /usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php
Code: [Select]
<script type='text/javascript'>$(document).ready(function(){$(".custom-menu").prev("LI").css("display","none");});</script>
<!-- MAIL REPORT -->
<noscript>
<li class="custom-menu"> <!-- this class "custom-menu" was added so you can remove the Developer Menu easily if you want -->
    <a href="?module=mailrelatorio"><span class="icon16 icomoon-icon-arrow-right-3"></span>MAIL REPORT</a>
</li>
</noscript>
<script type="text/javascript">
        $(document).ready(function() {
                var newButtons = ''
                  +' <li>'
                  +' <a href="?module=mailrelatorio" class=""><span aria-hidden="true" class="icon16 icomoon-icon-arrow-right-3"></span>MAIL REPORT</a>'
                  +'</li>';
                $("ul#mn-15-sub").append(newButtons);
        });
</script>
<!-- end MAILREPORT -->

Thanks for RCshaff for his dns report code i have used the code to create a menu in plugins

after that reload the cwp admin panel you can see the module under plugins first time you need to install the said software follow the instruction displayed on that after that refresh to see the report

7
Backup / Re: New Backup 2
« on: May 25, 2020, 04:41:22 PM »
i have created a backup settings in new backup beta to store the zipped files in a ftp location,
it worked well before some update done by cwp team after that even i create a new one my self automatically the setting is disappeared also while checking in restore account settings i found those settings but no use its now taking backup to ftp

what we have to do clear the old settings and to create a new one


8
Updates / Re: Update cwp pro js problem
« on: May 22, 2020, 08:30:20 AM »
update to latest version problem got resolved

9
New Modules / Re: [module] WHMCS (Fix)
« on: May 22, 2020, 08:26:06 AM »
HI IHOS

i have added some code from github for auto login from client area for user panel

pls check this out
Code: [Select]
<?php
/**
 * Created by IntelliJ IDEA.
 * User: Vinicius Assis
 * E-mail: viniciusassisnascimento@gmail.com
 * Company: IHOS T.I.
 * Date: 10/03/2019
 * Time: 23:41
 *
 * Changelog
 * #############################
 * Date: 16/03/2019
 * Version Release: 1.0.1
 * + Added function ihoscwp7_LoaderFunction
 * #############################
 * Date: 13/03/2019
 * Version Release: 1.0.0
 * # Fix/Revised methods CreateAccount, SuspendAccount, UnsuspendAccount, TerminateAccount, ChangePassword, ChangePackage
 * + Added detailed success and error logs in all methods
 * + Added Verification on file for not directly accessing
 * + Added exception handling
 * #############################
 */

if (!defined("WHMCS")) {
    die(
"This file cannot be accessed directly");
}

/**
 * @return array
 */
function ihoscwp7_MetaData()
{
    return array(
        
'DisplayName' => 'IHOS CWP7',
        
'APIVersion' => '1.1'// Use API Version 1.1
        
'RequiresServer' => true,
        
'DefaultSSLPort' => '2304'// Default SSL Connection Port
        
'ServiceSingleSignOnLabel' => 'Login to Panel as User',
        
'AdminSingleSignOnLabel' => 'Login to Panel as Admin',
    );
}

/**
 * @return array
 */
function ihoscwp7_ConfigOptions()
{
    return array(
        
'PACKAGE-NUMBER' => array(
            
'Type' => 'text',
            
'Loader' => 'ihoscwp7_LoaderFunction',
            
'SimpleMode' => true,
            
'Description' => 'Package ID'
        
),
        
'Inode' => array(
            
'Type' => 'text',
            
'Default' => '0',
            
'SimpleMode' => true,
            
'Description' => 'Limit Inodes, 0 for unlimited'
        
),
        
'Nofile' => array(
            
'Type' => 'text',
            
'Default' => '100',
            
'SimpleMode' => true,
            
'Description' => 'Limit number of Open Files for account'
        
),
        
'Nproc' => array(
            
'Type' => 'text',
            
'Default' => '40',
            
'SimpleMode' => true,
            
'Description' => 'Limit number of Processes for account, don\'t use 0 as it will not allow any processes'
        
)
    );
}

/**
 * @param array $params
 * @return mixed|string
 */
function ihoscwp7_CreateAccount(array $params)
{
    try {

        if (
$params['server'] == 1) {

            
$postvars = array(
                
'package' => $params['configoption1'],
                
'domain' => $params['domain'],
                
'key' => $params['serveraccesshash'],
                
'action' => 'add',
                
'username' => $params['username'],
                
'user' => $params['username'],
                
'pass' => $params['password'],
                
'email' => $params['clientsdetails']['email'],
                
'inode' => $params['configoption2'],
                
'nofile' => $params['configoption3'],
                
'nproc' => $params['configoption4'],
                
'server_ips' => $params['serverip']
            );

            
$postdata http_build_query($postvars);

            
$url 'https://' $params['serverhostname'] . ':' $params['serverport'] . '/v1/account';

            
$curl curl_init();
            
curl_setopt($curlCURLOPT_URL'https://' $params['serverhostname'] . ':' $params['serverport'] . '/v1/account');
            
curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);
            
curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
            
curl_setopt($curlCURLOPT_CUSTOMREQUEST'POST');
            
curl_setopt($curlCURLOPT_POSTtrue);
            
curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
$response curl_exec($curl);

            
logModuleCall(
                
'ihoscwp7',
                
__FUNCTION__,
                
$url '/?' $postdata,
                
$response
            
);

            
$response json_decode($responsetrue);
            if (
$response['status'] == 'OK') {
                
$result 'success';
            } else {
                
$result $response;
            }

        }

    } catch (
Exception $e) {
        
logModuleCall(
            
'ihoscwp7',
            
__FUNCTION__,
            
$params,
            
$e->getMessage(),
            
$e->getTraceAsString()
        );

        return 
$e->getMessage();
    }

    return 
$result;
}

/**
 * @param array $params
 * @return mixed|string
 */
function ihoscwp7_SuspendAccount(array $params)
{
    try {

        if (
$params['server'] == 1) {

            
$postvars = array(
                
'key' => $params['serveraccesshash'],
                
'action' => 'susp',
                
'user' => $params['username']
            );

            
$postdata http_build_query($postvars);

            
$url 'https://' $params['serverhostname'] . ':' $params['serverport'] . '/v1/account';

            
$curl curl_init();
            
curl_setopt($curlCURLOPT_URL'https://' $params['serverhostname'] . ':' $params['serverport'] . '/v1/account');
            
curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);
            
curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
            
curl_setopt($curlCURLOPT_CUSTOMREQUEST'POST');
            
curl_setopt($curlCURLOPT_POSTtrue);
            
curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
$response curl_exec($curl);

            
logModuleCall(
                
'ihoscwp7',
                
__FUNCTION__,
                
$url '/?' $postdata,
                
$response
            
);

            
$response json_decode($responsetrue);
            if (
$response['status'] == 'OK') {
                
$result 'success';
            } else {
                
$result $response;
            }

        }

    } catch (
Exception $e) {
        
logModuleCall(
            
'ihoscwp7',
            
__FUNCTION__,
            
$params,
            
$e->getMessage(),
            
$e->getTraceAsString()
        );

        return 
$e->getMessage();
    }

    return 
$result;
}

/**
 * @param array $params
 * @return mixed|string
 */
function ihoscwp7_UnsuspendAccount(array $params)
{
    try {

        if (
$params['server'] == 1) {

            
$postvars = array(
                
'key' => $params['serveraccesshash'],
                
'action' => 'unsp',
                
'user' => $params['username']
            );

            
$postdata http_build_query($postvars);

            
$url 'https://' $params['serverhostname'] . ':' $params['serverport'] . '/v1/account';

            
$curl curl_init();
            
curl_setopt($curlCURLOPT_URL'https://' $params['serverhostname'] . ':' $params['serverport'] . '/v1/account');
            
curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);
            
curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
            
curl_setopt($curlCURLOPT_CUSTOMREQUEST'POST');
            
curl_setopt($curlCURLOPT_POSTtrue);
            
curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
$response curl_exec($curl);

            
logModuleCall(
                
'ihoscwp7',
                
__FUNCTION__,
                
$url '/?' $postdata,
                
$response
            
);

            
$response json_decode($responsetrue);
            if (
$response['status'] == 'OK') {
                
$result 'success';
            } else {
                
$result $response;
            }

        }

    } catch (
Exception $e) {
        
logModuleCall(
            
'ihoscwp7',
            
__FUNCTION__,
            
$params,
            
$e->getMessage(),
            
$e->getTraceAsString()
        );

        return 
$e->getMessage();
    }

    return 
$result;
}

/**
 * @param array $params
 * @return mixed|string
 */
function ihoscwp7_TerminateAccount(array $params)
{
    try {

        if (
$params['server'] == 1) {

            
$postvars = array(
                
'key' => $params['serveraccesshash'],
                
'action' => 'del',
                
'user' => $params['username'],
                
'email' => $params['clientsdetails']['email']
            );

            
$postdata http_build_query($postvars);

            
$url 'https://' $params['serverhostname'] . ':' $params['serverport'] . '/v1/account';

            
$curl curl_init();
            
curl_setopt($curlCURLOPT_URL$url);
            
curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);
            
curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
            
curl_setopt($curlCURLOPT_CUSTOMREQUEST'POST');
            
curl_setopt($curlCURLOPT_POSTtrue);
            
curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
$response curl_exec($curl);

            
logModuleCall(
                
'ihoscwp7',
                
__FUNCTION__,
                
$url '/?' $postdata,
                
$response
            
);

            
$response json_decode($responsetrue);
            if (
$response['status'] == 'OK') {
                
$result 'success';
            } else {
                
$result $response;
            }

        }

    } catch (
Exception $e) {
        
logModuleCall(
            
'ihoscwp7',
            
__FUNCTION__,
            
$params,
            
$e->getMessage(),
            
$e->getTraceAsString()
        );

        return 
$e->getMessage();
    }

    return 
$result;
}

/**
 * @param array $params
 * @return mixed|string
 */
function ihoscwp7_ChangePassword(array $params)
{
    try {

        if (
$params['server'] == 1) {

            
$postvars = array(
                
'key' => $params['serveraccesshash'],
                
'action' => 'udp',
                
'user' => $params['username'],
                
'pass' => $params['password']
            );

            
$postdata http_build_query($postvars);

            
$url 'https://' $params['serverhostname'] . ':' $params['serverport'] . '/v1/changepass';

            
$curl curl_init();
            
curl_setopt($curlCURLOPT_URL$url);
            
curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);
            
curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
            
curl_setopt($curlCURLOPT_CUSTOMREQUEST'POST');
            
curl_setopt($curlCURLOPT_POSTtrue);
            
curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
$response curl_exec($curl);

            
logModuleCall(
                
'ihoscwp7',
                
__FUNCTION__,
                
$url '/?' $postdata,
                
$response
            
);

            
$response json_decode($responsetrue);
            if (
$response['status'] == 'OK') {
                
$result 'success';
            } else {
                
$result $response;
            }

        }

    } catch (
Exception $e) {
        
logModuleCall(
            
'ihoscwp7',
            
__FUNCTION__,
            
$params,
            
$e->getMessage(),
            
$e->getTraceAsString()
        );

        return 
$e->getMessage();
    }

    return 
$result;
}

/**
 * @param array $params
 * @return mixed|string
 */
function ihoscwp7_ChangePackage(array $params)
{
    try {

        if (
$params['server'] == 1) {

            
$postvars = array(
                
'key' => $params['serveraccesshash'],
                
'action' => 'udp',
                
'user' => $params['username'],
                
'package' => $params['configoption1']
            );

            
$postdata http_build_query($postvars);

            
$url 'https://' $params['serverhostname'] . ':' $params['serverport'] . '/v1/changepack';

            
$curl curl_init();
            
curl_setopt($curlCURLOPT_URL$url);
            
curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);
            
curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
            
curl_setopt($curlCURLOPT_CUSTOMREQUEST'POST');
            
curl_setopt($curlCURLOPT_POSTtrue);
            
curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
$response curl_exec($curl);

            
logModuleCall(
                
'ihoscwp7',
                
__FUNCTION__,
                
$url '/?' $postdata,
                
$response
            
);

            
$response json_decode($responsetrue);
            if (
$response['status'] == 'OK') {
                
$result 'success';
            } else {
                
$result $response;
            }

        }

    } catch (
Exception $e) {
        
logModuleCall(
            
'ihoscwp7',
            
__FUNCTION__,
            
$params,
            
$e->getMessage(),
            
$e->getTraceAsString()
        );

        return 
$e->getMessage();
    }

    return 
$result;
}

/**
 * @param array $params
 * @return string
 */
function ihoscwp7_ClientArea(array $params)
{
      
$postvars = array('key' => $params["serveraccesshash"],'action' => 'list','user' => $params["username"],'timer'=>5);
    
$postdata http_build_query($postvars);
    
$curl curl_init();
    
curl_setopt($curlCURLOPT_URL'https://' $params["serverhostname"] . ':2304/v1/user_session');
    
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);
    
$arry=(json_decode($answer,true)); //die;
    
$link=$arry['msj']['details'];
    
$linkautologin="https://{$params["serverhostname"]}:2083/{$link[0]['user']}/?user_session={$link[0]['token']}";
    
//logModuleCall('cwpwhmcs','centoswebpanel_LoginLink','https://' . $params["serverhostname"] . ':2304/v1/user_session'.$postdata,$answer);


    
$code '<form action="'.$linkautologin.'" method="GET" target="_blank">
        <input type="submit" value="Login to Control Panel" />
        <input type="hidden" id="user_session" name="user_session" value="'
.$link[0]['token'].'" />
        <input type="button" value="Login to Webmail" onClick="window.open(\'https://'
.$params["serverhostname"].'/webmail\')" />
        </form>'
;
    return 
$code;
}

/**
 * @param $params
 * @return string
 */
function ihoscwp7_AdminLink($params)
{
    
$code '<input type="button" value="Admin Control Panel" onClick="window.open(\'https://' $params['serverhostname'] . ':2031/login/index.php\')" />';

    return 
$code;
}

/**
 * @param $params
 */
function ihoscwp7_LoginLink($params)
{
   
$postvars = array('key' => $params["serveraccesshash"],'action' => 'list','user' => $params["username"],'timer'=>5);
    
$postdata http_build_query($postvars);
    
$curl curl_init();
    
curl_setopt($curlCURLOPT_URL'https://' $params["serverhostname"] . ':2304/v1/user_session');
    
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);
    
$arry=(json_decode($answer,true)); //die;
    
$link=$arry['msj']['details'];
    
$linkautologin="https://{$params["serverhostname"]}:2083/{$link[0]['user']}/?user_session={$link[0]['token']}";
    
logModuleCall('cwpwhmcs','centoswebpanel_LoginLink','https://' $params["serverhostname"] . ':2304/v1/user_session'.$postdata,$answer);

    echo 
"<a href=\"{$linkautologin}\" target=\"_blank\" style=\"color:#cc0000\">Control Panel</a>";
}

function 
ihoscwp7_LoaderFunction($params)
{
    try {

        if (
$params['server'] == 1) {

            
$postvars = array(
                
'key' => $params['serveraccesshash'],
                
'action' => 'list'
            
);

            
$postdata http_build_query($postvars);

            
$url 'https://' $params['serverhostname'] . ':' $params['serverport'] . '/v1/packages';

            
$curl curl_init();
            
curl_setopt($curlCURLOPT_URL$url);
            
curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);
            
curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
            
curl_setopt($curlCURLOPT_CUSTOMREQUEST'POST');
            
curl_setopt($curlCURLOPT_POSTtrue);
            
curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
$response curl_exec($curl);

            
logModuleCall(
                
'ihoscwp7',
                
__FUNCTION__,
                
$url '/?' $postdata,
                
$response
            
);

        }

        if (
curl_error($curl)) {
            throw new 
Exception('Unable to connect: ' curl_errno($curl) . ' - ' curl_error($curl));
        } elseif (empty(
$response)) {
            throw new 
Exception('Empty response');
        }

        
curl_close($curl);

        
$packages json_decode($responsetrue);

        
$packageNames = [];
        foreach (
$packages['msj'] as $key => $package) {
            
$packageNames[$package['id']] = ucfirst($package['package_name']);
        }

        if (
is_null($packageNames)) {
            throw new 
Exception('Invalid response format');
        }

    } catch (
Exception $e) {
        
logModuleCall(
            
'ihoscwp7',
            
__FUNCTION__,
            
$params,
            
$e->getMessage(),
            
$e->getTraceAsString()
        );

        return 
$e->getMessage();
    }

    return 
$packageNames;
}

10
New Modules / Re: [Module] CWP_DNSREPORT
« on: May 21, 2020, 06:44:43 PM »
I have installed with you github script but the page is not working shows error

ss.php): failed to open stream: No such file or directory in /usr/local/cwpsrv/htdocs/resources/admin/modules/dnsreport/header.php on line 12

Warning: include_once(): Failed opening 'update_class.php' for inclusion (include_path='.:/usr/local/cwp/php71/lib/php') in /usr/local/cwpsrv/htdocs/resources/admin/modules/dnsreport/header.php on line 12

Fatal error: Uncaught Error: Class 'gitupdate' not found in /usr/local/cwpsrv/htdocs/resources/admin/modules/dnsreport/header.php:13 Stack trace: #0 /usr/local/cwpsrv/htdocs/resources/admin/modules/dnsreport/index.php(3): include_once() #1 /usr/local/cwpsrv/htdocs/admin/admin/index.php(0): unknown() #2 {main} thrown in /usr/local/cwpsrv/htdocs/resources/admin/modules/dnsreport/header.php on line 13

11
Updates / Re: PHP Imagemagick error after last update
« on: May 21, 2020, 03:50:56 PM »
yu can rebuild your php version using version switcher

12
Updates / Re: New update available?
« on: May 21, 2020, 03:15:57 PM »
Hey Guys Pls check now the version is updated to CWPpro version: 0.9.8.979
i think they have updated

13
Updates / Re: New update available?
« on: May 21, 2020, 03:09:46 PM »
I too Have the same issue already tried all the ways to update but remain the same mostly a bug

14
Addons / Re: Problem with the backup
« on: May 16, 2020, 08:47:04 PM »
Hi
Rightnow restore option is not Working(available) in restore account in newbackup beta.
If you have backup file then you can restore it manually
by creating database, weebsites, mails seperately

15
Hi CWP team

The new backup beta is not working since i have updated to the latest panel still showing loading list accounts thats all no backup done
it was worked before update pls check this also restore accounts is not working atleast manual restore is posssible if we get the full account backup

Thanks in advance

Pages: [1] 2