vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Deluxe vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=108026)

steveheinsch 07-30-2007 05:25 PM

I would like to thank you for this hack Bill. I am using it as the heart of a custom CMS I am building for one of my clients and it works great. I just need to do some more digging into the vB core to see how they access certain info so I can use it. Thanks again...this rocks.

steveheinsch 07-30-2007 05:49 PM

Did anybody get this to work (check for membergroupids)?

Looking at the below example, I noticed that you are using 'usergroupid' and I think this needs to be 'membergroupids' like:
PHP Code:

<?php 
if ($vbulletin->userinfo['membergroupids'is_member_of(n,n,n)) 
    { 
    echo 
"This is only visible to people in usergroups n,n,n";} 
    
?>

usergroupid is a users primary access level while membergroupids can contain multiple secondary access levels.

Quote:

Originally Posted by Billspaintball (Post 1133647)
Try something like

PHP Code:

<?php 
if ($vbulletin->userinfo['usergroupid'is_member_of(n,n,n)) 
    { 
    echo 
"This is only visible to people in usergroups n,n,n";} 
    
?>

where n = the groups you want to check.

I havent tried this yet, it may or may not work.
Look here for more info https://vborg.vbsupport.ru/showthread.php?t=132024


Thorlax402 07-31-2007 03:03 AM

Hello,

I have been having a lot of trouble with getting this modification to work. I have read of numerous people having the same problem as well. I read to about page 13 before I gave up and decided to post (sorry if this was fixed between here and there).

Anyway, my login box appears to work fine in all aspects accept actually logging in. After typing in my username and password, I am sent to the page saying I have successfully logged in. However, I am then redirected back to the page with the login only to find that I am in fact not logged in. The same thing happens when I try to log out using this script as well. Everything appears fine, but I don't log out.

On the other hand, the login box reflects perfectly whether I am actually logged in or not. It can tell if I have logged in on the forum's login page and reacts accordingly. It just can't perform any of the operations itself.

I have also read through the troubleshooting and the changing the cookie information didn't change anything.
Any suggestions?

Luke Brown256 07-31-2007 03:49 AM

Ok i am having some problems, i set the login script up to how i needed it and i ran this script:

Code:

<?php
$curdir = getcwd ();
chdir('../../vbulletin');
require_once('global.php');
chdir ($curdir);
?>
<html>
<body>
This is a heading<br />
This is some more stuff <br />
And another line<br />
You get the idea<br />
Just place stuff as you normally would with HTML<br />
I use CSS to style and position on my site fwiw<br />
<br />
How about we put the login box right under here?<br />
<br />
<?php
  require_once('login_inc.php');
?>
</body>
</html>

simple and bog standard, but as soon as i execute the script, the page loads a copy of the login page, but it is NOT redirecting to my login page as the path stays the same:

http://img518.imageshack.us/img518/1600/helpbm4.th.jpg

This seems to occur when i include global.php and i am completely lost, can anyone help?

----
UPDATE:
Ok i forgot to include some pertinent information, this only occurs when i am not logged in, if i am logged in then it all works fine:
URL=http://img505.imageshack.us/my.php?image=icasdo1.jpg]http://img505.imageshack.us/img505/5113/icasdo1.th.jpg[/URL]

But if i am not logged in, or click log out, then when i attempt to access the login page, (the one i designed using the login_inc) it simple embeds the proper login page attempting to use my style aswell, but failing because the images paths are not correct, (because the script remains the same, it does NOT redirect to a new script)

I cant login using this page because the paths are all wrong.

Luke Brown256 08-02-2007 01:09 AM

Ok i have worked out what is wrong, i dont know if this is something that can be fixed or not but perhaps it should be added as a notice.

If you set your forums up so unregistered/ not logged in users can NOT see any forums, then you will get the same problem i have done, if the user tries to access any page in which global.php is included then it will embed a vb login box, but all the paths will be relative, so it wont work.

Took me several hours of reading global.php and then trying some things but yeah, so i am going to bed now.
The way around this is simply to enable unregistered users to see SOMETHING, but if someone finds another way around this then i look forward to reading it.

steveheinsch 08-02-2007 01:22 AM

This code will check BOTH the primary and secondary usergroups for access...

PHP Code:

if (is_member_of($vbulletin->userinfoXXX)) { 
  echo 
"Your usergroup has access to this area";
}
else { 
   echo 
"You are not in a usergroup with access";


Where X is a usergroup (primary or secondary, it checks them BOTH).
If you only want to check for one value, just use one groupid...multiple values use multiple groupids. You can check for as many as you would like.

Hope it helps,
Steve

essexell 08-03-2007 01:17 PM

I'm having a problem using this mod which I see other people have had before - but I couldn't find a solution on this thread.
I'm using the login box in the header all pages on the site, and for consistency, it's in the same place on the forum pages. All is working fins apart from the variables:
$pmbox[lastvisitdate]
$pmbox[lastvisittime]
$vbphrase[unread_x_nav_compiled]
$vbphrase[total_x_nav_compiled]
Which won't show on the forum (fine on all other pages).
Sorry if this has been resolved before - but I'd really appreciate some help!
THanks.

CSGCarl 08-05-2007 02:46 PM

Hello,

I was just wondering if any one knows how to edit the global.php file so when forum is closed it dosn't close the site as well?

Cheers

RPG_Messiah 08-22-2007 03:23 AM

my avatar and the other stuff shows up but above all that there is an error that shows up:
Quote:

Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in /home/.kirsten/rpg_messiah/galanovagames.com/login_inc.php on line 34

Warning: getimagesize(http://www.galanovagames.com/community/image.php?u=1) [function.getimagesize]: failed to open stream: no suitable wrapper could be found in /home/.kirsten/rpg_messiah/galanovagames.com/login_inc.php on line 34

EDIT: Well I fixed that problem....all I did was delete line 34.

But one problem I can't seem to figure out is why I have to press the refresh button on my browser to update the online/offline status if I login/logout in the forum and then go to my home page from there. I already cleared my cache and it still does it. Can someone please help me w/this?

RPG_Messiah 08-25-2007 05:35 PM

Is there any way of forcing the page to automatically refresh or something???


All times are GMT. The time now is 10:50 AM.

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.01837 seconds
  • Memory Usage 1,758KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete