Skip to content
Permalink
Browse files

log permission fixes

- fixed bug introduced with commit 016f3c7
- fixed log edit links for locked caches when using viewlogs.php
    (added `status` to SELECT statement)
  • Loading branch information...
following
following committed Aug 26, 2012
1 parent 12bf606 commit 53b73481f5e07f570fe21e7f1671af2bfabddd3f
Showing with 12 additions and 2 deletions.
  1. +1 −1 htdocs/templates2/ocstyle/res_logentry_logitem.tpl
  2. +11 −1 htdocs/viewlogs.php
@@ -38,7 +38,7 @@
[<a href="editlog.php?logid={$logItem.id|urlencode}">{t}Edit{/t}</a>]
{/if}

{if $logItem.userid==$login.userid}
{if $cache.userid==$login.userid || $logItem.userid==$login.userid}
<a href="removelog.php?logid={$logItem.id|urlencode}"><img src="resource2/{$opt.template.style}/images/log/16x16-trash.png" border="0" align="middle" border="0" width="16" height="16" alt="" /></a>
[<a href="removelog.php?logid={$logItem.id|urlencode}">{t}Delete{/t}</a>]
{/if}
@@ -39,7 +39,17 @@
if ($cache_id != 0)
{
//get cache record
$rs = sql("SELECT `caches`.`cache_id`, `caches`.`wp_oc` AS `wpoc`, `caches`.`user_id` AS `userid`, `caches`.`name`, IFNULL(`stat_caches`.`found`, 0) AS `found`, IFNULL(`stat_caches`.`notfound`, 0) AS `notfound`, IFNULL(`stat_caches`.`note`, 0) AS `note`, `cache_status`.`allow_user_view` FROM `caches` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` LEFT JOIN `stat_caches` ON `caches`.`cache_id`=`stat_caches`.`cache_id` WHERE `caches`.`cache_id`='&1'", $cache_id);
$rs = sql("SELECT `caches`.`cache_id`, `caches`.`wp_oc` AS `wpoc`,
`caches`.`user_id` AS `userid`, `caches`.`name`,
`caches`.`status` AS `status`,
IFNULL(`stat_caches`.`found`, 0) AS `found`,
IFNULL(`stat_caches`.`notfound`, 0) AS `notfound`,
IFNULL(`stat_caches`.`note`, 0) AS `note`,
`cache_status`.`allow_user_view`
FROM `caches`
INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`
LEFT JOIN `stat_caches` ON `caches`.`cache_id`=`stat_caches`.`cache_id`
WHERE `caches`.`cache_id`='&1'", $cache_id);
$rCache = sql_fetch_array($rs);
sql_free_result($rs);

0 comments on commit 53b7348

Please sign in to comment.
You can’t perform that action at this time.