############################################### ## Hack Title: Force Email Update ## Hack Version: 1.0.0 ## Author: Majorflam ## ## Description: If you ever get emails "bounced back" because a user's email address is no longer valid, ## This hack will give you the option to force the user to change their email address in their profile. ## Until they change their email address, they will have no ability to post on your forums, ## and no access to the PM system. The user is forced by admin, when the admin selects the option ## in the user edit facilty in the Admin CP. When forced to change email address, the user will not ## recieve any more email notification of PM's, and they will not be able to watch any topics. ## ## Included with this Mod, is an email search facility, where you can enter an email address and ## find which user has registered with it. It will be added to the Admin CP, under User Management. ## ## Compatibility: 2.0.6 ## ## Installation Level: Easy ## Installation Time: 10 minutes ## Files To Edit: <8> ## ## admin/admin_users.php ## includes/usercp_register.php ## language/lang_english/lang_admin.php ## templates/subSilver/admin/user_edit_body.tpl ## templates/subSilver/admin/user_select_body.tpl ## posting.php ## privmsg.php ## viewtopic.php ## ## Included Files: <3> ## ## admin/admin_email_search.php ## templates/subSilver/admin/admin_email_search.tpl ## db_update.php ## ## History: ## Version 1.0.0: Initial Release ## ## Author Notes: ## N.B. Please back-up all files related to this Mod, before attempting any edits. ## ## Support: ## Copyright: ©2004 Force Email Update Mod 1.0.0 - Majorflam ## ############################################### ## You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads. ## Please visit http://www.phpbbhacks.com/forums for support. ############################################### ## ############################################### ## This hack is released under the GPL License. ## This hack can be freely used, but not distributed, without permission. ## Intellectual Property is retained by the hack author(s) listed above. ############################################### ## ## ## # #-----[ COPY ]------------------------------------------ # admin/admin_email_search.php templates/subSilver/admin/admin_email_search.tpl db_update.php ## ## Database Changes ## ## 1) Run db_update.php from your web broswer to make the table changes (you must be logged in as an Administrator). ## 2) Delete db_update.php. ## 3) Read below to make the rest of the changes. ## # #-----[ OPEN ]------------------------------------------ # admin/admin_users.php # #-----[ FIND ]------------------------------------------ # $user_allowpm = ( !empty($HTTP_POST_VARS['user_allowpm']) ) ? intval( $HTTP_POST_VARS['user_allowpm'] ) : 0; # #-----[ AFTER, ADD ]------------------------------------------ # // force email update mod $email_validation = ( !empty($HTTP_POST_VARS['email_validation']) ) ? intval( $HTTP_POST_VARS['email_validation'] ) : 0; // end force email update mod # #-----[ FIND ]------------------------------------------ # // // Update entry in DB // if( !$error ) { # #-----[ AFTER, ADD ]------------------------------------------ # //force email update mod if ( $email_validation == 1 ) { $user_id = $this_userdata['user_id']; $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " WHERE user_id = $user_id"; if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not delete topic watch information for forced email validation', '', __LINE__, __FILE__, $sql); } $notifypm = 0; } //end force email update mod # #-----[ FIND ]------------------------------------------ # # actual line is much longer... # $sql = "UPDATE " . USERS_TABLE . " SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_ # #-----[ IN LINE, FIND ]------------------------------------------ # , user_allow_pm = $user_allowpm # #-----[ IN LINE, AFTER ADD ]------------------------------------------ # , email_validation = $email_validation # #-----[ FIND ]------------------------------------------ # $user_allowpm = $this_userdata['user_allow_pm']; # #-----[ AFTER, ADD ]------------------------------------------ # // force email update mod $email_validation = $this_userdata['email_validation']; // end force email update mod # #-----[ FIND ]------------------------------------------ # $s_hidden_fields .= ''; # #-----[ AFTER, ADD ]------------------------------------------ # // force email update mod $s_hidden_fields .= ''; // end force email update mod # #-----[ FIND ]------------------------------------------ # 'ALLOW_PM_YES' => ($user_allowpm) ? 'checked="checked"' : '', 'ALLOW_PM_NO' => (!$user_allowpm) ? 'checked="checked"' : '', # #-----[ AFTER, ADD ]------------------------------------------ # // force email update mod 'EMAIL_VALIDATION_YES' => ($email_validation) ? 'checked="checked"' : '', 'EMAIL_VALIDATION_NO' => (!$email_validation) ? 'checked="checked"' : '', // end force email update mod # #-----[ FIND ]------------------------------------------ # 'L_USER_ACTIVE' => $lang['User_status'], 'L_ALLOW_PM' => $lang['User_allowpm'], # #-----[ AFTER, ADD ]------------------------------------------ # // force email update mod 'L_EMAIL_VALIDATION' => $lang['email_validation'], // end force email update mod # #-----[ FIND ]------------------------------------------ # 'L_LOOK_UP' => $lang['Look_up_user'], 'L_FIND_USERNAME' => $lang['Find_username'], # #-----[ AFTER, ADD ]------------------------------------------ # // force email update mod 'FORCEEMAIL_USERNAME' => stripslashes($HTTP_GET_VARS['forceemail_username']), // end force email update mod # #-----[ OPEN ]------------------------------------------ # includes/usercp_register.php # #-----[ FIND ]------------------------------------------ # # The actual line is much longer # $sql = "UPDATE " . USERS_TABLE . " SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = # #-----[ BEFORE, ADD ]------------------------------------------ # // force email update mod if ( $userdata['email_validation'] == 1 ) { if ( $userdata['user_email'] == str_replace("\'", "''", $email) ) { $notifypm = 0; } else { $sql = "UPDATE " . USERS_TABLE . " SET email_validation=0 WHERE user_id = $user_id"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not update users table for email validation', '', __LINE__, __FILE__, $sql); } } } // end force email update mod # #-----[ OPEN ]------------------------------------------ # language/lang_english/lang_admin.php # #-----[ FIND ]------------------------------------------ # // // That's all Folks! // ------------------------------------------------- # #-----[ BEFORE, ADD ]------------------------------------------ # // force email update mod $lang['email_validation'] = "Force User To Submit New Email Address"; $lang['email_update_search_header'] = "Force Email Update - Email Search"; $lang['email_update_search_explain'] = "Here, you can enter an email address to find which user registered with it. When you click Submit Search, the page will refresh with the information. Simply click on the username, to edit their profile."; $lang['email_update_search_detailshead'] = "Enter An Email To Find A User"; $lang['email_update_search_emailhead'] = "Email To Search"; $lang['email_update_search_userhead'] = "Username This Email Belongs To"; // end force email update mod # #-----[ OPEN ]------------------------------------------ # templates/subSilver/admin/user_edit_body.tpl # #-----[ FIND ]------------------------------------------ # {L_ALLOW_PM} {L_YES}   {L_NO} # #-----[ AFTER, ADD ]------------------------------------------ # {L_EMAIL_VALIDATION} {L_YES}   {L_NO} # #-----[ OPEN ]------------------------------------------ # templates/subSilver/admin/user_select_body.tpl # #-----[ FIND ]------------------------------------------ # input type="text" class="post" name="username" maxlength="50" size="20" # #-----[ AFTER, ADD ]------------------------------------------ # value="{FORCEEMAIL_USERNAME}" # #-----[ OPEN ]------------------------------------------ # posting.php # #-----[ FIND ]------------------------------------------ # // // End session management // # #-----[ AFTER, ADD ]------------------------------------------ # // force email update mod if ( $userdata['email_validation'] == 1 ) { message_die(GENERAL_MESSAGE, "Your ability to post on the board has been temporarily disabled. This is because the email address in your profile is invalid. Please go to your Profile, and update your email address.", "", "", "", ""); } // end force email update mod # #-----[ OPEN ]------------------------------------------ # privmsg.php # #-----[ FIND ]------------------------------------------ # // // End session management // # #-----[ AFTER, ADD ]------------------------------------------ # // force email update mod if ( $userdata['email_validation'] == 1 ) { message_die(GENERAL_MESSAGE, "Your ability to use the Private Messaging System has been temporarily disabled. This is because the email address in your profile is invalid. Please go to your Profile, and update your email address.", "", "", "", ""); } // end force email update mod # #-----[ OPEN ]------------------------------------------ # viewtopic.php # #-----[ FIND ]------------------------------------------ # // // Topic watch information // # #-----[ AFTER, ADD ]------------------------------------------ # // force email update mod if ( $userdata['email_validation'] == 0 ) { // end force email update mod # #-----[ FIND ]------------------------------------------ # $s_watching_topic_img = ( isset($images['Topic_watch']) ) ? "' . $lang['Start_watching_topic'] . '' : ''; } } # #-----[ AFTER, ADD ]------------------------------------------ # // force email update mod } // end force email update mod # #-----[Mod End]---------------------------------------------- #