|
|
@ -39,16 +39,34 @@ Class ListController extends Controller { |
|
|
|
}else if (!empty($cachedParentData)) { |
|
|
|
}else if (!empty($cachedParentData)) { |
|
|
|
$currentDir = $cachedParentData[$cateId]; |
|
|
|
$currentDir = $cachedParentData[$cateId]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//扫描当前目录 |
|
|
|
|
|
|
|
$scanner->setWebRoot($this->getCurrentWebroot($currentDir['realpath'])); |
|
|
|
|
|
|
|
$scanner->setRootDir($currentDir['realpath']); |
|
|
|
|
|
|
|
|
|
|
|
//密码授权检查 |
|
|
|
//密码授权检查 |
|
|
|
$isAllowed = Common::isUserAllowedToDir($currentDir['directory']); |
|
|
|
$isAllowed = Common::isUserAllowedToDir($currentDir['directory']); |
|
|
|
if (!$isAllowed) { |
|
|
|
if (!$isAllowed) { |
|
|
|
$goUrl = "/site/pwdauth/?dir=" . urlencode($currentDir['directory']) . "&back=" . urlencode(FSC::$app['requestUrl']); |
|
|
|
$goUrl = "/site/pwdauth/?dir=" . urlencode($currentDir['directory']) . "&back=" . urlencode(FSC::$app['requestUrl']); |
|
|
|
return $this->redirect($goUrl); |
|
|
|
return $this->redirect($goUrl); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//扫描当前目录 |
|
|
|
//获取目录面包屑 |
|
|
|
$scanner->setWebRoot($this->getCurrentWebroot($currentDir['realpath'])); |
|
|
|
$breadcrumbs = $this->getBreadcrumbs($currentDir, $cachedParentData, $scanner); |
|
|
|
$scanner->setRootDir($currentDir['realpath']); |
|
|
|
|
|
|
|
|
|
|
|
//父目录密码授权检查 |
|
|
|
|
|
|
|
$isAllowed = true; |
|
|
|
|
|
|
|
$needAuthDir = ''; |
|
|
|
|
|
|
|
foreach($breadcrumbs as $subdir) { |
|
|
|
|
|
|
|
$isAllowed = Common::isUserAllowedToDir($subdir['name']); |
|
|
|
|
|
|
|
if (!$isAllowed) { |
|
|
|
|
|
|
|
$needAuthDir = $subdir['name']; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!$isAllowed && !empty($needAuthDir)) { |
|
|
|
|
|
|
|
$goUrl = "/site/pwdauth/?dir=" . urlencode($needAuthDir) . "&back=" . urlencode(FSC::$app['requestUrl']); |
|
|
|
|
|
|
|
return $this->redirect($goUrl); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -268,9 +286,6 @@ Class ListController extends Controller { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取目录面包屑 |
|
|
|
|
|
|
|
$breadcrumbs = $this->getBreadcrumbs($currentDir, $cachedParentData, $scanner); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$isAdminIp = Common::isAdminIp($this->getUserIp()); //判断是否拥有管理权限 |
|
|
|
$isAdminIp = Common::isAdminIp($this->getUserIp()); //判断是否拥有管理权限 |
|
|
|
|
|
|
|
|
|
|
|
$viewName = '//site/index'; //共享视图 |
|
|
|
$viewName = '//site/index'; //共享视图 |
|
|
|