Added standard fields, login/reset display improvements
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user