Current time: 05-24-2012, 11:24 PM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] canviewthreads and forum list [C-Michael83]
01-17-2009, 02:49 PM (This post was last modified: 01-17-2009 02:51 PM by Michael S..)
Post: #1
[F] canviewthreads and forum list [C-Michael83]
Reference: http://community.mybboard.net/thread-431...#pid298546

If you have a forum set for "Can view forum?" to yes but "Can view threads within forum?" to no you can still see the thread list if you enter the forum.

Greets,
Michael
-------------
[Image: donation_drive_sig.png]
Visit this user's website Find all posts by this user
01-17-2009, 05:10 PM (This post was last modified: 01-17-2009 05:10 PM by Ryan Gordon.)
Post: #2
RE: canviewthreads and forum list
Are you sure it's not just because of your admin permissions?
Visit this user's website Find all posts by this user
01-18-2009, 12:20 AM
Post: #3
RE: canviewthreads and forum list
No, because I changed the permissions for the unregistered group. The screenshots were taken as a guest user.

Greets,
Michael
-------------
[Image: donation_drive_sig.png]
Visit this user's website Find all posts by this user
02-15-2009, 02:48 AM
Post: #4
RE: canviewthreads and forum list
(01-17-2009 02:49 PM)Michael83 Wrote:  Reference: http://community.mybboard.net/thread-431...#pid298546

If you have a forum set for "Can view forum?" to yes but "Can view threads within forum?" to no you can still see the thread list if you enter the forum.
For the convenient of others, here's the post:
(01-16-2009 04:34 PM)Michael83 Wrote:  Revision #4308

...

But you're still able to see the thread list if you enter the forum.

In addition to that the forum is marked as locked although it isn't.
http://community.mybboard.net/attachment.php?aid=12362

ok, I think I found a solution but it's seems crappy, need your opinion:

in forumdisplay.php find: (around line 300)
PHP Code:
// Set here to fetch only approved topics (and then below for a moderator we change this).
$visibleonly "AND visible='1'";
$tvisibleonly "AND t.visible='1'";

// Check if the active user is a moderator and get the inline moderation tools.
if(is_moderator($fid))
{
    eval(
"\$inlinemodcol = \"".$templates->get("forumdisplay_inlinemoderation_col")."\";");
    
$ismod true;
    
$inlinecount "0";
    
$inlinecookie "inlinemod_forum".$fid;
    
$visibleonly " AND (visible='1' OR visible='0')";
    
$tvisibleonly " AND (t.visible='1' OR t.visible='0')";
}
else
{
    
$inlinemod '';
    
$ismod false;

replace with:
PHP Code:
// Set here to fetch only approved topics (and then below for a moderator we change this).
$visibleonly "AND visible='1'";
$tvisibleonly "AND t.visible='1'";
if (
$fpermissions['canviewthreads'] != 1)
{
    
$visibleonly .= "AND false";
    
$tvisibleonly .= "AND false";
}

// Check if the active user is a moderator and get the inline moderation tools.
if(is_moderator($fid))
{
    eval(
"\$inlinemodcol = \"".$templates->get("forumdisplay_inlinemoderation_col")."\";");
    
$ismod true;
    
$inlinecount "0";
    
$inlinecookie "inlinemod_forum".$fid;
    
$visibleonly " AND (visible='1' OR visible='0')";
    
$tvisibleonly " AND (t.visible='1' OR t.visible='0')";
}
else
{
    
$inlinemod '';
    
$ismod false;


Creativity is a drug I cannot live without.
[Image: 1]Support PM will be ignored
Visit this user's website Find all posts by this user
02-15-2009, 02:52 AM
Post: #5
RE: canviewthreads and forum list
That setting is just so that the user cannot read the thread no?
Because if you click on the thread it usually gives an error.

Twinkle Hendleberge thought Earl was pretty cool. Gerry Austin didn't think so, however, so he ran away. My goodness, what is this point of all this? Everything has a point.
p.s. you just lost it
Visit this user's website Find all posts by this user
02-15-2009, 03:17 AM
Post: #6
RE: canviewthreads and forum list
dvb, that fix won't really do anything/isn't proper
Visit this user's website Find all posts by this user
02-15-2009, 06:04 AM (This post was last modified: 02-15-2009 06:04 AM by Yumi.)
Post: #7
RE: canviewthreads and forum list
Haven't bothered trying anything, but guessing this is all you need to do:
forumdisplay.php
Replace
PHP Code:
if($fpermissions['canview'] != 1
with
PHP Code:
if($fpermissions['canview'] != || $fpermissions['canviewthreads'] != 1

The fix in the previous thread is causing the lock status, because:
PHP Code:
            if($forum['password'] != '' && $mybb->cookies['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password'])  || $permissions['canviewthreads'] !=1)
            {
                
$hideinfo true;
            } 
$hideinfo is sent as the locked status
PHP Code:
$lightbulb get_forum_lightbulb($forum$lastpost_data$hideinfo); 
PHP Code:
function get_forum_lightbulb($forum$lastpost$locked=0)
{
    global 
$mybb$lang$db$unread_forums;

    
// This forum is closed, so override the folder icon with the "offlock" icon.
    
if($forum['open'] == || $locked)
    {
        
$folder "offlock";
        
$altonoff $lang->forum_locked;
    } 
Fix should be easy, so I'll leave it up to you Toungue
Visit this user's website Find all posts by this user
02-17-2009, 07:09 AM (This post was last modified: 02-18-2009 11:53 PM by dvb.)
Post: #8
RE: canviewthreads and forum list
(02-15-2009 03:17 AM)Ryan Gordon Wrote:  dvb, that fix won't really do anything/isn't proper
Are you sure? on my testing board it fixed the problem...

I'll look again later, I don't have the time ATM.

But IIRC, I've tried to also prevent the SQL queries from returning results instead of just prevent the output of them (exactly as MyBB does always) and therefore the solution is weird...

The solution of Yumi was insufficient IMO because with this solution the user can't view anything in this page, while with my solution the user can't view just the thread listing, this is the proper behavior to the mentioned permissions:
(01-17-2009 02:49 PM)Michael83 Wrote:  If you have a forum set for "Can view forum?" to yes but "Can view threads within forum?" to no you can still see the thread list if you enter the forum.

Update:
well, my fix is working but Ryan found a better one Big Grin

Creativity is a drug I cannot live without.
[Image: 1]Support PM will be ignored
Visit this user's website Find all posts by this user
02-18-2009, 02:59 AM
Post: #9
RE: canviewthreads and forum list
(02-17-2009 07:09 AM)dvb Wrote:  
(02-15-2009 03:17 AM)Ryan Gordon Wrote:  dvb, that fix won't really do anything/isn't proper
Are you sure? on my testing board it fixed the problem...

I'm definately sure. It doesn't even make any sense.
Visit this user's website Find all posts by this user
02-19-2009, 07:44 PM
Post: #10
[F] canviewthreads and forum list
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group
Visit this user's website Find all posts by this user


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication