vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   [HTL] and [Normal] Save Prior Email (https://vborg.vbsupport.ru/showthread.php?t=63745)

Hurricane 04-10-2004 10:00 PM

[HTL] and [Normal] Save Prior Email
 
Save Prior Email
Version: v1.0.1
vB-version: 3.0.0
Developer: Glenn H. Shelton III
Install difficulty: Easy
File edits: 3
Template edits: 0

Description of the Hack:
This hack allows you to save the prior email address of a user when they change it. This is one of the largest missing features I have found in vBulletin.

The issue I fought with is a user signing up using a legit email, trash posting, then changing the email address to a non-legit email account. This locks

them out as they can not activate the account, however, it does not let you find them easily. This will allow you to have a "legit" contact method.



Bug Fixes 04-11-2004
===========
Changed the original code to stop the "emailold" from being overwritten if the user was in "Awaiting Email Confirmation" group.


Files Have been updated.




HACK INSTALLATION DETAILS:
Files modified for this Hack:
profile.php
admin/user.php

New DB columns for this Hack:
user


Remember: If you use it, please click install! :)

AN-net 04-11-2004 05:44 AM

great idea!

Hurricane 04-11-2004 02:03 PM

Quote:

Originally Posted by AN-net
great idea!

Thank You.

I added a screen grab above.

KTBleeding 04-11-2004 05:33 PM

Def. a good hack, I'll be installing this once I get my board ready. :)

assassingod 04-11-2004 05:36 PM

What if the user changes their e-mail constantly? Does the original e-mail stay or is it over-written?

neocorteqz 04-11-2004 05:38 PM

Quote:

Originally Posted by assassingod
What if the user changes their e-mail constantly? Does the original e-mail stay or is it over-written?

good question. I installed it anyways. :) it's a good addition

Hurricane 04-11-2004 05:48 PM

Quote:

Originally Posted by assassingod
What if the user changes their e-mail constantly? Does the original e-mail stay or is it over-written?

The "emailold" is over written by "email" each time the user changes email addresses.

I did not realize a user can change their email even when they are "awaiting email confirmation." I will fix this and post it asap. ;)

Thanks everyone!

Boofo 04-11-2004 05:53 PM

Will this only save just the prior one or can it be set up to save ALL they change? Somewtimes they will do more than one if they are really trying to pull something. ;)

Hurricane 04-11-2004 06:17 PM

OK, here is the fix: (I updated the installer, but here is all you need to change.)

In the original install file, it says:
Code:

Find: (About Line: 330)

                $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET $newpassword $newemail usergroupid = " . intval($bbuserinfo['usergroupid']) . " WHERE userid = $bbuserinfo[userid]");

Replace With: (Make sure your "Awaiting Email Confirmation" usergroup id is equal to 3)

//Start Save Prior Email v1.0 // Written By: Glenn H. Shelton III
                $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET $newpassword $newemail $oldemail usergroupid = " . intval($bbuserinfo['usergroupid']) . " WHERE userid = $bbuserinfo[userid]");
//End Save Prior Email v1.0 // Written By: Glenn H. Shelton III

But Now it reads:
Code:

Find: (About Line: 330)

                $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET $newpassword $newemail usergroupid = " . intval($bbuserinfo['usergroupid']) . " WHERE userid = $bbuserinfo[userid]");


Replace With: (Make sure your "Awaiting Email Confirmation" usergroup id is equal to 3)

//Start Save Prior Email v1.0 // Written By: Glenn H. Shelton III
                if ($bbuserinfo['usergroupid'] != 3)
                {
                $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET $newpassword $newemail $oldemail usergroupid = " . intval($bbuserinfo['usergroupid']) . " WHERE userid = $bbuserinfo[userid]");
                } else {
                $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET $newpassword $newemail usergroupid = " . intval($bbuserinfo['usergroupid']) . " WHERE userid = $bbuserinfo[userid]");
                }
//End Save Prior Email v1.0 // Written By: Glenn H. Shelton III

@Bob: At this point it only stores the last confirmed email address. If there is enough of a request to store all email addresses of a user I will look into it. But the way it is now, once they confirm their account to post you know it is a valid email. When they change it the first time the "known good" email address is moved to the "emailold" spot and the new email is stored. If that account is not ever confirmed then the "known good" email stored in "emailold" will not be overwritten. If it is confirmed, it will over write the old "known good" with the new "known good" when they change it again.

