Esempio n. 1
0
         $objNZBLog->writeLine("Removed entry \"" . $arrDownloadList[$intEntryID]['title'] . "\" from the download list.");
     } else {
         $arrPlaceholders = array('ITEM' => 'An error occured! Please try again.', 'FONT_COLOR' => 'red', 'COLOR' => 'red');
         $objNZBLog->writeLine("Removed entry \"" . $arrDownloadList[$intEntryID]['title'] . "\" from the download list failed.");
     }
     # Replace placeholders
     $templateRemoveDownload->replace_array($arrPlaceholders);
     # Add to contents
     $content = $templateRemoveDownload->contents();
 } elseif (isset($_GET['e']) and is_numeric($_GET['e'])) {
     # Get entry ID
     $intEntryID = $_GET['e'];
     # Instantiate downloadlist object
     $objDownload = new nzbg_conf("download");
     # Fetch all items to array
     $arrDownloadList = $objDownload->get_xml_as_array();
     switch ($arrDownloadList[$intEntryID]['type']) {
         case "tvnzb":
             # Load edit template TVNZB
             $templateEdit = new nzbg_template("download.edit.tvnzb");
             $arrPlaceholders = array('ID' => $intEntryID, 'ENTRYTITLE' => $arrDownloadList[$intEntryID]['title'], 'ENTRYPATTERN' => $arrDownloadList[$intEntryID]['findstring']);
             # Which quality selected?
             if ($arrDownloadList[$intEntryID]['quality'] == "HD") {
                 $selected_hd = " selected";
                 $selected_sd = "";
             } else {
                 $selected_sd = " selected";
                 $selected_hd = "";
             }
             # Which methode selected?
             if ($arrDownloadList[$intEntryID]['downloadtype'] == "queue") {
Esempio n. 2
0
 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;
} else {