Fixed the privacy issue - now for sure

This commit is contained in:
Polonkai Gergely 2012-07-23 18:23:13 +02:00
parent ff1e3fd9fc
commit 2e7d217503
3 changed files with 5 additions and 1 deletions

View File

@ -2,6 +2,7 @@
<html>
<head>
<title>Kék Rózsák{% block title %}{% endblock %}</title>
<meta charset="utf8" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/kekrozsak_front.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/jquery.tooltip.css') }}" />
{% block additional_css %}{% endblock %}

View File

@ -5,4 +5,7 @@
{% if article.source %}
<p class="forras">Forrás: {{ article.source }}</p>
{% endif %}
{% if app.user %}
<p class="szerzo">{{ article.createdBy.displayName }}</p>
{% endif %}
{% endblock content %}

View File

@ -21,7 +21,7 @@ class NewsExtension extends \Twig_Extension
{
$newsRepo = $this->_doctrine->getRepository('KekRozsakFrontBundle:News');
$searchCriteria = array();
if (!is_object($this->_securityContext->getToken()->getUser()))
if (!is_object($this->_securityContext->getToken()) || !is_object($this->_securityContext->getToken()->getUser()))
$searchCriteria['public'] = true;
$news = $newsRepo->findBy($searchCriteria, array('createdAt' => 'DESC'), 4);