mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
29 lines
563 B
PHP
29 lines
563 B
PHP
<?php
|
|
|
|
use nntmux\NZBGet;
|
|
use nntmux\SABnzbd;
|
|
use App\Models\User;
|
|
|
|
if (! User::isLoggedIn()) {
|
|
$page->show403();
|
|
}
|
|
|
|
if (empty($_GET['id'])) {
|
|
$page->show404();
|
|
}
|
|
|
|
$user = User::find(User::currentUserId());
|
|
if ((int) $user['queuetype'] !== 2) {
|
|
$sab = new SABnzbd($page);
|
|
if (empty($sab->url)) {
|
|
$page->show404();
|
|
}
|
|
if (empty($sab->apikey)) {
|
|
$page->show404();
|
|
}
|
|
$sab->sendToSab($_GET['id']);
|
|
} elseif ((int) $user['queuetype'] === 2) {
|
|
$nzbget = new NZBGet($page);
|
|
$nzbget->sendURLToNZBGet($_GET['id']);
|
|
}
|