Keep the feed back coming.

Boofo 04-11-2004 07:20 PM

Might not be a bad idea to have it as a drop down then older email address could be added to it very easily in case you ever run into that. I ran into in on my vB2 board but haven't yet so far on vb3, but I'm sure it's coming. ;)

gspot 04-12-2004 04:57 AM

Quote:

Originally Posted by Boofo
Might not be a bad idea to have it as a drop down then older email address could be added to it very easily in case you ever run into that. I ran into in on my vB2 board but haven't yet so far on vb3, but I'm sure it's coming. ;)

I like this hack, it has a ton of potential... Now a couple of questions. If you send out an email, will it email the old and the new email address for the member? or just the new email address? Also, when you search for a member, can you search by both email address's in order to find the same member??

Thanks. :)

Hurricane 04-12-2004 02:04 PM

Quote:

Originally Posted by gspot
I like this hack, it has a ton of potential... Now a couple of questions. If you send out an email, will it email the old and the new email address for the member? or just the new email address? Also, when you search for a member, can you search by both email address's in order to find the same member??

Thanks. :)


When you email the member, it will only email the new address. That way if a member has changed their email due to the old one being a bad email address, you will not be mailing to a bad email address.

You can not search it at this time. I did not think there would be a need for that feature, but I can put it on the list for future releases.

mtha 04-12-2004 10:48 PM

Quote:

Originally Posted by Hurricane
@Bob: At this point it only stores the last confirmed email address. If there is enough of a request to store all email addresses of a user I will look into it. But the way it is now, once they confirm their account to post you know it is a valid email. When they change it the first time the "known good" email address is moved to the "emailold" spot and the new email is stored. If that account is not ever confirmed then the "known good" email stored in "emailold" will not be overwritten. If it is confirmed, it will over write the old "known good" with the new "known good" when they change it again.

Keep the feed back coming.

:) actually, you can save OLD EMAIL as it's a log table. for every single change in email address, you just ADD (not replace) the new "old email address" into the "old email addresses" list.

And it's simple enough, just load the old email list from database, and add newemaillist= oldemail + oldemaillist;

admin dont need to verify addresses, they just need to read the first or last email address in the list.

If i were you, i would add the oldemail = userfield, using ACP userfield tool.

anyway, good one.

Boofo 04-13-2004 12:41 AM

Quote:

Originally Posted by mtha
:) actually, you can save OLD EMAIL as it's a log table. for every single change in email address, you just ADD (not replace) the new "old email address" into the "old email addresses" list.

And it's simple enough, just load the old email list from database, and add newemaillist= oldemail + oldemaillist;

admin dont need to verify addresses, they just need to read the first or last email address in the list.

If i were you, i would add the oldemail = userfield, using ACP userfield tool.

anyway, good one.

Can you show me how to do this in pm?

mtha 04-13-2004 06:05 AM

Mod description:
- Add OldEmail to OldEmailList if user change email (or password)

File to edit: 1
Template to edit: 0
Template to add: 0
ProfileField to add: 1

Version: vB 3.0.0

Credit: Glenn H. Shelton III, who wrote the Save Prior Email hack


(Sorry Glenn, hope you dont my me adding this hack on yours. If you do, let me know, I will remove it right away :) )

Hurricane 04-05-2005 07:08 PM

Quote:

Originally Posted by mtha
(Sorry Glenn, hope you dont my me adding this hack on yours. If you do, let me know, I will remove it right away :) )

I have been gone from here for quite sometime. No harm no foul on this mod. I will add it to the original install file as I feel it is a great addition.

Thanks.

mtha 04-05-2005 08:01 PM

Quote:

Originally Posted by Hurricane
I have been gone from here for quite sometime. No harm no foul on this mod. I will add it to the original install file as I feel it is a great addition.

Thanks.

:)

In mine, you only need to edit 1 file, no change in database. 2 additional queries run when update profile

Hurricane 04-05-2005 08:13 PM

Yes, I realized that after I posted. I like it. It makes it much easier. I will update the hack. ;) Thanks again.

Boofo 04-05-2005 08:55 PM

Any way to remove the trailing comma on the emails line? ;)


All times are GMT. The time now is 04:46 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.01258 seconds
  • Memory Usage 1,785KB
  • 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
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)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