Announcement

Collapse
No announcement yet.

[Release vb2.0] Send random password instead of activation code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Essam with so many, I would actually recommend you delete them, because there are bound to be a lot of duplicate people who tried several times, or people who tried a long time ago and forgot about it.

    If, however, you want to send them a password anyway and don't mind about "dead" registrations, then you could just do the following two steps IN THAT ORDER:

    1) email password to all the users in the "Users Awaiting Email
    Confirmation"

    2) AFTER sending the e-mail, run a MySQL query via phpMyAdmin:

    Code:
    UPDATE user SET usergroupid='2' WHERE usergroupid='3' AND posts='0'
    Personally, I would recommend you delete all those accounts who are, say, one month old. If you want to do this, then run the following command BEFORE you do steps 1 and 2 mentioned above:

    Code:
    DELETE FROM user WHERE usergroupid='3' AND posts='0' AND joindate<'986500000'

    Comment


    • #17
      Thank you bira,
      I'll try that.

      Comment


      • #18
        Is this hack for rc1 or rc2 ?

        get a parsing error in register.php line 204 /207

        Comment


        • #19
          rc2

          Comment


          • #20
            lol than I must upgrade

            Comment


            • #21
              bira

              Thank you very very much

              It was a dream to have this hack

              I have RC1 and it is working wounderfull

              Comment


              • #22
                Glad to have helped, Remi

                Comment


                • #23
                  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.
                  Rob

                  Comment


                  • #24
                    RobAC, if you give me the URL to that hack, I'll check where they collide and how you can use them together.

                    Comment


                    • #25
                      Bira,

                      Here you go. Thanks!

                      http://www.vbulletin.com/forum/showt...threadid=13857
                      Rob

                      Comment


                      • #26
                        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) {
                            [color=red]if ($randpassword=="0") {[/color]
                                $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)."\";");
                            [color=red]} else {
                                eval("\$message = \"".gettemplate("email_lostpw",1,0)."\";");
                                eval("\$subject = \"".gettemplate("emailsubject_lostpw",1,0)."\";");   
                            }[/color]
                        
                            mail ($email,$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
                        
                          }
                        
                          [color=blue]// 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[/color]
                        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.

                        Comment


                        • #27
                          Bira,

                          I'll double check this....actually, you've made a good point here. Thanks.
                          Rob

                          Comment


                          • #28
                            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.
                            Rob

                            Comment


                            • #29
                              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.

                              Comment


                              • #30
                                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("[color=red]email_lostpw[/color]",1,0)."\";");
                                          eval("\$subject = \"".gettemplate("[color=red]emailsubject_lostpw[/color]",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
                                Last edited by bira; Wed 9 May '01, 4:37pm.

                                Comment

                                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                                Working...
                                X