Skip to content

Commit

Permalink
make class of Session model in SessionHeader middleware in Identity p…
Browse files Browse the repository at this point in the history
…lugin overrideable
  • Loading branch information
maxmamis committed Oct 24, 2013
1 parent 21d9aa1 commit d0ab1ef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extensions/Identity/middleware/SessionHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class SessionHeader extends Middleware {
* @var \MABI\Identity\Session
*/
public $session = NULL;

protected $sessionModelClass = '\MABI\Identity\Session';

/**
* Call
Expand All @@ -24,8 +26,8 @@ class SessionHeader extends Middleware {
*/
public function call() {
$sessionId = $this->getApp()->getRequest()->headers('SESSION');

$foundSession = Session::init($this->getApp());
$foundSession = call_user_func($this->sessionModelClass . '::init', $this->getApp());
if($foundSession->findById($sessionId)) {
$this->session = $foundSession;
$this->getApp()->getRequest()->session = $this->session;
Expand Down

0 comments on commit d0ab1ef

Please sign in to comment.