IonAuth Module for CodeIgniter : bugs with mongo

After many considerations, this module is good to start a serious applications for mongodb.

you can test this module from here : https://github.com/benedmunds

To make serious test with MongoDB you will need to upload le session and database libraries :

CodeIgniter MongoDB Active Record Library - http://github.com/alexbilbie/codeigniter-mongodb-library/tree/v2 
CodeIgniter MongoDB Session Library - http://github.com/sepehr/ci-mongodb-session 

Bug 1 : Unable to connect to MongoDB: - Found unknown connection string option 'persist' with value 'ci_mongo_persist'
With recent version of Mongo 2, you must comment ( //$options['persist'] = $this->_persist_key;) because the driver PECL 1.3 does not
recognize anymore this option.

Bug 2 : illegal offset in public function in_group($check_group, $id=false) of Ion_Auth.php library.
You must replace the code by : 

public function in_group($check_group, $id=false)
{
$this->ion_auth_model->trigger_events('in_group');

    $id || $id = $this->session->userdata('user_id');

    if (!is_array($check_group))
    {
        $check_group = array($check_group);
    }

    if (isset($this->_cache_user_in_group[$id->{'$id'}]))
    {
        $groups_array = $this->_cache_user_in_group[$id->{'$id'}];
    }
    else
    {

        $users_groups = $this->ion_auth_model->get_users_groups($id)->result();

        $groups_array = array();
        foreach ($users_groups as $group)
        {
            $groups_array[$group->id->{'$id'}] = $group->name;
        }
        $this->_cache_user_in_group[$id->{'$id'}] = $groups_array;

    }



    foreach ($check_group as $key => $value)
    {
        $groups = (is_string($value)) ? $groups_array : array_keys($groups_array);


        if (in_array($value, $groups))
        {
            return TRUE;
        }
    }

    return FALSE;
}

}

After that all seems to work perfectly.
Wish you a goog test


 

 

extradrmtech

Since 30 years I work on Database Architecture and data migration protocols. I am also a consultant in Web content management solutions and medias protecting solutions. I am experienced web-developer with over 10 years developing PHP/MySQL, C#, VB.Net applications ranging from simple web sites to extensive web-based business applications. Besides my work, I like to work freelance only on some wordpress projects because it is relaxing and delightful CMS for me. When not working, I like to dance salsa and swing and to have fun with my little family.

You may also like...