ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

flexi auth - A user authentication library for CodeIgniter

September 15, 2012 1:51am

Subscribe [104]
  • #331 / Oct 06, 2014 12:54pm

    MrTomTom

    30 posts

    Hi There,

    I am trying to upgrade a system to CI3 however I cannot get FlexiAuth to work with it. When I try and load Flexi_auth I get the following error

    Severity: Error
    Message: Class ‘CI_Flexi_auth_lite’ not found
    Filename: core/Common.php
    Line Number: 185

    I presume this is because it can’t find Flexi_auth_lite in the libraries folder so it goes on to look for it in the system libraries? Does anyone have any idea how to fix this?

  • #332 / Oct 08, 2014 4:13am

    fabioferrero

    6 posts

    I’ve a developer installation with CI 2.2.0 and last flexi auth that worked well on OsX Mountain Lion. Few days ago I’ve upgraded the operating system to OsX Mavericks, and flexi auth start to doesn’t work well. I’ve many sql error like:

    Error Number: 1064
    
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'user_accounts`.`uacc_id`' at line 7
    
    Filename: models/flexi_auth_lite_model.php
    
    Line Number: 213

    What’s wrong?

  • #333 / Oct 08, 2014 5:03am

    fabioferrero

    6 posts

    I’ve a developer installation with CI 2.2.0 and last flexi auth that worked well on OsX Mountain Lion. Few days ago I’ve upgraded the operating system to OsX Mavericks, and flexi auth start to doesn’t work well. I’ve many sql error like:
    What’s wrong?

    Seems that all works well, the only problem is the error_reporting (and warning/notice) that are changed from php 5.3.15 (in Mountain Lion) to php 5.4.17 (in Mavericks). Added

    error_reporting(0);

    and apparently all works again…

  • #334 / Oct 29, 2014 4:26pm

    magorich

    2 posts

    Hi haseydesign I’ve been using flexi_auth on a system but I have some session problems when testing, the page just logout everyonce in a while, and it¿s not a problem of the session time because we changed the limit.

    So what I was thinking and possible is the error is that you can’t be logged in with the same user in multiple computers at the same time, am I right?

    If this is the problem what can I do, or what do you recommend?

    Thanks

  • #335 / Oct 30, 2014 2:49pm

    magorich

    2 posts

    I have exactly the same problem: apparently random logouts

    I actually just figured it out I think. There is a bug in the code igniter framework related to multiple ajax calls running on a page. If you are using AJAX this could be it?

    There seems to be a fix, have a look at this fix from posted here. It seems to not been merged into the main codeigniter, but i am not sure why:

    https://github.com/EllisLab/CodeIgniter/pull/1900/files
    http://blog.jonaszamora.es/en/codeigniter-fix-for-session-loss-caused-by-ajax/

    This seems to have fixed my problem but I have not tested fully yet.

     

    Thanks a lot, I’m going to try this, hope it works

  • #336 / Nov 02, 2014 11:35pm

    sasa10

    1 posts

    Hi first of all you have done a great work.

    I am trying to get to work with postgresql and flexi, i have installed the demo and it really works but with mysql, then i changed the database to postgresql with the same data & structure, i am getting this errror when i insert a new user.

    Error Number:
    
    ERROR: Column does not exist «user_accounts» in the relation «user_accounts» LINE 1: INSERT INTO "user_accounts" ("user_accounts"."uacc_group_fk"... ^
    
    INSERT INTO "user_accounts" ("user_accounts"."uacc_group_fk", "user_accounts"."uacc_email", "user_accounts"."uacc_username", "user_accounts"."uacc_password", "user_accounts"."uacc_ip_address", "user_accounts"."uacc_date_last_login", "user_accounts"."uacc_date_added", "user_accounts"."uacc_activation_token", "user_accounts"."uacc_active", "user_accounts"."uacc_suspend", "user_accounts"."uacc_salt")
     VALUES (1, 'sasa2@hotmail.com', 'sasa10', '$2a$08$tbxuO0z02mk5TwF445M8yeLSH67P995Q5p7l.R1zQfmhaUb2bHb7y', '127.0.0.1', '2014-11-03 04:26:15', '2014-11-03 04:26:15', '5ae984c9433f146561a79c54a2d6160fa37d2af8', 0, 0, 'F4kFtBvt6b')
    
    Filename: C:\wamp\www\auth\system\database\DB_driver.php
    
    Line Number: 330

    And i am almost sure that the problem is the table name union in the fields(“user_accounts”.“uacc_group_fk” ), i would like to know how can i delete this part in the code.

    Thanks in advance!

  • #337 / Nov 06, 2014 12:36pm

    Kaucsenta

    1 posts

    Hi, I have a problem. I try to create some new user group, like “Kezelő”, “Ügyintéző” etc. But when i set this group names, the actual users in this group can’t log in. I try to set the database lines from latin to utf8_general, but it is not work.

    But, if I use “Kezelo” or “Ugyintezo” all user can log in.

    Where is the problem? I try to check, but i can’t find the problem.

    Somebody can help me?

  • #338 / Nov 10, 2014 5:23am

    slosumo

    2 posts

    Hey everyone!

    I’ve set up flexi_auth with ease on one of my sites, now I tried to set it up on my other one and I’m having some weird problems with the register form. I got it working on the first site by simply modifying some demo files to fit my needs and now trying to use the same ones for the new site I can’t seem to get the rules to validate. “$this->form_validation->run()” always returns FALSE in the register_account method of the auth_model, but it never sets the validation errors(regardless if there are errors or not).

    If I simply do a TRUE check instead of $this->form_validation->run() the user will be registered normally(but there would be no error notices/validation obviously). So why is $this->form_validation->run() always returning FALSE and not setting any error messages?

    auth_model.php

    function register_account()
     {
      $this->load->library('form_validation');
      // Set validation rules.
      // The custom rules 'identity_available' and 'validate_password' can be found in '../libaries/MY_Form_validation.php'.
      $validation_rules = array(   
       array('field' => 'register_email_address', 'label' => 'Email Address', 'rules' => 'required|valid_email|identity_available'),
       array('field' => 'register_username', 'label' => 'Username', 'rules' => 'required|min_length[4]|identity_available'),   
       array('field' => 'register_password', 'label' => 'Password', 'rules' => 'required|validate_password'),
       array('field' => 'register_confirm_password', 'label' => 'Confirm Password', 'rules' => 'required|matches[register_password]')
      );
    
      $this->form_validation->set_rules($validation_rules);
      
      // Run the validation. ->>> it always gets stuck here
      if ($this->form_validation->run())
      { 
       // Get user login details from input.
       $email = $this->input->post('register_email_address');
       $username = $this->input->post('register_username');
       $password = $this->input->post('register_password');
       
       // Get user profile data from input.
       // You can add whatever columns you need to customise user tables.
       $profile_data = array(
       );
       
       // Set whether to instantly activate account.
       // This var will be used twice, once for registration, then to check if to log the user in after registration.
       $instant_activate = FALSE;
     
       // The last 2 variables on the register function are optional, these variables allow you to:
       // #1. Specify the group ID for the user to be added to (i.e. 'Moderator' / 'Public'), the default is set via the config file.
       // #2. Set whether to automatically activate the account upon registration, default is FALSE. 
       // Note: An account activation email will be automatically sent if auto activate is FALSE, or if an activation time limit is set by the config file.
       $response = $this->flexi_auth->insert_user($email, $username, $password, $profile_data, 2, $instant_activate);
    
       if ($response)
       {
        // This is an example 'Welcome' email that could be sent to a new user upon registration.
        // Bear in mind, if registration has been set to require the user activates their account, they will already be receiving an activation email.
        // Therefore sending an additional email welcoming the user may be deemed unnecessary.
        $email_data = array('identity' => $email);
        $this->flexi_auth->send_email($email, 'Welcome', 'registration_welcome.tpl.php', $email_data);
        // Note: The 'registration_welcome.tpl.php' template file is located in the '../views/includes/email/' directory defined by the config file.
        
        ###+++++++++++++++++###
        
        // Save any public status or error messages (Whilst suppressing any admin messages) to CI's flash session data.
        $this->session->set_flashdata('message', $this->flexi_auth->get_messages());
        
        // This is an example of how to log the user into their account immeadiately after registering.
        // This example would only be used if users do not have to authenticate their account via email upon registration.
        if ($instant_activate && $this->flexi_auth->login($email, $password))
        {
         // Redirect user to public dashboard.
         redirect('racun');
        }
        
        // Redirect user to login page
        redirect('racun');
       }
      }
    
      // Set validation errors. -> these are NEVER set
      $this->data['message'] = validation_errors('', '');
    
      return FALSE;
     }

    And before you ask, my field names are correct and the POST data is transmitted, it’s just that no validation takes place/it always returns false?

     

  • #339 / Nov 10, 2014 6:13am

    slosumo

    2 posts

    Regarding my problem, it was something foolish like I was expected. But naturally I figured it out after posting this. It turned out I sent $data to templates instead of $this->data(so no errors were shown), and my testing passwords were to short.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases