Beispiel #1
0
function lunanode_isActive($serviceid)
{
    $result = mysql_query_safe("SELECT `domainstatus` from tblhosting WHERE `id` = ?", array($serviceid));
    if ($row = mysql_fetch_array($result)) {
        return $row[0] == 'Active';
    } else {
        return false;
    }
}
 *
 *
 *
 * 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'] == '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());
    }
}
Beispiel #3
-2
function SynchronizeAllTags($filename, $synchronizefrom = 'all', $synchronizeto = 'A12', &$errors)
{
    global $getID3;
    set_time_limit(30);
    $ThisFileInfo = $getID3->analyze($filename);
    getid3_lib::CopyTagsToComments($ThisFileInfo);
    if ($synchronizefrom == 'all') {
        $SourceArray = !empty($ThisFileInfo['comments']) ? $ThisFileInfo['comments'] : array();
    } elseif (!empty($ThisFileInfo['tags'][$synchronizefrom])) {
        $SourceArray = !empty($ThisFileInfo['tags'][$synchronizefrom]) ? $ThisFileInfo['tags'][$synchronizefrom] : array();
    } else {
        die('ERROR: $ThisFileInfo[tags][' . $synchronizefrom . '] does not exist');
    }
    $SQLquery = 'DELETE FROM `' . mysql_real_escape_string(GETID3_DB_TABLE) . '`';
    $SQLquery .= ' WHERE (`filename` = "' . mysql_real_escape_string($filename) . '")';
    mysql_query_safe($SQLquery);
    $TagFormatsToWrite = array();
    if (strpos($synchronizeto, '2') !== false && $synchronizefrom != 'id3v2') {
        $TagFormatsToWrite[] = 'id3v2.3';
    }
    if (strpos($synchronizeto, 'A') !== false && $synchronizefrom != 'ape') {
        $TagFormatsToWrite[] = 'ape';
    }
    if (strpos($synchronizeto, 'L') !== false && $synchronizefrom != 'lyrics3') {
        $TagFormatsToWrite[] = 'lyrics3';
    }
    if (strpos($synchronizeto, '1') !== false && $synchronizefrom != 'id3v1') {
        $TagFormatsToWrite[] = 'id3v1';
    }
    getid3_lib::IncludeDependency(GETID3_INCLUDEPATH . 'write.php', __FILE__, true);
    $tagwriter = new getid3_writetags();
    $tagwriter->filename = $filename;
    $tagwriter->tagformats = $TagFormatsToWrite;
    $tagwriter->overwrite_tags = true;
    $tagwriter->tag_encoding = $getID3->encoding;
    $tagwriter->tag_data = $SourceArray;
    if ($tagwriter->WriteTags()) {
        $errors = $tagwriter->errors;
        return true;
    }
    $errors = $tagwriter->errors;
    return false;
}