[eluser]xwero[/eluser]
My first impression
- The try login snippet needs array() around the array content
- what is the point of the helper functions? They are just wrappers for the library methods. Do they work when the library isn't loaded, i think not but maybe i'm wrong. So the only reason why there are helper functions is to lessen the typing?
- using php4 calling the try_login method gives following error
Quote:Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: database/DB_active_rec.php
Line Number: 62
I build the query and i discovered removing the limit en offset from the getwhere method did the trick.
- in the getRole method why do you use and explicit join
Code:
$this->CI->db->select('roles.name');
$this->CI->db->JOIN('roles', 'users.role_id = roles.id');
$query = $this->CI->db->getwhere('users', array('users.id'=>$this->CI->session->userdata('user_id')), 1, 0);
Don't other databases know implicit joins?
Code:
$this->CI->db->select('roles.name');
$query = $this->CI->db->getwhere('users,roles', array('users.role_id' => 'roles.id','users.id'=>$this->CI->session->userdata('user_id')), 1, 0);
- I'm wondering how the class would handle content that is visible for different roles
Code:
<? if (getRole() == 'admin' || getRole() == 'test' || getRole() == 'test2') { ?>
<li><?= anchor('admin/users', 'Users'); ?></li>
<? } ?>
This can get messy.
Maybe i'm coming on a bit too strong but i think this is good stuff so it can accept a little criticism