kishor10d/Admin-Panel-User-Management-using-CodeIgniter

Need multiple admin with multiple users!

savyad opened this issue · 27 comments

I know it's not an issue but it's my requirement,i want multiple admin with multiple users in the current project so what changes i have to do.
let's say what current module does is working with one admin and multiple users,actually i want multiple admin with their respective multiple users.

@savyad : Hello, thanks for giving me some point to work with.
I understood your requirement as :

  1. You need 1 superadmin to monitor all other admins
  2. Admins also can manage users of the system.
  3. Suppose admin X created 3 users, Y created 2 users, then X can manage those 3 and Y can manage his 2 users.

Current system is not actually working like this. I need some time to make it possible. If you are in great hurry, then you can free to change the code as per your need.

need help urgent!!!

@savyad : You can start from database.

  1. Add superadmin at start, others are admins, and you can create users.
  2. Add extra field e.g. admin_id in tbl_users table, where you can mention the parent admin id who can see them.
  3. Write extra queries as per the role OR manage the available queries for roles if you can.

when I am login in from manager account, and adding another another controller file, model file, and view file, then link is displaying access denied error page.
Please suggest me changes

what exactly you are trying to achieve

@mkshravan : It is the constraint that thing is not accessible to anyone except Admin.
If you want to give access to Manager then you need to check the user's role.

if($this->isAdmin() == TRUE)
{
      $this->loadThis();
}

The above code restrict the access to any other user except Admin. If you want to check for Manager role, then there is a function isTicketter() in application/libraries/BaseController.php.

function isTicketter() {
     if ($this->role != ROLE_ADMIN || $this->role != ROLE_MANAGER) {
          return true;
     } else {
          return false;
     }
}
function index()
{
    if($this->isTicketter() == TRUE)
    {
        $this->loadThis();
    }
    
    else
    {        
        $searchText = $this->security->xss_clean($this->input->post('searchText'));
        $data['searchText'] = $searchText;
        
        $this->load->library('pagination');
        
        $count = $this->user_model->userListingCount($searchText);

		$returns = $this->paginationCompress ( "userListing/", $count, 10 );
        
        $data['userRecords'] = $this->user_model->userListing($searchText, $returns["page"], $returns["segment"]);
        
        $this->global['pageTitle'] = 'Users';
        
        $this->loadViews("users", $this->global, $data, NULL);
    }
}

This also gives "access denied".
Please help

@mkshravan : You need to tell me which role actually you are giving to user. Role constants are declared in constants.php file. You need to check that.
Also please check the constructor. May be you defined something in constructor itself.

how will forget password will work?

I know it's not an issue but it's my requirement,i want multiple admin with multiple users in the current project so what changes i have to do.
let's say what current module does is working with one admin and multiple users,actually i want multiple admin with their respective multiple users.

This Feature will comes within few days

actually we dont have the option to create new role & permissions in adminpanel when will this option added. as of now we need create everything in setup.

i hope if this is done which will be useful for more peoples.

@manigopal How did u get that you can check wich priveliges

@danny007in is that one newer

@danny007in is that one newer

With AdminLTE 3 and updated db
its breaking change

Are there also new feautures i now use the master branch

Are there also new feautures i now use the master branch

Check both plz
i forget (because i was created 1 year back)

I have 2 problems now with it the bigest 1 How can i create more roles and more admin users
@danny007in

And if you created roles where can you change the rights

@finnie2006 actually it heavy changes made
so do not use to project if completed

? How can i

@finnie2006 : The multiple roles and rights assignments task is going on. But I am not sure when it will be complete.

Next month? @kishor10d

Still working on this. Check "to do" in above pull request.

@finnie2006 : The dynamic roles & access related part is done.