Welcome Guest, Not a member yet? Register   Sign In
help for profile implementation
#1

Hi friends,

I'd like to ask for advice in a small application I'm working.
My job is to create an application with two profiles, administrator and user. For the implementation, my idea is to do a controller for each profile, and in the controller's constructor set a stop and allow entry only if the user has the correct profile.

The code is the following:

PHP Code:
class Administrator extends CI_Controller {
 
 
  public 
function __construct(){
 
   ...
    if(
$_SESSION['profile'] != 'admin'){
        
$this->load->view('error');
        
$this->output->_display();
        exit;
    }
 
 }


What do you think? 
With gratitude,
Daniel
Reply
#2

For one you are going to need an auth system to handle users.

You could then create a database profile table according to
the users id for look ups.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB