function opensrspro_getSetting($setting)
{
    $result = mysql_safequery("SELECT value FROM tblregistrars WHERE registrar='opensrspro' AND setting=?", array($setting));
    if ($row = mysql_fetch_assoc($result)) {
        return decrypt($row['value']);
    }
    return false;
}
/**
 * Load language
 * @global array $opensrs_truste_language
 * @return array 
 */
function opensrs_sitelock_loadLanguage()
{
    global $opensrs_sitelock_language;
    if ($opensrs_sitelock_language) {
        return $opensrs_sitelock_language;
    }
    $language = null;
    if (isset($_SESSION['Language'])) {
        $language = strtolower($_SESSION['Language']);
    } else {
        $q = mysql_safequery("SELECT language FROM tblclients WHERE id = ?", array($_SESSION['uid']));
        $row = mysql_fetch_assoc($q);
        if ($row['language']) {
            $language = $row['language'];
        }
    }
    if (!$language) {
        $q = mysql_safequery("SELECT value FROM tblconfiguration WHERE setting = 'Language' LIMIT 1");
        $row = mysql_fetch_assoc($q);
        $language = $row['language'];
    }
    $langfilename = dirname(__FILE__) . DS . 'lang' . DS . $language . '.php';
    $deflangfilename = dirname(__FILE__) . DS . 'lang' . DS . 'english.php';
    if (file_exists($langfilename)) {
        include $langfilename;
    } else {
        include $deflangfilename;
    }
    $opensrs_sitelock_language = $_LANG;
    return $_LANG;
}
Example #3
0
 *
 *
 *
 * 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 <maciej@modulesgarden.com>
 */
if (!defined("WHMCS")) {
    die("This file cannot be accessed directly");
}
if (isset($_POST['action']) && $_POST['action'] == 'addProduct') {
    if (mysql_num_rows(mysql_query_safe("SELECT `id` FROM tblproductgroups WHERE `name`='SpamExperts'")) == 0) {
        mysql_safequery("INSERT INTO tblproductgroups (`name`) VALUES(?)", array('SpamExperts'));
    }
    $group = mysql_fetch_assoc(mysql_query("SELECT `id` FROM tblproductgroups WHERE `name`='SpamExperts'"));
    $api = getWHMCSconfig('kwspamexperts_api');
    $data = unserialize($api);
    if (mysql_safequery("INSERT INTO tblproducts \n        (\n            `type`,\n            `name`,\n            `gid`,\n            `configoption1`,\n            `configoption2`,\n            `configoption3`,\n            `configoption4`,\n            `configoption5`,\n            `configoption6`,\n            `servertype`,\n            `showdomainoptions`,\n            `paytype`\n        ) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)", array('hostingaccount', $_POST['product']['name'], $group['id'], $_POST['product']['type'], $data['url'], $data['user'], $data['password'], $data['disable_manage_routes'], $data['disable_edit_contact'], 'kwspamexperts', 'on', 'free'))) {
        addInfo('Product has been added');
    } else {
        addError(mysql_error());
    }
}
Example #4
0
 function updateProductsConfig($c)
 {
     $array = unserialize($c);
     if (!isset($array['disable_manage_routes'])) {
         $array['disable_manage_routes'] = '0';
     }
     if (!isset($array['disable_edit_contact'])) {
         $array['disable_edit_contact'] = '0';
     }
     return mysql_safequery("UPDATE tblproducts SET configoption2 = ?, configoption3 = ?, configoption4 = ?, configoption5 = ?, configoption6 = ? WHERE servertype = 'kwspamexperts';", array($array['url'], $array['user'], $array['password'], $array['disable_manage_routes'], $array['disable_edit_contact']));
 }
 public static function getAdmin()
 {
     $q = mysql_safequery('SELECT username FROM tbladmins WHERE roleid = 1 LIMIT 1');
     $row = mysql_fetch_assoc($q);
     return $row['username'];
 }