1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-19 20:21:51 +02:00

Fixes #973 - permissions lookup issue corrected.

This commit is contained in:
Cameron 2015-04-23 20:19:14 -07:00
parent 5a0d33c8cf
commit d60a5edeab
2 changed files with 14 additions and 8 deletions

View File

@ -454,16 +454,17 @@ class e107forum
private function loadPermList()
{
$e107 = e107::getInstance();
if($tmp = $e107->ecache->retrieve_sys('forum_perms'))
if($tmp = e107::getCache()->retrieve_sys('forum_perms'))
{
e107::getMessage()->addDebug("Using Permlist cache: True");
$this->permList = e107::unserialize($tmp);
}
else
{
e107::getMessage()->addDebug("Using Permlist cache: False");
$this->_getForumPermList();
$tmp = e107::serialize($this->permList, false);
$e107->ecache->set_sys('forum_perms', $tmp);
e107::getCache()->set_sys('forum_perms', $tmp);
}
unset($tmp);
}
@ -497,7 +498,6 @@ class e107forum
private function _getForumPermList()
{
$e107 = e107::getInstance();
$sql = e107::getDb();
$this->permList = array();
@ -535,6 +535,12 @@ class e107forum
$tmp[$row['forum_parent']] = 1;
}
ksort($tmp);
if($key == 'post')
{
//echo "<h3>Raw Perms</h3>";
// echo "Qry: ".$qryList['post'];
// print_a($tmp);
}
$this->permList[$key] = array_keys($tmp);
$this->permList[$key.'_list'] = implode(',', array_keys($tmp));
}
@ -545,6 +551,7 @@ class e107forum
function checkPerm($forumId, $type='view')
{
// print_a( $this->permList[$type]);
return (in_array($forumId, $this->permList[$type]));
}

View File

@ -51,8 +51,9 @@ class forum_post_handler
define('MODERATOR', USER && $this->forumObj->isModerator(USERID));
$this->checkPerms($this->id);
$this->data = $this->processGet();
$this->checkPerms($this->data['forum_id']);
$this->processPosted();
$this->renderForm();
@ -206,9 +207,7 @@ class forum_post_handler
{
require_once(HEADERF);
$mes->addError(LAN_FORUM_3001);
// $mes->addDebug("action: ".$this->action);
// $mes->addDebug("id: ".$this->id);
// $mes->addDebug(print_a($threadInfo, true));
$mes->addDebug(print_a($this->data, true));
$ns->tablerender(LAN_FORUM_1001, $mes->render());
require_once(FOOTERF);
exit;