"권한이 없습니다." Alert 창 대신 로그인 화면으로 이동시키기

by 조쉬 posted Aug 29, 2016
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄
로그인 하지 않고 회원 전용 글을 읽으려하면,
"권한이 없습니다.", 로그인 버튼이 나오는 부분이 있는가 하면,
Alert으로 "권한이 없습니다."만 딸랑 나오는 경우도 있어서 일관성이 없어보일때가 있습니다.

여기 팁이나 질문 답변에 아무리 찾아봐도 없길래 올려봅니다.

modules/board/board.view.php
에서

142번째 줄에 보시면
if(!$this->grant->view && !$oDocument->isGranted()) {
   $oDocument = null;
  $oDocument = $oDocumentModel->getDocument(0);
 
  Context::set('document_srl','',true);
 
   $this->alertMessage('msg_not_permitted');



요렇게 있습니다만, 맨 아래 코드를 주석처리하시고

 if(!$this->grant->view && !$oDocument->isGranted()) {
                        $oDocument = null;
                        $oDocument = $oDocumentModel->getDocument(0);
 
                        Context::set('document_srl','',true);
 
//                        $this->alertMessage('msg_not_permitted');
                        return $this->dispBoardMessage('msg_not_permitted');



요렇게 바꾸시면 됩니다.


위 코드 세줄은 별 필요 없어보입니다만, 지우셔도 되고 그냥 두셔도 될듯 합니다.