vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   User Login for non vB pages (https://vborg.vbsupport.ru/showthread.php?t=41437)

Martaigne 07-23-2002 05:50 PM

User Login for non vB pages
 
Okay, I've searched and found two small hacks for trying to add a user login or welcome panel to non-vB pages. Neither of them suit my purposes. The first was overly simple, just checking the login against the database and returning to the page with no user info. The second was more complicated, but was too much, being the entire welcome panel; additionally I couldn't get it to work with my site directory structure.

All I'm looking for is this. A simple file I can use as an include that will ask a user to login, register, or logout depending on their vB cookie. It'll say [b]'You are logged in as 'username'. logout'[b] if they are logged in, and have the form to login or register if they aren't. That simple.

Does anyone have anything this small and simple already? I've seen plenty of sites that use vB database for login, but only those two hacks here.

Logician 07-23-2002 06:13 PM

it may not help you getting a welcome panel, but I guess it can help the rest:

https://vborg.vbsupport.ru/showthrea...threadid=36419

Take a look..

Martaigne 07-23-2002 06:26 PM

Thanks, I looked at that late last night while I was looking for different login solutions. Nice setup, but unfortunately doesn't suit my purposes either. :) Most of what I'm making is from scratch but I don't have enough knowledge of how vB works to make a stupid simple login.

Logician 07-23-2002 06:31 PM

ok then:

if you add line:
PHP Code:

require('./global.php'); 

in the begining of your PHP file, you can then check his status like

PHP Code:

if ($bbuserinfo[userid]>0) {echo "logged in";}
else {echo 
"not logged in or unregistered";} 


Martaigne 07-23-2002 06:43 PM

I also found this instruction in a search but I can't for the life of me figure out what half of it means! lol

"Val>

Use the $ logincode

Then use the forum home login template to display what you want for when they are logged out. (Keep normal for the login)

And use forumhoemlogout for what you want to display when they are logged in. Ala the box with their user info. Just be sure to include a link to logout in the user box.

This is what I have always done."

Martaigne 07-23-2002 06:45 PM

Quote:

Originally posted by Logician
ok then:

if you add line:
PHP Code:

require('./global.php'); 

in the begining of your PHP file, you can then check his status like

PHP Code:

if ($bbuserinfo[userid]>0) {echo "logged in";}
else {echo 
"not logged in or unregistered";} 



Hey, this is pretty close to what I need. If I can get it to return the username in that message, and perhaps the userid somewhere so I can use it to check permissions on the admin side, it would pretty much be perfect.

Martaigne 07-23-2002 06:50 PM

I think I may have the template I need. Will this work by itself? Or do I just need to include globals.php?

PHP Code:

<smallfont><a href="member.php?s=$session[sessionhash]&action=markread">Mark All Forums Read</a> | <a href="showgroups.php?s=$session[sessionhash]">Forum Leaders</a></smallfont>

<
table border="0" cellpadding="0" cellspacing="0">
<
form action="member.php" method="post">
<
tr>
    <
td nowrap><smallfont><b>Not cookied?</b><br>Login with username and password:</smallfont></td>
</
tr><tr>
    <
td nowrap><input type="hidden" name="s" value="$session[sessionhash]">
    <
input type="hidden" name="action" value="login">
    <
input type="text" class="bginput" name="username" size="7">
    <
input type="password" class="bginput" name="password" size="7">
    <
input type="submit" class="bginput" value="Login!"></td>
</
tr>
</
form>
</
table


Logician 07-23-2002 06:58 PM

to post a template:

create it as a new template inside your admin CP then call it in your code like that:

eval("dooutput(\"".gettemplate("NAME_OF_YOUR_TEMPL ATE")."\");");

To refer user's username you can use variable $bbuserinfo[username] in your code (after "require global.php" line)

Martaigne 07-23-2002 07:44 PM

Thanks, I think this may be enough for me to work with for the time being.

Chris M 07-23-2002 08:06 PM

:)

If you need any more help, holler!

Satan


All times are GMT. The time now is 07:32 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.01077 seconds
  • Memory Usage 1,756KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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