Add AuthenticationServiceProvider

This commit is contained in:
Romain Neutron
2013-02-15 11:08:05 +01:00
parent f5c5aebe22
commit d2bc4f4a23
117 changed files with 610 additions and 535 deletions

View File

@@ -33,7 +33,7 @@
<input type="hidden" name="usr_id" value="{{ owner.getUser().get_id() }}" />
</td>
<td style="padding-right:10px;min-width:100px;">
{% if app['phraseanet.user'].get_id() == owner.getUser(app).get_id() %}
{% if app['authentication'].getUser().get_id() == owner.getUser(app).get_id() %}
{% if owner.getRole() == constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %}
{% trans 'You are Admin' %}
{% endif %}
@@ -53,7 +53,7 @@
{% endif %}
</td>
<td style="width:15px">
{% if app['phraseanet.user'].get_id() != owner.getUser(app).get_id() %}
{% if app['authentication'].getUser().get_id() != owner.getUser(app).get_id() %}
<a href="#" class="deleter">
<img src="/skins/prod/Push/close_badge.png" title="{% trans 'Remove' %}"/>
</a>

View File

@@ -5,7 +5,7 @@
<table style="height: 40px;">
<tr>
<td style="white-space:nowrap;">
{% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
{% if list.getOwner(app['authentication'].getUser(), app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<form class="form-inline" method="POST" name="SaveName" action="/prod/lists/list/{{ list.getId() }}/update/">
<label>{% trans 'List Name' %}</label>
<input type="text" name="name" style="margin: 0 5px;" value="{{ list.getName() }}"/>
@@ -16,14 +16,14 @@
{% endif %}
</td>
<td style="text-align:right;white-space:nowrap;">
{% if list.getOwner(app['phraseanet.user'], app).getRole() == constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %}
{% if list.getOwner(app['authentication'].getUser(), app).getRole() == constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %}
<a href="/prod/lists/list/{{ list.getId() }}/share/" title="{% trans 'Share the list' %}" class="list_sharer">
<img src="/skins/prod/Push/list-icon.png" />
{% trans "Set sharing permission" %}
</a>
{% endif %}
</td>
{% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %}
{% if list.getOwner(app['authentication'].getUser(), app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %}
<td style="text-align:right;white-space:nowrap;width:150px;">
<button class="deleter btn btn-inverse">
{% trans 'Delete' %}
@@ -40,20 +40,20 @@
<p>
{% set length = '<span class="counter current">' ~ list.getEntries().count() ~ '</span>' %}
{% trans %}{{ length }} peoples{% endtrans %}
{% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
{% if list.getOwner(app['authentication'].getUser(), app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<button class="EditToggle btn btn-inverse">{% trans 'Edit' %}</button>
{% endif %}
</p>
</div>
<div class="PNB" style="top:35px;overflow:auto;">
{% set role = list.getOwner(app['phraseanet.user'], app).getRole() %}
{% set role = list.getOwner(app['authentication'].getUser(), app).getRole() %}
{% for entry in list.getEntries() %}
{{ ListsMacros.badgeReadonly(entry, role) }}
{% endfor %}
</div>
</div>
</div>
{% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
{% if list.getOwner(app['authentication'].getUser(), app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<div class="PNB content readwrite grey-bg" style="display:none;top:40px;">
<form name="list-editor-search" method="POST" action="/prod/push/edit-list/{{ list.getId() }}/">
<div class="PNB10" style="height:160px;">

View File

@@ -14,7 +14,7 @@
{% set length = '<span class="counter">' ~ list.getEntries().count() ~ '</span>' %}
<li class="list" style="padding:2px;">
<a href="/prod/push/edit-list/{{ list.getId() }}/" class="list_link">
{% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
{% if list.getOwner(app['authentication'].getUser(), app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<img src="/skins/prod/Push/list-icon.png" />
{% else %}
<img src="/skins/icons/SHARE16.png" />