handle case where user is null in interactions
This commit is contained in:
parent
5e80f58f40
commit
9014ca45f3
@ -8,7 +8,12 @@
|
|||||||
<h3> <?= $O_appr->getAuthorOrAnon()->S_USERNAME ?> </h3>
|
<h3> <?= $O_appr->getAuthorOrAnon()->S_USERNAME ?> </h3>
|
||||||
<p>Le <?= $O_appr->S_DATE ?> </p>
|
<p>Le <?= $O_appr->S_DATE ?> </p>
|
||||||
<p> <?= $O_appr->I_NOTE ?>/5 </p>
|
<p> <?= $O_appr->I_NOTE ?>/5 </p>
|
||||||
<?php if ($A_view["ADMIN"] || $A_view["USER_ID"] === $O_appr->I_AUTHOR_ID) { ?>
|
<?php
|
||||||
|
$B_can_delete = (
|
||||||
|
$A_view["ADMIN"] ||
|
||||||
|
($A_view["USER_ID"] === $O_appr->I_AUTHOR_ID && $O_appr->I_AUTHOR_ID !== null)
|
||||||
|
);
|
||||||
|
if ($B_can_delete) { ?>
|
||||||
<a href="/appr/delete/<?= $O_appr->I_ID ?>">Supprimer l'appréciation</a>
|
<a href="/appr/delete/<?= $O_appr->I_ID ?>">Supprimer l'appréciation</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@ -37,7 +37,12 @@ $O_recipe = $A_view["RECIPE"];
|
|||||||
|
|
||||||
<p>By <?= $O_recipe->getAuthorOrAnon()->S_USERNAME ?> </p>
|
<p>By <?= $O_recipe->getAuthorOrAnon()->S_USERNAME ?> </p>
|
||||||
|
|
||||||
<?php if ($A_view["ADMIN"] || $A_view["USER_ID"] === $O_recipe->I_AUTHOR_ID) { ?>
|
<?php
|
||||||
|
$B_can_interact = (
|
||||||
|
$A_view["ADMIN"] ||
|
||||||
|
($A_view["USER_ID"] === $O_appr->I_AUTHOR_ID && $O_appr->I_AUTHOR_ID !== null)
|
||||||
|
);
|
||||||
|
if ($B_can_interact) { ?>
|
||||||
<section class="buttonsEditRecipe">
|
<section class="buttonsEditRecipe">
|
||||||
<a href="/recipe/edit/<?= $O_recipe->I_ID ?>">Modifier la recette</a>
|
<a href="/recipe/edit/<?= $O_recipe->I_ID ?>">Modifier la recette</a>
|
||||||
<a href="/recipe/delete/<?= $O_recipe->I_ID ?>">Supprimer la recette</a>
|
<a href="/recipe/delete/<?= $O_recipe->I_ID ?>">Supprimer la recette</a>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user