Exemplo n.º 1
0
$releases = new Releases();
$db = new Settings();
$cat = new Categorize();
$releaseRegex = new ReleaseRegex();
$nzb = new NZB();
$page = new Page();
$num = 0;
$usefilename = true;
$dupecheck = true;
$movefiles = true;
$categoryoverride = -1;
if (empty($argc) || $argc <= 1) {
    $path = "./";
} else {
    $util = new Utility();
    $path = !$util->endsWith($argv[1], "/") ? $argv[1] . "/" : $argv[1];
    if (isset($argv[2])) {
        $usefilename = strtolower($argv[2]) == 'true';
    }
    if (isset($argv[3])) {
        $dupecheck = strtolower($argv[3]) == 'true';
    }
    if (isset($argv[4])) {
        $movefiles = strtolower($argv[4]) == 'true';
    }
    if (isset($argv[5]) && is_numeric($argv[5])) {
        $categoryoverride = $argv[5];
    }
}
$groups = $db->query("SELECT id, name FROM groups");
foreach ($groups as $group) {
Exemplo n.º 2
0
require_once "config.php";
use newznab\db\Settings;
use newznab\utility\Utility;
if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$r = new Releases();
$pdo = new Settings();
if ($pdo->getSetting('sabvdir') == "" || $pdo->getSetting('sabcompletedir') == "" || !file_exists($pdo->getSetting('sabcompletedir'))) {
    $page->show404();
}
if (!Utility::endsWith($pdo->getSetting('sabcompletedir'), "/")) {
    $pdo->getSetting('sabcompletedir');
}
if (!Utility::endsWith($pdo->getSetting('sabvdir'), "/")) {
    $pdo->getSetting('sabvdir');
}
$basepath = $pdo->getSetting('sabcompletedir');
$webpath = $pdo->getSetting('sabvdir');
$subpath = "";
if (isset($_REQUEST["sp"])) {
    $subpath = urldecode($_REQUEST["sp"]);
}
$listmode = true;
if (isset($_REQUEST["lm"])) {
    $listmode = $_REQUEST["lm"] == "1";
}
$path = $basepath . $subpath;
$webpath .= $subpath;
if (!Utility::startsWith(realpath($path), realpath($basepath))) {
Exemplo n.º 3
0
if (!$data) {
    $page->show404();
}
$errorStr = '';
switch ($action) {
    case 'newapikey':
        $page->users->updateRssKey($userid);
        header("Location: profileedit");
        break;
    case 'clearcookies':
        $sab->unsetCookie();
        header("Location: profileedit");
        break;
    case 'submit':
        $data["email"] = $_POST['email'];
        if (isset($_POST['saburl']) && strlen(trim($_POST['saburl'])) > 0 && !Utility::endsWith($_POST['saburl'], "/")) {
            $_POST['saburl'] = $_POST['saburl'] . "/";
        }
        if ($_POST['password'] != "" && $_POST['password'] != $_POST['confirmpassword']) {
            $errorStr = "Password Mismatch";
        } else {
            if ($_POST['password'] != "" && !$page->users->isValidPassword($_POST['password'])) {
                $errorStr = "Your password must be longer than five characters.";
            } else {
                if (isset($_POST['nzbgeturl']) && $nzbGet->verifyURL($_POST['nzbgeturl']) === false) {
                    $errorStr = "The NZBGet URL you entered is invalid!";
                } else {
                    if (!$page->users->isValidEmail($_POST['email'])) {
                        $errorStr = "Your email is not a valid format.";
                    } else {
                        $res = $page->users->getByEmail($_POST['email']);