diff --git a/Blacklight/http/BasePage.php b/Blacklight/http/BasePage.php index 991880189..0bdd73090 100644 --- a/Blacklight/http/BasePage.php +++ b/Blacklight/http/BasePage.php @@ -121,17 +121,16 @@ class BasePage // Buffer settings/DB connection. $this->settings = new Settings(); $this->pdo = new DB(); - $this->smarty = new Smarty(); - $this->smarty->setCompileDir(config('ytake-laravel-smarty.compile_path')); - $this->smarty->setConfigDir(array_get(config('ytake-laravel-smarty'), 'config_paths')); - $this->smarty->setCacheDir(config('ytake-laravel-smarty.cache_path')); + app('smarty.view')->setCompileDir(config('ytake-laravel-smarty.compile_path')); + app('smarty.view')->setConfigDir(array_get(config('ytake-laravel-smarty'), 'config_paths')); + app('smarty.view')->setCacheDir(config('ytake-laravel-smarty.cache_path')); foreach (array_get(config('ytake-laravel-smarty'), 'plugins_paths', []) as $plugins) { - $this->smarty->addPluginsDir($plugins); + app('smarty.view')->addPluginsDir($plugins); } - $this->smarty->error_reporting = E_ALL & ~E_NOTICE; + app('smarty.view')->error_reporting = E_ALL & ~E_NOTICE; - $this->smarty->assign('serverroot', url('/')); + app('smarty.view')->assign('serverroot', url('/')); $this->page = request()->input('page') ?? 'content'; @@ -141,17 +140,17 @@ class BasePage } else { $this->theme = $this->getSettingValue('site.main.style'); - $this->smarty->assign('isadmin', 'false'); - $this->smarty->assign('ismod', 'false'); - $this->smarty->assign('loggedin', 'false'); + app('smarty.view')->assign('isadmin', 'false'); + app('smarty.view')->assign('ismod', 'false'); + app('smarty.view')->assign('loggedin', 'false'); } if ($this->theme === 'None') { $this->theme = Settings::settingValue('site.main.style'); } - $this->smarty->assign('theme', $this->theme); - $this->smarty->assign('site', $this->settings); - $this->smarty->assign('page', $this); + app('smarty.view')->assign('theme', $this->theme); + app('smarty.view')->assign('site', $this->settings); + app('smarty.view')->assign('page', $this); } /** @@ -165,26 +164,6 @@ class BasePage $this->show503(); } - /** - * Inject content into the html head. - * - * @param $headcontent - */ - public function addToHead($headcontent): void - { - $this->head = $this->head."\n".$headcontent; - } - - /** - * Inject js/attributes into the html body tag. - * - * @param $attr - */ - public function addToBody($attr): void - { - $this->body = $this->body.' '.$attr; - } - /** * @return bool */ @@ -277,7 +256,7 @@ class BasePage public function render() { - $this->smarty->display($this->page_template); + app('smarty.view')->display($this->page_template); } /** @@ -303,73 +282,39 @@ class BasePage User::updateSiteAccessed($this->userdata['id']); } - $this->smarty->assign('userdata', $this->userdata); - $this->smarty->assign('loggedin', 'true'); + app('smarty.view')->assign('userdata', $this->userdata); + app('smarty.view')->assign('loggedin', 'true'); if ($this->userdata['nzbvortex_api_key'] !== '' && $this->userdata['nzbvortex_server_url'] !== '') { - $this->smarty->assign('weHasVortex', true); + app('smarty.view')->assign('weHasVortex', true); } else { - $this->smarty->assign('weHasVortex', false); + app('smarty.view')->assign('weHasVortex', false); } $sab = new SABnzbd($this); - $this->smarty->assign('sabintegrated', $sab->integratedBool); + app('smarty.view')->assign('sabintegrated', $sab->integratedBool); if ($sab->integratedBool !== false && $sab->url !== '' && $sab->apikey !== '') { - $this->smarty->assign('sabapikeytype', $sab->apikeytype); + app('smarty.view')->assign('sabapikeytype', $sab->apikeytype); } switch ((int) $this->userdata['user_roles_id']) { case User::ROLE_ADMIN: - $this->smarty->assign('isadmin', 'true'); + app('smarty.view')->assign('isadmin', 'true'); break; case User::ROLE_MODERATOR: - $this->smarty->assign('ismod', 'true'); + app('smarty.view')->assign('ismod', 'true'); } } - /** - * Allows to fetch a value from the settings table. - * - * This method is deprecated, as the column it uses to select the data is due to be removed - * from the table *soon*. - * - * @param $setting - * - * @return array|bool|mixed|null|string - * @throws \Exception - */ - public function getSetting($setting) - { - if (strpos($setting, '.') === false) { - trigger_error('You should update your template to use the newer method "$page->getSettingValue()"" of fetching values from the "settings" table! This method *will* be removed in a future version.', E_USER_WARNING); - } else { - return $this->getSettingValue($setting); - } - - return $this->settings->$setting; - } - - /** - * @param $setting - * - * @return null|string - * @throws \Exception - */ - public function getSettingValue($setting): ?string - { - return Settings::settingValue($setting); - } - /** * Setup user preferences. * * * @throws \Exception - * @throws \SmartyException */ public function setUserPrefs() { // Tell Smarty which directories to use for templates - $this->smarty->setTemplateDir([ + app('smarty.view')->setTemplateDir([ 'user' => config('ytake-laravel-smarty.template_path').DIRECTORY_SEPARATOR.$this->theme, 'shared' => config('ytake-laravel-smarty.template_path').'/shared', 'default' => config('ytake-laravel-smarty.template_path').'/Gentele', @@ -381,16 +326,16 @@ class BasePage } $content = new Contents(); - $this->smarty->assign('menulist', Menu::getMenu($role, $this->serverurl)); - $this->smarty->assign('usefulcontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role)); - $this->smarty->assign('articlecontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role)); + app('smarty.view')->assign('menulist', Menu::getMenu($role, $this->serverurl)); + app('smarty.view')->assign('usefulcontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role)); + app('smarty.view')->assign('articlecontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role)); if ($this->userdata !== null) { - $this->smarty->assign('recentforumpostslist', Forumpost::getPosts(Settings::settingValue('..showrecentforumposts'))); + app('smarty.view')->assign('recentforumpostslist', Forumpost::getPosts(Settings::settingValue('..showrecentforumposts'))); } - $this->smarty->assign('main_menu', $this->smarty->fetch('mainmenu.tpl')); - $this->smarty->assign('useful_menu', $this->smarty->fetch('usefullinksmenu.tpl')); - $this->smarty->assign('article_menu', $this->smarty->fetch('articlesmenu.tpl')); + app('smarty.view')->assign('main_menu', app('smarty.view')->fetch('mainmenu.tpl')); + app('smarty.view')->assign('useful_menu', app('smarty.view')->fetch('usefullinksmenu.tpl')); + app('smarty.view')->assign('article_menu', app('smarty.view')->fetch('articlesmenu.tpl')); if (! empty($this->userdata)) { $parentcatlist = Category::getForMenu($this->userdata['categoryexclusions'], $this->userdata['rolecategoryexclusions']); @@ -398,27 +343,27 @@ class BasePage $parentcatlist = Category::getForMenu(); } - $this->smarty->assign('parentcatlist', $parentcatlist); - $this->smarty->assign('catClass', Category::class); + app('smarty.view')->assign('parentcatlist', $parentcatlist); + app('smarty.view')->assign('catClass', Category::class); $searchStr = ''; if ($this->page === 'search' && request()->has('id')) { $searchStr = request()->input('id'); } - $this->smarty->assign('header_menu_search', $searchStr); + app('smarty.view')->assign('header_menu_search', $searchStr); if (request()->has('t')) { - $this->smarty->assign('header_menu_cat', request()->input('t')); + app('smarty.view')->assign('header_menu_cat', request()->input('t')); } else { - $this->smarty->assign('header_menu_cat', ''); + app('smarty.view')->assign('header_menu_cat', ''); } - $header_menu = $this->smarty->fetch('headermenu.tpl'); - $this->smarty->assign('header_menu', $header_menu); + $header_menu = app('smarty.view')->fetch('headermenu.tpl'); + app('smarty.view')->assign('header_menu', $header_menu); } public function setAdminPrefs() { // Tell Smarty which directories to use for templates - $this->smarty->setTemplateDir( + app('smarty.view')->setTemplateDir( [ 'admin' => config('ytake-laravel-smarty.template_path').'/admin', 'shared' => config('ytake-laravel-smarty.template_path').'/shared', @@ -426,7 +371,7 @@ class BasePage ] ); - $this->smarty->assign('catClass', Category::class); + app('smarty.view')->assign('catClass', Category::class); } /** @@ -434,7 +379,7 @@ class BasePage */ public function pagerender(): void { - $this->smarty->assign('page', $this); + app('smarty.view')->assign('page', $this); $this->page_template = 'basepage.tpl'; $this->render(); @@ -447,10 +392,10 @@ class BasePage */ public function adminrender(): void { - $this->smarty->assign('page', $this); + app('smarty.view')->assign('page', $this); - $admin_menu = $this->smarty->fetch('adminmenu.tpl'); - $this->smarty->assign('admin_menu', $admin_menu); + $admin_menu = app('smarty.view')->fetch('adminmenu.tpl'); + app('smarty.view')->assign('admin_menu', $admin_menu); $this->page_template = 'baseadminpage.tpl'; diff --git a/Changelog b/Changelog index fde28f02d..066e3415c 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2018-03-29 DariusIII + * Chg: Remove login/register pages, use Login/Register controllers completely 2018-03-28 DariusIII * Chg: Update laravel/framework to version 5.6.14 * Chg: Change login/register pages diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index ccbe7c441..a35b31dbd 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Auth; +use App\Models\Settings; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; @@ -65,10 +66,35 @@ class LoginController extends Controller return redirect()->intended($this->redirectPath()); } + app('smarty.view')->assign('error', 'These credentials do not match our records.'); return redirect()->back() ->withInput() ->withErrors([ 'login' => 'These credentials do not match our records.', ]); } + + /** + * @throws \Exception + */ + public function showLoginForm() + { + $theme = Settings::settingValue('site.main.style'); + app('smarty.view')->assign(['error' => '', 'username' => '', 'rememberme' => '']); + + $meta_title = 'Login'; + $meta_keywords = 'Login'; + $meta_description = 'Login'; + $content = app('smarty.view')->fetch($theme.'/login.tpl'); + app('smarty.view')->assign( + [ + 'error' => 'These credentials do not match our records.', + 'content' => $content, + 'meta_title' => $meta_title, + 'meta_keywords' => $meta_keywords, + 'meta_description' => $meta_description, + ] + ); + app('smarty.view')->display($theme.'/basepage.tpl'); + } } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 76788334a..5241ac939 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -85,7 +85,7 @@ class RegisterController extends Controller public function register(Request $request) { - $userName = $password = $confirmPassword = $email = $inviteCode = $inviteCodeQuery = ''; + $error = $userName = $password = $confirmPassword = $email = $inviteCode = $inviteCodeQuery = ''; $showRegister = 1; if ((int) Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_CLOSED) { @@ -118,41 +118,41 @@ class RegisterController extends Controller if ((int) Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_INVITE) { if ($inviteCode === '') { - echo 'Sorry, the invite code is old or has been used.'; + $error = 'Sorry, the invite code is old or has been used.'; break; } $invitedBy = User::checkAndUseInvite($inviteCode); if ($invitedBy < 0) { - echo 'Sorry, the invite code is old or has been used.'; + $error = 'Sorry, the invite code is old or has been used.'; break; } } if (! User::isValidUsername($userName)) { - echo 'Your username must be at least five characters.'; + $error = 'Your username must be at least five characters.'; break; } if (! User::isValidPassword($password)) { - echo 'Your password must be longer than eight characters, have at least 1 number, at least 1 capital and at least one lowercase letter'; + $error = 'Your password must be longer than eight characters, have at least 1 number, at least 1 capital and at least one lowercase letter'; break; } if (! User::isValidEmail($email)) { - echo 'Your email is not a valid format.'; + $error = 'Your email is not a valid format.'; break; } $res = User::getByUsername($userName); if ($res) { - echo 'Sorry, the username is already taken.'; + $error = 'Sorry, the username is already taken.'; break; } $res = User::getByEmail($email); if ($res) { - echo 'Sorry, the email is already in use.'; + $error = 'Sorry, the email is already in use.'; break; } @@ -181,7 +181,7 @@ class RegisterController extends Controller // See if it is a valid invite. $invite = Invitation::getInvite($inviteCode); if (! $invite) { - echo sprintf('Bad or invite code older than %d days.', Invitation::DEFAULT_INVITE_EXPIRY_DAYS); + $error = sprintf('Bad or invite code older than %d days.', Invitation::DEFAULT_INVITE_EXPIRY_DAYS); $showRegister = 0; } else { $inviteCode = $invite['guid']; @@ -191,5 +191,40 @@ class RegisterController extends Controller } } } + app('smarty.view')->assign( + [ + 'username' => Utility::htmlfmt($userName), + 'password' => Utility::htmlfmt($password), + 'confirmpassword' => Utility::htmlfmt($confirmPassword), + 'email' => Utility::htmlfmt($email), + 'invitecode' => Utility::htmlfmt($inviteCode), + 'invite_code_query' => Utility::htmlfmt($inviteCodeQuery), + 'showregister' => $showRegister, + 'error' => $error, + ] + ); + } + + /** + * @throws \Exception + */ + public function showRegistrationForm() + { + $theme = Settings::settingValue('site.main.style'); + + $meta_title = 'Register'; + $meta_keywords = 'register,signup,registration'; + $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, + ] + ); + app('smarty.view')->display($theme.'/basepage.tpl'); } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 8bb91f05f..baec82066 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -13,7 +13,8 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - // + $smarty = app('smarty.view'); + view()->share('smarty', $smarty); } /** diff --git a/public/index.php b/public/index.php index 3439e63fd..149d43326 100644 --- a/public/index.php +++ b/public/index.php @@ -56,7 +56,6 @@ switch ($page->page) { case 'profileedit': case 'profile_delete': case 'queue': - case 'register': case 'sabqueuedata': case 'search': case 'sendtocouch': @@ -70,7 +69,6 @@ switch ($page->page) { case 'api': case 'failed': case 'getnzb': - case 'login': case 'rss': include NN_WWW.'pages/'.$page->page.'.php'; break; diff --git a/public/pages/login.php b/public/pages/login.php deleted file mode 100644 index 896818d0e..000000000 --- a/public/pages/login.php +++ /dev/null @@ -1,9 +0,0 @@ -smarty->assign(['error' => '', 'username' => '', 'rememberme' => '']); - -$page->meta_title = 'Login'; -$page->meta_keywords = 'Login'; -$page->meta_description = 'Login'; -$page->content = $page->smarty->fetch('login.tpl'); -$page->pagerender(); diff --git a/public/pages/register.php b/public/pages/register.php deleted file mode 100644 index d78f0e7ec..000000000 --- a/public/pages/register.php +++ /dev/null @@ -1,30 +0,0 @@ -smarty->assign( - [ - 'username' => Utility::htmlfmt($userName), - 'password' => Utility::htmlfmt($password), - 'confirmpassword' => Utility::htmlfmt($confirmPassword), - 'email' => Utility::htmlfmt($email), - 'invitecode' => Utility::htmlfmt($inviteCode), - 'invite_code_query' => Utility::htmlfmt($inviteCodeQuery), - 'showregister' => $showRegister, - 'error' => $error, - ] -); -$page->meta_title = 'Register'; -$page->meta_keywords = 'register,signup,registration'; -$page->meta_description = 'Register'; - -$page->content = $page->smarty->fetch('register.tpl'); -$page->pagerender(); diff --git a/resources/views/themes/Charisma/basepage.tpl b/resources/views/themes/Charisma/basepage.tpl index 77431157c..678207898 100755 --- a/resources/views/themes/Charisma/basepage.tpl +++ b/resources/views/themes/Charisma/basepage.tpl @@ -24,7 +24,7 @@ === --> - {$page->meta_title}{if $page->meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} + {$meta_title}{if $meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} @@ -146,7 +146,7 @@
- {$page->content} + {$content}
diff --git a/resources/views/themes/Charisma/contact.tpl b/resources/views/themes/Charisma/contact.tpl index 26e394538..f26dd16a8 100755 --- a/resources/views/themes/Charisma/contact.tpl +++ b/resources/views/themes/Charisma/contact.tpl @@ -43,7 +43,7 @@ - {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()}{NoCaptcha::renderJs()} diff --git a/resources/views/themes/Charisma/forgottenpassword.tpl b/resources/views/themes/Charisma/forgottenpassword.tpl index b29a4c446..abd462f18 100755 --- a/resources/views/themes/Charisma/forgottenpassword.tpl +++ b/resources/views/themes/Charisma/forgottenpassword.tpl @@ -59,7 +59,7 @@

- {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()}{NoCaptcha::renderJs()}

diff --git a/resources/views/themes/Charisma/login.tpl b/resources/views/themes/Charisma/login.tpl index 0343465c5..02ecf74c7 100755 --- a/resources/views/themes/Charisma/login.tpl +++ b/resources/views/themes/Charisma/login.tpl @@ -67,7 +67,7 @@

- {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()}{NoCaptcha::renderJs()}

diff --git a/resources/views/themes/Charisma/profileedit.tpl b/resources/views/themes/Charisma/profileedit.tpl index c03dee950..f45024ab5 100755 --- a/resources/views/themes/Charisma/profileedit.tpl +++ b/resources/views/themes/Charisma/profileedit.tpl @@ -146,7 +146,7 @@ - {if $page->getSettingValue('site.main.userselstyle') == 1} + {if{{Setting::settingValue('site.main.userselstyle')}} == 1} {html_options style="color: black;" id="style" name='style' values=$themelist output=$themelist selected=$user.style} {/if} @@ -171,7 +171,7 @@ function.
- {if $page->getSettingValue('apps.sabnzbplus.integrationtype') != 1} + {if {{Setting::settingValue('apps.sabnzbplus.integrationtype')}} != 1} @@ -190,7 +190,7 @@
{/if} - {if $user.queuetype == 1 && $page->getSettingValue('apps.sabnzbplus.integrationtype') == 2} + {if $user.queuetype == 1 && {{Setting::settingValue('apps.sabnzbplus.integrationtype')}} == 2} @@ -240,7 +240,7 @@
{/if} - {if $user.queuetype == 2 && ($page->getSettingValue('apps.sabnzbplus.integrationtype') == 0 || $page->getSettingValue('apps.sabnzbplus.integrationtype') == 2)} + {if $user.queuetype == 2 && ({{Setting::settingValue('apps.sabnzbplus.integrationtype')}} == 0 || {{Setting::settingValue('apps.sabnzbplus.integrationtype')}} == 2)} diff --git a/resources/views/themes/Charisma/register.tpl b/resources/views/themes/Charisma/register.tpl index 2e1b3978d..b444ba13c 100755 --- a/resources/views/themes/Charisma/register.tpl +++ b/resources/views/themes/Charisma/register.tpl @@ -68,7 +68,7 @@

