Welcome Guest, Not a member yet? Register   Sign In
Community Auth problem with login
#4

(03-02-2016, 08:53 AM)yettie Wrote: Sorry, I answer so late. Thank you for explanations. Now I got the solution, which is doing what I really wanted.
But this is only the beginning of many questions. My solution for this time -> following your guide:

This page, where the loginpage shows up:
define('LOGIN_PAGE', 'welcome');

This page, where you go after login page:
$route[LOGIN_PAGE] = 'welcome/login';

authentication.php
$config['default_login_redirect'] = 'welcome';
$config['allowed_pages_for_login'] = array('welcome_message');

welcome.php
class Welcome extends My_Controller { ...

public function index()
{
if( $this->uri->uri_string() == 'welcome')
show_404();

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

$this->setup_login_form();

$this->load->view('welcome_message');
}

public function login()
{
if( $this->require_role('admin,ag,an') )
{
$this->load->view( $this->auth_role.'_dashboard' );
} else {
$this->setup_login_form();
$this->load->view('welcome_message');
}
}

... }

Like this I am fine for the moment, thank you.


I'm glad you figured it out. In the future, it would be beneficial for you to format your code using bbcode. It'll keep your whitespace and make it easier for me to help you.
Reply


Messages In This Thread
Community Auth problem with login - by yettie - 02-29-2016, 10:51 AM
RE: Community Auth problem with login - by yettie - 03-02-2016, 08:53 AM
RE: Community Auth problem with login - by skunkbad - 03-02-2016, 02:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB