We’ve created an admin area that looks nice. But… It is not secured. Everyone can get in there and do whatever he/she wants. So why not using a well established CodeIgniter library like Ion Auth which has great documentation?
So let’s download it from Github (https://github.com/benedmunds/CodeIgniter-Ion-Auth).
After we’ve downloaded it, we should just copy the files from the package to the corresponding directory in our application.
- copy ion_auth.php from Ion_Auth’s config to your application/config/development
- copy auth.php from Ion_Auth’s controllers to your application/controllers/admin (make sure the name of the file starts with uppercase)
- from language, copy your language directory‘s files into application/language/yourlanguage (where yourlanguage is your language)
- from Ion Auth’s libraries directory copy the files into your application/libraries directory
- from Ion Auth’s models copy ion_auth_model.php inside your application/models directory making sure the file name starts with uppercase (Ion_auth_model.php)
- from Ion Auth’s views directory copy the folder auth inside your application/views directory.
Of course, the library uses databases to keep its information, so let’s import into our database the ion_auth.sql file that can be found inside Ion Auth’s sql directory.
If the import went ok, you should have 4 new tables into your database: groups, login_attempts, users and users_groups
Also, some tables should be prepopulated with the first records. In our next tutorial we will create our login and logout pages.
- Step 1 – Create an admin area in CodeIgniter 3
- Step 2 – Create a template for admin area
- Step 3.1 – Creating the login and logout page with Ion Auth
- Step 3.2 – Administer groups with Ion Auth
- Step 3.3 – Administer users with Ion Auth
- Step 3.4 – Creating the profile page with Ion Auth
- Step 4 – Create a multilanguage site with CodeIgniter
- Step 4.1 – Create the admin area for a multilanguage site in CodeIgniter
- Step 4.2 – Set up the language for a multilanguage site in CodeIgniter
- Step 4.3 – Use “personalized” controllers and methods for a multilanguage site in CodeIgniter
- Step 4.4 – Returning to our MY_Controller. Doing everything that needs to be done for better working with languages
- Step 5 – Administer static pages for our multilanguage CMS – creating the pages
- Step 5.1 – Administer static pages for our multilanguage CMS – listing the created pages
- Step 5.2 – Administer static pages for our multilanguage CMS – editing the pages
- Step 5.3 – Administer static pages for our multilanguage CMS – deleting the pages
- Step 6 – Creating categories for a multilanguage site in CodeIgniter
- Step 7 – Using the language files for a multi-language site in CodeIgniter
- Step 8 – Putting it all together. How do visitors access our pages