SessionJoomla.php (mrbs-1.9.4) | : | SessionJoomla.php (mrbs-1.10.0) | ||
---|---|---|---|---|
<?php | <?php | |||
namespace MRBS\Session; | namespace MRBS\Session; | |||
use \MRBS\JFactory; | use \MRBS\JFactory; | |||
use MRBS\User; | ||||
require_once MRBS_ROOT . '/auth/cms/joomla.inc'; | require_once MRBS_ROOT . '/auth/cms/joomla.inc'; | |||
class SessionJoomla extends SessionWithLogin | class SessionJoomla extends SessionWithLogin | |||
{ | { | |||
public function __construct() | public function __construct() | |||
{ | { | |||
$this->checkTypeMatchesSession(); | $this->checkTypeMatchesSession(); | |||
parent::__construct(); | parent::__construct(); | |||
} | } | |||
public function getCurrentUser() | public function getCurrentUser() : ?User | |||
{ | { | |||
return \MRBS\auth()->getUser(); | return \MRBS\auth()->getUser(); | |||
} | } | |||
protected function logonUser($username) | protected function logonUser(string $username) : void | |||
{ | { | |||
// Don't need to do anything: the user will have been logged on when the | // Don't need to do anything: the user will have been logged on when the | |||
// username and password were validated. | // username and password were validated. | |||
} | } | |||
public function logoffUser() | public function logoffUser() : void | |||
{ | { | |||
$mainframe = JFactory::getApplication('site'); | $mainframe = JFactory::getApplication('site'); | |||
$mainframe->logout(); | $mainframe->logout(); | |||
} | } | |||
} | } | |||
End of changes. 4 change blocks. | ||||
3 lines changed or deleted | 4 lines changed or added |