[Isocial-svn] SF.net SVN: isocial: [56] app/controllers/user_controller.php
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <agu...@us...> - 2008-03-09 19:52:32
|
Revision: 56 http://isocial.svn.sourceforge.net/isocial/?rev=56&view=rev Author: aguidrevitch Date: 2008-03-09 12:52:38 -0700 (Sun, 09 Mar 2008) Log Message: ----------- 'remember me' login option works now Modified Paths: -------------- app/controllers/user_controller.php Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-03-09 19:33:31 UTC (rev 55) +++ app/controllers/user_controller.php 2008-03-09 19:52:38 UTC (rev 56) @@ -29,22 +29,26 @@ return; } - $this->_loginUser($this->params['email'], $this->params['password']); - - $this->addError( - '_common', - 'Incorrect e-mail/password combination', - 'Passwords are case sensitive. Please check your CAPS lock key' - ); + if (!$this->_loginUser($this->params['email'], $this->params['password'], @$this->params['remember_me'])) { + $this->addError( + '_common', + 'Incorrect e-mail/password combination', + 'Passwords are case sensitive. Please check your CAPS lock key' + ); + } } - function _loginUser ($email, $password) + function _loginUser ($email, $password, $remember_me = false) { $user = $this->User->login($email, $password); if ($user && $user->active) { $this->_login($user->id); + if ($remember_me) { + setcookie(session_name(), session_id(), time() + 60 * 60 * 24 * 365 * 3, '/'); + } $this->redirectToAction( 'home' ); } + return false; } function logout () { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |