Exemple #1
0
 *
 *  CREATED BY MODULESGARDEN       ->        http://modulesgarden.com
 *  CONTACT                        ->       contact@modulesgarden.com
 *
 *
 *
 *
 * This software is furnished under a license and may be used and copied
 * only  in  accordance  with  the  terms  of such  license and with the
 * inclusion of the above copyright notice.  This software  or any other
 * copies thereof may not be provided or otherwise made available to any
 * other person.  No title to and  ownership of the  software is  hereby
 * transferred.
 *
 *
 * ******************************************************************** */
/**
 * @author Maciej Husak <*****@*****.**>
 */
if (!defined("WHMCS")) {
    die("This file cannot be accessed directly");
}
include_once ROOTDIR . DS . 'modules' . DS . 'servers' . DS . 'kwspamexperts' . DS . 'class.connection.php';
global $CONFIG;
$addon = mysql_fetch_assoc(mysql_query("SELECT `value` as `version` FROM  `tbladdonmodules` WHERE `module`='spamexperts' LIMIT 1"));
$api = getWHMCSconfig('kwspamexperts_api');
$data = unserialize($api);
$curl = curl_version();
$api = new kwspamexperts_api(array('configoption2' => $data['url'], 'configoption3' => $data['user'], 'configoption4' => $data['password']));
$api->call('/version/get/');
$spam = $api->getResponse();
/**
* FUNCTION kwspamexperts_ClientArea
* Display extended pages in clientarea
* @params array
* @return array
*/
function kwspamexperts_ClientArea($params)
{
    global $CONFIG, $smarty;
    $lang = kwspamexperts_getLang($params);
    $api = new kwspamexperts_api($params);
    $smarty->assign('lang', $lang['mainsite']);
    $domain = !empty($params["customfields"]["Domain"]) ? $params["customfields"]["Domain"] : $params['domain'];
    $api->call("authticket/create/username/" . $domain . "/");
    if (strpos($params['configoption2'], 'http') !== false) {
        $api_url = $params['configoption2'];
    } else {
        $api_url = 'https://' . $params['configoption2'];
    }
    $auth = $api->getResponse();
    if ($api->isSuccess()) {
        $smarty->assign('api_url', $api_url);
        $smarty->assign('api_auth', $auth['result']);
    }
    $smarty->assign('disable_manage_routes', $params['configoption5']);
    $smarty->assign('disable_edit_contact', $params['configoption6']);
}
Exemple #3
0
 *  CREATED BY MODULESGARDEN       ->        http://modulesgarden.com
 *  CONTACT                        ->       contact@modulesgarden.com
 *
 *
 *
 *
 * This software is furnished under a license and may be used and copied
 * only  in  accordance  with  the  terms  of such  license and with the
 * inclusion of the above copyright notice.  This software  or any other
 * copies thereof may not be provided or otherwise made available to any
 * other person.  No title to and  ownership of the  software is  hereby
 * transferred.
 *
 *
 * ******************************************************************** */
/**
 * @author Maciej Husak <*****@*****.**>
 */
if (!defined("WHMCS")) {
    die("This file cannot be accessed directly");
}
if (isset($_POST['action']) && $_POST['action'] == 'testconnection') {
    include_once ROOTDIR . DS . 'modules' . DS . 'servers' . DS . 'kwspamexperts' . DS . 'class.connection.php';
    $api = new kwspamexperts_api(array('configoption2' => $_POST['url'], 'configoption3' => $_POST['user'], 'configoption4' => $_POST['password']));
    $api->call('/version/get/');
    if ($api->isSuccess()) {
        die('success');
    } else {
        die($api->error());
    }
}