Esempio n. 1
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;
}
Esempio n. 2
0
            $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) {
                $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) {