2016-08-22 6 views
0
$groupadmin ='1'; 
if ($this->ion_auth->in_group($groupadmin)) 
{ 
    $this->session->set_flashdata('message', 'You must be part of the group 1 to view this page'); 
    redirect('dashboard'); 
}else 
{ 
    $this->session->set_flashdata('message', 'You must be part of the group 2 to view this page'); 
    redirect('test'); 
} 

경우 그룹 id = 1 다음 사용자 리디렉션 대시 보드와 그룹 ID = 2 다음 사용자 테스트 컨트롤러하지만 모두 로그인 사용자 리디렉션 테스트 컨트롤러이온 인증 그룹 기반 로그인

+0

이'in_group() '함수 코드를보기 참조 용으로이 URL을 방문 할 수 있습니다. –

+0

나는 codeigniter에 Ben Edmunds Ion Auth 라이브러리를 사용하고 있습니다. –

답변

0

을 당신은 interger에 코드 groupadmin 변수를 변경할 수 있습니다 리디렉션 만.

$groupadmin = 1; 
if ($this->ion_auth->in_group($groupadmin)) 
{ 
    $this->session->set_flashdata('message', 'You must be part of the group 1 to view this page'); 
    redirect('dashboard'); 
} else { 
    $this->session->set_flashdata('message', 'You must be part of the group 2 to view this page'); 
    redirect('test'); 
} 

당신은 http://benedmunds.com/ion_auth/#in_group

+0

감사합니다. Nikunj –

+0

다른 사람들에게 도움이 될 수 있으므로이 답변을 승인하십시오. –

+0

좋습니다. 다음 대답을 수락하십시오 :). –