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) |
flexi auth - A user authentication library for CodeIgniter - El Forum - 10-16-2012 [eluser]haseydesign[/eluser] @PyroDev Thanks for posting the code to help anyone else having problems with getting flexi auth to work on earlier versions of php - much appreciated! Regarding setting the 'usess_series' to NULL, this should be absolutely fine. flexi auth - A user authentication library for CodeIgniter - El Forum - 10-16-2012 [eluser]haseydesign[/eluser] @Xosen It looks like you uncovered a bug that was preventing logging in via ajax. I have just updated the Github repo with a fix for this problem, you just need to update the flexi_auth_lite_model.php file to get the new changes. As a bonus, I've also updated the demo to include an example of logging in via ajax. This is also available via the same Github repo. You can also view this new demo via the live demo site @ http://haseydesign.com/flexi-auth/auth/login_via_ajax flexi auth - A user authentication library for CodeIgniter - El Forum - 10-16-2012 [eluser]code_has_been_ignited[/eluser] I have jut installed the library and have coded a registration form. Nothing special but its allowing me to become familiar. The reg form currently does not vary by much from the demo included with the download. When I submit my form to register a user I get this error message: Code: A PHP Error was encountered Any ideas on this? I installed everything par the instructions and the demo installed in a separate folder seems to work fine. Thanks for any help flexi auth - A user authentication library for CodeIgniter - El Forum - 10-17-2012 [eluser]haseydesign[/eluser] @code_has_been_ignited The error suggests there is a misconfiguration problem somewhere with how you have installed the library. From looking at the error message, I would first check that you have properly defined the session config settings via the flexi auth config file. In the demo config file, this can be found on line 285 and should look like: Code: $config['sessions']['user_id'] = 'user_id'; If that fails, you've probably already gone through it, but try to re-go through each point of the installation guide @ http://haseydesign.com/flexi-auth/user_guide/installation Other than that, it's hard to pinpoint the problem. In such a situation I find it is best to make a fresh clean install of CI and the flexi auth demo, and then reverse engineer the registration page to what you want, when it works, compare what is different through the config, controller and view files to the code that is causing the problem now. flexi auth - A user authentication library for CodeIgniter - El Forum - 10-17-2012 [eluser]code_has_been_ignited[/eluser] Hey, Thanks for the reply, everything was fine, except I double loaded the library. Once i corrected this everything seemed fine. I do have another issue or bug. When I am logging in, if i leave a field blank, error messages show, which is good, But if I enter wrong information not message displays. Ive tried to enter, right username, wrong password, wrong username, right password etc, but it wont throw the "Login unsuccessful" message. Any idea on this, maybe lead me in the right direction? Thanks flexi auth - A user authentication library for CodeIgniter - El Forum - 10-17-2012 [eluser]haseydesign[/eluser] @code_has_been_ignited Hey man, Regarding how to return error messages with actions like failed logins, you can use the 'get_messages()' function. How you implement the passing of data returned from this function to your view is up to you. You could simply call the function directly within you view if you wanted. What I will note though is that if like in the demo you add the returned messages to a CI flash session, then the page must be reloaded before the message will be available from the flash session data - this is just how CI's session class works. So as an example for returning error messages using CI flash sessions after a login attempt, you could use the following code: Code: // Attempt to login user. To return the message instantly: Code: // Attempt to login user. flexi auth - A user authentication library for CodeIgniter - El Forum - 10-17-2012 [eluser]code_has_been_ignited[/eluser] Hey, What I guess what I do not understand is why it WILL show the error if im missing the username or password, because it will not pass the form_validation. This is my function: Code: public function login() Code: <?php if (! empty($message)) { ?> The code is almost identical to the demo, with exception I process the login inside my controller. Thanks for any tips and solutions Will flexi auth - A user authentication library for CodeIgniter - El Forum - 10-18-2012 [eluser]haseydesign[/eluser] @code_has_been_ignited I think the problem is because you are redirecting the user to your 'account' page regardless of whether or not the login has been successful. Even if you then only redirected on success, then with your current code you are trying to get the login error message from a CI flash session that has only been set just above. Data set to CI flash session is not accessible until the page is reloaded. Try changing your code to the following. Code: public function login() flexi auth - A user authentication library for CodeIgniter - El Forum - 10-18-2012 [eluser]code_has_been_ignited[/eluser] Thank you for this input. I have a better picture of what needs to be done. I will adjust my code and will come back to post my results. Thank you for your time. flexi auth - A user authentication library for CodeIgniter - El Forum - 10-19-2012 [eluser]davidinchi[/eluser] Is there a relation between Flexi-auth and a bug with the C.I. Cookies? I'm working with CodeIgniter 2.1.3 and Flexi-auth but when a I login with Chrome or IE 9 if a user refresh or change the page I'm logout. The problem seems with the ci_cookie. In Chrome or IE 9 that cookie is created but expire immediatly. I try to fix this bug installing the upgrade that has been offered to @xosen in this forum, but without results. Best. |