⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

ion auth multiple groups



DREON
  • profile picture
  • Member

Posted 05 June 2013 - 02:38 AM

hi to all i have a question on how can i redirect my groups in the different pages

 

example: i have ser groups, called user1,user2,user3

 

 user1 will go to main/view1

user2 will go to main/view2

user3 will go to main/view3

 

 

this is my ion auth controller:

 

function index()
    {

        if (!$this->ion_auth->logged_in())
        {
            //redirect them to the login page
            redirect('auth/login', 'refresh');
        }
        elseif (!$this->ion_auth->is_admin())
        {
            //redirect them to the home page because they must be an administrator to view this
            redirect('/', 'refresh');
        }
        else
        {
            //set the flash data error message if there is one
            $this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');

            //list the users
            $this->data['users'] = $this->ion_auth->users()->result();
            foreach ($this->data['users'] as $k => $user)
            {
                $this->data['users'][$k]->groups = $this->ion_auth->get_users_groups($user->id)->result();
            }

            $this->_render_page('auth/index', $this->data);
        }

 


davidoster
  • profile picture
  • Member

Posted 05 June 2013 - 05:35 AM

Well this is not a Grocery CRUD question.

[member=dreon] after so many questions you have asked here you should know this.

 

You need to check with ion_auth.