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

[eluser]haseydesign[/eluser]
@Lee

Regarding the login form within the header of a page.
What you describe is of course entirely possible, it shouldn't really be any trickier that your primary login form.

What I would start with is ensuring that the post data from the header form is actually being received properly when submitted to your 'user/login' controller/method. Simply put the following code at the start of your 'user/login' controller and method:
Code:
echo '<pre>';
print_r($_POST);
exit;

If that is receiving the data properly, just ensure that you direct the flow of data to the flexi auth login function - just like you suggest is happening via the primary login form.

--

Regarding whether there is a specific function to return the username - no there isn't.
If your flexi auth primary identity column was setup as the username, then the get_user_identity() function would do this, but you state that the users email is the primary identity.

Therefore, probably the easiest way to return the username is via the get_user_by_id() or get_user_by_identity() functions.
Code:
$sql_select = 'uacc_username';
$user_data = $this->flexi_auth->get_user_by_id(false, $sql_select)->row_array();
echo $user_data['uacc_username'];

HTH


Messages In This Thread
flexi auth - A user authentication library for CodeIgniter - by El Forum - 06-03-2013, 04:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB