CodeIgniter Forums
flexi auth - A user authentication library for CodeIgniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: flexi auth - A user authentication library for CodeIgniter (/showthread.php?tid=54581)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34


flexi auth - A user authentication library for CodeIgniter - El Forum - 06-03-2013

[eluser]devha[/eluser]
Answering to my own question, adding "$this->set_error_message('login_session_expired', 'config');" to flexi_auth_lite_model.php, after the line 419 solves my problem.

Or is there any better way to do this?


flexi auth - A user authentication library for CodeIgniter - El Forum - 06-06-2013

[eluser]haseydesign[/eluser]
@devha

I thought your suggestion to add further conditions when the 'login_session_expired' status message should be displayed was a good call, so I did a a little testing with your suggested implementation but come across some scenarios that caused problems.

I have since found what I believe is a more reliable method and have implemented it into the library.
Hopefully this will accomplish what you have requested.

You can get the changes via the usual Github repo.


flexi auth - A user authentication library for CodeIgniter - El Forum - 06-06-2013

[eluser]haseydesign[/eluser]
A support email received from Filip:

Quote:I installed [flexi auth] locally on Windows and it works perfect so far.
But when i put it on server (Unix), If a User is assigned to a valid
UserGroup, then i cant log in. The login() functions return true, but after
that i check the session and all data fields from the flexi data: Id,
identification etc. are still set to false. If I change the ID of the group
on a user to a non-valid one (random) then The user loges in successful and
the session data of the group is '' => NULL, but its logged.

This problem is only on my unix server. The local copy on windows does not
have this problem.

Filip's own solution:

Quote:I found what was causing the problem. It was if I put the group name in UTF8 then my server was unable to write down the UTF8 encoded chars in the session (probably my server is not set).



flexi auth - A user authentication library for CodeIgniter - El Forum - 06-10-2013

[eluser]devha[/eluser]
Thanks haseydesign!

Great support, great commit!


flexi auth - A user authentication library for CodeIgniter - El Forum - 06-10-2013

[eluser]Shinamee[/eluser]
[quote author="haseydesign" date="1366280309"]
@Shinamee

My first steps to diagnose the problem here would be to ensure that the user id and the uacc_forgotten_password_token both match the value within the database, then ensure that the uacc_forgotten_password_expire date is still in the future.

You can redefine the expire time of forgotten passwords via the config setting:
Code:
$config['security']['expire_forgotten_password'] = 15;

If nothing stands out as wrong, then what is the code that you're using to run this feature?[/quote]

Hello,

I am still getting the same error and I have double checked the user_id and token matches, I only changed
Code:
$config['security']['expire_forgotten_password'] = 15;
to
Code:
$config['security']['expire_forgotten_password'] = 1440 // 24 hours;

For this part, I am not using any custom code, I have the default from the demo ... I only changed layouts to match my design.


flexi auth - A user authentication library for CodeIgniter - El Forum - 06-10-2013

[eluser]Unknown[/eluser]
Hi,

I've just downloaded this along with CI to test for a site I am working on, and despite following the installation instructions to the letter cannot get it to show any page except for the demo home page. all other links lead to 404 error.

I am running this on iis 8 with php 5.4.

Having read through this topic, there was only one post concerning this issue and I have double checked your response to that.

All base url's and include dir's point to the correct addresses.

Code:
// Note: This is only included to create base urls for purposes of this demo only and are not necessarily considered as 'Best practice'.
  $this->load->vars('base_url', 'http://localhost/cms/');
  $this->load->vars('includes_dir', 'http://localhost/cms/includes/');

Any other ideas as to this problem?
All other CI pages I create work fine.

Update:

If I add the CI index.php to the address eg: http://localhost/cms/index.php/auth_lite/demo
then the page will load, but adding that file back into the CI config and removing the .htaccess file make no difference.

Ok forget I asked. The problem was with the rewrite rules. On IIS these need to be imported to the built in url_rewrite app if you are not using mod_rewrite for iis.


Magus


flexi auth - A user authentication library for CodeIgniter - El Forum - 06-17-2013

[eluser]Unknown[/eluser]
Hi haseydesign,

First I'd like to thank you for flexi_auth. I use it much, and I think it is great.

I have found a #bug in one of your classes. Let me explain my problem first:

I have setup a Codeigniter with 2 applications (Frontend & Backend), but they use they same core.

My problem was:
1. I log in to the backend
2. When I log to the frontend from the same computer / browser I get logged out from the backend app.

After reading your code I have see that 'login_session_token' gets overwriten. So I determined it was my mistake. I should have setup different values for frontend for:
$config['cookies']['login_session_token'] = 'login_session_token';
$config['sessions']['login_session_token'] = 'login_session_token';

Whcih I did.... but It didn't work again.

I have spend some time debugging your code and I have found a mistake:

in file: flexi_auth_lite_model.php
on line: 370
you use: if (get_cookie('login_session_token') != $hash_session_token)

which is not correct. It should pull the data from config like:

if (get_cookie($this->auth->session_name['login_session_token']) != $hash_session_token)

I hope I was able to help and contribute one small % to your great work.

wish you all the best


flexi auth - A user authentication library for CodeIgniter - El Forum - 06-18-2013

[eluser]haseydesign[/eluser]
@cure85
Thanks for letting us know of this bug, I've pushed a fix to the repo with a credit to you in the commit message.

Just a pointer to the solution code you posted yourself. If should actually be cookie_name instead of session_name
Code:
if (get_cookie($this->auth->cookie_name['login_session_token']) != $hash_session_token)

Thanks again!

----------------------------------

@Shinamee
I'm afraid I can't provide you with any further ideas on what the problem maybe, as my own attempts at using the feature work for me.

However, to debug the problem, I would suggest you look into the 'forgotten_password_complete()' method within the 'libraries/Flexi_auth.php' file.
You want to find out what is preventing the method from returning TRUE, and is instead setting the error message of:
Code:
$this->CI->flexi_auth_model->set_error_message('password_token_invalid', 'config');



flexi auth - A user authentication library for CodeIgniter - El Forum - 06-22-2013

[eluser]Hermann007[/eluser]
I love Flexi Auth libraries and firstly I would like to thank you for a fantastic product.

However I'm having some difficulty with the sending of activation emails etc. I keep getting the following error: "Unable to load the requested file: assets/includes/emails/activate_account.tpl.php".

I have played around with the directory structure etc. but still can't seem to fix this. I suspect that it might have something to do with my .htaccess file which looks like this:
RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]


My index.php file is located on the same level as my assets folder thus I'm not sure why this isn't working.

Any suggestions?

Thank you.


flexi auth - A user authentication library for CodeIgniter - El Forum - 06-24-2013

[eluser]Unknown[/eluser]
Hey,
I'd like to use this library just to learn how it works.
However I am a newbie to CodeIgniter and have some trouble with the installation process.
Maybe I am really dumb, but the Installation page says:
"To install the flexi auth library, copy the 'application' folder from 'library_files' to the root Codeigniter folder."
However if I do this, I would delete the already existing application folder here. I don't think that I should do that.
Furthermore to install the demo I need to:
"To install the flexi auth demo, install the essential library files as described above, then also copy the 'application' and 'includes' folder from 'demo_files' to the root Codeigniter folder."
Again in my terms this would mean to overwrite the application folder.

Can you please give me any hints what I need to do?
Regards
Gileo
PS:
Here is my current folder structure BEFORE installing flexi auth:
/var/www/CodeIgniter/application
/var/www/CodeIgniter/system
/var/www/CodeIgniter/user_guide
/var/www/CodeIgniter/index.php
/var/www/CodeIgniter/license.txt