A few miscellaneous suggestions:
config_demo.php
$config['sess_cookie_name'] = 'FreakAuth';//add a comment if name can be changed, or why this is needed
$config['sess_expiration'] = 7200;
$config['sess_encrypt_cookie'] = TRUE; //FAL has TRUE (CI distribution = FALSE)
$config['sess_use_database'] = TRUE; //FAL requires TRUE (CI distribution = FALSE)
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent']= FALSE;//FAL has FALSE (CI distribution = FALSE)
Basically I’m suggesting adding a few comments for education and perhaps highlighting changes from the ‘default’ CI distribution. When I modified my existing site, I did not just copy the entire file, I used config_demo as an example and I missed changing ‘sess_use_database’. All that I am saying is that a few comments would help educate about FAL.
A couple of very petty / insignificant changes to:
//installer.php
Old Line 56: $data['message'].='<p>After creating you DB, ...
New Line 56: $data['message'].='<p>After creating your DB, ...
//freakauth_demo.php
Old Lines 19&20:
$data['message'].='<div id="flashMessage"><p>If you think that this library saved you time, or helped you '."\n";
$data['message'].=' making money quicker, or you simply like it, please help its future development and maintenance making a <a href="http://www.4webby.com/freakauth" target="_blank">donation.</p>';
New Lines 19&20: (corrects some english spelling, grammar, and adds link to donate)
$data['message'].='<div id="flashMessage"><p>If you think that this library saved you time, helped you '."\n";
$data['message'].=' make money quicker, or you simply like it, please help its future development and maintenance by making a <a href="http://www.4webby.com/freakauth" target="_blank">donation.</p>';
Installer
The “installer” is very nice.
I did a clean install of FAL on a clean CI download and had no problems. I applied FAL on an existing site and experienced difficulties. I started debugging and found the source of the problem, that I forgot to set the
$config['sess_use_database'] = TRUE; //Required for FAL
I made the mistake of not opening the installer page and instead just opened the root of the site which of course gave errors. My point here is to say that the installer is great.
For future releases you might consider checking out BambooInvoice if you have not already. Derek has a clever installer routine as well and it installs the DB as well. Basically just check if table exists and if not add it. Maybe the DB install routine isn’t directly a part of your ‘installer’ but within the installer in the checks for the DB where it checks if the required tables exists you have links that go to a controller method that installs those tables. I am not saying to do something exactly like the BambooInvoice installer. I’m just saying to take a look at it for the logic as it has a few features that could be easily implemented here for improvement. I can elaborate further if you don’t want to bother with downloading, but that might defeat the purpose because if you download it and run the installer you’ll experience exactly what I’m talking about very quickly and you can check out the installer if you want later.
I went ahead and inserted some snippets from the relevant code to make it easier.
This is install.php which is at the same level as the main index.php. As you can see it just launches the installer.
<?php
Header ("Location: index.php/install");
// Bamboo utilizes an MVC pattern, and thus calling "index.php/install" is really calling the
// file install.php from the system/controllers directory.
?>
<?php
/*
This install controller is only for quick insertion of an admin user into the system.
I strongly recommend you delete this file after you've installed BambooInvoice.
This controller is not in any way needed to run the application.
*/
class Install extends Controller {
function __construct()
{
parent::Controller();
$this->load->library('encrypt');
$this->load->dbutil();
}
function index()
{
$admin_email = 'you@email.com'; // change this to a different username if you want
$admin_firstname = 'first_name';
$admin_lastname = 'last_name';
// -----------------------------
// Setting your admin password
// -----------------------------
// If you'd prefer to set your password to a specific word rather then a random string
// uncomment the second line... if you'd prefer a randmom, uncomment the first
// $admin_password = substr(sha1(rand(0,999)), 0, 8); // generate random password
$admin_password = 'demo';
/*
* You shouldn't need to modify anything beneath here
*/
if (!isset($admin_password) || !isset($admin_email)) {
die ("Please first define your admin login, email and password. Instructions for this are located in the file /bamboo_system_files/application/controllers/install.php");
}
if (!$this->db->table_exists('some_table')) {
$this->db->query("CREATE TABLE 'some_table' (
`session_id` varchar(40) NOT NULL default '0',
`ip_address` varchar PRIMARY KEY (`session_id`)
) TYPE=MyISAM;");