Javascript quiz Thursday! Be sure to have Part 1 done by then!
Authentication Packages with in Fuel: SimpleAuth, OrmAuth
Contains drivers that handle users, groups, roles, and permissions
Similar to SimpleAuth, but uses a database to store all its data
Allows for direct assignment of permissions to users/groups and other features to provide a more "fine-grained permission system".
Find and copy these files: /fuel/packages/auth/config/auth.php
and /fuel/packages/auth/config/ormauth.php
; to your main /fuel/app/config/
folder.
Change the "driver" option in /fuel/app/config/auth.php
on line 25 from Simpleauth
to Ormauth
(case-sensitive!). For now, change your "salt" option to an empty string.
In /fuel/app/config/config.php
, we'll need to uncomment parts of the "always_load" section.
The lines that need to be uncommented are 262, 275-278, and 314. It should look similar to what is below:
. . . /**************************************************************************/ /* Always Load */ /**************************************************************************/ 'always_load' => array( <----262 /** * These packages are loaded on Fuel's startup. * You can specify them in the following manner: * * array('auth'); // This will assume the packages are in PKGPATH * * // Use this format to specify the path to the package explicitly * array( * array('auth' => PKGPATH.'auth/') * ); */ 'packages' => array( <----275 'orm', 'auth', ), /** * These modules are always loaded on Fuel's startup. You can specify them * in the following manner: . . . ), <----314
Down the source files here and note that there is no model for this example.
This authentication stuff can be pretty complicated so I will try to break it down in the lab video more.
Use this code as an opportunity to read and learn about authentication. Note that I had to use PHP sessions ($_SESSION) because the standard authentication code was not working for me.
Also note that the code / styles were generated using bootstrap 5, if you are interested here is a link: Bootstrap