vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   [beta release] Forum Passwords (https://vborg.vbsupport.ru/showthread.php?t=12610)

JamesUS 03-29-2001 06:27 PM

Okay I've seen a lot of demand for this so decided to give it a shot. It is still in BETA so please don't use it without taking full backups etc! I will release a final version in a week or so.

It was developed on v2 beta 3 but I would imagine it would work on any v2 beta.



1. Add a field to the forum table called "password". Make it CHAR of 50 characters. You can also run this SQL statement:
Code:

ALTER TABLE forum ADD password CHAR (50) not null

forumdisplay.php
Put this on line 33:
PHP Code:

if ($action == "dopassword") {
    if (
md5($password) == md5($foruminfo['password'])) {
        
vbsetcookie("bbforumpass[$forumid]"md5($foruminfo['password']),0);
    } else {
        eval(
"standarderror(\"".gettemplate('error_passwordrequired')."\");");
        exit;
    }
} else {
    if (
$foruminfo['password']) {
        if (
$bbforumpass[$forumid] != md5($foruminfo['password'])) {
             eval(
"standarderror(\"".gettemplate('error_passwordrequired')."\");");
            exit;
        }
    }


showthread.php
Insert on line 114:
PHP Code:


if ($forum['password']) {
    if (
$bbforumpass[$forumid] != md5($foruminfo['password'])) {
        eval(
"standarderror(\"".gettemplate('error_passwordrequired')."\");");
        exit;
    }


admin/forum.php
Line 94:
PHP Code:

  makeinputcode("Forum Password<br>(Max length of 50 characters)","password"); 

Change line 129 from:
PHP Code:

  (forumid,styleid,title,description,active,displayorder,parentid

to

PHP Code:

  (password,forumid,styleid,title,description,active,displayorder,parentid

Change line 119 from:
PHP Code:

  (NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid'

to
PHP Code:

  ('$password',NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid'

Insert on line 194:
PHP Code:

makeinputcode("Forum Password<br>(Max length of 50 characters)","password",$forum[password]); 

Change line 242 from:
PHP Code:

moderateattach='$moderateattach' 

to

PHP Code:

moderateattach='$moderateattach',password='$password' 

Templates
Add a template called error_passwordrequired. In it should be this:
Quote:

A password is required to enter this forum. Please enter it below: <br>
<form action="forumdisplay.php" method="POST">
<input type="password" name="password">
<br>
<input type="hidden" name="action" value="dopassword">
<input type="hidden" name="forumid" value=$foruminfo[forumid]>
<input type="submit" value="Submit">
</form>

03-29-2001 06:37 PM

Very Nice! This will come in very handy....thx James...

03-29-2001 07:11 PM

That make very long time than we wait that!!
Thx very much!!

RaMMSTeiN 06-21-2001 09:47 AM

Quote:

Originally posted by JamesUS
[B]
1. Add a field to the forum table called "password". Make it CHAR of 50 characters. You can also run this SQL statement:
Code:

ALTER TABLE forum ADD password CHAR (50) not null

i have done everything but how do that?? ;) above?? :confused:

kicks 06-21-2001 12:15 PM

You can use phpmyadmin or do it from command line if you have shell access to your server :)

RaMMSTeiN 06-21-2001 05:51 PM

where can i find the PHPadmin?? or the commandline shell....

im just started
a guy had setup our forum, so im a newbee LOL:D

JamesUS 06-21-2001 07:03 PM

Do you have telnet or SSH access to your host?

The Prohacker 06-21-2001 07:21 PM

PHP Code:

<?
require(".global.php");
cpheader();
$DB_site->query("ALTER TABLE forum ADD password CHAR (50) not null");
echo("Database altered successfully. Please ".makelinkcode("click here","./index.php?s=$session[sessionhash]")." to proceed to your Admin CP");
cpfooter();
?>

Put this in a file called pass-install.php
and upload it to your admin dir, now call it from your browser to install the sql for this hack, after installed, delete pass-install.php.

Hopefully this will help

RaMMSTeiN 06-21-2001 07:57 PM

Quote:

Originally posted by JamesUS
Do you have telnet or SSH access to your host?
what is that???
i have a normal 56 K modem, a ISDN line & and a cable modem?? do i have one of the asked things??? ;)

thnx prohacker

JaDy 06-22-2001 07:53 AM

is that working for version 1.1.4 too ?


All times are GMT. The time now is 01:36 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.01085 seconds
  • Memory Usage 1,769KB
  • 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_code_printable
  • (11)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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