maesk - 29 July 2007 09:08 AM
Hi guys
I think FreakAuth is an excellent addition to CodeIgniter and it saved me a lot of time. It’s really quite easy to install, use and adapt. What I didn’t achieve is to display the login form in my content div of one of my views. Is this possible? If I have a particular page that should be secured I want to show the login form on this page in the content div so that it shows the header, navigation and all. Now I just adapted the templates so that everything shows adapted to my design, except for the navigation. If it’s not possible, it’s not a big problem either. The backend of FreakAuth is also very useful and makes a good starting point for a cms backend.
So thanks a lot for your work. I donated 10 Euro, it’s not much but better than nothing.
Cheers
maesk
Cheers Maesk for the donation by me and Chris (aka grahack - he is in holydays now so don’t blame him for low activity in the forum!).
About your question:
You have 2 ways:
a) use the helper function displayLoginForm() in your view
b) this is better in my opinion, use the fal_front method in your controller.
<?php
class YourController extends Controller
{
/**
* Initialises the controller
*
*/
function YourController()
{
parent::Controller();
$this->load->library('FAL_front', 'fal_front');
$this->_container = $this->config->item('FAL_template_dir').'template/YOURcontainer';
}
// --------------------------------------------------------------------
/**
* Displays the login form.
*
*/
function index()
{
$this->login();
}
// --------------------------------------------------------------------
/**
* Displays the login form.
*
*/
function login() //you can change the action name
{
$data['fal'] = $this->fal_front->login();
$this->load->view($this->_container, $data);
}
Speaking about method b) take as example the auth.php controller and read this tutorial:
- I don’t like that “auth.php” controller!
Hope this helps!
Dan