Browse Source

improve login check for /site/new/

master
filesite 7 months ago
parent
commit
b8a816cb0e
  1. 14
      themes/tajian/controller/SiteController.php

14
themes/tajian/controller/SiteController.php

@ -172,18 +172,18 @@ Class SiteController extends Controller {
} }
//添加新视频 //添加新视频
//增加必须登录才能使用限制
public function actionNew() { public function actionNew() {
//判断是否已经登录,自动跳转到自己的添加视频网址 //判断是否已经登录,自动跳转到自己的添加视频网址
$loginedUser = Common::getUserFromSession(); $loginedUser = Common::getUserFromSession();
if (!empty(FSC::$app['config']['multipleUserUriParse']) && empty(FSC::$app['user_id'])) { if (empty($loginedUser['username'])) {
if (!empty($loginedUser['username'])) { return $this->redirect('/site/login/');
$shareUrl = "/{$loginedUser['username']}/site/new/"; }else if (!empty(FSC::$app['config']['multipleUserUriParse']) && empty(FSC::$app['user_id']) && !empty($loginedUser['username'])) {
return $this->redirect($shareUrl); $shareUrl = "/{$loginedUser['username']}/site/new/";
}else { return $this->redirect($shareUrl);
return $this->redirect('/site/login/');
}
} }
//获取数据 //获取数据
$menus = array(); //菜单,一级目录 $menus = array(); //菜单,一级目录
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍

Loading…
Cancel
Save