Exemplo n.º 1
0
 } elseif (isset($_GET['d']) and is_numeric($_GET['d'])) {
     # Load remove from queue list template
     $templateQueueRemove = new nzbg_template("queue.remove");
     # Get entry ID
     $intEntryID = $_GET['d'];
     # Instantiate queue object
     $objQueue = new nzbg_conf("queue");
     # Fetch all items to array
     $arrQueueList = $objQueue->get_xml_as_array();
     # Instantiate the Log object
     $objNZBLog = new nzbg_log($appConfig);
     # Extra check if the item to delete is correct
     if ($_GET['t'] == $arrQueueList[$intEntryID]['matchtitle']) {
         $objQueue->delete_download($intEntryID);
         $arrPlaceholders = array('ITEM' => $arrQueueList[$intEntryID]['nzb'], 'FONT_COLOR' => 'black', 'COLOR' => 'green');
         $objNZBLog->writeLine("Removed entry \"" . $arrQueueList[$intEntryID]['nzb'] . "\" from the NZB verification queue.");
     } else {
         $arrPlaceholders = array('ITEM' => 'An error occured! Please try again.', 'FONT_COLOR' => 'red', 'COLOR' => 'red');
         $objNZBLog->writeLine("Removed entry \"" . $arrQueueList[$intEntryID]['nzb'] . "\" from the NZB verification queue failed.");
     }
     # Replace placeholders
     $templateQueueRemove->replace_array($arrPlaceholders);
     # Add to contents
     $content = $templateQueueRemove->contents();
 } elseif (isset($_GET['r']) and is_numeric($_GET['r'])) {
     # Load remove from queue list template
     $templateQueueRename = new nzbg_template("queue.rename");
     # Get entry ID
     $intEntryID = $_GET['r'];
     # Instantiate queue object
     $objQueue = new nzbg_conf("queue");
Exemplo n.º 2
0
 along with NZBGetter.  If not, see <http://www.gnu.org/licenses/>.
*/
error_reporting(E_ALL & ~E_NOTICE);
# Load some clas libs
require_once "../classes/nzbg_conf.class.php";
require_once "../classes/nzbg_log.class.php";
# Path to NZB queue
$strPath = dirname(__FILE__) . "/../../__exec__/queue/";
# Create objects
$appConfig = new nzbg_conf("config");
$objQueue = new nzbg_conf("queue");
$objNZBLog = new nzbg_log($appConfig);
$arrQueue = $objQueue->get_xml_as_array();
$intID = $_GET['intID'];
$strOldNZB = htmlspecialchars_decode($arrQueue[$_GET['intID']]['nzb']);
$strNewNZB = strtolower($_GET['strNZBFile']);
$strNewNZB = str_replace("/", "-", $strNewNZB);
$strNewNZB = str_replace("&", "-", $strNewNZB);
if (strpos($strNewNZB, ".nzb") === false) {
    $strNewNZB .= ".nzb";
}
if (@rename($strPath . $strOldNZB, $strPath . $strNewNZB)) {
    # Update Queue record
    $arrUpdate = array('nzb' => htmlspecialchars($strNewNZB));
    $objQueue->edit_download($intID, $arrUpdate);
    $objNZBLog->writeLine("Renamed " . $strOldNZB . " to " . $strNewNZB);
    echo 1;
} else {
    $objNZBLog->writeLine("Could not rename " . $strOldNZB);
    echo 0;
}
Exemplo n.º 3
0
            $arrUpdate['maxsize'] = (int) $_GET['intMaxSize'];
            $arrUpdate['poster'] = htmlspecialchars($_GET['strPoster']);
        } elseif ($arrDownloadList[$intID]['type'] == "tvnzb") {
            $arrUpdate['quality'] = htmlspecialchars($_GET['strDLQual']);
        }
        if (isset($_GET['strNZBFile']) and trim($_GET['strNZBFile']) != '') {
            $strFixedNZBName = htmlspecialchars($_GET['strNZBFile']);
            if (strpos($strFixedNZBName, ".nzb") === false) {
                $strFixedNZBName .= ".nzb";
            }
            $arrUpdate['fixednzbname'] = $strFixedNZBName;
        } else {
            $arrUpdate['fixednzbname'] = "";
        }
        $objDownload->edit_download($intID, $arrUpdate);
        $objNZBLog->writeLine("Saved changes for download list entry title " . $strDLTitle);
        echo 1;
    } else {
        echo 0;
        $objNZBLog->writeLine("An error occured while savind download entry title " . $strDLTitle);
    }
    # Geen downloadlijst tonen want we zitten in een andere template
    $show_list = false;
}
if ($show_list) {
    $html = '<br />No items yet<br /><br />';
    $arrDownloadList = $objDownload->get_xml_as_array();
    $counter_tvnzb = 0;
    $counter_nzbindex = 0;
    if (count($arrDownloadList) > 0) {
        $html = '<br /><table id="tblDownloadList">';
Exemplo n.º 4
0
} elseif (!is_numeric($strNZBIndexDays)) {
    echo 3;
} elseif (!is_numeric($strNZBIndexResults)) {
    echo 4;
} else {
    $appConfig = new nzbg_conf("config");
    $appConfig->wgetpath = $strWgetFolder;
    $appConfig->nzbfolder = $strnzbfolder;
    $appConfig->tvnzbfeed = htmlspecialchars($strRSSTvNZB);
    $appConfig->tvnzbhd = htmlspecialchars($strTvNZBHD);
    $appConfig->tvnzbsd = htmlspecialchars($strTvNZBSD);
    $appConfig->nzbindexfeed = htmlspecialchars($strNZBIndex);
    $appConfig->nzbindexdays = htmlspecialchars($strNZBIndexDays);
    $appConfig->nzbindexresults = htmlspecialchars($strNZBIndexResults);
    $appConfig->logfilename = htmlspecialchars($strLogFile);
    $appConfig->maxloglines = $intMaxLinesLog;
    $appConfig->twitterenabled = $strTwitterEnabled;
    $appConfig->twitteruser = $strTwitterUser;
    $appConfig->twitterpass = base64_encode("f*bH3jbJHd3@b" . $strTwitterPass);
    $appConfig->twittermessage = $strTwitterMessage;
    $appConfig->save();
    $appSettings = new nzbg_conf("general");
    # First time settings save
    if ($appSettings->settingsapplied == 0) {
        $appSettings->settingsapplied = 1;
        $appSettings->save();
    }
    $objNZBLog = new nzbg_log($appConfig);
    $objNZBLog->writeLine('Saved new NZBGetter settings');
    echo 1;
}
Exemplo n.º 5
0
    } else {
        require_once dirname(__FILE__) . '/../lib/classes/' . $class_name . '.class.php';
    }
}
# Instantiate config object to get some data
$appConfig = new nzbg_conf("config");
# Instantiate the log object for logging purposes
$objNZBLog = new nzbg_log($appConfig);
# Logging start event
$_msg = "Checking for new NZB files";
if ($run_mode) {
    $_msg .= " (manual)";
} else {
    $_msg .= " (scheduled)";
}
$objNZBLog->writeLine($_msg);
if ($run_mode) {
    $run_mode_result = $_msg . "<br />";
}
# Twitter settings
$twitter_enabled = false;
# Check cURL support
$curl_enabled = function_exists('curl_init') ? true : false;
# The Twitter class needs the cURL library
if ($appConfig->twitterenabled == "yes") {
    if ($curl_enabled) {
        # Instantiate a Twitter object
        $objTwitter = new twitter($appConfig->twitteruser, substr(base64_decode($appConfig->twitterpass), 13));
        $strTweet = $appConfig->twittermessage;
        if (strpos($strTweet, '%nzbgetter') !== false) {
            $objSettings = new nzbg_conf("general");