1 (edited by ConnyT 2003-12-30 12:32)

Topic: No permissions with EFAM

I have installed EFAM with the hope that i could set viewing permissions for the individual user, to each forum individually.

My problem is that the user can access the locked forum but not view the topic in it.
I did some alterations to the code were the user status was checked.

viewtopic.php
---------------
if($locked == '1' && $cur_user['status'] < 2 && !eregi("$username", $locked_users))
    message($lang_common['No permission']);

viewtopic.php after alteration
--------------------------------
if($locked == '1' && $cur_user['status'] < 1 && !eregi("$username", $locked_users))
    message($lang_common['No permission']);

Still the user can not access the topic unless set as moderator.
I do not want the user to be given the moderator status in order to access the topics in the locked forums. (I have done the same type of modification in the viewforum.php)

Re: No permissions with EFAM

Well, what the altered condition says is:

if the topic is locked AND the user is a regular user AND the user is not in $locked_users

Is that what you want? I've don't know how the mod works, so I can't really tell you what to do.

[moved to mods forum]

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3 (edited by ConnyT 2003-12-30 14:27)

Re: No permissions with EFAM

If the forum is locked and the user exists in the $locked_users he/she should have access.

That's what I want..

Re: No permissions with EFAM

Try this:

if($locked == '1' && ($cur_user['status'] < 1 || !eregi("$username", $locked_users)))
    message($lang_common['No permission']);

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: No permissions with EFAM

Tell you what I did:

Instead of your code above I replaced it with
if($locked == '1') {
$isUserInList = strpos($locked_users, $username);
  if (!$isUserInList) {
   message($lang_common['No permission'].' T');
  }
}

and that seems to solve the problems I had.
As I understand this solution doesn't take any notice of the users status and if the forum is locked, checks if the user is in the list of accepted users.

Please correct me if I am doing something seriously wrong..

Re: No permissions with EFAM

That should work.

I'll have a look at the efam code someday and fix the problem.

Re: No permissions with EFAM

You are a gentleman!
smile