-
Bug
-
Resolution: Fixed
-
Major
-
3.1.0-RC2
-
None
And it seems to be unintentional:
*lock*
'lock' => array('LOCK_TOPIC', ($topic_data['topic_status'] == ITEM_UNLOCKED) && ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'] && $topic_data['topic_status'] == ITEM_UNLOCKED))),
|
Line breaks:
'lock' => array('LOCK_TOPIC',
|
($topic_data['topic_status'] == ITEM_UNLOCKED) &&
|
(
|
$auth->acl_get('m_lock', $forum_id) ||
|
(
|
$auth->acl_get('f_user_lock', $forum_id) &&
|
$user->data['is_registered'] &&
|
$user->data['user_id'] == $topic_data['topic_poster'] &&
|
$topic_data['topic_status'] == ITEM_UNLOCKED
|
)
|
)
|
),
|
*unlock*
'unlock' => array('UNLOCK_TOPIC', ($topic_data['topic_status'] != ITEM_UNLOCKED) && ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'] && $topic_data['topic_status'] == ITEM_UNLOCKED))),
|
Line breaks:
'unlock' => array('UNLOCK_TOPIC',
|
($topic_data['topic_status'] != ITEM_UNLOCKED) &&
|
(
|
$auth->acl_get('m_lock', $forum_id) ||
|
(
|
$auth->acl_get('f_user_lock', $forum_id) &&
|
$user->data['is_registered'] &&
|
$user->data['user_id'] == $topic_data['topic_poster'] &&
|
$topic_data['topic_status'] == ITEM_UNLOCKED
|
)
|
)
|
),
|
The second topic status in the lock check is redundant.
The second one in the unlock check is never true, due to the first topic status comparison. I think it should be != ITEM_UNLOCKED there aswell and then its redundant and can be removed aswell.
If we do not want f_user_lock to be able to unlock topics, it should be
'unlock' => array('UNLOCK_TOPIC', $topic_data['topic_status'] != ITEM_UNLOCKED) && $auth->acl_get('m_lock', $forum_id)),
|
But the current statement is just non-sense