mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 00:01:21 +00:00
Small optimizations in code, use compact where applicable
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2019-01-25 DariusIII
|
||||
* Chg: Small optimizations in code, use compact where applicable
|
||||
* Chg: Add config/nntmux_nntp.php and use the config in NNTP class
|
||||
* Chg: Updated czproject/git-php (v3.16.1 => v3.16.2)
|
||||
2019-01-24 DariusIII
|
||||
|
||||
@@ -16,7 +16,7 @@ class AjaxController extends BasePageController
|
||||
/**
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function ajaxAction(Request $request)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ class AnidbController extends BasePageController
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$AniDB = new AniDB();
|
||||
$title = 'AniDB List';
|
||||
$title = $meta_title = 'AniDB List';
|
||||
|
||||
$aname = '';
|
||||
if (request()->has('animetitle') && ! empty(request()->input('animetitle'))) {
|
||||
@@ -33,13 +33,7 @@ class AnidbController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('anidb-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -95,12 +89,7 @@ class AnidbController extends BasePageController
|
||||
$title = 'Edit AniDB Data';
|
||||
$content = $this->smarty->fetch('anidb-edit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -126,12 +115,7 @@ class AnidbController extends BasePageController
|
||||
|
||||
$title = 'Remove anidbID from Releases';
|
||||
$content = $this->smarty->fetch('anidb-remove.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,19 +17,13 @@ class BlacklistController extends BasePageController
|
||||
$this->setAdminPrefs();
|
||||
$binaries = new Binaries();
|
||||
|
||||
$title = 'Binary Black/Whitelist List';
|
||||
$meta_title = $title = 'Binary Black/Whitelist List';
|
||||
|
||||
$binlist = $binaries->getBlacklist(false);
|
||||
$this->smarty->assign('binlist', $binlist);
|
||||
|
||||
$content = $this->smarty->fetch('binaryblacklist-list.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -45,7 +39,7 @@ class BlacklistController extends BasePageController
|
||||
$binaries = new Binaries(['Settings' => null]);
|
||||
$error = '';
|
||||
$regex = ['id' => '', 'groupname' => '', 'regex' => '', 'description' => '', 'msgcol' => 1, 'status' => 1, 'optype' => 1];
|
||||
$title = 'Binary Black/Whitelist';
|
||||
$meta_title = $title = 'Binary Black/Whitelist';
|
||||
|
||||
switch ($request->input('action') ?? 'view') {
|
||||
case 'submit':
|
||||
@@ -113,13 +107,7 @@ class BlacklistController extends BasePageController
|
||||
);
|
||||
|
||||
$content = $this->smarty->fetch('binaryblacklist-edit.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class BookController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'Book List';
|
||||
$meta_title = $title = 'Book List';
|
||||
|
||||
$bookList = BookInfo::query()->orderByDesc('created_at')->paginate(config('nntmux.items_per_page'));
|
||||
|
||||
@@ -25,13 +25,7 @@ class BookController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('book-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -47,6 +41,8 @@ class BookController extends BasePageController
|
||||
$this->setAdminPrefs();
|
||||
$book = new Books();
|
||||
|
||||
$meta_title = $title = 'Book Edit';
|
||||
|
||||
// set the current action
|
||||
$action = $request->input('action') ?? 'view';
|
||||
|
||||
@@ -78,7 +74,6 @@ class BookController extends BasePageController
|
||||
break;
|
||||
case 'view':
|
||||
default:
|
||||
$title = 'Book Edit';
|
||||
$this->smarty->assign('book', $b);
|
||||
break;
|
||||
}
|
||||
@@ -86,13 +81,7 @@ class BookController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('book-edit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class CategoryController extends BasePageController
|
||||
public function index()
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$title = 'Category List';
|
||||
$meta_title = $title = 'Category List';
|
||||
|
||||
$categorylist = Category::getFlat();
|
||||
|
||||
@@ -22,13 +22,7 @@ class CategoryController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('category-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class CategoryRegexesController extends BasePageController
|
||||
$this->setAdminPrefs();
|
||||
$regexes = new Regexes(['Settings' =>null, 'Table_Name' => 'category_regexes']);
|
||||
|
||||
$title = 'Category Regex List';
|
||||
$meta_title = $title = 'Category Regex List';
|
||||
|
||||
$group = $request->has('group') && ! empty($request->input('group')) ? $request->input('group') : '';
|
||||
$regex = $regexes->getRegex($group);
|
||||
@@ -33,13 +33,7 @@ class CategoryRegexesController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('category_regexes-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -97,11 +91,11 @@ class CategoryRegexesController extends BasePageController
|
||||
case 'view':
|
||||
default:
|
||||
if ($request->has('id')) {
|
||||
$title = 'Category Regex Edit';
|
||||
$meta_title = $title = 'Category Regex Edit';
|
||||
$id = $request->input('id');
|
||||
$regex = $regexes->getRegexByID($id);
|
||||
} else {
|
||||
$title = 'Category Regex Add';
|
||||
$meta_title = $title = 'Category Regex Add';
|
||||
}
|
||||
$this->smarty->assign('regex', $regex);
|
||||
break;
|
||||
@@ -128,13 +122,7 @@ class CategoryRegexesController extends BasePageController
|
||||
$this->smarty->assign('category_ids', $categories['category_ids']);
|
||||
|
||||
$content = $this->smarty->fetch('category_regexes-edit.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,26 +19,15 @@ class CollectionRegexesController extends BasePageController
|
||||
$this->setAdminPrefs();
|
||||
$regexes = new Regexes(['Settings' => null, 'Table_Name' => 'collection_regexes']);
|
||||
|
||||
$title = 'Collections Regex List';
|
||||
$meta_title = $title = 'Collections Regex List';
|
||||
|
||||
$group = ($request->has('group') && ! empty($request->input('group')) ? $request->input('group') : '');
|
||||
$regex = $regexes->getRegex($group);
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'group' => $group,
|
||||
'regex' => $regex,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('group', 'regex'));
|
||||
|
||||
$content = $this->smarty->fetch('collection_regexes-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -89,10 +78,10 @@ class CollectionRegexesController extends BasePageController
|
||||
case 'view':
|
||||
default:
|
||||
if ($request->has('id')) {
|
||||
$title = 'Collections Regex Edit';
|
||||
$meta_title = $title = 'Collections Regex Edit';
|
||||
$regex = $regexes->getRegexByID($request->input('id'));
|
||||
} else {
|
||||
$title = 'Collections Regex Add';
|
||||
$meta_title = $title = 'Collections Regex Add';
|
||||
$regex += ['status' => 1];
|
||||
}
|
||||
break;
|
||||
@@ -105,13 +94,7 @@ class CollectionRegexesController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('collection_regexes-edit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -124,7 +107,7 @@ class CollectionRegexesController extends BasePageController
|
||||
public function testRegex(Request $request)
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$title = 'Collections Regex Test';
|
||||
$meta_title = $title = 'Collections Regex Test';
|
||||
|
||||
$group = trim($request->has('group') && ! empty($request->input('group')) ? $request->input('group') : '');
|
||||
$regex = trim($request->has('regex') && ! empty($request->input('regex')) ? $request->input('regex') : '');
|
||||
@@ -137,13 +120,7 @@ class CollectionRegexesController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('collection_regexes-test.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -14,19 +14,13 @@ class CommentsController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'Comments List';
|
||||
$meta_title = $title = 'Comments List';
|
||||
|
||||
$commentsList = ReleaseComment::getCommentsRange();
|
||||
$this->smarty->assign('commentslist', $commentsList);
|
||||
|
||||
$content = $this->smarty->fetch('comments-list.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class ConsoleController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'Console List';
|
||||
$meta_title = $title = 'Console List';
|
||||
|
||||
$consoleList = Utility::getRange('consoleinfo');
|
||||
|
||||
@@ -25,13 +25,7 @@ class ConsoleController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('console-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -47,6 +41,7 @@ class ConsoleController extends BasePageController
|
||||
$this->setAdminPrefs();
|
||||
$console = new Console(['Settings' => null]);
|
||||
$gen = new Genres();
|
||||
$meta_title = $title = 'Console Edit';
|
||||
|
||||
// set the current action
|
||||
$action = $request->input('action') ?? 'view';
|
||||
@@ -81,7 +76,6 @@ class ConsoleController extends BasePageController
|
||||
break;
|
||||
case 'view':
|
||||
default:
|
||||
$title = 'Console Edit';
|
||||
$this->smarty->assign('console', $con);
|
||||
$this->smarty->assign('genres', $gen->getGenres(Genres::CONSOLE_TYPE));
|
||||
break;
|
||||
@@ -90,13 +84,7 @@ class ConsoleController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('console-edit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -15,21 +15,14 @@ class ContentController extends BasePageController
|
||||
public function index()
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$contents = new Contents();
|
||||
$contentList = $contents->getAll();
|
||||
$contentList = (new Contents())->getAll();
|
||||
$this->smarty->assign('contentlist', $contentList);
|
||||
|
||||
$title = 'Content List';
|
||||
$meta_title = $title = 'Content List';
|
||||
|
||||
$content = $this->smarty->fetch('content-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -85,7 +78,7 @@ class ContentController extends BasePageController
|
||||
case 'view':
|
||||
default:
|
||||
if ($request->has('id')) {
|
||||
$title = 'Content Edit';
|
||||
$meta_title = $title = 'Content Edit';
|
||||
$id = $request->input('id');
|
||||
|
||||
$content = $contents->getByID($id, User::ROLE_ADMIN);
|
||||
@@ -99,23 +92,17 @@ class ContentController extends BasePageController
|
||||
$this->smarty->assign('yesno_ids', [1, 0]);
|
||||
$this->smarty->assign('yesno_names', ['Yes', 'No']);
|
||||
|
||||
$contenttypelist = ['1' => 'Useful Link', '2' => 'Article', '3' => 'Homepage'];
|
||||
$contenttypelist = [1 => 'Useful Link', 2 => 'Article', 3 => 'Homepage'];
|
||||
$this->smarty->assign('contenttypelist', $contenttypelist);
|
||||
|
||||
$this->smarty->assign('content', $content);
|
||||
|
||||
$rolelist = ['0' => 'Everyone', '1' => 'Logged in Users', '2' => 'Admins'];
|
||||
$rolelist = [1 => 'Everyone', 2 => 'Logged in Users', 3 => 'Admins'];
|
||||
$this->smarty->assign('rolelist', $rolelist);
|
||||
|
||||
$content = $this->smarty->fetch('content-add.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -14,20 +14,14 @@ class FailedReleasesController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'Failed Releases List';
|
||||
$meta_title = $title = 'Failed Releases List';
|
||||
|
||||
$frellist = Release::getFailedRange();
|
||||
$this->smarty->assign('releaselist', $frellist);
|
||||
|
||||
$content = $this->smarty->fetch('failrel-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class GameController extends BasePageController
|
||||
$this->setAdminPrefs();
|
||||
$game = new Games(['Settings' => null]);
|
||||
|
||||
$title = 'Game List';
|
||||
$meta_title = $title = 'Game List';
|
||||
|
||||
$gamelist = $game->getRange();
|
||||
|
||||
@@ -26,13 +26,7 @@ class GameController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('game-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -48,6 +42,8 @@ class GameController extends BasePageController
|
||||
$this->setAdminPrefs();
|
||||
$games = new Games(['Settings' => null]);
|
||||
$gen = new Genres(['Settings' => null]);
|
||||
$meta_title = $title = 'Game Edit';
|
||||
|
||||
|
||||
// Set the current action.
|
||||
$action = $request->input('action') ?? 'view';
|
||||
@@ -83,7 +79,6 @@ class GameController extends BasePageController
|
||||
|
||||
case 'view':
|
||||
default:
|
||||
$title = 'Game Edit';
|
||||
$this->smarty->assign('game', $game);
|
||||
$this->smarty->assign('genres', $gen->getGenres(Genres::GAME_TYPE));
|
||||
break;
|
||||
@@ -91,13 +86,7 @@ class GameController extends BasePageController
|
||||
}
|
||||
|
||||
$content = $this->smarty->fetch('game-edit.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,16 +26,10 @@ class GroupController extends BasePageController
|
||||
]
|
||||
);
|
||||
|
||||
$title = 'Group List';
|
||||
$meta_title = $title = 'Group List';
|
||||
$content = $this->smarty->fetch('group-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -64,16 +58,10 @@ class GroupController extends BasePageController
|
||||
$this->smarty->assign('yesno_ids', [1, 0]);
|
||||
$this->smarty->assign('yesno_names', ['Yes', 'No']);
|
||||
|
||||
$title = 'Bulk Add Newsgroups';
|
||||
$meta_title = $title = 'Bulk Add Newsgroups';
|
||||
$content = $this->smarty->fetch('group-bulk.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -122,13 +110,13 @@ class GroupController extends BasePageController
|
||||
|
||||
case 'view':
|
||||
default:
|
||||
$title = 'Group Edit';
|
||||
$meta_title = $title = 'Group Edit';
|
||||
if ($request->has('id')) {
|
||||
$title = 'Newsgroup Edit';
|
||||
$meta_title = $title = 'Newsgroup Edit';
|
||||
$id = $request->input('id');
|
||||
$group = Group::getGroupByID($id);
|
||||
} else {
|
||||
$this->title = 'Newsgroup Add';
|
||||
$meta_title = $title = 'Newsgroup Add';
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -140,13 +128,7 @@ class GroupController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('group-edit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -172,17 +154,11 @@ class GroupController extends BasePageController
|
||||
|
||||
$this->smarty->assign('grouplist', $grouplist);
|
||||
|
||||
$title = 'Group List';
|
||||
$meta_title = $title = 'Group List';
|
||||
|
||||
$content = $this->smarty->fetch('group-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -208,17 +184,11 @@ class GroupController extends BasePageController
|
||||
|
||||
$this->smarty->assign('grouplist', $grouplist);
|
||||
|
||||
$title = 'Group List';
|
||||
$meta_title = $title = 'Group List';
|
||||
|
||||
$content = $this->smarty->fetch('group-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -18,20 +18,14 @@ class MovieController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'Movie List';
|
||||
$meta_title = $title = 'Movie List';
|
||||
|
||||
$movieList = Utility::getRange('movieinfo');
|
||||
$this->smarty->assign('movielist', $movieList);
|
||||
|
||||
$content = $this->smarty->fetch('movie-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -50,14 +44,14 @@ class MovieController extends BasePageController
|
||||
$this->setAdminPrefs();
|
||||
$movie = new Movie(['Settings' => null]);
|
||||
|
||||
$title = 'Movie Add';
|
||||
$meta_title = $title = 'Movie Add';
|
||||
|
||||
$id = str_pad($request->input('id'), 7, '0', STR_PAD_LEFT);
|
||||
|
||||
if ($request->has('id') && \strlen($id) === 7) {
|
||||
$movCheck = $movie->getMovieInfo($id);
|
||||
$movieInfo = $movie->updateMovieInfo($id);
|
||||
if ($movieInfo === true && ($movCheck === null || ($request->has('update') === true && (int) $request->input('update') === 1))) {
|
||||
if ($movieInfo && ($movCheck === null || ($request->has('update') && (int) $request->input('update') === 1))) {
|
||||
$forUpdate = Release::query()->where('imdbid', $id)->get(['id']);
|
||||
if ($forUpdate !== null) {
|
||||
$movieInfoId = MovieInfo::query()->where('imdbid', $id)->first(['id']);
|
||||
@@ -76,13 +70,7 @@ class MovieController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('movie-add.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -98,7 +86,7 @@ class MovieController extends BasePageController
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$movie = new Movie();
|
||||
$title = 'Add Movie';
|
||||
$meta_title = $title = 'Add Movie';
|
||||
|
||||
// set the current action
|
||||
$action = $request->input('action') ?? 'view';
|
||||
@@ -159,7 +147,7 @@ class MovieController extends BasePageController
|
||||
break;
|
||||
case 'view':
|
||||
default:
|
||||
$title = 'Movie Edit';
|
||||
$meta_title = $title = 'Movie Edit';
|
||||
$this->smarty->assign('movie', $mov);
|
||||
break;
|
||||
}
|
||||
@@ -167,13 +155,7 @@ class MovieController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('movie-edit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -17,20 +17,14 @@ class MusicController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'Music List';
|
||||
$meta_title = $title = 'Music List';
|
||||
|
||||
$musicList = Utility::getRange('musicinfo');
|
||||
|
||||
$this->smarty->assign('musiclist', $musicList);
|
||||
|
||||
$content = $this->smarty->fetch('music-list.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -46,6 +40,8 @@ class MusicController extends BasePageController
|
||||
$music = new Music();
|
||||
$gen = new Genres();
|
||||
|
||||
$meta_title = $title = 'Music Edit';
|
||||
|
||||
// set the current action
|
||||
$action = $request->input('action') ?? 'view';
|
||||
|
||||
@@ -80,7 +76,6 @@ class MusicController extends BasePageController
|
||||
break;
|
||||
case 'view':
|
||||
default:
|
||||
$title = 'Music Edit';
|
||||
$this->smarty->assign('music', $mus);
|
||||
$this->smarty->assign('genres', $gen->getGenres(Genres::MUSIC_TYPE));
|
||||
break;
|
||||
@@ -88,13 +83,7 @@ class MusicController extends BasePageController
|
||||
}
|
||||
|
||||
$content = $this->smarty->fetch('music-edit.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,15 +63,9 @@ class NzbController extends BasePageController
|
||||
}
|
||||
}
|
||||
|
||||
$title = 'Import Nzbs';
|
||||
$meta_title = $title = 'Import Nzbs';
|
||||
$content = $this->smarty->fetch('nzb-import.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -134,7 +128,7 @@ class NzbController extends BasePageController
|
||||
);
|
||||
}
|
||||
|
||||
$title = 'Export Nzbs';
|
||||
$meta_title = $title = 'Export Nzbs';
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'gziplist' => [1 => 'True', 0 => 'False'],
|
||||
@@ -142,13 +136,7 @@ class NzbController extends BasePageController
|
||||
]
|
||||
);
|
||||
$content = $this->smarty->fetch('nzb-export.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,15 +35,7 @@ class PredbController extends BasePageController
|
||||
$meta_description = 'View PreDb info';
|
||||
|
||||
$content = $this->smarty->fetch('predb.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class ReleaseNamingRegexesController extends BasePageController
|
||||
$this->setAdminPrefs();
|
||||
$regexes = new Regexes(['Settings' => null, 'Table_Name' => 'release_naming_regexes']);
|
||||
|
||||
$title = 'Release Naming Regex List';
|
||||
$meta_title = $title = 'Release Naming Regex List';
|
||||
|
||||
$group = '';
|
||||
if ($request->has('group') && ! empty($request->input('group'))) {
|
||||
@@ -29,13 +29,7 @@ class ReleaseNamingRegexesController extends BasePageController
|
||||
$this->smarty->assign('regex', $regex);
|
||||
|
||||
$content = $this->smarty->fetch('release_naming_regexes-list.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -86,11 +80,11 @@ class ReleaseNamingRegexesController extends BasePageController
|
||||
case 'view':
|
||||
default:
|
||||
if ($request->has('id')) {
|
||||
$title = 'Release Naming Regex Edit';
|
||||
$meta_title = $title = 'Release Naming Regex Edit';
|
||||
$id = $request->input('id');
|
||||
$regex = $regexes->getRegexByID($id);
|
||||
} else {
|
||||
$title = 'Release Naming Regex Add';
|
||||
$meta_title = $title = 'Release Naming Regex Add';
|
||||
$regex = ['status' => 1];
|
||||
}
|
||||
break;
|
||||
@@ -102,13 +96,7 @@ class ReleaseNamingRegexesController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('release_naming_regexes-edit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -121,7 +109,7 @@ class ReleaseNamingRegexesController extends BasePageController
|
||||
public function testRegex(Request $request)
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$title = 'Release Naming Regex Test';
|
||||
$meta_title = $title = 'Release Naming Regex Test';
|
||||
|
||||
$group = trim($request->has('group') && ! empty($request->input('group')) ? $request->input('group') : '');
|
||||
$regex = trim($request->has('regex') && ! empty($request->input('regex')) ? $request->input('regex') : '');
|
||||
@@ -134,13 +122,7 @@ class ReleaseNamingRegexesController extends BasePageController
|
||||
}
|
||||
|
||||
$content = $this->smarty->fetch('release_naming_regexes-test.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,20 +17,14 @@ class ReleasesController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'Release List';
|
||||
$meta_title = $title = 'Release List';
|
||||
|
||||
$releaseList = Release::getReleasesRange();
|
||||
$this->smarty->assign('releaselist', $releaseList);
|
||||
|
||||
$content = $this->smarty->fetch('release-list.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -44,6 +38,7 @@ class ReleasesController extends BasePageController
|
||||
public function edit(Request $request)
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$meta_title = $title = 'Release Edit';
|
||||
|
||||
// Set the current action.
|
||||
$action = ($request->input('action') ?? 'view');
|
||||
@@ -76,7 +71,6 @@ class ReleasesController extends BasePageController
|
||||
|
||||
case 'view':
|
||||
default:
|
||||
$title = 'Release Edit';
|
||||
$id = $request->input('id');
|
||||
$release = Release::getByGuid($id);
|
||||
$this->smarty->assign('release', $release);
|
||||
@@ -89,13 +83,7 @@ class ReleasesController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('release-edit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class RoleController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'User Role List';
|
||||
$meta_title = $title = 'User Role List';
|
||||
|
||||
//get the user roles
|
||||
$userroles = Role::all();
|
||||
@@ -24,11 +24,7 @@ class RoleController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('role-list.tpl');
|
||||
|
||||
$this->smarty->assign([
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -44,7 +40,7 @@ class RoleController extends BasePageController
|
||||
|
||||
switch ($request->input('action') ?? 'view') {
|
||||
case 'submit':
|
||||
$title = 'Add User Role';
|
||||
$meta_title = $title = 'Add User Role';
|
||||
$role = Role::create([
|
||||
'name' => $request->input('name'),
|
||||
'apirequests' => $request->input('apirequests'),
|
||||
@@ -101,7 +97,7 @@ class RoleController extends BasePageController
|
||||
break;
|
||||
case 'view':
|
||||
default:
|
||||
$title = 'Add User Role';
|
||||
$meta_title = $title = 'Add User Role';
|
||||
$role = [
|
||||
];
|
||||
|
||||
@@ -113,14 +109,7 @@ class RoleController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('role-add.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
'role' => $role,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content', 'role'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -134,7 +123,7 @@ class RoleController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'User Roles';
|
||||
$meta_title = $title = 'User Roles';
|
||||
|
||||
// Get the user roles.
|
||||
$userRoles = Role::all();
|
||||
@@ -145,7 +134,7 @@ class RoleController extends BasePageController
|
||||
|
||||
switch ($request->input('action') ?? 'view') {
|
||||
case 'submit':
|
||||
$title = 'Update User Role';
|
||||
$meta_title = $title = 'Update User Role';
|
||||
$role = Role::find($request->input('id'));
|
||||
$role->update([
|
||||
'name' => $request->input('name'),
|
||||
@@ -231,7 +220,7 @@ class RoleController extends BasePageController
|
||||
case 'view':
|
||||
default:
|
||||
if ($request->has('id')) {
|
||||
$title = 'User Roles Edit';
|
||||
$meta_title = $title = 'User Roles Edit';
|
||||
$role = Role::findById($request->input('id'));
|
||||
$this->smarty->assign('role', $role);
|
||||
}
|
||||
@@ -243,13 +232,7 @@ class RoleController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('role-edit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class SharingController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'Sharing Settings';
|
||||
$meta_title = $title = 'Sharing Settings';
|
||||
|
||||
$allSites = SharingSite::query()->orderByDesc('id')->paginate(config('nntmux.items_per_cover_page'));
|
||||
if ($allSites->total() === 0) {
|
||||
@@ -49,14 +49,7 @@ class SharingController extends BasePageController
|
||||
$max_download = $ourSite['max_download'];
|
||||
}
|
||||
Sharing::query()
|
||||
->update(
|
||||
[
|
||||
'site_name' => $site_name,
|
||||
'max_push' => $max_push,
|
||||
'max_pull' => $max_pull,
|
||||
'max_download' => $max_download,
|
||||
]
|
||||
);
|
||||
->update(compact('site_name', 'max_push', 'max_pull', 'max_download'));
|
||||
|
||||
$ourSite = $ourSite = Sharing::query()->first();
|
||||
}
|
||||
@@ -65,13 +58,7 @@ class SharingController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('sharing.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class ShowsController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'TV Shows List';
|
||||
$meta_title = $title = 'TV Shows List';
|
||||
|
||||
$tvshowname = ($request->has('showname') && ! empty($request->input('showname')) ? $request->input('showname') : '');
|
||||
|
||||
@@ -30,13 +30,7 @@ class ShowsController extends BasePageController
|
||||
);
|
||||
|
||||
$content = $this->smarty->fetch('show-list.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -69,15 +63,9 @@ class ShowsController extends BasePageController
|
||||
|
||||
$this->smarty->assign('show', $show);
|
||||
|
||||
$title = 'Edit TV Show Data';
|
||||
$meta_title = $title = 'Edit TV Show Data';
|
||||
$content = $this->smarty->fetch('show-edit.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -99,15 +87,9 @@ class ShowsController extends BasePageController
|
||||
|
||||
$this->smarty->assign('success', $success);
|
||||
|
||||
$title = 'Remove Video and Episode IDs from Releases';
|
||||
$meta_title = $title = 'Remove Video and Episode IDs from Releases';
|
||||
$content = $this->smarty->fetch('show-remove.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
$this->adminrender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ class SiteController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$meta_title = $title = 'Site Edit';
|
||||
|
||||
// set the current action
|
||||
$action = $request->input('action') ?? 'view';
|
||||
|
||||
@@ -66,8 +68,6 @@ class SiteController extends BasePageController
|
||||
break;
|
||||
case 'view':
|
||||
default:
|
||||
|
||||
$title = 'Site Edit';
|
||||
$site = $this->settings;
|
||||
$this->smarty->assign('site', $site);
|
||||
$this->smarty->assign('settings', Settings::toTree());
|
||||
@@ -176,13 +176,7 @@ class SiteController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('site-edit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -194,7 +188,7 @@ class SiteController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'Site Stats';
|
||||
$meta_title = $title = 'Site Stats';
|
||||
|
||||
$topgrabs = User::getTopGrabbers();
|
||||
$this->smarty->assign('topgrabs', $topgrabs);
|
||||
@@ -218,13 +212,7 @@ class SiteController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('site-stats.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -23,13 +23,13 @@ class TmuxController extends BasePageController
|
||||
switch ($action) {
|
||||
case 'submit':
|
||||
Settings::settingsUpdate($request->all());
|
||||
$title = 'Tmux Settings Edit';
|
||||
$meta_title = $title = 'Tmux Settings Edit';
|
||||
$this->smarty->assign('site', $this->settings);
|
||||
break;
|
||||
|
||||
case 'view':
|
||||
default:
|
||||
$title = 'Tmux Settings Edit';
|
||||
$meta_title = $title = 'Tmux Settings Edit';
|
||||
$this->smarty->assign('site', $this->settings);
|
||||
break;
|
||||
}
|
||||
@@ -66,13 +66,7 @@ class TmuxController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('tmux-edit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class UserController extends BasePageController
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$title = 'User List';
|
||||
$meta_title = $title = 'User List';
|
||||
|
||||
$roles = [];
|
||||
foreach (Role::all()->toArray() as $userRole) {
|
||||
@@ -72,13 +72,7 @@ class UserController extends BasePageController
|
||||
}
|
||||
|
||||
$content = $this->smarty->fetch('user-list.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
@@ -102,7 +96,7 @@ class UserController extends BasePageController
|
||||
'rate_limit' => 60,
|
||||
];
|
||||
|
||||
$title = 'View User';
|
||||
$meta_title = $title = 'View User';
|
||||
|
||||
// set the current action
|
||||
$action = $request->input('action') ?? 'view';
|
||||
@@ -156,10 +150,8 @@ class UserController extends BasePageController
|
||||
}
|
||||
if ($request->input('role') !== null) {
|
||||
$roleName = Role::query()->where('id', $request->input('role'))->value('name');
|
||||
if ($roleName === 'Disabled') {
|
||||
if (env('FIREWALL_ENABLED') === true && \Firewall::isBlacklisted($editedUser->host) === false) {
|
||||
\Firewall::blacklist($editedUser->host);
|
||||
}
|
||||
if (($roleName === 'Disabled') && config('firewall.enabled') === true && ! \Firewall::isBlacklisted($editedUser->host)) {
|
||||
\Firewall::blacklist($editedUser->host);
|
||||
}
|
||||
$editedUser->refresh();
|
||||
SendAccountChangedEmail::dispatch($editedUser);
|
||||
@@ -221,13 +213,7 @@ class UserController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('user-edit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'meta_title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
@@ -107,12 +107,7 @@ class AdultController extends BasePageController
|
||||
} else {
|
||||
$content = $this->smarty->fetch('xxx.tpl');
|
||||
}
|
||||
$this->smarty->assign([
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,15 +77,7 @@ class AnimeController extends BasePageController
|
||||
$this->smarty->assign('nodata', '');
|
||||
}
|
||||
$content = $this->smarty->fetch('viewanime.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'title' => $title,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'title', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
}
|
||||
@@ -131,15 +123,7 @@ class AnimeController extends BasePageController
|
||||
$this->smarty->assign('animetitle', $animeTitle);
|
||||
$content = $this->smarty->fetch('viewanimelist.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'title' => $title,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'title', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ class ApiController extends BasePageController
|
||||
}
|
||||
}
|
||||
|
||||
if ($res->hasRole('Disabled') === true) {
|
||||
if ($res->hasRole('Disabled')) {
|
||||
Utility::showApiError(101);
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ class ApiController extends BasePageController
|
||||
$api->verifyEmptyParameter('g');
|
||||
UserRequest::addApiRequest($apiKey, $request->getRequestUri());
|
||||
$relData = Release::checkGuidForApi($request->input('id'));
|
||||
if ($relData !== false) {
|
||||
if ($relData) {
|
||||
return redirect(WWW_TOP.'/getnzb?r='.$apiKey.'&id='.$request->input('id').(($request->has('del') && $request->input('del') === '1') ? '&del=1' : ''));
|
||||
}
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ class ApiV2Controller extends BasePageController
|
||||
{
|
||||
UserRequest::addApiRequest($request->input('api_token'), $request->getRequestUri());
|
||||
$relData = Release::checkGuidForApi($request->input('id'));
|
||||
if ($relData !== false) {
|
||||
if ($relData) {
|
||||
return redirect('/getnzb?r='.$request->input('api_token').'&id='.$request->input('id').(($request->has('del') && $request->input('del') === '1') ? '&del=1' : ''));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,15 +23,7 @@ class ApiHelpController extends BasePageController
|
||||
$meta_description = 'View description of the site Nzb Api.';
|
||||
|
||||
$content = $this->smarty->fetch('apidesc.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'title' => $title,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'title', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -47,15 +39,7 @@ class ApiHelpController extends BasePageController
|
||||
$meta_description = 'View description of the site Nzb version 2 Api.';
|
||||
|
||||
$content = $this->smarty->fetch('apiv2desc.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'title' => $title,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'title', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class LoginController extends Controller
|
||||
$user = User::getByEmail($request->input('username'));
|
||||
}
|
||||
|
||||
if ($user !== null && ((config('firewall.enabled') === true && \Firewall::isBlacklisted($user->host) === false) || config('firewall.enabled') === false)) {
|
||||
if ($user !== null && ((config('firewall.enabled') === true && ! \Firewall::isBlacklisted($user->host)) || config('firewall.enabled') === false)) {
|
||||
if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) {
|
||||
$this->validate($request, [
|
||||
'g-recaptcha-response' => ['required', 'captcha'],
|
||||
@@ -74,7 +74,7 @@ class LoginController extends Controller
|
||||
|
||||
$rememberMe = $request->has('rememberme') && $request->input('rememberme') === 'on';
|
||||
|
||||
if ($user->isVerified() === false || $user->isPendingVerification()) {
|
||||
if (! $user->isVerified() || $user->isPendingVerification()) {
|
||||
return $this->showLoginForm('You have not verified your email address!');
|
||||
}
|
||||
|
||||
@@ -112,14 +112,7 @@ class LoginController extends Controller
|
||||
$meta_keywords = 'Login';
|
||||
$meta_description = 'Login';
|
||||
$content = app('smarty.view')->fetch($theme.'/login.tpl');
|
||||
app('smarty.view')->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
app('smarty.view')->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
app('smarty.view')->display($theme.'/basepage.tpl');
|
||||
}
|
||||
|
||||
|
||||
@@ -221,15 +221,7 @@ class RegisterController extends Controller
|
||||
$meta_description = 'Register';
|
||||
|
||||
$content = app('smarty.view')->fetch($theme.'/register.tpl');
|
||||
app('smarty.view')->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
'nocaptcha' => $nocaptcha,
|
||||
]
|
||||
);
|
||||
app('smarty.view')->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description', 'nocaptcha'));
|
||||
app('smarty.view')->display($theme.'/basepage.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,14 +256,14 @@ class BasePageController extends Controller
|
||||
|
||||
$sab = new SABnzbd($this);
|
||||
$this->smarty->assign('sabintegrated', $sab->integratedBool);
|
||||
if ($sab->integratedBool !== false && $sab->url !== '' && $sab->apikey !== '') {
|
||||
if ($sab->integratedBool && $sab->url !== '' && $sab->apikey !== '') {
|
||||
$this->smarty->assign('sabapikeytype', $sab->apikeytype);
|
||||
}
|
||||
if ($this->userdata->hasRole('Admin') === true) {
|
||||
if ($this->userdata->hasRole('Admin')) {
|
||||
$this->smarty->assign('isadmin', 'true');
|
||||
}
|
||||
|
||||
if ($this->userdata->hasRole('Moderator') === true) {
|
||||
if ($this->userdata->hasRole('Moderator')) {
|
||||
$this->smarty->assign('ismod', 'true');
|
||||
}
|
||||
|
||||
|
||||
@@ -101,14 +101,7 @@ class BooksController extends BasePageController
|
||||
$meta_keywords = 'browse,nzb,books,description,details';
|
||||
$meta_description = 'Browse for Books';
|
||||
$content = $this->smarty->fetch('books.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -45,14 +45,7 @@ class BrowseController extends BasePageController
|
||||
$meta_description = 'Browse for Nzbs';
|
||||
|
||||
$content = $this->smarty->fetch('browse.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -141,15 +134,7 @@ class BrowseController extends BasePageController
|
||||
$meta_description = 'Browse for Nzbs';
|
||||
|
||||
$content = $this->smarty->fetch('browse.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'covgroup' => $covgroup,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'covgroup', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -187,14 +172,7 @@ class BrowseController extends BasePageController
|
||||
$meta_description = 'Browse Groups';
|
||||
$content = $this->smarty->fetch('browse.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
|
||||
$this->pagerender();
|
||||
}
|
||||
@@ -233,14 +211,7 @@ class BrowseController extends BasePageController
|
||||
$meta_description = 'Browse Groups';
|
||||
$content = $this->smarty->fetch('browse.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -20,14 +20,7 @@ class BrowseGroupController extends BasePageController
|
||||
$meta_description = 'Browse groups';
|
||||
|
||||
$content = $this->smarty->fetch('browsegroup.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,14 +55,7 @@ class BtcPaymentController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('btc_payment.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'title' => $title,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'title', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,14 +23,7 @@ class CartController extends BasePageController
|
||||
$this->smarty->assign('results', $results);
|
||||
|
||||
$content = $this->smarty->fetch('cart.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
|
||||
@@ -110,14 +110,7 @@ class ConsoleController extends BasePageController
|
||||
$meta_description = 'Browse for Console Games';
|
||||
$content = $this->smarty->fetch('console.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -64,16 +64,7 @@ class ContactUsController extends BasePageController
|
||||
$meta_description = 'Contact us at '.Settings::settingValue('site.main.title').' and submit your feedback';
|
||||
$content = $this->smarty->fetch('contact.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
'msg' => $msg,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'content', 'meta_title', 'meta_keywords', 'meta_description', 'msg'));
|
||||
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -75,14 +75,7 @@ class ContentController extends BasePageController
|
||||
$this->smarty->assign('content', $content);
|
||||
|
||||
$content = $this->smarty->fetch('content.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,14 +163,7 @@ class DetailsController extends BasePageController
|
||||
$meta_description = 'View NZB for'.$data['searchname'];
|
||||
|
||||
$content = $this->smarty->fetch('viewnzb.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,13 +46,7 @@ class FileListController extends BasePageController
|
||||
$content = $this->smarty->fetch('viewfilelist.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
compact('title', 'content', 'meta_title', 'meta_keywords', 'meta_description')
|
||||
);
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -58,12 +58,7 @@ class ForumController extends BasePageController
|
||||
$content = $this->smarty->fetch('forum.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
compact('content', 'meta_title', 'meta_keywords', 'meta_description')
|
||||
);
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -82,12 +82,7 @@ class GamesController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('games.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
compact('content', 'meta_title', 'meta_keywords', 'meta_description')
|
||||
);
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class GetNzbController extends BasePageController
|
||||
$uid = $this->userdata->id;
|
||||
$maxDownloads = $this->userdata->role->downloadrequests;
|
||||
$rssToken = $this->userdata['api_token'];
|
||||
if ($this->userdata->hasRole('Disabled') === true) {
|
||||
if ($this->userdata->hasRole('Disabled')) {
|
||||
Utility::showApiError(101);
|
||||
}
|
||||
} else {
|
||||
@@ -47,7 +47,7 @@ class GetNzbController extends BasePageController
|
||||
$uid = $res['id'];
|
||||
$rssToken = $res['api_token'];
|
||||
$maxDownloads = $res->role->downloadrequests;
|
||||
if ($res->hasRole('Disabled') === true) {
|
||||
if ($res->hasRole('Disabled')) {
|
||||
Utility::showApiError(101);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,13 +45,7 @@ class MovieController extends BasePageController
|
||||
}
|
||||
}
|
||||
|
||||
$this->smarty->assign([
|
||||
'content' => $content,
|
||||
'title' => $title,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]);
|
||||
$this->smarty->assign(compact('content', 'title', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -171,12 +165,7 @@ class MovieController extends BasePageController
|
||||
$content = $this->smarty->fetch('movies.tpl');
|
||||
}
|
||||
|
||||
$this->smarty->assign([
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -216,13 +205,7 @@ class MovieController extends BasePageController
|
||||
if ($modal) {
|
||||
echo $content;
|
||||
} else {
|
||||
$this->smarty->assign([
|
||||
'content' => $content,
|
||||
'title' => $title,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]);
|
||||
$this->smarty->assign(compact('content', 'title', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,14 +109,7 @@ class MusicController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('music.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -167,13 +167,7 @@ class MyMoviesController extends BasePageController
|
||||
$this->smarty->assign('movies', true);
|
||||
|
||||
$content = $this->smarty->fetch('browse.tpl');
|
||||
$this->smarty->assign([
|
||||
'content' => $content,
|
||||
'title' => $title,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]);
|
||||
$this->smarty->assign(compact('content', 'title', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
break;
|
||||
default:
|
||||
@@ -210,13 +204,7 @@ class MyMoviesController extends BasePageController
|
||||
$this->smarty->assign('movies', $results);
|
||||
|
||||
$content = $this->smarty->fetch('mymovies.tpl');
|
||||
$this->smarty->assign([
|
||||
'content' => $content,
|
||||
'title' => $title,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]);
|
||||
$this->smarty->assign(compact('content', 'title', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -156,13 +156,7 @@ class MyShowsController extends BasePageController
|
||||
$this->smarty->assign('shows', $results);
|
||||
|
||||
$content = $this->smarty->fetch('myshows.tpl');
|
||||
$this->smarty->assign([
|
||||
'content' => $content,
|
||||
'title' => $title,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]);
|
||||
$this->smarty->assign(compact('content', 'title', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -50,13 +50,7 @@ class NfoController extends BasePageController
|
||||
if ($modal) {
|
||||
echo $content;
|
||||
} else {
|
||||
$this->smarty->assign([
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]);
|
||||
$this->smarty->assign(compact('title', 'content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -29,7 +29,7 @@ class ProfileController extends BasePageController
|
||||
$sab = new SABnzbd($this);
|
||||
|
||||
$userID = $this->userdata->id;
|
||||
$privileged = $this->userdata->hasRole('Admin') === true || $this->userdata->hasRole('Moderator');
|
||||
$privileged = $this->userdata->hasRole('Admin') || $this->userdata->hasRole('Moderator');
|
||||
$privateProfiles = (int) Settings::settingValue('..privateprofiles') === 1;
|
||||
$publicView = false;
|
||||
|
||||
@@ -92,7 +92,7 @@ class ProfileController extends BasePageController
|
||||
'sabapikey' => $sab->apikey,
|
||||
'sabapikeytype' => $sab->apikeytype !== '' ? $sabApiKeyTypes[$sab->apikeytype] : '',
|
||||
'sabpriority' => $sab->priority !== '' ? $sabPriorities[$sab->priority] : '',
|
||||
'sabsetting' => $sabSettings[$sab->checkCookie() === true ? 2 : 1],
|
||||
'sabsetting' => $sabSettings[$sab->checkCookie() ? 2 : 1],
|
||||
]
|
||||
);
|
||||
|
||||
@@ -197,67 +197,67 @@ class ProfileController extends BasePageController
|
||||
(int) Settings::settingValue('site.main.userselstyle') === 1 ? $request->input('style') : 'None'
|
||||
);
|
||||
|
||||
if ((int) $request->input('viewconsole') === 1 && $data->role->hasPermissionTo('view console') === true && $data->hasDirectPermission('view console') === false) {
|
||||
if ((int) $request->input('viewconsole') === 1 && $data->role->hasPermissionTo('view console') === true && ! $data->hasDirectPermission('view console')) {
|
||||
$data->givePermissionTo('view console');
|
||||
} elseif ((int) $request->input('viewconsole') === 0 && $data->role->hasPermissionTo('view console') === true && $data->hasPermissionTo('view console') === true) {
|
||||
} elseif ((int) $request->input('viewconsole') === 0 && $data->role->hasPermissionTo('view console') === true && $data->hasPermissionTo('view console')) {
|
||||
$data->revokePermissionTo('view console');
|
||||
} elseif ($data->role->hasPermissionTo('view console') === false && $data->hasDirectPermission('view console') === true && ((int) $request->input('viewconsole') === 0 || (int) $request->input('viewconsole') === 1)) {
|
||||
} elseif ($data->role->hasPermissionTo('view console') === false && $data->hasDirectPermission('view console') && ((int) $request->input('viewconsole') === 0 || (int) $request->input('viewconsole') === 1)) {
|
||||
$data->revokePermissionTo('view console');
|
||||
}
|
||||
|
||||
if ((int) $request->input('viewmovies') === 1 && $data->role->hasPermissionTo('view movies') === true && $data->hasDirectPermission('view movies') === false) {
|
||||
if ((int) $request->input('viewmovies') === 1 && $data->role->hasPermissionTo('view movies') === true && ! $data->hasDirectPermission('view movies')) {
|
||||
$data->givePermissionTo('view movies');
|
||||
} elseif ((int) $request->input('viewmovies') === 0 && $data->role->hasPermissionTo('view movies') === true && $data->hasDirectPermission('view movies') === true) {
|
||||
} elseif ((int) $request->input('viewmovies') === 0 && $data->role->hasPermissionTo('view movies') === true && $data->hasDirectPermission('view movies')) {
|
||||
$data->revokePermissionTo('view movies');
|
||||
} elseif ($data->role->hasPermissionTo('view movies') === false && $data->hasDirectPermission('view movies') === true && ((int) $request->input('viewmovies') === 0 || (int) $request->input('viewmovies') === 1)) {
|
||||
} elseif ($data->role->hasPermissionTo('view movies') === false && $data->hasDirectPermission('view movies') && ((int) $request->input('viewmovies') === 0 || (int) $request->input('viewmovies') === 1)) {
|
||||
$data->revokePermissionTo('view movies');
|
||||
}
|
||||
|
||||
if ((int) $request->input('viewaudio') === 1 && $data->role->hasPermissionTo('view audio') === true && $data->hasDirectPermission('view audio') === false) {
|
||||
if ((int) $request->input('viewaudio') === 1 && $data->role->hasPermissionTo('view audio') === true && ! $data->hasDirectPermission('view audio')) {
|
||||
$data->givePermissionTo('view audio');
|
||||
} elseif ((int) $request->input('viewaudio') === 0 && $data->role->hasPermissionTo('view audio') === true && $data->hasDirectPermission('view audio') === true) {
|
||||
} elseif ((int) $request->input('viewaudio') === 0 && $data->role->hasPermissionTo('view audio') === true && $data->hasDirectPermission('view audio')) {
|
||||
$data->revokePermissionTo('view audio');
|
||||
} elseif ($data->role->hasPermissionTo('view audio') === false && $data->hasDirectPermission('view audio') === true && ((int) $request->input('viewaudio') === 0 || (int) $request->input('viewaudio') === 1)) {
|
||||
} elseif ($data->role->hasPermissionTo('view audio') === false && $data->hasDirectPermission('view audio') && ((int) $request->input('viewaudio') === 0 || (int) $request->input('viewaudio') === 1)) {
|
||||
$data->revokePermissionTo('view audio');
|
||||
}
|
||||
|
||||
if ((int) $request->input('viewpc') === 1 && $data->role->hasPermissionTo('view pc') === true && $data->hasDirectPermission('view pc') === false) {
|
||||
if ((int) $request->input('viewpc') === 1 && $data->role->hasPermissionTo('view pc') === true && ! $data->hasDirectPermission('view pc')) {
|
||||
$data->givePermissionTo('view pc');
|
||||
} elseif ((int) $request->input('viewpc') === 0 && $data->role->hasPermissionTo('view pc') === true && $data->hasDirectPermission('view pc') === true) {
|
||||
} elseif ((int) $request->input('viewpc') === 0 && $data->role->hasPermissionTo('view pc') === true && $data->hasDirectPermission('view pc')) {
|
||||
$data->revokePermissionTo('view pc');
|
||||
} elseif ($data->role->hasPermissionTo('view pc') === false && $data->hasDirectPermission('view pc') === true && ((int) $request->input('viewpc') === 0 || (int) $request->input('viewpc') === 1)) {
|
||||
} elseif ($data->role->hasPermissionTo('view pc') === false && $data->hasDirectPermission('view pc') && ((int) $request->input('viewpc') === 0 || (int) $request->input('viewpc') === 1)) {
|
||||
$data->revokePermissionTo('view pc');
|
||||
}
|
||||
|
||||
if ((int) $request->input('viewtv') === 1 && $data->role->hasPermissionTo('view tv') === true && $data->hasDirectPermission('view tv') === false) {
|
||||
if ((int) $request->input('viewtv') === 1 && $data->role->hasPermissionTo('view tv') === true && ! $data->hasDirectPermission('view tv')) {
|
||||
$data->givePermissionTo('view tv');
|
||||
} elseif ((int) $request->input('viewtv') === 0 && $data->role->hasPermissionTo('view tv') === true && $data->hasDirectPermission('view tv') === true) {
|
||||
} elseif ((int) $request->input('viewtv') === 0 && $data->role->hasPermissionTo('view tv') === true && $data->hasDirectPermission('view tv')) {
|
||||
$data->revokePermissionTo('view tv');
|
||||
} elseif ($data->role->hasPermissionTo('view tv') === false && $data->hasDirectPermission('view tv') === true && ((int) $request->input('viewtv') === 0 || (int) $request->input('viewtv') === 1)) {
|
||||
} elseif ($data->role->hasPermissionTo('view tv') === false && $data->hasDirectPermission('view tv') && ((int) $request->input('viewtv') === 0 || (int) $request->input('viewtv') === 1)) {
|
||||
$data->revokePermissionTo('view tv');
|
||||
}
|
||||
|
||||
if ((int) $request->input('viewadult') === 1 && $data->role->hasPermissionTo('view adult') === true && $data->hasDirectPermission('view adult') === false) {
|
||||
if ((int) $request->input('viewadult') === 1 && $data->role->hasPermissionTo('view adult') === true && ! $data->hasDirectPermission('view adult')) {
|
||||
$data->givePermissionTo('view adult');
|
||||
} elseif ((int) $request->input('viewadult') === 0 && $data->role->hasPermissionTo('view adult') === true && $data->hasDirectPermission('view adult') === true) {
|
||||
} elseif ((int) $request->input('viewadult') === 0 && $data->role->hasPermissionTo('view adult') === true && $data->hasDirectPermission('view adult')) {
|
||||
$data->revokePermissionTo('view adult');
|
||||
} elseif ($data->role->hasPermissionTo('view adult') === false && $data->hasDirectPermission('view adult') === true && ((int) $request->input('viewadult') === 0 || (int) $request->input('viewadult') === 1)) {
|
||||
} elseif ($data->role->hasPermissionTo('view adult') === false && $data->hasDirectPermission('view adult') && ((int) $request->input('viewadult') === 0 || (int) $request->input('viewadult') === 1)) {
|
||||
$data->revokePermissionTo('view adult');
|
||||
}
|
||||
|
||||
if ((int) $request->input('viewbooks') === 1 && $data->role->hasPermissionTo('view books') === true && $data->hasDirectPermission('view books') === false) {
|
||||
if ((int) $request->input('viewbooks') === 1 && $data->role->hasPermissionTo('view books') === true && ! $data->hasDirectPermission('view books')) {
|
||||
$data->givePermissionTo('view books');
|
||||
} elseif ((int) $request->input('viewbooks') === 0 && $data->role->hasPermissionTo('view books') === true && $data->hasDirectPermission('view books') === true) {
|
||||
} elseif ((int) $request->input('viewbooks') === 0 && $data->role->hasPermissionTo('view books') === true && $data->hasDirectPermission('view books')) {
|
||||
$data->revokePermissionTo('view books');
|
||||
} elseif ($data->role->hasPermissionTo('view books') === false && $data->hasDirectPermission('view books') === true && ((int) $request->input('viewbooks') === 0 || (int) $request->input('viewbooks') === 1)) {
|
||||
} elseif ($data->role->hasPermissionTo('view books') === false && $data->hasDirectPermission('view books') && ((int) $request->input('viewbooks') === 0 || (int) $request->input('viewbooks') === 1)) {
|
||||
$data->revokePermissionTo('view books');
|
||||
}
|
||||
|
||||
if ((int) $request->input('viewother') === 1 && $data->role->hasPermissionTo('view other') === true && $data->hasDirectPermission('view other') === false) {
|
||||
if ((int) $request->input('viewother') === 1 && $data->role->hasPermissionTo('view other') === true && ! $data->hasDirectPermission('view other')) {
|
||||
$data->givePermissionTo('view other');
|
||||
} elseif ((int) $request->input('viewother') === 0 && $data->role->hasPermissionTo('view other') === true && $data->hasDirectPermission('view other') === true) {
|
||||
} elseif ((int) $request->input('viewother') === 0 && $data->role->hasPermissionTo('view other') === true && $data->hasDirectPermission('view other')) {
|
||||
$data->revokePermissionTo('view other');
|
||||
} elseif ($data->role->hasPermissionTo('view other') === false && $data->hasDirectPermission('view other') === true && ((int) $request->input('viewother') === 0 || (int) $request->input('viewother') === 1)) {
|
||||
} elseif ($data->role->hasPermissionTo('view other') === false && $data->hasDirectPermission('view other') && ((int) $request->input('viewother') === 0 || (int) $request->input('viewother') === 1)) {
|
||||
$data->revokePermissionTo('view other');
|
||||
}
|
||||
|
||||
@@ -336,14 +336,7 @@ class ProfileController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('profileedit.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
|
||||
@@ -95,13 +95,7 @@ class QueueController extends BasePageController
|
||||
$meta_keywords = 'view,'.strtolower($queueType).',queue';
|
||||
$meta_description = 'View'.$queueType.' Queue';
|
||||
$content = $this->smarty->fetch('viewqueue.tpl');
|
||||
$this->smarty->assign([
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]);
|
||||
$this->smarty->assign(compact('title', 'content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -329,12 +323,7 @@ class QueueController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('nzbvortex.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'content'));
|
||||
|
||||
$this->pagerender();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class RssController extends BasePageController
|
||||
$title = 'Rss Info';
|
||||
$meta_title = 'Rss Nzb Info';
|
||||
$meta_keywords = 'view,nzb,description,details,rss,atom';
|
||||
$meta_description = 'View information about Newznab Tmux RSS Feeds.';
|
||||
$meta_description = 'View information about NNTmux RSS Feeds.';
|
||||
|
||||
$firstShow = $rss->getFirstInstance('videos_id', 'releases', 'id');
|
||||
$firstAni = $rss->getFirstInstance('anidbid', 'releases', 'id');
|
||||
@@ -86,7 +86,7 @@ class RssController extends BasePageController
|
||||
$rssToken = $res['api_token'];
|
||||
$maxRequests = $res->role->apirequests;
|
||||
|
||||
if ($res->hasRole('Disabled') === true) {
|
||||
if ($res->hasRole('Disabled')) {
|
||||
Utility::showApiError(101);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,14 +197,7 @@ You can combine some of these rules, but not all.<br />';
|
||||
);
|
||||
|
||||
$content = $this->smarty->fetch('search.tpl');
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,13 +139,7 @@ class SeriesController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch('viewserieslist.tpl');
|
||||
|
||||
$this->smarty->assign([
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]);
|
||||
$this->smarty->assign(compact('title', 'content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
$this->pagerender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,15 +19,7 @@ class TermsController extends BasePageController
|
||||
|
||||
$content = $this->smarty->fetch($this->theme.'/terms.tpl');
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
'meta_title' => $meta_title,
|
||||
'meta_keywords' => $meta_keywords,
|
||||
'meta_description' => $meta_description,
|
||||
]
|
||||
);
|
||||
$this->smarty->assign(compact('title', 'content', 'meta_title', 'meta_keywords', 'meta_description'));
|
||||
|
||||
$this->smarty->display($this->theme.'/basepage.tpl');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user