Part of the EllisLab Network
   
9 of 53
9
FreakAuth light 1.1 released
Posted: 07 September 2007 11:37 AM   [ Ignore ]   [ # 81 ]  
Summer Student
Total Posts:  22
Joined  07-25-2007

Hi,

I installed FA into an existing application and am having a little trouble.

The default login page is going where I want, and I have a logout link on all the internal pages - index.php/logout - and the logout page is basically a mirror of the login page I created. The logout link goes to that page, but it isn’t actually logging out the session. In the logout page in the index function in the controller, I have tried

$this->logout(); 

This does nothing.

I have tried

$this->fal_front->logout(); 

This logs out the session, but brings the viewer to the FAL logout page. I tried using a redirect, but this doesn’t work either.

Can anyone please point me in the right direction here? I have searched and searched, but only found the sess_destroy which didn’t work either.

Much thanks.

Profile
 
 
Posted: 07 September 2007 12:20 PM   [ Ignore ]   [ # 82 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  297
Joined  02-21-2007

Did you try to change the config item

$config['FAL_logout_uri''auth/logout'

around line 250 of www/system/application/config/freakauth_light.php ?

Profile
 
 
Posted: 07 September 2007 12:53 PM   [ Ignore ]   [ # 83 ]  
Summer Student
Total Posts:  22
Joined  07-25-2007

Yes, I did change that in the config file. Here is my logout controller

<?php




class Logout extends Controller {    
    
function Logout()
    
{
        parent
::Controller();
    
$this->load->library('FAL_front''fal_front');
        
$this->load->helper('url');
    
}
    
function index(){
          
//$this->fal_front->logout(); <-- this brings me to the FAL logout page if active
          
$this->load->view('logout_view');        
    
}
}
?> 

If the fal_logout isn’t commented out, it brings me to the fal logout page. When it does this it successfuly ends the session and logs me out, but I don’t want to use the fal logout page, I want to use my own.

The way it is working now, it goes to my logout page, but doesn’t end the session. I will be in the logout page, but I can press a link to on of the protected pages and get to it without having to log back in instead of getting the deny page.

I guess what I need is the logout function to add to my logout.php controller index function. I tried finding it in the stuff that came with fal, but the only thing I could find is what’s commented out. I need the actual log out function, and I can find it anywhere.

Much thanks for your help.

Profile
 
 
Posted: 07 September 2007 01:44 PM   [ Ignore ]   [ # 84 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  297
Joined  02-21-2007

EDIT: This post, even being a small one, is full of mistakes. Please ignore it.

maybe FAL_logout_success_action should be FAL_logout_uri in the main lib line 534

please could you try this fix ?

and remember to set $config[‘FAL_logout_uri’] to a CI URI and not a view (you didn’t give your config for this item, so I give this advice just in case…)

Profile
 
 
Posted: 07 September 2007 01:49 PM   [ Ignore ]   [ # 85 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  297
Joined  02-21-2007

STOOOOOP !!!
no bug in the lib, in my previous previous post I meant

Did you try to change the config item

$config['FAL_logout_success_action''your_ci_uri'

I mixed the two config items in my small little head that is back to work with lines of code after long holidays.

Profile
 
 
Posted: 07 September 2007 02:22 PM   [ Ignore ]   [ # 86 ]  
Summer Student
Total Posts:  22
Joined  07-25-2007

Thanks, that seems to be working. When I log out, it brings me back to the login page, and denies access to the other pages. Thank you very much.

I seem to be having another strange issue. When I log in as superadmin, I get forwarded to the correct page. But when I try to log in as a regular user I get spit back to the login page (well, not really the login page, it looks like the login page, but the uri is index.php instead of index.php/login). At the uri it spits to (index.php) the links on the page don’t work either because they are all relative. So the home link links to ci/home instead of ci/index.php/home. Any clue where this problem could be coming from?

I hope I’m not totally making a mess of the app trying to get fal to work. I really like fal, and have little hope of getting any other auth working.

Again, thank you very much for your help. You’re saving my ass here.

Profile
 
 
Posted: 07 September 2007 02:55 PM   [ Ignore ]   [ # 87 ]  
Summer Student
Total Posts:  22
Joined  07-25-2007

Sorry… I had

$config['FAL_login_success_action'''

was blank… Fried brain here.

Though I am having trouble getting the hang of the way fal is set up. I can’t figure out for the life of me where/how to take over the auth. For instance, I don’t want any of the fal pages to show up to my users at all. I took care of the empty usernam/password redirect by using javascript form validation to make sure the fields are filled with something. But now I have no idea how to change the invalid username/password so it doesn’t redirect to the fal page. It goes to auth/login which I assume is the auth.php controller, but there are only 2 lines in that function:

$data['fal'$this->fal_front->login();
        
$this->load->view($this->_container$data); 

which doesn’t help me much in finding the root of the issue.

Again, thanks very much for the help. And sorry for being such a newb.

Profile
 
 
Posted: 08 September 2007 04:32 AM   [ Ignore ]   [ # 88 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  297
Joined  02-21-2007
I666I - 07 September 2007 06:55 PM

I can’t figure out for the life of me where/how to take over the auth. For instance, I don’t want any of the fal pages to show up to my users at all.

Did you try the “I don’t like that auth controller” tuto?

I took care of the empty usernam/password redirect by using javascript form validation to make sure the fields are filled with something. But now I have no idea how to change the invalid username/password so it doesn’t redirect to the fal page. It goes to auth/login which I assume is the auth.php controller, but there are only 2 lines in that function:

$data['fal'$this->fal_front->login();
        
$this->load->view($this->_container$data); 

which doesn’t help me much in finding the root of the issue.

Many things are hidden from the auth controller in fal_front.

I’m not sure to understand fully, but as seen on this portion of code, you could try to change the FAL_login_view config item.

Profile
 
 
Posted: 09 September 2007 01:28 PM   [ Ignore ]   [ # 89 ]  
Research Assistant
RankRankRank
Total Posts:  325
Joined  09-09-2007

I was wondering if there is a way to use the email address as the username instead of having a separate username.  That way, when they login, they will use their email address and password.

I’m could just rewrite parts to make it happen but I didn’t know if there was a config option or if someone has already done this and would share.  Thanks.

 Signature 

Zenedy | Anyvite | Tweetvite

Profile
 
 
Posted: 09 September 2007 07:29 PM   [ Ignore ]   [ # 90 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  297
Joined  02-21-2007

Not in 1.1, maybe in next release. If you do it before us (with a config option for *user_name, *email_only or *autodetect) maybe you will become a contributor… wink

Profile
 
 
   
9 of 53
9