mirror of
https://github.com/e107inc/e107.git
synced 2025-07-29 19:00:26 +02:00
Fixes #973 - permissions lookup issue corrected.
This commit is contained in:
@@ -454,16 +454,17 @@ class e107forum
|
|||||||
|
|
||||||
private function loadPermList()
|
private function loadPermList()
|
||||||
{
|
{
|
||||||
$e107 = e107::getInstance();
|
if($tmp = e107::getCache()->retrieve_sys('forum_perms'))
|
||||||
if($tmp = $e107->ecache->retrieve_sys('forum_perms'))
|
|
||||||
{
|
{
|
||||||
|
e107::getMessage()->addDebug("Using Permlist cache: True");
|
||||||
$this->permList = e107::unserialize($tmp);
|
$this->permList = e107::unserialize($tmp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
e107::getMessage()->addDebug("Using Permlist cache: False");
|
||||||
$this->_getForumPermList();
|
$this->_getForumPermList();
|
||||||
$tmp = e107::serialize($this->permList, false);
|
$tmp = e107::serialize($this->permList, false);
|
||||||
$e107->ecache->set_sys('forum_perms', $tmp);
|
e107::getCache()->set_sys('forum_perms', $tmp);
|
||||||
}
|
}
|
||||||
unset($tmp);
|
unset($tmp);
|
||||||
}
|
}
|
||||||
@@ -497,7 +498,6 @@ class e107forum
|
|||||||
|
|
||||||
private function _getForumPermList()
|
private function _getForumPermList()
|
||||||
{
|
{
|
||||||
$e107 = e107::getInstance();
|
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
|
|
||||||
$this->permList = array();
|
$this->permList = array();
|
||||||
@@ -535,6 +535,12 @@ class e107forum
|
|||||||
$tmp[$row['forum_parent']] = 1;
|
$tmp[$row['forum_parent']] = 1;
|
||||||
}
|
}
|
||||||
ksort($tmp);
|
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] = array_keys($tmp);
|
||||||
$this->permList[$key.'_list'] = implode(',', array_keys($tmp));
|
$this->permList[$key.'_list'] = implode(',', array_keys($tmp));
|
||||||
}
|
}
|
||||||
@@ -545,6 +551,7 @@ class e107forum
|
|||||||
|
|
||||||
function checkPerm($forumId, $type='view')
|
function checkPerm($forumId, $type='view')
|
||||||
{
|
{
|
||||||
|
// print_a( $this->permList[$type]);
|
||||||
return (in_array($forumId, $this->permList[$type]));
|
return (in_array($forumId, $this->permList[$type]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -51,8 +51,9 @@ class forum_post_handler
|
|||||||
|
|
||||||
define('MODERATOR', USER && $this->forumObj->isModerator(USERID));
|
define('MODERATOR', USER && $this->forumObj->isModerator(USERID));
|
||||||
|
|
||||||
$this->checkPerms($this->id);
|
|
||||||
$this->data = $this->processGet();
|
$this->data = $this->processGet();
|
||||||
|
$this->checkPerms($this->data['forum_id']);
|
||||||
$this->processPosted();
|
$this->processPosted();
|
||||||
$this->renderForm();
|
$this->renderForm();
|
||||||
|
|
||||||
@@ -206,9 +207,7 @@ class forum_post_handler
|
|||||||
{
|
{
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
$mes->addError(LAN_FORUM_3001);
|
$mes->addError(LAN_FORUM_3001);
|
||||||
// $mes->addDebug("action: ".$this->action);
|
$mes->addDebug(print_a($this->data, true));
|
||||||
// $mes->addDebug("id: ".$this->id);
|
|
||||||
// $mes->addDebug(print_a($threadInfo, true));
|
|
||||||
$ns->tablerender(LAN_FORUM_1001, $mes->render());
|
$ns->tablerender(LAN_FORUM_1001, $mes->render());
|
||||||
require_once(FOOTERF);
|
require_once(FOOTERF);
|
||||||
exit;
|
exit;
|
||||||
|
Reference in New Issue
Block a user