Ejemplo n.º 1
0
<?php

use nzedb\Category;
use nzedb\NZBGet;
use nzedb\SABnzbd;
use nzedb\Users;
if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$category = new Category(['Settings' => $page->settings]);
$sab = new SABnzbd($page);
$nzbGet = new NZBGet($page);
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
$userid = $page->users->currentUserId();
$data = $page->users->getById($userid);
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'];
        $data["firstname"] = $_POST['firstname'];
Ejemplo n.º 2
0
<?php

use nzedb\ReleaseComments;
use nzedb\SABnzbd;
if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$rc = new ReleaseComments($page->settings);
$sab = new SABnzbd($page);
$userid = $page->users->currentUserId();
$privileged = $page->users->isAdmin($userid) || $page->users->isModerator($userid) ? true : false;
$privateProfiles = $page->settings->getSetting('privateprofiles') == 1 ? true : false;
$publicView = false;
if (!$privateProfiles || $privileged) {
    $altID = isset($_GET['id']) && $_GET['id'] >= 0 ? (int) $_GET['id'] : false;
    $altUsername = isset($_GET['name']) && strlen($_GET['name']) > 0 ? $_GET['name'] : false;
    // If both 'id' and 'name' are specified, 'id' should take precedence.
    if ($altID === false && $altUsername !== false) {
        $user = $page->users->getByUsername($altUsername);
        if ($user) {
            $altID = $user['id'];
        }
    } else {
        if ($altID !== false) {
            $userid = $altID;
            $publicView = true;
        }
    }
}
$data = $page->users->getById($userid);
if (!$data) {
Ejemplo n.º 3
0
<?php

use nzedb\NZBGet;
use nzedb\SABnzbd;
if (!$page->users->isLoggedIn()) {
    $page->show403();
}
if (empty($_GET["id"])) {
    $page->show404();
}
$user = $page->users->getById($page->users->currentUserId());
if ($user['queuetype'] != 2) {
    $sab = new SABnzbd($page);
    if (empty($sab->url)) {
        $page->show404();
    }
    if (empty($sab->apikey)) {
        $page->show404();
    }
    $sab->sendToSab($_GET["id"]);
} elseif ($user['queuetype'] == 2) {
    $nzbget = new NZBGet($page);
    $nzbget->sendURLToNZBGet($_GET['id']);
}
Ejemplo n.º 4
0
<?php

use nzedb\SABnzbd;
if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$sab = new SABnzbd($page);
$output = "";
$json = $sab->getQueue();
if ($json !== false) {
    $obj = json_decode($json);
    $queue = $obj->{'jobs'};
    $count = 1;
    $output .= "<div class='container text-center' style='display:block;'>\n\t\t\t<div style='width:16.666666667%;float:left;'><b>Speed:</b><br /> " . $obj->{'speed'} . "B/s </div>\n\t\t\t<div style='width:16.666666667%;float:left;'><b>Queued:</b><br /> " . round($obj->{'mbleft'}, 2) . "MB / " . round($obj->{'mb'}, 2) . "MB" . " </div>\n\t\t\t<div style='width:16.666666667%;float:left;'><b>Status:</b><br /> " . ucwords(strtolower($obj->{'state'})) . " </div>\n\t\t\t<div style='width:16.666666667%;float:left;'><b>Free (temp):</b><br /> " . round($obj->{'diskspace1'}) . "GB </div>\n\t\t\t<div style='width:16.666666667%;float:left;'><b>Free Space:</b><br /> " . round($obj->{'diskspace2'}) . "GB</div>\n\t\t\t<div style='width:16.666666667%;float:left;'><b>Stats:</b><br /> " . preg_replace('/\\s+\\|\\s+| /', ',', $obj->{'loadavg'}) . " </div>\n\t\t</div>";
    if (count($queue) > 0) {
        $output .= "<table class='table table-striped table-condensed table-highlight data'>\n\t\t\t\t<thead>\n\t\t\t\t\t<tr >\n\t\t\t\t\t\t<th style='width=10px;text-align:center;'>#</th>\n\t\t\t\t\t\t<th style='text-align:left;'>Name</th>\n\t\t\t\t\t\t<th style='width:80px;text-align:center;'>Size</th>\n\t\t\t\t\t\t<th style='width:80px;text-align:center;'>Left</th>\n\t\t\t\t\t\t<th style='width:50px;text-align:center;'>Done</th>\n\t\t\t\t\t\t<th style='width:80px;text-align:center;'>Time Left</th>\n\t\t\t\t\t\t<th style='width:50px;text-align:center;'>Delete</th>\n\t\t\t\t\t\t<th style='width:80px;text-align:center;'><a href='?pall'>Pause all</a></th>\n\t\t\t\t\t\t<th style='width:80px;text-align:center;'><a href='?rall'>Resume all</a></th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>";
        foreach ($queue as $item) {
            if (strpos($item->{'filename'}, "fetch NZB") === false) {
                $output .= "<tr>" . "<td style='text-align:center;width:10px'>" . $count . "</td>" . "<td style='text-align:left;'>" . $item->{'filename'} . "</td>" . "<td style='text-align:center;'>" . round($item->{'mb'}, 2) . " MB</td>" . "<td style='text-align:center;'>" . round($item->{'mbleft'}, 2) . " MB</td>" . "<td style='text-align:center;'>" . ($item->{'mb'} == 0 ? 0 : round(100 - $item->{'mbleft'} / $item->{'mb'} * 100)) . "%</td>" . "<td style='text-align:center;'>" . $item->{'timeleft'} . "</td>" . "<td style='text-align:center;'><a  onclick=\"return confirm('Are you sure?');\" href='?del=" . $item->{'id'} . "'>Delete</a></td>" . "<td style='text-align:center;'><a href='?pause=" . $item->{'id'} . "'>Pause</a></td>" . "<td style='text-align:center;'><a href='?resume=" . $item->{'id'} . "'>Resume</a></td>" . "</tr>";
                $count++;
            }
        }
        $output .= "</tbody>\n\t\t\t</table>";
    } else {
        $output .= "<br /><br /><p style='text-align:center;'>The queue is currently empty.</p>";
    }
} else {
    $output .= "<p style='text-align:center;'>Error retrieving queue.</p>";
}
print $output;
Ejemplo n.º 5
0
<?php

use nzedb\ReleaseComments;
use nzedb\SABnzbd;
if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$rc = new ReleaseComments($page->settings);
$sab = new SABnzbd($page);
$userID = $page->users->currentUserId();
$privileged = $page->users->isAdmin($userID) || $page->users->isModerator($userID) ? true : false;
$privateProfiles = $page->settings->getSetting('privateprofiles') == 1 ? true : false;
$publicView = false;
if (!$privateProfiles || $privileged) {
    $altID = isset($_GET['id']) && $_GET['id'] >= 0 ? (int) $_GET['id'] : false;
    $altUsername = isset($_GET['name']) && strlen($_GET['name']) > 0 ? $_GET['name'] : false;
    // If both 'id' and 'name' are specified, 'id' should take precedence.
    if ($altID === false && $altUsername !== false) {
        $user = $page->users->getByUsername($altUsername);
        if ($user) {
            $altID = $user['id'];
        }
    } else {
        if ($altID !== false) {
            $userID = $altID;
            $publicView = true;
        }
    }
}
$data = $page->users->getById($userID);
if (!$data) {