Added standard fields, login/reset display improvements

This commit is contained in:
Deon George
2016-08-18 12:34:53 +10:00
parent a7616960f0
commit 2b48dde8f7
14 changed files with 155 additions and 182 deletions

View File

@@ -13,6 +13,8 @@
abstract class lnApp_Controller_Login extends Controller_TemplateDefault {
protected $auth_required = FALSE;
protected $login_attribute = 'email';
/**
* Activate an account so that it can login and use the site
*/
@@ -208,12 +210,12 @@ abstract class lnApp_Controller_Login extends Controller_TemplateDefault {
*/
public function action_reset() {
// Minutes to keep our token
$token_expire = 15*60;
$token_expire = 15;
// If the user posted their details to reset their password
if ($this->request->post()) {
// If the username is correct, create a method token
if ($ao=ORM::factory('Account',array('email'=>$this->request->post('username'))) AND $ao->loaded()) {
if ($this->request->post('username') AND ($ao=ORM::factory('Account',array($this->login_attribute=>$this->request->post('username')))) AND $ao->loaded()) {
$token = $ao->token($token_expire,'account','user:resetpassword',2);
if ($token) {