{"id":548,"date":"2013-01-15T21:41:02","date_gmt":"2013-01-15T19:41:02","guid":{"rendered":"http:\/\/www.extradrm.com\/?p=548"},"modified":"2013-06-18T20:57:56","modified_gmt":"2013-06-18T18:57:56","slug":"ionauth-module-for-codeigniter-bugs-with-mongo","status":"publish","type":"post","link":"https:\/\/www.extradrm.com\/?p=548","title":{"rendered":"IonAuth Module for CodeIgniter : bugs with mongo"},"content":{"rendered":"<p>After many considerations, this module is good to start a serious applications for mongodb.<\/p>\n<p>you can test this module from here : <a title=\"IonAuth CodeIgniter Login Module\" href=\"https:\/\/github.com\/benedmunds\/CodeIgniter-Ion-Auth\" target=\"_blank\">https:\/\/github.com\/benedmunds<\/a><\/p>\n<p>To make serious test with MongoDB you will need to upload le session and database libraries :<\/p>\n<pre><code>CodeIgniter MongoDB Active Record Library - http:\/\/github.com\/alexbilbie\/codeigniter-mongodb-library\/tree\/v2 \nCodeIgniter MongoDB Session Library - http:\/\/github.com\/sepehr\/ci-mongodb-session \n\n<strong>Bug 1<\/strong> : Unable to connect to MongoDB: - Found unknown connection string option 'persist' with value 'ci_mongo_persist'\nWith recent version of Mongo 2, you must comment ( \/\/$options['persist'] = $this-&gt;_persist_key;) because the driver PECL 1.3 does not\nrecognize anymore this option.\n\nBug 2 : illegal offset in public function in_group($check_group, $id=false) of Ion_Auth.php library.\nYou must replace the code by : \n\npublic function in_group($check_group, $id=false)\n{\n$this-&gt;ion_auth_model-&gt;trigger_events('in_group');\n\n\u00a0\u00a0\u00a0 $id || $id = $this-&gt;session-&gt;userdata('user_id');\n\n\u00a0\u00a0\u00a0 if (!is_array($check_group))\n\u00a0\u00a0\u00a0 {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $check_group = array($check_group);\n\u00a0\u00a0\u00a0 }\n\n\u00a0\u00a0\u00a0 if (isset($this-&gt;_cache_user_in_group[$id-&gt;{'$id'}]))\n\u00a0\u00a0\u00a0 {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $groups_array = $this-&gt;_cache_user_in_group[$id-&gt;{'$id'}];\n\u00a0\u00a0\u00a0 }\n\u00a0\u00a0\u00a0 else\n\u00a0\u00a0\u00a0 {\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $users_groups = $this-&gt;ion_auth_model-&gt;get_users_groups($id)-&gt;result();\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $groups_array = array();\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 foreach ($users_groups as $group)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $groups_array[$group-&gt;id-&gt;{'$id'}] = $group-&gt;name;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $this-&gt;_cache_user_in_group[$id-&gt;{'$id'}] = $groups_array;\n\n\u00a0\u00a0\u00a0 }\n\n\n\n\u00a0\u00a0\u00a0 foreach ($check_group as $key =&gt; $value)\n\u00a0\u00a0\u00a0 {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $groups = (is_string($value)) ? $groups_array : array_keys($groups_array);\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (in_array($value, $groups))\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return TRUE;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\n\u00a0\u00a0\u00a0 }\n\n\u00a0\u00a0\u00a0 return FALSE;\n}\n\n}\n\nAfter that all seems to work perfectly.\nWish you a goog test\n\n\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2841,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,16],"tags":[348,70,351],"youtube_video":null,"_links":{"self":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/548"}],"collection":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=548"}],"version-history":[{"count":0,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/548\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/media\/2841"}],"wp:attachment":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}