EllisLab text mark
Advanced Search
8 of 17
8
   
flexi auth - A user authentication library for CodeIgniter
Posted: 22 November 2012 07:25 AM   [ Ignore ]   [ # 111 ]   [ Rating: 0 ]
Joined: 2012-11-22
8 posts

Hey haseydesign ,

Thanks for your reply , it seems

$config['sess_use_database']TRUE

main problem.When it is true im getting error and seems when i follow flexi_cart installation guide i setted true.

Thanks again.

 
Posted: 26 November 2012 10:01 PM   [ Ignore ]   [ # 112 ]   [ Rating: 0 ]
Joined: 2011-08-25
6 posts

I just did a fresh CI install with Flexi Auth and tried to setup the Demo version via the Installation Guide, but when I go to my site (I’m setting it up on a live site), all I’m getting is the following error:

An Error Was Encountered
Unable to load the requested class: flexi_auth_lite

I’ve gone over the installation guide 10 times now and I’m quite sure I’ve done everything right. Any help would be greatly appreciated! Thanks!

 
Posted: 27 November 2012 07:43 AM   [ Ignore ]   [ # 113 ]   [ Rating: 0 ]
Joined: 2012-03-08
156 posts

@pinmouse

If you Google ‘Unable to load the requested class’ you will get a lot of returned results specifically related to CodeIgniter that may be able to help you track down the problem.

From what I can see as the general cause is that it may be something to do with the letter casing of some of the library or model files.
Other than that, trying to autoload the library (Which is not currently possible with flexi auth) seems to return the same error.

Have you renamed any of the library files?
Are you loading the library similar to the following method?

$this->auth = new stdClass;
$this->load->library('flexi_auth'); 
 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 27 November 2012 10:51 AM   [ Ignore ]   [ # 114 ]   [ Rating: 0 ]
Joined: 2011-08-25
6 posts
haseydesign - 27 November 2012 07:43 AM

Have you renamed any of the library files?
Are you loading the library similar to the following method?

$this->auth = new stdClass;
$this->load->library('flexi_auth'); 

No I haven’t renamed anything, this is a totally fresh install of the demo, just as it is instructed. I’m not loading any library, just uploading the demo files and going to my URL.

 
Posted: 28 November 2012 10:56 PM   [ Ignore ]   [ # 115 ]   [ Rating: 0 ]
Joined: 2010-08-09
2 posts
pinmouse - 27 November 2012 10:51 AM
haseydesign - 27 November 2012 07:43 AM

Have you renamed any of the library files?
Are you loading the library similar to the following method?

$this->auth = new stdClass;
$this->load->library('flexi_auth'); 


Basically mate you have to combine the demo files and the library files in order to work.

The demo is working like a charm, and the documentation is superb!!!

 

 
Posted: 30 November 2012 10:27 AM   [ Ignore ]   [ # 116 ]   [ Rating: 0 ]
Joined: 2012-11-30
15 posts

I have installed the demo but am unable to logout or use the ajax login (it does nothing). It seems to work in IE but doesn’t work in FF or Chrome.

 
Posted: 03 December 2012 08:54 AM   [ Ignore ]   [ # 117 ]   [ Rating: 0 ]
Joined: 2012-03-08
156 posts

@jimsefton

I’ve sent you a pm to try and help you out with your problem. Awaiting your reply.

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 03 December 2012 11:57 AM   [ Ignore ]   [ # 118 ]   [ Rating: 0 ]
Joined: 2012-11-30
15 posts
haseydesign - 03 December 2012 08:54 AM

@jimsefton

I’ve sent you a pm to try and help you out with your problem. Awaiting your reply.

Hi,

Thanks, but I have no sign of a PM from you, please can you try it again?

Thanks

Jim

 
Posted: 04 December 2012 05:16 AM   [ Ignore ]   [ # 119 ]   [ Rating: 0 ]
Joined: 2012-03-08
156 posts

Hey Jim,
I think these forums have developed a few problems with their notification and private message system no longer working.

Can you zip your flexi auth application folder and email it to me at flexiauth [at] haseydesign [dot] com.
I’ll try having a look at it for you.

Rob

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 05 December 2012 08:11 AM   [ Ignore ]   [ # 120 ]   [ Rating: 0 ]
Joined: 2012-11-30
15 posts
haseydesign - 04 December 2012 05:16 AM

Hey Jim,
I think these forums have developed a few problems with their notification and private message system no longer working.

Can you zip your flexi auth application folder and email it to me at flexiauth [at] haseydesign [dot] com.
I’ll try having a look at it for you.

Rob

Hi Rob,

Thanks. I had deleted the installation, so I installed it again and it now appears to be working. Not sure what was different.

I did have a few issues in that I’d added flexi_auth to the autoload file and it didn’t like that. Now I removed that and just have database and session libraries autoloaded.

Anyway, seems to be working now, hopefully it’ll be a bit smoother from here on in.

Thanks,

Jim

P.S. Yeah, these forums are a mess… pagination doesn’t seem to work in some browsers and PM’s are going astray… doesn’t give much confidence in the CodeIgniter framework, does it?!

 
Posted: 05 December 2012 12:15 PM   [ Ignore ]   [ # 121 ]   [ Rating: 0 ]
Joined: 2012-11-30
15 posts

Hi again,

I spotted a small error in your demo files. In the user_group_insert_view.php file you have the description field name set to “update_group_description” instead of “insert_group_description”.

Other than that am getting on with it fine.

Cheers,

Jim

 
Posted: 05 December 2012 01:34 PM   [ Ignore ]   [ # 122 ]   [ Rating: 0 ]
Joined: 2012-09-13
19 posts

Hi,

We are using the framework now for some time and still grald with it!
But, I miss the point with the Remember Me option when logging in. In my view, this should take care of remaining logged after a browser closure or computer shutdown.
A bit like some email providers work, when I log in to Yahoo, I do not need to enter my credentials until I explicit log out or log in from another machine.

But even when selecting Remember Me, I need to re-enter my credentials after having closed the browser (Firefox). Also the Demo application shows this behaviour.
Am I missing something or is this a (known) issue?

N.B. The following line is set:
$config[‘security’][‘logout_user_onclose’] = FALSE;

 
Posted: 06 December 2012 05:40 AM   [ Ignore ]   [ # 123 ]   [ Rating: 0 ]
Joined: 2012-03-08
156 posts

@jimsefton
Thanks for the good use of your eagle eye there Jim.
I’ll make the changes on that very soon.

@Klausch
To test whether this is a bug with your version of FF, I’ve temporarily updated the live demo @ http://haseydesign.com/flexi-auth/auth so that the ‘logout_user_onclose’ also equals false.

$config[‘security’][‘logout_user_onclose’] FALSE

Can you please login to the demo using FF (With ‘remember me’ checked) and then close your browser, then reload the site on page http://haseydesign.com/flexi-auth/auth_lite/privilege_examples.

The login method should go from ‘User logged in via password’ before close to ‘User logged in via “Remember me”’.
Whilst the user is still logged in, they haven’t validated their credentials via a password during this session, therefore, you can decide whether you wish to force the user to properly enter their password before performing specific actions within their account - for example, they must login properly before changing their email address.

For my version of FF (v15), this works fine.
If your own implementation is automatically logging you out, then maybe you have the native CI config option ‘sess_expire_on_close’ set to true (application/config.php). It needs to be like the following.

'$config['sess_expire_on_close'] = FALSE; 

HTH

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 06 December 2012 09:18 AM   [ Ignore ]   [ # 124 ]   [ Rating: 0 ]
Joined: 2012-09-13
19 posts

Hi,
Thanks for your quick reaction.
I tested it with your demo app and everything is working normally, and after loggin in with Remember Me, after closing the browser and reopening it, I am logged in automatically, as expected.
Als also the login method now shows ‘User logged in via “Remember me”’, so this works OK.

But in my app is still does not work.

My setting
‘$config[‘sess_expire_on_close’]
is indeed set to FALSE so this cannot be the problem.

I figured out the cookies after logging in with Remember Me:
login_via_password_token
user_id
remember_series
remember_token
ci_session

Which are the same as with your demo app after loggin in using Remember Me.

But… after closing the browser, reopen it and visit my site, I am not logged in.
The call to $this->flexi_auth->is_logged_in()
returns FALSE.

No no solution yet, any more ideas?

EDIT:
I put some debug messages in the is_logged_in() function, due to some redirects this function is called 3 times, and during the last call the user_identity is NULL:
ERROR - 2012-12-06 18:53:02—> function is_logged_in()
ERROR - 2012-12-06 18:53:02—> this->CI->auth->session_data[this->CI->auth->session_name[‘user_identifier’]] = ‘klausch68@gmail.com’
ERROR - 2012-12-06 18:53:03—> function is_logged_in()
ERROR - 2012-12-06 18:53:03—> this->CI->auth->session_data[this->CI->auth->session_name[‘user_identifier’]] = ‘klausch68@gmail.com’
ERROR - 2012-12-06 18:53:03—> function is_logged_in()
ERROR - 2012-12-06 18:53:03—> this->CI->auth->session_data[this->CI->auth->session_name[‘user_identifier’]] = NULL
ERROR - 2012-12-06 18:53:03—> Not logged in


EDIT:
Some more debugging gives the following, albeit still confusing information:
I have several Controller class which all extends MY_Controller. In the constructor of MY_Controller, the calls:
$this->auth = new stdClass;
$this->load->library(‘flexi_auth’);
are made.


After closing the browser when looged in using “Remember Me” and reopening Firefox. I notice that the call to   is_logged_in() is made during the load->library(‘flexi_auth’) statement two times.
Apparently these calls originate from the Flexi_auth_lite constructor.

Both times it returns TRUE, and the right email address is found in the session.

But later in the constructor, the call to is_logged_in() returns FALSE.

Also, when visiting the site for the second time, only the first of the two calls to load->library(‘flexi_auth’) return TRUE.

So…. this is really wierd! Any suggestions?
EDIT: This is probably explained in this comment:
/ If loading the ‘complete’ library, it extends the ‘lite’ library with additional functions,
// however, this would also runs the __construct twice, causing the user to wastefully be verified twice.
// To counter this, the ‘auth_verified’ var is set to indicate the user has already been verified for this page load.

EDIT:
In the constructor of Flexi_auth_lite, it appears that this test is passed:
if ($this->is_logged_in() && $this->CI->auth->auth_security[‘validate_login_onload’] && !isset($this->CI->flexi_auth_lite_model->auth_verified))

So the else-branch, containing the call:
$this->CI->flexi_auth_model->login_remembered_user();

is not reached. I think I am getting close to the culprit now…
How about the validate_login_onload property? It is set to TRUE in my config file.

EDIT:
I notice that the constructor code of Flexi_auth_lite (called by parent::__construct() in the constructor of Flexi_auth) is called twice. Immediately after each other.
I cannot see why that happens or understand whether this happens deliberately.
During some calls (apparently all calls except the first one after opening the browser), the this->CI->auth->session_data[this->CI->auth->session_name[‘user_identifier’]] variable is empty in the second execution.
Strange stuff….

EDIT:
I carried out a test with validate_login_onload = FALSE,
Now the user is remembered after closing and re-opening the browser window. But….  this also happens when I do NOT select the “Remember Me” option!
This really makes me crazy… :-s

 
Posted: 11 December 2012 05:31 AM   [ Ignore ]   [ # 125 ]   [ Rating: 0 ]
Joined: 2012-03-08
156 posts

@Klausch,
Oh man, it sounds like been on a mission to the depths of hell and haven’t found your way back out yet.

Sadly, I can’t give you a quick fix on what your problem is, as it obviously sounds like you’ve got the library already fully wired into your new site. This means there could any number of configs that could be conflicting with the library, which is going to be unique to your setup.

I can confirm that on the current live demo site, the config setting ‘validate_login_onload’ = TRUE.

Personally what I would do in your situation is create a clone copy of your existing CodeIgniter setup and start rebuilding your setup piece-by-piece to identify the culprit.

First off, copy the flexi auth demo to your existing application folder and check whether it works on your own server.
Provided it does, then you know the library does indeed work on your server.

Next, create a new controller and views that allow you to simply login and then display your login credentials and permissions.
If this page works, then start to rebuild your controller setup to include the other code, libraries and models in your existing setup.

Eventually, something is going to break it, and there will be the main lead to what your problem is.

I hope that helps you out. Keep us posted.

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
8 of 17
8