vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   My Permissions arent working>_< (https://vborg.vbsupport.ru/showthread.php?t=68921)

AN-net 08-31-2004 04:49 PM

My Permissions arent working>_<
 
ok im even logged out and it still doesnt deny the viewer

here is my code
PHP Code:

            if($journalinfo['private']==1)
            {
                if((
$bbuserinfo['userid']==$journalinfo['journalist_id']) OR ($bbuserinfo['usergroupid']==6) OR (in_array($bbuserinfo['userid'], array($journalinfo['whocanview']))))
                {
                    
$canview['thisjournal']= true;
                }
                else if((
$journalinfo['allowbuddies']==1) AND (in_array($bbuserinfo['userid'], $jbuddies)))
                {
                    
$canview['thisjournal']= true;
                }
                else if(
$bbuserinfo['userid']==0)
                {
                    
$canview['thisjournal']= false;
                }
                else
                {
                    
$canview['thisjournal']= false;
                }
            }
            else
            {
                
$canview['thisjournal']= true;
            } 

$journalinfo[private] is set to 1 so it should consider it private. i even add the if the statement for guests to assure they cant view it but still it doesnt work>_<

if $canview[thisjournal] returns false it should print no permission but it isnt. anyone know y?

rake 08-31-2004 06:09 PM

in the bbuserinfo[userid] == 0 part, add the following:

echo "1";
print_r($canview);
exit;

if you don't get anything it means one of the above statements returns true, and it doesn't even get to this part.

Also, i'm guessing after this, there's something like:

if($canview['thisjournal'] == false)
{
print_no_permission();
}

AN-net 08-31-2004 06:43 PM

well its just
PHP Code:

if($canview['thisjournal'])
{
true stuff here
}
else
{
print_no_permission();



AN-net 08-31-2004 07:22 PM

fixed it, turns out it was thinking the guest was in private list of viewers>_>


All times are GMT. The time now is 03:36 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01027 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete