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)
-   -   Simple vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=100992)

Billspaintball 02-09-2006 10:29 PM

Quote:

Originally Posted by eByte
Hey, I'm using vBExternal also and getting the same error. What did you do to fix the problem? Thanks.

I think I know why. Let me instal vB External over weekend and have a peek at it.

Barteken 02-10-2006 03:23 PM

Quote:

Originally Posted by Billspaintball
To rule out anything else on the page conflicting, do the test page listed right at the end of the troubleshooting section.
See https://vborg.vbsupport.ru/showpost....98&postcount=2

got it to work but, the login banner is on top now but if there is no one logged in the page is still visible... how can i change this?

Grtz barteken

Billspaintball 02-12-2006 09:28 PM

Quote:

Originally Posted by Barteken
but if there is no one logged in the page is still visible... how can i change this?

Grtz barteken

Theres a list of conditionals that you can use in the instructions and in the 2nd post of this thread.
https://vborg.vbsupport.ru/showpost....98&postcount=2

To show different content depending of if people are logged in or not, you want to use this one.
PHP Code:

<?php 
If ($vbulletin->userinfo['userid']!=0
    {     
    echo 
"Your logged in so we can display this"
    } else { 
    echo 
"Your not logged in so we display this"
    } 
?>

The content can be text, html, php, inlude another page etc.

Kirk Y 02-13-2006 07:44 PM

Quote:

Originally Posted by Realm of Horror Comics
Is it possible to add the user's avatar yet?
Does anyone know how to do this?

In login_inc.php locate:
PHP Code:

// We check if user is logged in 

Above this place:
Code:

if ($vbulletin->userinfo['userid'])
{
require_once('./includes/functions_user.php'); //make sure we have the function we need
$navbar_ava = fetch_avatar_url($vbulletin->userinfo['userid']);
if (!is_array($navbar_ava))
{
$navbar_ava[] = "/images/misc/noavatar.gif";
}
}

In login_inc.php locate:
PHP Code:

// If Logged in display welcome back message 

Below this place:
Code:

echo "<img src='http://www.yoursite.com/forum/$navbar_ava[0]' align='left' />";
Upload the attached noavatar.gif image to your images/misc folder.
This will show the User's current avatar, and if the User has no avatar specified, it'll show the no avatar image. Don't forget to change the "yoursite.com" to reflect your forum.

See attached for Screenshots.

nicedreams 02-13-2006 07:55 PM

ok, so i got it working, sort of.

It shows me logged in, but doesnt look like my cookie ever expires when it should. so, on the page i created, i'm always logged in, even after the cookie should have timed out with me idling.

Also, from the who's online page, it never updates the time of last activity or the location if i'm on a page outside of vb.

Jim

Billspaintball 02-13-2006 09:09 PM

Quote:

Originally Posted by nicedreams
ok, so i got it working, sort of.

It shows me logged in, but doesnt look like my cookie ever expires when it should. so, on the page i created, i'm always logged in, even after the cookie should have timed out with me idling.

I will look at that.
Quote:

Also, from the who's online page, it never updates the time of last activity or the location if i'm on a page outside of vb.
Its not ment to.

Realm of Horror Comics 02-13-2006 10:08 PM

Quote:

Originally Posted by acidburn0520
In login_inc.php locate:
PHP Code:

// We check if user is logged in 

Above this place:
Code:

if ($vbulletin->userinfo['userid'])
{
require_once('./includes/functions_user.php'); //make sure we have the function we need
$navbar_ava = fetch_avatar_url($vbulletin->userinfo['userid']);
if (!is_array($navbar_ava))
{
$navbar_ava[] = "/images/misc/noavatar.gif";
}
}

In login_inc.php locate:
PHP Code:

// If Logged in display welcome back message 

Below this place:
Code:

echo "<img src='http://www.yoursite.com/forum/$navbar_ava[0]' align='left' />";
Upload the attached noavatar.gif image to your images/misc folder.
This will show the User's current avatar, and if the User has no avatar specified, it'll show the no avatar image. Don't forget to change the "yoursite.com" to reflect your forum.

See attached for Screenshots.

Sweet! That did it.

Thanks!

Billspaintball 02-14-2006 01:04 PM

Enhanced version with avatar, number of PM's and user stats is ready.... I think....
I just need to test it on someone who uses a table prefix for their database.

Realm of Horror Comics 02-14-2006 02:00 PM

Awesome, I look forward to it. :)

Kirk Y 02-15-2006 12:53 AM

I'm having an issue where everything looks like it's logging in fine, but when it goes back to the page, it shows me as not being logged in. I checked the cookie fix discussed in the Troubleshooting section and it's as it should be. Sometimes though, if I go to the Forum and then go back to the page, it shows me as logged in. Any ideas? I love this hack, but I don't want it acting up like this to the regular users.

Quote:

Originally Posted by Realm of Horror Comics
Sweet! That did it.

Thanks!

Good to hear it. I too wanted this feature!

Evil X 02-15-2006 01:11 AM

thanks

Billspaintball 02-15-2006 10:40 AM

Deluxe Version of this hack is now available
Has Avatars, PM's Number of Posts etc.

Click Here

opteek 02-17-2006 07:44 PM

Ok guys, I am having a slight problem. I am using the test.php script that was posted here. When I have the script outside of my forum directory, like my httpdroot directory, as soon as I try to login, I get a login.php not found error. However, when the script is in my /httpdroot/forum directory, it works just fine. I have my cookie path set to / and I dunno what else the problem could be. I've checked the login_inc.php file, but all links to login.php seem like they include the forumpath as a prefix... anyone have any ideas??

Billspaintball 02-17-2006 08:08 PM

Sounds like a path problem more than anything else.

Look at point 2 under troubleshooting https://vborg.vbsupport.ru/showpost....98&postcount=2

Run that script in the same directory as login.php and make sure you use that path.

opteek 02-17-2006 09:03 PM

Yeah, I am using the exact same path as I get from that php in point 2 of troubleshooting. Is there anything else?

Here is an update on the situation.

I am using the test.php you have mentioned previously in this thread.

I have test.php in three different places on my host:

/httpdroot
/httpdroot/forum
/httpdroot/auction

Now, when I remove the chdir statement at the top of the script, in both the httpdroot and auction test.php's, the screen is just blank white, no source. The forum test.php works fine.

Previously, when I had the chdir statement at the top of the test.php's, the auction and httpdroot test.php's gave a login.php not found error, it stated it was looking for login.php in the httpdroot, which is not were it was. However, the forum test.php still worked fine.

So, how can I get files OUTSIDE of my forum directory to work with this?

I've now tried various thngs with the chdir at the top, omitting it, adding another one after the require, changing the path to of the test.php file and still nothing. The only one that works is the one in the main forum directory. :(

Hornstar 02-18-2006 07:00 AM

Probably been answered and the answer is probably no.

however can this work on my other sites, for example use the login details on site www.a.com to also work on site www.b.com


i want all my users on my current site to be able to login on this new site im going to create which will have an arcade system on it.

thanks

Barteken 02-18-2006 06:49 PM

Quote:

Originally Posted by Billspaintball
Theres a list of conditionals that you can use in the instructions and in the 2nd post of this thread.
https://vborg.vbsupport.ru/showpost....98&postcount=2

To show different content depending of if people are logged in or not, you want to use this one.
PHP Code:

<?php 
If ($vbulletin->userinfo['userid']!=0
    {     
    echo 
"Your logged in so we can display this"
    } else { 
    echo 
"Your not logged in so we display this"
    } 
?>

The content can be text, html, php, inlude another page etc.

doesn't seems to work either :S

opteek 02-18-2006 08:00 PM

No, you're not understanding. All these directories are under the same domain.

Billspaintball 02-19-2006 10:47 AM

Quote:

Originally Posted by hornstar1337
Probably been answered and the answer is probably no.

Correct on both counts.

You can try step 4 of the trouble shooting guide, but I doubt if it will work.
https://vborg.vbsupport.ru/showpost....98&postcount=2

Billspaintball 02-19-2006 10:56 AM

Quote:

Originally Posted by opteek
Yeah, I am using the exact same path as I get from that php in point 2 of troubleshooting. Is there anything else?

Here is an update on the situation.

I am using the test.php you have mentioned previously in this thread.

I have test.php in three different places on my host:

/httpdroot
/httpdroot/forum
/httpdroot/auction

Now, when I remove the chdir statement at the top of the script, in both the httpdroot and auction test.php's, the screen is just blank white, no source. The forum test.php works fine.

Yes, that would be correct. If you remeove chdir then the only way it should work is if its in the forums directory.
Quote:

Previously, when I had the chdir statement at the top of the test.php's, the auction and httpdroot test.php's gave a login.php not found error, it stated it was looking for login.php in the httpdroot,
Make sure you edited the path in the login_inc.php file correctly.
What you are describing is the symptons when you are using incorrect Paths.

Quote:

I've now tried various thngs with the chdir at the top, omitting it, adding another one after the require, changing the path to of the test.php file and still nothing. The only one that works is the one in the main forum directory. :(
PHP Code:

<?php
   chdir
('/path/to/your/forums'); 
   require_once(
'/path/to/your/forums/global.php');  
?>

That MUST be at the very top of the page else it will not work.

just a thought, is your Hosting on a windows box?

Billspaintball 02-19-2006 11:13 AM

Quote:

Originally Posted by Barteken
doesn't seems to work either :S

It does, Ive PM'ed a reply to what you sent.

opteek 02-19-2006 06:34 PM

I don't understand what could be wrong with my paths. I've checked them again and again. If they were wrong, wouldn't the whole thing not work at all? It works fine if the test.php file is in the forum directory, otherwise, no go, even subdirectories of the forum directory don't work.

When it works, I get the vBulletin logo linking to main forum page in the topleft corner of the login box screen. When it doesn't work because it is in another directory, instead of the vBulletin logo, I simply get a text link to my main forum page.

This is running on a fedora system. Is there anything that can be wrong besides the path? I have the https://www.myforum.site/forum in my login_inc.php, which is included in my httpsroot directory. That paths in the test.php file are completely accurate as well. This is killing me. I was just gonna install the software I needed into the forum directory but that would be chaos and there are some overlapping files. :disappointed:

Virtuosofriend 02-19-2006 09:12 PM

Do you think that it will work with another php script,for instance lets say pafiledb?

Billspaintball 02-20-2006 02:47 AM

Quote:

Originally Posted by Virtuosofriend
Do you think that it will work with another php script,for instance lets say pafiledb?

Short answer is No idea.

You may be able to modify it to work with pafiledb, but since I havent seen how pafiledb authenticates I cant say for sure.

Virtuosofriend 02-20-2006 06:30 AM

You can get it and play around with it from www.phparena.net

Billspaintball 02-20-2006 09:49 PM

Quote:

Originally Posted by Virtuosofriend
You can get it and play around with it from www.phparena.net

Just had a quick look.
Its something the pafiledb developers would need to do.

Virtuosofriend 02-21-2006 04:44 PM

hmm i thought so.Thanks mate.

medw1974 02-24-2006 10:29 AM

Quote:

Originally Posted by boske
I am getting the error

Line: 469
Char: 1
Error: Expected '('
Code: 0

And I think I narrowed it down to this line:
Code:

        <input name=vb_login_username type=text id=navbar_username onfocus=if (this.value == '$vbphrase[username]') this.value = ''; size=10 />
It has to be this though
onfocus=if (this.value == '$vbphrase[username]') this.value = '';

Does anyone know what that does?

I had exactly the same situation removing the onfocus section gets rid of the javascript error on IE and doesn't seem to affect the operation of the script. Can anyone confirm what that code section actually does?

UtilityGeek 02-27-2006 12:11 PM

Does anyone know if there's a way to check if they forums are currently down/closed and then display some text or whatever if they are. The way it currently works is if they are down then the user is thrown to the vB forum page showing that the forum is down and is unable to access the site. It would be great if it could just say "User information not available." or whatever.

Is this possible? I would still like for the site to be available when the forums themselves are down.

Billspaintball 02-28-2006 12:30 AM

Good idea.
Not sure if its possible but I will look into it.

idwf 03-02-2006 10:29 PM

this seems perfect for what i want, however, i can't get it working correct.

I can get the log into to work, so that it says 'welcome Magik' and all that jazz, but it then redirects me to a page with the login bar there again. Not a 'wecome magik' thing. what am i doing wrong?

Billspaintball 03-03-2006 01:37 AM

Quote:

Originally Posted by idwf
this seems perfect for what i want, however, i can't get it working correct.

I can get the log into to work, so that it says 'welcome Magik' and all that jazz, but it then redirects me to a page with the login bar there again. Not a 'wecome magik' thing. what am i doing wrong?

Have a look at step 3 in troubleshooting.
See https://vborg.vbsupport.ru/showpost....98&postcount=2
Did that fix it?

idwf 03-03-2006 02:15 AM

OK. I've been playing around with it all day because i really ened this to work, and i've got it working. However, I now get

Quote:

Fatal error: Call to a member function unlock
The log-in, owever, works for now!

Quarterbore 03-05-2006 04:21 AM

I am just starting to play with this and your test scripts work great for me...

I am trying to take an old php script (Recipe Script) that uses it's own member login and password and use your mod to use vB UserId to be forced... As long as the person has to be signed in and I can capture their user ID that is good enough for this need (for now).

I am curious if the fact that this script I am working with conects to a different database then vB will cause me problems using this method?

Billspaintball 03-06-2006 08:45 AM

Quote:

Originally Posted by idwf
OK. I've been playing around with it all day because i really ened this to work, and i've got it working. However, I now get



The log-in, owever, works for now!

Ive never seen that error before.

Are you running any other scripts on that page?
If so, my guess there is a conflict with one of them.

Billspaintball 03-06-2006 08:50 AM

Quote:

Originally Posted by Quarterbore
I am just starting to play with this and your test scripts work great for me...

I am trying to take an old php script (Recipe Script) that uses it's own member login and password and use your mod to use vB UserId to be forced... As long as the person has to be signed in and I can capture their user ID that is good enough for this need (for now).

I am curious if the fact that this script I am working with conects to a different database then vB will cause me problems using this method?

I think I see what your trying to do. Use the vB userid from this and record it in the other database?

I do something similar on my site where a couple of custom databases record the record owner by their vB id.

Short answer is that I dont know if it will conflict with your script or not. All you can really do is try and see.

chickedy 03-07-2006 09:43 PM

I have installed the script as described. I named my page members.php and put it in the root directory. The page shows up fine, but when I try to login it just refreshes back to the page. I have changed the Cookie path to / and still nothing.

Any ideas?

Thanks

Billspaintball 03-07-2006 10:52 PM

What version of vB are you using?
Your profile says 3.0.3

EDFMedia 03-13-2006 09:48 PM

Quote:

Originally Posted by Billspaintball
I think I know why. Let me instal vB External over weekend and have a peek at it.

Curious to know if you ever found what the problem might be when using vbexternal? Everything works perfect until I use it in conjunction with vbexternal and I get a "Cannot redeclare class vbulletinhook" error.

eNforce 03-14-2006 12:21 PM

okay, i got it to work... however once logged in it won't keep you logged in :(
http://www.areyouserios.com/ - removed for now.

you can test by loggin in with
username: demo
password: demo

http://www.seriosgaming.com/test_login.php it sort of works here, log out doesn't work though.

i've tried all the cookie settings as suggested


All times are GMT. The time now is 01:01 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.02905 seconds
  • Memory Usage 1,862KB
  • 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
  • (5)bbcode_code_printable
  • (7)bbcode_php_printable
  • (22)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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