- {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()}{NoCaptcha::renderJs()}

diff --git a/resources/views/themes/Charisma/viewqueue.tpl b/resources/views/themes/Charisma/viewqueue.tpl index f8df495a9..f041fb553 100755 --- a/resources/views/themes/Charisma/viewqueue.tpl +++ b/resources/views/themes/Charisma/viewqueue.tpl @@ -8,12 +8,12 @@ {if $error == ''} -{if $page->getSettingValue('apps.sabnzbplus.integrationtype') > 0 || $user.queuetype == 2} +{if {{Setting::settingValue('apps.sabnzbplus.integrationtype')}} > 0 || $user.queuetype == 2}

The following queue is pulled from {$serverURL|escape:"htmlall"}.
- {if $page->getSettingValue('apps.sabnzbplus.integrationtype') == 2 || $user.queuetype == 2}Edit your queue settings in + {if {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} == 2 || $user.queuetype == 2}Edit your queue settings in your profile .{/if}

diff --git a/resources/views/themes/Gamma/basepage.tpl b/resources/views/themes/Gamma/basepage.tpl index 415257845..7b0f57ddc 100755 --- a/resources/views/themes/Gamma/basepage.tpl +++ b/resources/views/themes/Gamma/basepage.tpl @@ -14,11 +14,11 @@ {/literal} - metakeywords != ""},{/if}{$site->metakeywords}" /> - metadescription != ""} - {/if}{$site->metadescription}" /> + metakeywords != ""},{/if}{$site->metakeywords}" /> + metadescription != ""} - {/if}{$site->metadescription}" /> - {$page->meta_title}{if $page->meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} + {$meta_title}{if $meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} @@ -125,7 +125,7 @@
- {$page->content} + {$content}
diff --git a/resources/views/themes/Gamma/contact.tpl b/resources/views/themes/Gamma/contact.tpl index 2b251473b..75e779184 100755 --- a/resources/views/themes/Gamma/contact.tpl +++ b/resources/views/themes/Gamma/contact.tpl @@ -35,7 +35,7 @@ diff --git a/resources/views/themes/Gamma/forgottenpassword.tpl b/resources/views/themes/Gamma/forgottenpassword.tpl index e36a07f3f..0b714d6c8 100755 --- a/resources/views/themes/Gamma/forgottenpassword.tpl +++ b/resources/views/themes/Gamma/forgottenpassword.tpl @@ -26,7 +26,7 @@ border: 1px solid #e1e1e8;
- {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()}{NoCaptcha::renderJs()}

diff --git a/resources/views/themes/Gamma/login.tpl b/resources/views/themes/Gamma/login.tpl index 270224d90..437ce2f90 100755 --- a/resources/views/themes/Gamma/login.tpl +++ b/resources/views/themes/Gamma/login.tpl @@ -19,7 +19,7 @@ Remember me
I forgot my password
- {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()}{NoCaptcha::renderJs()}
- {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()}{NoCaptcha::renderJs()}
diff --git a/resources/views/themes/Gamma/profileedit.tpl b/resources/views/themes/Gamma/profileedit.tpl index c86503795..8129e3b75 100755 --- a/resources/views/themes/Gamma/profileedit.tpl +++ b/resources/views/themes/Gamma/profileedit.tpl @@ -53,11 +53,11 @@
Site Preferences - {if $page->getSettingValue('site.main.userselstyle') == 1} + {if {{App\Models\Settings::settingValue('site.main.userselstyle')}} == 1}
- {if $page->getSettingValue('site.main.userselstyle') == 1} + {if {{App\Models\Settings::settingValue('site.main.userselstyle')}} == 1} {html_options id="style" name='style' values=$themelist output=$themelist selected=$user.style} {/if}
@@ -113,8 +113,8 @@
- {if $page->getSettingValue('apps.sabnzbplus.integrationtype') > 0} - {if $page->getSettingValue('apps.sabnzbplus.integrationtype') != 1} + {if {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} > 0} + {if {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} != 1} Queue type (NZBget / Sabnzbd)
diff --git a/resources/views/themes/Gamma/register.tpl b/resources/views/themes/Gamma/register.tpl index 7bca029ae..449749d94 100755 --- a/resources/views/themes/Gamma/register.tpl +++ b/resources/views/themes/Gamma/register.tpl @@ -25,7 +25,7 @@ - {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()}{NoCaptcha::renderJs()} diff --git a/resources/views/themes/Gamma/viewqueue.tpl b/resources/views/themes/Gamma/viewqueue.tpl index f8df495a9..619acad60 100755 --- a/resources/views/themes/Gamma/viewqueue.tpl +++ b/resources/views/themes/Gamma/viewqueue.tpl @@ -8,12 +8,12 @@
{if $error == ''} -{if $page->getSettingValue('apps.sabnzbplus.integrationtype') > 0 || $user.queuetype == 2} +{if {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} > 0 || $user.queuetype == 2}

The following queue is pulled from {$serverURL|escape:"htmlall"}.
- {if $page->getSettingValue('apps.sabnzbplus.integrationtype') == 2 || $user.queuetype == 2}Edit your queue settings in + {if {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} == 2 || $user.queuetype == 2}Edit your queue settings in your profile .{/if}

diff --git a/resources/views/themes/Gentele/basepage.tpl b/resources/views/themes/Gentele/basepage.tpl index f32687beb..54c706cc3 100755 --- a/resources/views/themes/Gentele/basepage.tpl +++ b/resources/views/themes/Gentele/basepage.tpl @@ -19,7 +19,7 @@ - {$page->meta_title}{if $page->meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} + {$meta_title}{if $meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} {{Html::style("{$smarty.const.WWW_ASSETS}/bootstrap-3.x/dist/css/bootstrap.min.css")}} @@ -153,7 +153,7 @@
- {$page->content} + {$content}
diff --git a/resources/views/themes/Gentele/contact.tpl b/resources/views/themes/Gentele/contact.tpl index 6427997b8..525517713 100755 --- a/resources/views/themes/Gentele/contact.tpl +++ b/resources/views/themes/Gentele/contact.tpl @@ -2,7 +2,7 @@ - {$page->meta_title}{if $page->meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} + {$meta_title}{if $meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} @@ -54,7 +54,7 @@ - {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()}{NoCaptcha::renderJs()} diff --git a/resources/views/themes/Gentele/forgottenpassword.tpl b/resources/views/themes/Gentele/forgottenpassword.tpl index 20ba48991..fef114907 100755 --- a/resources/views/themes/Gentele/forgottenpassword.tpl +++ b/resources/views/themes/Gentele/forgottenpassword.tpl @@ -33,7 +33,7 @@
- {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()}{NoCaptcha::renderJs()}

