|
找到文件:template\default\forum\discuzcode.htm
搜索代码:forum.php?mod=misc&action=viewattachpayments&aid=$attach[aid]
将附近的代码全部换成一下代码:下面是包含购买和记录2个判断,同时允许管理员查看购买记录
- <!--{if in_array($_G[group][groupid], array(1,2)) || $_G['uid'] == $attach[uid]}-->
- <a href="forum.php?mod=misc&action=viewattachpayments&aid=$attach[aid]" onclick="showWindow('attachpay', this.href)" target="_blank">[{lang pay_view}]</a>
- <!--{elseif !$attach['payed'] || !$_G['uid']}-->
- [<a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" onclick="showWindow('attachpay', this.href)" target="_blank">{lang attachment_buy}</a>]
- <!--{/if}-->
- <!--{/if}-->
复制代码 上面解决了前台的按钮记录,接下来解决后台权限记录(防止越权查看)
打开文件:source/module/forum/forum_misc.php,搜索:
- $auid = DB::result_first("select uid from ".DB::table('forum_attachment')." where aid='$_GET[aid]'");
- if( $_G['uid'] != $auid && !in_array($_G['groupid'], array(1,2))) {
- showmessage('抱歉,您无权查看!');
- }
复制代码
|
|