Thank you for the work you've put into Tank Auth. I like it a lot (especially since I didn't have to write it myself).
I've been playing around with it and noticed that you have no method built in to return the users email address. You do provide functions to return the user id & username (get_user_id, get_username).
Normally this wouldn't be an issue, but I'm building a site with email login only, and as the email address it the login it'd be handy to be able to retrieve it when necessary.
There are two work arounds to this, I don't know which is better.
1/ Alter the login function so that on successful login the username session variable is the email address. This way get_username() will return the email address that was used to login.
Note I haven't tested this bit.
Code:
if (($login_by_username AND $login_by_email) OR $login_by_username)
$this->ci->session->set_userdata(array(
'user_id' => $user->id,
'username' => $user->username,
'status' => ($user->activated == 1) ? STATUS_ACTIVATED : STATUS_NOT_ACTIVATED,
));
2/ Alter the login function to create an extra session variable for the users email address and create a new function get_email() which returns this, then leave it up to the developer to know which one should be used in their situation.