diff --git a/resources/views/themes/Gentele/login.tpl b/resources/views/themes/Gentele/login.tpl index 4a07dd568..b4d8ef4bf 100755 --- a/resources/views/themes/Gentele/login.tpl +++ b/resources/views/themes/Gentele/login.tpl @@ -29,7 +29,8 @@ name="rememberme" type="checkbox"> Remember Me
- {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()} + {NoCaptcha::renderJs()}
diff --git a/resources/views/themes/Gentele/profileedit.tpl b/resources/views/themes/Gentele/profileedit.tpl index 9caf40646..4feae3196 100755 --- a/resources/views/themes/Gentele/profileedit.tpl +++ b/resources/views/themes/Gentele/profileedit.tpl @@ -145,7 +145,7 @@ - {if $page->getSettingValue('site.main.userselstyle') == 1} + {if {{App\Models\Settings::settingValue('site.main.userselstyle')}} == 1} {html_options id="style" name='style' values=$themelist output=$themelist selected=$user.style} {/if} @@ -170,7 +170,7 @@ function.

- {if $page->getSettingValue('apps.sabnzbplus.integrationtype') != 1} + {if {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} != 1} @@ -189,7 +189,7 @@
{/if} - {if $user.queuetype == 1 && $page->getSettingValue('apps.sabnzbplus.integrationtype') == 2} + {if $user.queuetype == 1 && {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} == 2} @@ -240,7 +240,7 @@
{/if} - {if $user.queuetype == 2 && ($page->getSettingValue('apps.sabnzbplus.integrationtype') == 0 || $page->getSettingValue('apps.sabnzbplus.integrationtype') == 2)} + {if $user.queuetype == 2 && ({{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} == 0 || {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} == 2)} diff --git a/resources/views/themes/Gentele/register.tpl b/resources/views/themes/Gentele/register.tpl index f6431c193..8e46267d4 100755 --- a/resources/views/themes/Gentele/register.tpl +++ b/resources/views/themes/Gentele/register.tpl @@ -55,7 +55,8 @@
- {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()} + {NoCaptcha::renderJs()}
I already have a membership diff --git a/resources/views/themes/Gentele/terms.tpl b/resources/views/themes/Gentele/terms.tpl index 3678f072c..f3a53f50e 100755 --- a/resources/views/themes/Gentele/terms.tpl +++ b/resources/views/themes/Gentele/terms.tpl @@ -2,7 +2,7 @@ - {$page->meta_title}{if $page->meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} + {$meta_title}{if $meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} diff --git a/resources/views/themes/Gentele/viewqueue.tpl b/resources/views/themes/Gentele/viewqueue.tpl index 704f921ec..cda6d5810 100755 --- a/resources/views/themes/Gentele/viewqueue.tpl +++ b/resources/views/themes/Gentele/viewqueue.tpl @@ -9,12 +9,12 @@ {if $error == ''} - {if $page->getSettingValue('apps.sabnzbplus.integrationtype') > 0 || $user.queuetype == 2} + {if {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} > 0 || $user.queuetype == 2}

The following queue is pulled from {$serverURL|escape:"htmlall"}.
- {if $page->getSettingValue('apps.sabnzbplus.integrationtype') == 2 || $user.queuetype == 2}Edit your queue settings in + {if {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} == 2 || $user.queuetype == 2}Edit your queue settings in your profile .{/if}

diff --git a/resources/views/themes/Omicron/basepage.tpl b/resources/views/themes/Omicron/basepage.tpl index 1730e1963..086b8382f 100755 --- a/resources/views/themes/Omicron/basepage.tpl +++ b/resources/views/themes/Omicron/basepage.tpl @@ -13,7 +13,7 @@ {/literal} - {$page->meta_title}{if $page->meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} + {$meta_title}{if $meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} @@ -242,7 +242,7 @@
- {$page->content} + {$content}
diff --git a/resources/views/themes/Omicron/contact.tpl b/resources/views/themes/Omicron/contact.tpl index 72811356e..e9abcecce 100755 --- a/resources/views/themes/Omicron/contact.tpl +++ b/resources/views/themes/Omicron/contact.tpl @@ -2,7 +2,7 @@ - {$page->meta_title}{if $page->meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} + {$meta_title}{if $meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} @@ -54,7 +54,7 @@ - {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()}{NoCaptcha::renderJs()} @@ -171,7 +171,7 @@ function.
- {if $page->getSettingValue('apps.sabnzbplus.integrationtype') != 1} + {if {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} != 1}
- {if $page->getSettingValue('site.main.userselstyle') == 1} + {if {{App\Models\Settings::settingValue('site.main.userselstyle')}} == 1} {html_options id="style" name='style' values=$themelist output=$themelist selected=$user.style} {/if}
@@ -190,7 +190,7 @@
{/if} - {if $user.queuetype == 1 && $page->getSettingValue('apps.sabnzbplus.integrationtype') == 2} + {if $user.queuetype == 1 && {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} == 2} @@ -240,7 +240,7 @@
{/if} - {if $user.queuetype == 2 && ($page->getSettingValue('apps.sabnzbplus.integrationtype') == 0 || $page->getSettingValue('apps.sabnzbplus.integrationtype') == 2)} + {if $user.queuetype == 2 && ({{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} == 0 || {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} == 2)} diff --git a/resources/views/themes/Omicron/register.tpl b/resources/views/themes/Omicron/register.tpl index fec037a62..64b77c1a2 100755 --- a/resources/views/themes/Omicron/register.tpl +++ b/resources/views/themes/Omicron/register.tpl @@ -11,7 +11,7 @@ {/if} - {$page->meta_title}{if $page->meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} | Registration Page + {$meta_title}{if $meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} | Registration Page {if $showregister != "0"} @@ -55,7 +55,7 @@
- {$page->smarty->fetch('captcha.tpl')} + {NoCaptcha::display()}{NoCaptcha::renderJs()}
I already have a membership diff --git a/resources/views/themes/Omicron/terms.tpl b/resources/views/themes/Omicron/terms.tpl index 3678f072c..f3a53f50e 100755 --- a/resources/views/themes/Omicron/terms.tpl +++ b/resources/views/themes/Omicron/terms.tpl @@ -2,7 +2,7 @@ - {$page->meta_title}{if $page->meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} + {$meta_title}{if $meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} diff --git a/resources/views/themes/Omicron/viewqueue.tpl b/resources/views/themes/Omicron/viewqueue.tpl index f8df495a9..619acad60 100755 --- a/resources/views/themes/Omicron/viewqueue.tpl +++ b/resources/views/themes/Omicron/viewqueue.tpl @@ -8,12 +8,12 @@ {if $error == ''} -{if $page->getSettingValue('apps.sabnzbplus.integrationtype') > 0 || $user.queuetype == 2} +{if {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} > 0 || $user.queuetype == 2}

The following queue is pulled from {$serverURL|escape:"htmlall"}.
- {if $page->getSettingValue('apps.sabnzbplus.integrationtype') == 2 || $user.queuetype == 2}Edit your queue settings in + {if {{App\Models\Settings::settingValue('apps.sabnzbplus.integrationtype')}} == 2 || $user.queuetype == 2}Edit your queue settings in your profile .{/if}

diff --git a/resources/views/themes/admin/baseadminpage.tpl b/resources/views/themes/admin/baseadminpage.tpl index 947589a12..f84434bd3 100644 --- a/resources/views/themes/admin/baseadminpage.tpl +++ b/resources/views/themes/admin/baseadminpage.tpl @@ -18,7 +18,7 @@ - {$page->meta_title}{if $page->meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle} + {$meta_title}{if $meta_title != "" && $site->metatitle != ""} - {/if}{$site->metatitle}
- {$page->content} + {$content}
diff --git a/routes/web.php b/routes/web.php index 488a11291..10075bb83 100644 --- a/routes/web.php +++ b/routes/web.php @@ -27,16 +27,10 @@ Route::post('/', function () { Auth::routes(); -Route::get('/login', function () { - redirect('/login'); -})->middleware('guest'); - +Route::get('/login', 'Auth\LoginController@showLoginForm'); Route::post('/login', 'Auth\LoginController@login'); -Route::get('/register', function () { - redirect('/register'); -})->middleware('guest'); - +Route::get('/register', 'Auth\RegisterController@showRegistrationForm'); Route::post('/register', 'Auth\RegisterController@register'); Route::get('/forgottenpassword', function () {