Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by bira bira is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Version: 2.0.x Rating:
Released: 05-04-2001 Last Update: Never Installs: 0
 
No support by the author.

[high]THIS HACK WILL NOT WORK IN VB 2.2.0 AND UP! DO NOT ATTEMPT TO INSTALL IT!
Go to https://vborg.vbsupport.ru/showthrea...threadid=33068 for the appropriate hack[/high]


This is something I've wanted to do for a long time, and since someone mentioned it in the Suggestions forum, I figured I'd write the hack

Purpose: When a new user regsiters, he is e-mailed a password generated randomly. He will not be able to log in until he receives this e-mail and uses that password. (the same happens if an existing user changes his e-mail address).

After installing this hack, you will have three options essentially:

1) Don't verify the e-mail is valid.
In this case the user selects his own password and nothing is sent to him.

2) Verify the e-mail is valid by sending an activation code
This is how vBulletin works now: a user selects his own password during registration, and the BB Mailer sends him an activation code / link that he needs to use before he's able to post

3) Verify the e-mail is valid by sending a random password
In this case the user DOES NOT select a password but instead he receives a randomly generated password by e-mail. He will not be able to log in / post until he receives and uses this password.


The installation includes:

1) Running a script that updates your database (adds an option "Send New Users Random Password?" with default "NO" -- to preserve your currect state).

2) Editing three scripts (register.php, member.php, admin/functions.php)

3) Editing two templates (registeradult, registercoppa) and adding three new templates (small ones).


If you have questions, I'm here

Cheers,

Bira

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 05-09-2001, 12:17 PM
Remi Remi is offline
 
Join Date: Nov 2001
Location: London, UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bira

Thank you very very much

It was a dream to have this hack

I have RC1 and it is working wounderfull
Reply With Quote
  #23  
Old 05-09-2001, 12:30 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad to have helped, Remi
Reply With Quote
  #24  
Old 05-09-2001, 09:51 PM
RobAC RobAC is offline
 
Join Date: Oct 2001
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is an awesome hack as I just tested it out on my forums, but it breaks Tubedogg's automatic welcome message upon registration hack.
Reply With Quote
  #25  
Old 05-09-2001, 10:30 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

RobAC, if you give me the URL to that hack, I'll check where they collide and how you can use them together.
Reply With Quote
  #26  
Old 05-09-2001, 10:38 PM
RobAC RobAC is offline
 
Join Date: Oct 2001
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bira,

Here you go. Thanks!

http://www.vbulletin.com/forum/showt...threadid=13857
Reply With Quote
  #27  
Old 05-09-2001, 10:49 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

RobRAC,

I checked tubedogg's hack and there's no reason the two hacks should collide, provided you insert the code right.

Here's what you need to make sure:

If you already hacked the file register.php then the end result should be like this.

Find (in the ORIGINAL file):

Code:
  if ($verifyemail) {
    $getjoindate=$DB_site->query_first("SELECT joindate FROM user WHERE userid='$userid'");
    $activateid=$getjoindate[joindate];

    eval("\$message = \"".gettemplate("email_activateaccount",1,0)."\";");
    eval("\$subject = \"".gettemplate("emailsubject_activateaccount",1,0)."\";");

    mail ($email,$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");

  }
And CHANGE that to (my hack's addition is in red, and tubedogg's hack addition is in blue):

Code:
  if ($verifyemail) {
    if ($randpassword=="0") {
        $getjoindate=$DB_site->query_first("SELECT joindate FROM user WHERE userid='$userid'");
        $activateid=$getjoindate[joindate];
    
        eval("\$message = \"".gettemplate("email_activateaccount",1,0)."\";");
        eval("\$subject = \"".gettemplate("emailsubject_activateaccount",1,0)."\";");
    } else {
        eval("\$message = \"".gettemplate("email_lostpw",1,0)."\";");
        eval("\$subject = \"".gettemplate("emailsubject_lostpw",1,0)."\";");   
    }

    mail ($email,$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");

  }

  // send a welcome email using email_welcome and emailsubject_welcome templates, but don't
  //   send it now if they need to activate their account
    if ($welcomeuser) {
      eval("\$message = \"".gettemplate("email_welcome",1,0)."\";");
      eval("\$subject = \"".gettemplate("emailsubject_welcome",1,0)."\";");
  
      mail($newuseremail,$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
    }
  // end send mail
That's it. The two hacks don't even "meet" at any other point


By the way, out of curiosity: if you are using email verification, be it with activation code or with random password, why on earth do you need a separate Welcome E-mail? Simply add your welcome message and whatever text you want to the already existing e-mail templates that are sent to the new users.
Reply With Quote
  #28  
Old 05-09-2001, 10:56 PM
RobAC RobAC is offline
 
Join Date: Oct 2001
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bira,

I'll double check this....actually, you've made a good point here. Thanks.
Reply With Quote
  #29  
Old 05-09-2001, 11:18 PM
RobAC RobAC is offline
 
Join Date: Oct 2001
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bira,

Instead of using the email_lostpw template, how can I use a different email template? I want to add in the welcome message to this template, but don't want to make that kind of addition to the lostpw template.
Reply With Quote
  #30  
Old 05-09-2001, 11:25 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Rob, create a new template (eg: email_newpw) and in my hack, wherever it mentions email_lostpw change it to your new template's name.

p.s.

But make sure that the variables from email_lostpw (the variables for the username and password at least!) also appear in your new template.
Reply With Quote
  #31  
Old 05-09-2001, 11:35 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, Rob, there is only one place you need to replace email_lostpw with your new template's name, and that is in register.php.

In my hack instructions it says:

Code:
Find:

      $getjoindate=$DB_site->query_first("SELECT joindate FROM user WHERE userid='$userid'");
      $activateid=$getjoindate[joindate];

      eval("\$message = \"".gettemplate("email_activateaccount",1,0)."\";");
      eval("\$subject = \"".gettemplate("emailsubject_activateaccount",1,0)."\";");

REPLACE it with:

      if ($randpassword=="0") {
          $getjoindate=$DB_site->query_first("SELECT joindate FROM user WHERE userid='$userid'");
          $activateid=$getjoindate[joindate];
    
          eval("\$message = \"".gettemplate("email_activateaccount",1,0)."\";");
          eval("\$subject = \"".gettemplate("emailsubject_activateaccount",1,0)."\";");
      } else {
          eval("\$message = \"".gettemplate("email_lostpw",1,0)."\";");
          eval("\$subject = \"".gettemplate("emailsubject_lostpw",1,0)."\";");   
      }
This refers to register.php. So, in that bit - and ONLY that bit - you will want to replace email_lostpw with your new template's name, as well as emailsubject_lostpw with a new template's name (for the subject message of your combined Welcome + Password to new user).

So, to sum this up:

1) Create two new template, say email_newpw and emailsubject_newpw. These two templates should resemble in content the lostpw templates, only with your Welcome text.

2) Add my hack EXACTLY like the instructions says, but before you upload the hacked files run a SEARCH/REPLACE in register.php for _lostpw and replace it with _newpw.

That's it.

Am I making any sense? Sorry, I'm tired
Reply With Quote
Reply


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 07:26 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08515 seconds
  • Memory Usage 2,309KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete