forked from openpne/OpenPNE3
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'kawahara/remember_login'
- Loading branch information
Showing
5 changed files
with
144 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the OpenPNE package. | ||
* (c) OpenPNE Project (http://www.openpne.jp/) | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file and the NOTICE file that were distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* opRememberLoginFilter | ||
* | ||
* @package OpenPNE | ||
* @subpackage filter | ||
* @author Shogo Kawahara <[email protected]> | ||
*/ | ||
class opRememberLoginFilter extends sfFilter | ||
{ | ||
/** | ||
* Executes this filter. | ||
* | ||
* @param sfFilterChain $filterChain A sfFilterChain instance | ||
*/ | ||
public function execute($filterChain) | ||
{ | ||
if ($this->isFirstCall() && !$this->context->getUser()->isAuthenticated()) | ||
{ | ||
if ($memberId = $this->context->getUser()->getRememberedMemberId()) | ||
{ | ||
$this->context->getUser()->login($memberId); | ||
} | ||
} | ||
$filterChain->execute(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters