vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Login page for none members/not logged in members. (https://vborg.vbsupport.ru/showthread.php?t=36472)

ultimate family 03-23-2002 04:18 PM

Login page for none members/not logged in members.
 
Right i want to make it so only signed in members are able to view the board.

I have made the following page http://www.ultimate-forums.co.uk for people to log in with but i want it so no matter what page a person trying to view if there not loged in they will view this page.

eg try to view http://www.ultimate-forums.co.uk/vB/index.php if the uses are not loged in they view my log in page.

I know this has been done for ikonboard but can it also be done for vb? if so how?

Dexter 03-23-2002 07:59 PM

you have got to do this:
open member.php
find:
Code:

// ############################### start login ###############################
change everything until
Code:

    if ($user['cookieuser']==1) {
      vbsetcookie("bbuserid",$user['userid']);

in:
Code:

if ($action=="login") {
  include("./global.php");
  if (isset($username)) {
    // get userid for given username
    if ($user=$DB_site->query_first("SELECT userid,username,password,cookieuser FROM user WHERE username='".addslashes(htmlspecialchars($username))."'")) {
      if ($user['password']!=md5($password)) {  // check password
if ($sort == "bb") {;
        eval("standarderror(\"".gettemplate("error_wrongpassword")."\");");
} else {;
echo ("<meta http-equiv=\"Refresh\" content=\"0;URL=/index.php?msg=3\">");
};
        exit;
      }
      $userid=$user[userid];
    } else { // invalid username entered
if ($sort=="bb"){;
      eval("standarderror(\"".gettemplate("error_wrongusername")."\");");
} else {;
echo ("<meta http-equiv=\"Refresh\" content=\"0;URL=/index.php?msg=2\">");
};
      exit;
    }

step 2:
open up your CP and find every template that has anything to do with logging in, like the No permission form.
Add right underneath the sessionhash line:
Code:

<input type="hidden" name="sort" value="bb">
step 3:
create a new page index.php and place within:
Code:

<?php
echo ('
<HTML>
<HEAD>
<TITLE>AlexDex Net Board</TITLE>
</HEAD>
<BODY>
<table border="0" bgcolor="#555576" cellpadding="4" cellspacing="1" align="center">
<form action="/forums/member.php" method="post"><input type="hidden" name="s" value="0b99c5440d5ea1850fb094ae79454a1b">
<input type="hidden" name="sort" value="nobb">

<tr valign="top">
');
  if (!isset($msg)) {;
$msg="1";
};
if ($msg=="1") { echo('
You need to log in');
}
if ($msg=="2") { echo('
The given username was incorrect');
}
if ($msg=="3") { echo('
The given password was incorrect');
}

echo ('        <td bgcolor="#DFDFDF"><font face="verdana, arial, helvetica" size="2" ><b>Your User Name:</b></font></td>
        <td bgcolor="#DFDFDF"><font face="verdana, arial, helvetica" size="2" ><input type="text" class="bginput" name="username" value="Unregistered" size="25">
                &nbsp;&nbsp;</font>
                <font face="verdana,arial,helvetica" size="1" ><a href="/forums/register.php?action=signup">Want to register?</a>
        </font></td>
</tr>
<tr valign="top">
        <td bgcolor="#F1F1F1"><font face="verdana, arial, helvetica" size="2" ><b>Your Password:</b></font></td>
        <td bgcolor="#F1F1F1"><font face="verdana, arial, helvetica" size="2" ><input type="password" class="bginput" name="password" value="" size="25">
                &nbsp;&nbsp;</font>
                <font face="verdana,arial,helvetica" size="1" ><a href="/forums/member.php?action=lostpw">Forgotten your password?</a>
        </font></td>
</tr>

</table>

<br>

<center><font face="verdana, arial, helvetica" size="2" >
<input type="hidden" name="action" value="login">
<input type="hidden" name="url" value="/">
<input type="submit" class="bginput" value="Login!"></form>
</font></center>

<p><font face="verdana,arial,helvetica" size="1" >The administrator may have required you to
<a href="/forums/register.php?action=signup">register</a> before you can view this page.
</font></p></font></td>
</tr>
</table>

</BODY>
</HTML>
');
?>

of couse, you need to modify everything to fit in your page, and you will need to adjust some paths to the redirection.
The code above will produce, when you call the login from a separate page, you won't get the vBulletin errors for username and password, but the errors you specify in your php file
good luck!

Dexter 03-23-2002 08:39 PM

p.s.
if you are logged in on the board, you still need to provide your info every time.
maybe a good idea for a future hack

Admin 03-24-2002 11:24 AM

Dexter, please go to this page and enter your username, to show you are licensed. (you will need to use your customer number and password to access that page)
Thank you.

ultimate family 03-24-2002 11:54 AM

FireFly has your a good hacker (no butt kissing at all) have you got any ideas on just how i might be able to do this?


All times are GMT. The time now is 08:31 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.00965 seconds
  • Memory Usage 1,734KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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