안녕하세요.
Context::get('document_srl')
해당 구문으로 글읽기화면을 체크하고 있는데
로그아웃 버튼을 눌러도
dispMemberLogout?category=1234&document_srl=12345
document_srl=12345 가 포함되어있어서 글읽기 화면으로 인식을하네요.
Context::get('document_srl')
보다 더 명확한 글읽기 페이지를 체크하는 방법이 있을까요?
PHP | PHP 7.4 |
---|---|
CMS | Rhymix 2.1 |
안녕하세요.
Context::get('document_srl')
해당 구문으로 글읽기화면을 체크하고 있는데
로그아웃 버튼을 눌러도
dispMemberLogout?category=1234&document_srl=12345
document_srl=12345 가 포함되어있어서 글읽기 화면으로 인식을하네요.
Context::get('document_srl')
보다 더 명확한 글읽기 페이지를 체크하는 방법이 있을까요?
답변감사합니다.
if ($called_position == 'before_module_proc' && (Context::get('act') == 'procBoardInsertDocument' || Context::get('act') == 'dispBoardWrite' || Context::get('document_srl')))
에서
if ($called_position == 'before_module_proc' && (Context::get('act') == 'procBoardInsertDocument' || Context::get('act') == 'dispBoardWrite' || Context::get('oDocument')))
로 해보았는데 작동하지 않는 것 같습니다.
우선 act가 dispBoardContent인 경우로 제한해 놓고, 목록 화면과 글읽기 화면을 구분할 방법만 찾으면 되겠지요. 그 상황에서는 oDocument가 도움이 됩니다.
act를 먼저 확인하지 않으면 글 수정 화면, 삭제 화면 등 "특정한 문서"를 조작하는 다른 화면에도 oDocument가 존재하므로 구분이 불가능합니다.
위의 코드에서는 글읽기가 아닌 글쓰기 act를 참조하고 있네요.
dispBoardContent 에서 다 처리하고 있어서요..
Context::get('oDocument'); 을 가져와서 해당 값이 있으면 게시글을 읽는것이고 없으면 해당 값을 읽지 않는것이니 확인해보세요