Welcome Guest, Not a member yet? Register   Sign In
flexi auth - A user authentication library for CodeIgniter

[eluser]Unknown[/eluser]
Hi haseydesign

First of all thanks for such a great, well documented library. I am completely new to html, PHP, MVC concepts, CodeIgniter and Flexi Auth and so it's a credit to you that, as inexperienced as I am, I've still been able to get a modified version of your demo up and running.

Using the demo code, I'm trying (and failing) to get the 'Register' function to work when the administrator is signed on (I only want administrators to be able to create new accounts).

Here's what I've tried:

1. I've edited demo_header.php so that the Register link appears all the time (rather than when no-one is signed-in). So far so good.

2. I've edited \application\controllers\auth.php, commenting out the redirect that redirects the user away from the registration page if already logged in, leaving:
Code:
function register_account()
{
  if ($this->flexi_auth->is_logged_in())
  {
//   redirect('auth');
  }
  if ($this->input->post('register_user'))
  {  
   $this->load->model('demo_auth_model');
   $this->demo_auth_model->register_account();
  }
$this->data['message'] = (! isset($this->data['message'])) ? $this->session->flashdata('message') : $this->data['message'];
$this->load->view('demo/public_examples/register_view', $this->data);
}

3. However, if I now click on the Register link, it only displays the register view (Register_View.php) if no one is signed-in. As soon as I sign-in, the link does nothing (apart from causing a page refresh).

I'm stumped now and would really appreciate any pointers about how to get this working. Please bear in mind that I'm very new to coding. Cheers!


Messages In This Thread
flexi auth - A user authentication library for CodeIgniter - by El Forum - 07-06-2013, 11:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB