mirror of
https://github.com/e107inc/e107.git
synced 2025-08-09 08:06:38 +02:00
Fixes #1075, Fixes #441 - Forum permissions cache was stored incorrectly, causing incorrect permissions for some users.
This commit is contained in:
@@ -45,7 +45,8 @@ class ecache {
|
|||||||
*/
|
*/
|
||||||
public function setMD5($text)
|
public function setMD5($text)
|
||||||
{
|
{
|
||||||
$this->CachePageMD5 = md5($text);
|
$this->CachePageMD5 = md5($text);
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -7,7 +7,8 @@ function print_item($thread_id)
|
|||||||
$gen = new convert;
|
$gen = new convert;
|
||||||
include_once(e_PLUGIN.'forum/forum_class.php');
|
include_once(e_PLUGIN.'forum/forum_class.php');
|
||||||
$forum = new e107forum;
|
$forum = new e107forum;
|
||||||
$thread_info = $forum->thread_get($thread_id,0,999);
|
|
||||||
|
$thread_info = $forum->threadGet($thread_id,0,999);
|
||||||
$thread_name = $tp->toHTML($thread_info[0]['thread_name'], TRUE);
|
$thread_name = $tp->toHTML($thread_info[0]['thread_name'], TRUE);
|
||||||
$text = "<b>".$thread_name."</b><br />
|
$text = "<b>".$thread_name."</b><br />
|
||||||
".$thread_info[0]['user_name'].", ".$gen->convert_date($thread_info[0]['thread_datestamp'], "forum")."<br /><br />
|
".$thread_info[0]['user_name'].", ".$gen->convert_date($thread_info[0]['thread_datestamp'], "forum")."<br /><br />
|
||||||
@@ -35,7 +36,7 @@ function email_item($thread_id)
|
|||||||
$gen = new convert;
|
$gen = new convert;
|
||||||
include_once(e_PLUGIN.'forum/forum_class.php');
|
include_once(e_PLUGIN.'forum/forum_class.php');
|
||||||
$forum = new e107forum;
|
$forum = new e107forum;
|
||||||
$thread_info = $forum->thread_get($thread_id,0,999);
|
$thread_info = $forum->threadGet($thread_id,0,999);
|
||||||
|
|
||||||
$thread_name = $tp->toHTML($thread_info[0]['thread_name'], TRUE);
|
$thread_name = $tp->toHTML($thread_info[0]['thread_name'], TRUE);
|
||||||
$text = "<b>".$thread_name."</b><br />
|
$text = "<b>".$thread_name."</b><br />
|
||||||
|
@@ -474,17 +474,21 @@ class e107forum
|
|||||||
|
|
||||||
private function loadPermList()
|
private function loadPermList()
|
||||||
{
|
{
|
||||||
if($tmp = e107::getCache()->retrieve_sys('forum_perms'))
|
if($tmp = e107::getCache()->setMD5(e_LANGUAGE.USERCLASS_LIST)->retrieve('forum_perms'))
|
||||||
{
|
{
|
||||||
e107::getMessage()->addDebug("Using Permlist cache: True");
|
e107::getMessage()->addDebug("Using Permlist cache: True");
|
||||||
|
|
||||||
$this->permList = e107::unserialize($tmp);
|
$this->permList = e107::unserialize($tmp);
|
||||||
|
|
||||||
|
// print_a($this->permList);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
e107::getMessage()->addDebug("Using Permlist cache: False");
|
e107::getMessage()->addDebug("Using Permlist cache: False");
|
||||||
$this->_getForumPermList();
|
$this->_getForumPermList();
|
||||||
$tmp = e107::serialize($this->permList, false);
|
$tmp = e107::serialize($this->permList, false);
|
||||||
e107::getCache()->set_sys('forum_perms', $tmp);
|
e107::getCache()->setMD5(e_LANGUAGE.USERCLASS_LIST)->set('forum_perms', $tmp);
|
||||||
}
|
}
|
||||||
unset($tmp);
|
unset($tmp);
|
||||||
}
|
}
|
||||||
@@ -572,6 +576,11 @@ class e107forum
|
|||||||
function checkPerm($forumId, $type='view')
|
function checkPerm($forumId, $type='view')
|
||||||
{
|
{
|
||||||
// print_a( $this->permList[$type]);
|
// print_a( $this->permList[$type]);
|
||||||
|
if(empty($this->permList[$type]))
|
||||||
|
{
|
||||||
|
// return false;
|
||||||
|
}
|
||||||
|
|
||||||
return (in_array($forumId, $this->permList[$type]));
|
return (in_array($forumId, $this->permList[$type]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user