From b8a816cb0e922cb2c91b080cab8a595cb1c426ec Mon Sep 17 00:00:00 2001 From: filesite Date: Sun, 5 May 2024 14:05:00 +0000 Subject: [PATCH] improve login check for /site/new/ --- themes/tajian/controller/SiteController.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/themes/tajian/controller/SiteController.php b/themes/tajian/controller/SiteController.php index fbe8658..5ea7738 100644 --- a/themes/tajian/controller/SiteController.php +++ b/themes/tajian/controller/SiteController.php @@ -172,18 +172,18 @@ Class SiteController extends Controller { } //添加新视频 + //增加必须登录才能使用限制 public function actionNew() { //判断是否已经登录,自动跳转到自己的添加视频网址 $loginedUser = Common::getUserFromSession(); - if (!empty(FSC::$app['config']['multipleUserUriParse']) && empty(FSC::$app['user_id'])) { - if (!empty($loginedUser['username'])) { - $shareUrl = "/{$loginedUser['username']}/site/new/"; - return $this->redirect($shareUrl); - }else { - return $this->redirect('/site/login/'); - } + if (empty($loginedUser['username'])) { + return $this->redirect('/site/login/'); + }else if (!empty(FSC::$app['config']['multipleUserUriParse']) && empty(FSC::$app['user_id']) && !empty($loginedUser['username'])) { + $shareUrl = "/{$loginedUser['username']}/site/new/"; + return $this->redirect($shareUrl); } + //获取数据 $menus = array(); //菜单,一级目录 $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