} # Replace placeholders $templateQueueProcess->replace_array($arrPlaceholders); # Add to contents $content = $templateQueueProcess->contents(); } 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
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License 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;
$arrNew["fixednzbname"] = $strFixedNZBName; } $arrNew["hits"] = 0; $objDownload->add_download($arrNew); $appConfig = new nzbg_conf("config"); $objNZBLog = new nzbg_log($appConfig); $objNZBLog->writeLine("Saved entry \"{$strDLTitle}\" to the download list."); } elseif (isset($_GET['type']) and $_GET['type'] == "edit") { $intID = $_GET['intID']; $strDLOldTitle = $_GET['strOldTitle']; $strDLTitle = htmlspecialchars($_GET['strDLTitle']); $strDLMatch = htmlspecialchars($_GET['strDLMatch']); $strDLHow = $_GET['strDLHow']; $arrDownloadList = $objDownload->get_xml_as_array(); $appConfig = new nzbg_conf("config"); $objNZBLog = new nzbg_log($appConfig); if ($arrDownloadList[$intID]['title'] == $strDLOldTitle) { # Update Queue record $arrUpdate = array('title' => $strDLTitle, 'findstring' => $strDLMatch, 'downloadtype' => $strDLHow); # Check type if ($arrDownloadList[$intID]['type'] == "nzbindex") { $arrUpdate['excludekeywords'] = htmlspecialchars($_GET['strExclude']); $arrUpdate['minsize'] = (int) $_GET['intMinSize']; $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) {
} 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; }
# Check if either manual or cron mode $run_mode = (isset($_GET['mode']) and $_GET['mode'] == "m") ? true : false; # Autoloader for on the fly class initialization function __autoload($class_name) { global $run_mode; if ($run_mode) { require_once '../lib/classes/' . $class_name . '.class.php'; } 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;