Skip to content

Commit

Permalink
フロント認証を設定していない場合でもフロントのURLとしてパスワードリセット画面にアクセスできてしまう問題を改善 fix baserpro…
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuring committed Mar 27, 2020
1 parent 68f3d42 commit 101010a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/Baser/Controller/Component/BcReplacePrefixComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ public function startup(Controller $Controller) {
$requestedPrefix = $Controller->request->params['prefix'];
}

$prefix = [];
foreach(Configure::read('BcAuthPrefix') as $authPrefix) {
if(isset($authPrefix['alias'])) {
$prefix[] = $authPrefix['alias'];
} else {
$prefix[] = '';
}
}
if(!in_array($requestedPrefix, $prefix)) {
return;
}

$pureAction = preg_replace('/^' . $requestedPrefix . '_/', '', $Controller->action);

if (!in_array($pureAction, $this->allowedPureActions)) {
Expand Down

0 comments on commit 101010a

Please sign in to comment.