<?php
namespace Mm\Beton\Planungsatlas\AtlasBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Mm\Beton\Planungsatlas\AtlasBundle\Entity\Main\AtlasSession;
class AbstractAuthenticatedController extends AbstractController implements AuthenticatedControllerInterface
{
public function loadAtlasSession() {
$atlasSession = new AtlasSession();
$atlasSession->loadFromSession();
if(!empty($_SESSION['userinfo'])) {
$atlasSession->setUser($_SESSION['userinfo']);
}
return $atlasSession;
}
public function isUserLoggedIn() {
return ($this->loadAtlasSession()->getUser() != null) ? true : false;
}
}