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 - 01-09-2013

[eluser]Shinamee[/eluser]
Very nice and easy to configure library.

I seem to be having problem setting the user to activate automatically.

Sorry but my PHP skills is just picking-up and that is why I'm using this library for simple admin panel.

I followed this guide http://haseydesign.com/flexi-auth/user_guide/user_account_set_data#insert_user and changed $activate = TRUE

Is there anything else I'm missing?

Thanks in advance.


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

[eluser]haseydesign[/eluser]
@Shinamee

What you have posted suggests you are doing the right thing regarding auto activating a user upon insert.

Are you sure that the problem you are having is definitely that the user is still inactivated?
To check this, have a look at the user_accounts table and check the 'uacc_active' column for the user, 1 = active, 0 = inactivated.

Without seeing or knowing more about your code I can't really guess what the problem is, however, try copying the code from the included demo and see if you can get that to work.

The code can be found in the 'models/demo_auth_model.php' file within the function 'register_account()'.

Let us know if that helps.


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

[eluser]Shinamee[/eluser]
@haseydesign

Thank you very much - I guess I was changing the $activate in the wrong file, now it works fine.

Really nice and easy to configure library.


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

[eluser]Unknown[/eluser]
I had a pretty nasty bug while trying to use flexi_auth. I installed just the library files, and everything was working properly. I started working my way through the demo files trying to make a registration page. I started with my own controller and model.

Eventually I ran into the PHP error that the demo's controller talks about, so I added the given __get() fix.

Code:
public function &__get($key) {
        $CI =& get_instance();
        return $CI->$key;
    }

Then I hit another much harder fatal to fix.

Quote:Fatal error: Cannot assign by reference to overloaded object in -stuff-/system/core/Controller.php on line 46

Lines 44-49 of Controller.php:

Code:
foreach (is_loaded() as $var => $class)
  {
   $this->$var =& load_class($class);
  }

  $this->load =& load_class('Loader', 'core');

The internet was stunningly unhelpful. It appeared no other users of flexi_auth had this problem, or if they did, hadn't posted about it.

So I fixed it as follows:

I added a __set method to match the __get method in my controller
Code:
public function __set($key, $value) {
        $CI =& get_instance();
        $CI->$key = $value;
}

And in Controller.php, I removed the assign by reference operators to make lines 44-49 now read:

Code:
foreach (is_loaded() as $var => $class)
  {
   $this->$var = load_class($class);
  }

  $this->load = load_class('Loader', 'core');


My fix appears to work, although it involves modifying the core Controller.php file which I'm not a huge fan of. If it helps at all, I'm using PHP version 5.3.13. Is there a better way to do this?


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

[eluser]Unknown[/eluser]
very nice library and this is in accordance with the needs of my application,
I've tried several times to install the demo version on my localhost and everything went smoothly. But at the log in with user admin, moderator or the public, no one has succeeded. the message is always "Your login details are incorrect submitted." ... as if the user and password I entered is incorrect. but for the other features seem fine.
I've tried several times to reinstall but it always shows the same thing...

please give correction if there is any mistake in my DB setting or others.



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

[eluser]ranggadablues[/eluser]
Hi, your library was so great. But I'm have a little trouble here about send email for new user registration from localhost. I already change on
Code:
system/libraries/email
to my gmail setting.

the trouble is,
first from demo flexi auth it's not show any message after success registration, but the data success insert to database.
second I can't find any email on my gmail inbox?

so, did I missed any configuration?

thank you in advance


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

[eluser]nabberuk[/eluser]
I'm currently looking into creating a web application that would be charged on a per user per month scheme to companies. Obviously I could change the registration part to work well with this but the sticking point comes to only allowing x amount of users to be created (say they pay for 10 users per month, they can only create up to 10 accounts). Would this be a feature you'd be interested in adding? Or if you give me a rough idea on where to start?

Thanks


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

[eluser]haseydesign[/eluser]
Hey guys, I'm really busy at the moment and struggling to reply to everyone.

@ mvd7793

I can't recall getting any messages from other users with this error occurring for them.
Modifying the core Controller.php should be absolutely not necessary and (As I'm sure you're aware) is only going to cause you headaches if you later upgrade Codeigniter.

I'm not sure on my own exact PHP version, but it's around v5.3, so I highly doubt that is the issue here.

I can only guess that something has corrupted the library or demo since you've been altering the files.
If you haven't already, the best start to finding a solution to these problems is starting a minimal fresh reinstall of the demo, ensuring it works 'out-of-the-box', and then trying to work on it as you were before, testing step-by-step that it is still working.

Good luck with it.

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

@ nighttour

Have you by any chance changed the 'static_salt' value within the config file?
Code:
$config['security']['static_salt'] = 'change-me!'

If you change this value, then any existing users will not be able to login, as their password hash uses the original value of this.
For the purposes of the demo, you shouldn't change this salt value. However, when starting a new site, then it should be changed before you register any users.

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

@ ranggadablues,

There are quite a few things that could be the problem.

Firstly, ensure that you have a mail server setup on your local environment, I personally use http://www.hmailserver.com/
Since you suggest that you have sent emails from your localhost previously when using tank auth, then it would suggest this is not the problem.

From there, the flexi auth library uses Codeigniters own email library to send emails, so before trying to send an email using flexi auth, just try and send one from a standalone demo page.
http://ellislab.com/codeigniter/user-guide/libraries/email.html

If this does work, then you most likely have configured something wrong with the flexi auth library.
The email settings are defined via the flexi auth config file, you can read up on them @ http://haseydesign.com/flexi-auth/user_guide/email_config
Note that the ‘email_template_directory’ must be located within the CI ‘views’ directory.

Once you’ve check the settings, then (If you haven’t already) install the flexi auth demo that is included with the download.
Once installed, try and create a new user using your Gmail address, the registration process should send an email to you.

If that then doesn’t work, I’m out of ideas for you.
I know that in some of my previous attempts, that although it would successfully send the email to me, my email provider would never receive or spam the email as it was coming from a localhost address.
So if things look like they’re working, but you’re just not getting the email, try another address with another provider (Not Gmail).

Hope that helps.

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

@ nabberuk

The feature you have suggested is too much of an edge-case for me to add to the library.
However, I can't really see it being too hard to implement yourself.

I think all you would need to do is run a quick SQL query just before inserting a new user to the database that would count how many users have been inserted into the database for the current month. If it exceeds 10, then prevent the user being inserted and display a notification message to the user.

Use the 'date_added' column (Called 'uacc_date_added' within the database user_account table by default) as the date that you check against.



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

[eluser]Shinamee[/eluser]
DELETED.

I solved it.






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

[eluser]vlados2[/eluser]
I have a question:
All the permissions are stored into the session, so if I change some permissions for some user, he neeed to logout and sign in again to update the session with the permissions.
Is there a way to fix this?