Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 11-30-2002, 03:02 AM
WonderMonkey WonderMonkey is offline
 
Join Date: Nov 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Only allow invited users...

You know I KNOW this has got to have been asked before but I cannot find it via the search feature.

I am looking to restrict members of my board to those who are invited. It can either be:
1 - You have to have the proper code to create a user <- Easiest
2 - Be sent an email inviting you to create a user.

Or something that achieves the same results.

I am going to be shocked if this has not been done yet.

Regards,
WM
Reply With Quote
  #2  
Old 11-30-2002, 04:30 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1- Edit the template "registeradult" and insert an HTML form field like this into somewhere before </form>:
PHP Code:
<normalfont>Password to register:<input type="text" name="specialpassword"></normalfont
(You can spice up the design)

2-Then edit register.php, find:
PHP Code:
  if (!$allowregistration) {
    eval(
"standarderror(\"".gettemplate("error_noregister")."\");");
    exit;
  } 
after that add:
PHP Code:
  if ($specialpassword!='XXX') {
    eval(
"standarderror(\"".gettemplate("error_inviteonly")."\");");
    exit;
  } 
(Replace X with your special password)

Create a templated named "error_inviteonly" and enter your error message there. This will be displayed if the member didnt enter the correct password for registering.. Notice the password is case sensitive..

Enjoy..
Reply With Quote
  #3  
Old 12-01-2002, 12:14 AM
WonderMonkey WonderMonkey is offline
 
Join Date: Nov 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent. Thanks for the code. I am a developer but non-php at the moment and that follow pretty much what I envisioned as the "hard-coded" method.

Thanks for the post.
Reply With Quote
  #4  
Old 12-01-2002, 12:53 AM
WonderMonkey WonderMonkey is offline
 
Join Date: Nov 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had to change it a bit. When I implemented your code I would get the error message as soon as someone clicked on the "register" link to begin the process. I was able to look at the code and figure out enough to do the following"

In register.php
Code:
// This is the Registration Code
if ($action=="addmember") {
	if ($specialpassword!='XXX') {
    	eval("standarderror(\"".gettemplate("error_inviteonly")."\");");
    	exit;
  	}
}
Of course I may have implemented your code incorrectly to start with.

Thanks for pushing me most of the way!
Reply With Quote
  #5  
Old 12-01-2002, 08:14 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually my code is correct too but I did not notice there are 3 instances of the "if (!$allowregistration) {" part in register.php. What I meant was the one after "if ($HTTP_POST_VARS['action']=="addmember") {" section but you already figured that out.
Reply With Quote
  #6  
Old 12-01-2002, 02:25 PM
WonderMonkey WonderMonkey is offline
 
Join Date: Nov 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah! Well good! I was thinking it was implementation on my part.

Thanks again for the code.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:54 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.04321 seconds
  • Memory Usage 2,209KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete