蓝雨 发表于 2009-5-25 11:00:53

由于主题列表缓存引起管理框(adminbox)BUG解决方法:游客可见等

thread.php代码不合理性

由于主题列表缓存文件也对管理框进行缓存,而且没有对当前访问缓存文件用户管理框进行重新更新。
造成管理员看后缓存更新,游客可以看到管理员看到的管理框。
而游客更新了缓存,管理员却看不到管理框。


if ($fcache < 2) {//如果没有建立缓存就执行下面 ..............省略.................. if ($managecheck) { if ($thread==$fid) { $thread=\"<input type=\\\"checkbox\\\" name=\\\"tidarray[]\\\" value=\\\"$thread\\\" />\"; } else { $thread=\"<input type=\\\"checkbox\\\" name=\\\"tidarray[]\\\" value=\\\"$thread\\\" disabled />\"; } } ..............省略.................. $threaddb[$thread] = $thread;//问题,对$thread进行缓存 } else { //已经有缓存。 include_once(D_P.\"data/bbscache/fcache_{$fid}_{$page}.php\"); if ($page == 1 && !$ifsort) { foreach ($threaddb as $key => $value) { //问题,没有对$thread进行当前用户权限更新。 $value && $ifsort = 1; break; } } }

解决方法:

thread.php
查找并删除
if ($managecheck) { if ($thread==$fid) { $thread=\"<input type=\\\"checkbox\\\" name=\\\"tidarray[]\\\" value=\\\"$thread\\\" />\"; } else { $thread=\"<input type=\\\"checkbox\\\" name=\\\"tidarray[]\\\" value=\\\"$thread\\\" disabled />\"; } }
template\\wind\\thread.htm

查找
<!-- EOT; }if($thread){print <<<EOT --> <span style=\"margin-right:5px;\">$thread</span> <!-- EOT; }if($thread){print <<<EOT -->修改为
**** Hidden Message *****
页: [1]
查看完整版本: 由于主题列表缓存引起管理框(adminbox)BUG解决方法:游客可见等