Welcome Guest, Not a member yet? Register   Sign In
Can only login as Admin in Community Auth
#1

only auth_level that works for login is the one set for Admin level. If try the rest the said invalid username and or password.
Reply
#2

Show the codes...
So we people can help you.
Reply
#3

DEBUG - 2016-07-29 08:44:36 -->
string = cdyer
password = Dy3rb3ta
form_token = 7b360ae7
token_jar = ["d55d9e94","7b360ae7"]
DEBUG - 2016-07-29 08:44:36 --> Config file loaded: /www/nbcis/v2/application/third_party/community_auth/config/form_validation/login.php
DEBUG - 2016-07-29 08:44:37 -->
user is banned = no
password in database = $2y$10$287206c8c29ee45fcf232u21xEXpbuaAqMfwb2utf6LcoOX1yu04O
supplied password match = 1
required level or role = admin
auth level in database = 3
auth level equivalant role = membership
DEBUG - 2016-07-29 08:44:37 -->
string = cdyer
password = Dy3rb3ta
form_token = 7b360ae7
token_jar = []
DEBUG - 2016-07-29 08:44:37 --> Total execution time: 0.2182

public function login()
{
// Method should not be directly accessible
if( $this->uri->uri_string() == 'home/login')
show_404();

if( strtolower( $_SERVER['REQUEST_METHOD'] ) == 'post' )
$this->require_min_level(2);

$this->setup_login_form();

$redirect_url = $this->session->flashdata('redirect_url');

if ($redirect_url)
redirect($redirect_url,'refresh');

$this->load->view('user/login_header');
$this->load->view('user/login_form');



}

Is their anything else that need to see let me know
Reply
#4

You can see from the debugging:

required level or role = admin

So you are requiring admin. In your controller you probably see something like this:


Code:
if( $this->require_role('admin') ) {
  // ...
}


If you want to allow access by a role called "membership", then just add it:

Code:
if( $this->require_role('admin,membership') ) {
  // ...
}

If you want to add access to another role called donkey, add it:

Code:
if( $this->require_role('admin,membership,donkey') ) {
  // ...
}

and so on.

If you're using require_min_level() instead, make sure to adjust that so that the min level (int) of the role is used.
Reply
#5

Thank, I found issue my superviser wrote:
if ($this->require_role('admin'))
{
$sb_menu = 'membership_reports';
$this->load->view('templates/header', array('page_title' => 'NBCIS - Membership Reports'));
$this->load->view('templates/tables_dynamic_header');
$this->load->view('templates/doc_ready');
$this->load->view('header');
$this->load->view('sidebar',array('sb_menu' =>$sb_menu));
$this->load->view('breadcrumbs');
}

Now got change it required group so allow all employees to login
Reply
#6

(07-29-2016, 08:13 AM)jminton Wrote: Thank, I found issue my superviser wrote:
if ($this->require_role('admin'))
       {
           $sb_menu = 'membership_reports';
           $this->load->view('templates/header', array('page_title' => 'NBCIS - Membership Reports'));
           $this->load->view('templates/tables_dynamic_header');
           $this->load->view('templates/doc_ready');
           $this->load->view('header');
           $this->load->view('sidebar',array('sb_menu' =>$sb_menu));
           $this->load->view('breadcrumbs');
       }

Now got change it required group so allow all employees to login

Sounds good. It's really pretty easy to work with, and once you've been using it for a few days you won't even think about it anymore.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB