Merge from lnApp

This commit is contained in:
Deon George
2011-05-09 17:40:50 +10:00
parent 8814447096
commit 8b658b497a
46 changed files with 466 additions and 200 deletions

View File

@@ -51,13 +51,13 @@ class Model_Auth_UserDefault extends Model_Auth_User {
* @return boolean
*/
public function login(array & $array, $redirect = FALSE) {
$fieldname = 'admin_name';
$fieldname = 'admin_name'; // @todo This should be defined in a config or database driver file
$array = Validate::factory($array)
->label('admin_name', $this->_labels[$fieldname])
->label('username', $this->_labels[$fieldname])
->label('password', $this->_labels['password'])
->filter(TRUE, 'trim')
->filter('admin_name','strtoupper')
->rules('admin_name', $this->_rules[$fieldname])
->filter('username','strtoupper')
->rules('username', $this->_rules[$fieldname])
->rules('password', $this->_rules['password']);
// Get the remember login option
@@ -69,7 +69,7 @@ class Model_Auth_UserDefault extends Model_Auth_User {
if ($array->check())
{
// Attempt to load the user
$this->where($fieldname, '=', $array['admin_name'])->find();
$this->where($fieldname, '=', $array['username'])->find();
if ($this->loaded() AND Auth::instance()->login($this, $array['password'], $remember))
{