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 { @@ -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 内容,底部网站详细介绍

Loading…
Cancel
Save