Navigation

Pligg Support

Search Results for "moderator"
I am working on the groups system and came across a bug. I traced it and discovered the following:

The canIhaveAcess concept is erroneous and extensively redundant anywhere in the Pligg CMS files. In some places, the access is not granted to the Site Admin because it is overridden (not only in the groups), and here is how:

In \editgroup.php, LINE 19 to 30, we find:

//check group admin
$canIhaveAccess = checklevel('admin');
$canIhaveAccess = checklevel('moderator');

if($current_user->user_id != get_group_creator($requestID) && $canIhaveAccess != 1)
{
//page redirect
$redirect = '';
$redirect = getmyurl("group_story", $requestID);
// header("Location: $redirect");
die;
}

The second $canIhaveAccess, on LINE 21, is overriding the first and only the moderator is granted access to edit. If it happens that the logged in is the site Admin, no access is granted unless the Site Admin is the creator of the group, while if the logged in is a moderator, a full access is granted to him/her.

Now, if the concept is that the Site Admin and Moderators are supposed to be able to edit any group, then we must modify the code.

Open \editgroup.php, and replace the bloc of code from LINE 20 to 21:

$canIhaveAccess = checklevel('admin');
$canIhaveAccess = checklevel('moderator');

With this block of code:

$canIhaveAccess = 0;
$canIhaveAccess = $canIhaveAccess + checklevel('admin');
$canIhaveAccess = $canIhaveAccess + checklevel('moderator');

To explain:
When giving a user the 'moderator' user level, they seem to have no extra access than the 'normal' users. What should they be getting? Also, in the User management grid, the Moderator level does not appear in the Level column when assigned to the user. Have I set something up incorrectly?