Login/Activation tested
This commit is contained in:
@@ -50,7 +50,7 @@ abstract class lnApp_Model_Account extends Model_Auth_UserDefault {
|
||||
}
|
||||
|
||||
public function activated() {
|
||||
return $this->has_any('group',ORM::factory('Group',array('name'=>'Registered Users'))->list_childgrps(TRUE));
|
||||
return $this->verified;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,6 +68,9 @@ abstract class lnApp_Model_Account extends Model_Auth_UserDefault {
|
||||
}
|
||||
|
||||
public function log($message) {
|
||||
if (! class_exists('Model_Account_Log'))
|
||||
return TRUE;
|
||||
|
||||
// Log a message for this account
|
||||
$alo = ORM::factory('Account_Log');
|
||||
$alo->account_id = $this->id;
|
||||
@@ -110,6 +113,13 @@ abstract class lnApp_Model_Account extends Model_Auth_UserDefault {
|
||||
return trim(sprintf('%s %s',$this->first_name,$this->last_name));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a token valid for this user
|
||||
*/
|
||||
public function token($token_expire,$module,$method,$uses) {
|
||||
return $this->id.':'.md5(sprintf('%s-%s',$this->accnum(),$this->date_last));
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for accounts matching a term
|
||||
*/
|
||||
|
@@ -14,6 +14,7 @@ abstract class lnApp_Model_Auth_UserDefault extends Model_Auth_User {
|
||||
public function rules() {
|
||||
return array(
|
||||
'email' => array(
|
||||
array(array($this, 'unique'), array('email', ':value')),
|
||||
array('not_empty'),
|
||||
array('min_length', array(':value', 4)),
|
||||
array('max_length', array(':value', 127)),
|
||||
|
Reference in New Issue
Block a user