picture_modify: do not show link to gallery if user level is too low

This commit is contained in:
plegall
2021-01-06 10:14:45 +01:00
parent 4d102e9eba
commit baa2a2190d
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -183,6 +183,9 @@ UPDATE '.CATEGORIES_TABLE.'
$page['infos'][] = l10n('Photo informations updated');
pwg_activity('photo', $_GET['image_id'], 'edit');
// refresh page cache
$page['image'] = get_image_infos($_GET['image_id'], true);
}
// tags
@@ -379,6 +382,7 @@ while ($row = pwg_db_fetch_assoc($result))
// 3. if URL category not available or reachable, use the first reachable
// linked category
// 4. if no category reachable, no jumpto link
// 5. if level is too high for current user, no jumpto link
$query = '
SELECT category_id
@@ -420,7 +424,7 @@ else
}
}
if (isset($url_img))
if (isset($url_img) and $user['level'] >= $page['image']['level'])
{
$template->assign( 'U_JUMPTO', $url_img );
}
@@ -90,7 +90,7 @@ $('#action-delete-picture').on('click', function() {
{if isset($U_JUMPTO)}
<a class="icon-eye" href="{$U_JUMPTO}" title="{'Open in gallery'|@translate}"></a>
{else}
<a class="icon-eye unavailable" title="{'Photo is in a private album'|@translate}"></a>
<a class="icon-eye unavailable" title="{'You don\'t have access to this photo'|translate}"></a>
{/if}
<a class="icon-download" href="{$U_DOWNLOAD}" title="{'Download'|translate}"></a>
{if !url_is_remote($PATH)}