<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="./contrib/xsl/modx.prosilver.en.xsl"?>
<!--
	NOTICE: Please open this file in your web browser. If presented with a security warning, you may safely tell it to allow the blocked content.
-->
<!--For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD. Although MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD. No support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
	<header>
		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
		<title lang="en">Prime Update E-Mail</title>
	<description lang="en">Allows an administrator to stop board e-mails from being sent to a user until they update their e-mail address.</description>
		<author-notes lang="en">Support is given for both prosilver and subsilver2 templates. If you are using other templates then you will need to modify the template instructions to fit your templates.

Creating, maintaining, and updating MODs requires a lot of time and effort, so if you like this MOD and have the desire to express your thanks through a donation, that would be greatly appreciated. My Paypal ID is primehalo@gmail.com, or contact me for my mailing address. The suggested donation amount for this MOD is $5.00 (but any amount will help).</author-notes>
		<author-group>
			<author>
				<realname>Ken F. Innes IV</realname>
				<email>primehalo@gmail.com</email>
				<username>primehalo</username>
				<homepage><![CDATA[http://www.absoluteanime.com/admin/mods.htm#update_email]]></homepage>
			</author>
		</author-group>
		<mod-version>1.0.1</mod-version>
		<installation>
			<level>easy</level>
			<time>600</time>
			<target-version>3.0.10</target-version>
		</installation>
		<history>
			<entry>
				<date>2009-03-25</date>
				<rev-version>0.0.0</rev-version>
				<changelog lang="en">
					<change>Initial release</change>
				</changelog>
			</entry>
			<entry>
				<date>2009-12-01</date>
				<rev-version>0.0.0a</rev-version>
				<changelog lang="en">
					<change>Updated installation instructions for phpBB 3.0.6.</change>
				</changelog>
			</entry>
			<entry>
				<date>2010-07-09</date>
				<rev-version>1.0.0</rev-version>
				<changelog lang="en">
					<change>Added a list to the Users &amp; Groups page of the ACP that displays all users who have been requested to update their e-mail addresses.</change>
				</changelog>
			</entry>
			<entry>
				<date>2010-11-18</date>
				<rev-version>1.0.0a</rev-version>
				<changelog lang="en">
					<change>Added a German translation.</change>
				</changelog>
			</entry>
			<entry>
				<date>2012-02-20</date>
				<rev-version>1.0.1</rev-version>
				<changelog lang="en">
					<change>Fixed a typo in the prime_update_email.php file.</change>
					<change>Added a Russian translation.</change>
				</changelog>
			</entry>
		</history>
		<link-group>
			<link type="language" href="contrib/language - de.xml" realname="de" lang="en">German</link>
			<link type="language" href="contrib/language - ru.xml" realname="ru" lang="en">Russian</link>
		</link-group>
	</header>
	<action-group>
		<sql><![CDATA[ALTER TABLE phpbb_users ADD COLUMN user_update_email tinyint(4) DEFAULT '0' NOT NULL;]]></sql>

		<copy>
 			<file from="root/includes/prime_update_email.php" to="includes/prime_update_email.php" />
 			<file from="root/language/en/mods/prime_update_email.php" to="language/en/mods/prime_update_email.php" />
 			<file from="root/language/en/mods/info_acp_prime_update_email.php" to="language/en/mods/info_acp_prime_update_email.php" />
 			<file from="root/includes/acp/acp_prime_update_email.php" to="includes/acp/acp_prime_update_email.php" />
 			<file from="root/includes/acp/info/acp_prime_update_email.php" to="includes/acp/info/acp_prime_update_email.php" />
 			<file from="root/adm/style/acp_prime_update_email.html" to="adm/style/acp_prime_update_email.html" />
		</copy>

		<open src="includes/functions_admin.php">
			<edit>
				<find><![CDATA[	$topic_id_list = $reportee_id_list = $is_auth = $is_mod = array();]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Update E-Mail -----------------------------------------------//
// Add our language file for logs.
		$user->add_lang('mods/prime_update_email');
//-- end: Prime Update E-Mail -----------------------------------------------//]]></action>
			</edit>
		</open>

		<open src="includes/functions_posting.php">
			<edit>
				<find><![CDATA[			AND u.user_id = w.user_id';]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Update E-Mail -----------------------------------------------//
// Don't select users that need to update their e-mail address.
	include($phpbb_root_path . 'includes/prime_update_email.' . $phpEx);
	$prime_update_email->skip_bad_emails($sql, 'u');
//-- end: Prime Update E-Mail -----------------------------------------------//]]></action>
			</edit>
			<edit>
				<find><![CDATA[				AND u.user_id = fw.user_id';]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Update E-Mail -----------------------------------------------//
// Don't select users that need to update their e-mail address.
		$prime_update_email->skip_bad_emails($sql, 'u');
//-- end: Prime Update E-Mail -----------------------------------------------//]]></action>
			</edit>
		</open>

		<open src="includes/functions_privmsgs.php">
			<edit>
				<find><![CDATA[		WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($recipients)));]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Update E-Mail -----------------------------------------------//
// Don't select users that need to update their e-mail address.
	include($phpbb_root_path . 'includes/prime_update_email.' . $phpEx);
	$prime_update_email->skip_bad_emails($sql);
//-- end: Prime Update E-Mail -----------------------------------------------//]]></action>
			</edit>
		</open>

		<open src="includes/session.php">
			<edit>
				<find><![CDATA[				redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&amp;mode=reg_details'));
			}
		}]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Update E-Mail -----------------------------------------------//
// If user is required to update their e-mail address then take them to the correct page.
		include($phpbb_root_path . 'includes/prime_update_email.' . $phpEx);
		$prime_update_email->require_update();
//-- end: Prime Update E-Mail -----------------------------------------------//]]></action>
			</edit>
		</open>

		<open src="includes/acp/acp_users.php">
			<edit>
				<find><![CDATA[					switch ($action)
					{]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Update E-Mail -----------------------------------------------//
						case 'request_update_email':
						case 'cancel_update_email':
							include($phpbb_root_path . 'includes/prime_update_email.' . $phpEx);
							$prime_update_email->acp_request_update($action, $user_row, $this->u_action);
						break;
//-- end: Prime Update E-Mail -----------------------------------------------//]]></action>
			</edit>

			<edit>
				<find><![CDATA[						$quick_tool_ary['reactivate'] = 'FORCE';
					}]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Update E-Mail -----------------------------------------------//
//Add the option to the ACP User Quick Tools.
					include($phpbb_root_path . 'includes/prime_update_email.' . $phpEx);
					$prime_update_email->acp_quick_tools($quick_tool_ary, $user_row);
//-- end: Prime Update E-Mail -----------------------------------------------//]]></action>
			</edit>
		</open>

		<open src="includes/mcp/mcp_reports.php">
			<edit>
				<find><![CDATA[				AND r.user_id = u.user_id' . $pm_where;]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Update E-Mail -----------------------------------------------//
		include($phpbb_root_path . 'includes/prime_update_email.' . $phpEx);
		$prime_update_email->include_field_user_update_email($sql, 'u');
//-- end: Prime Update E-Mail -----------------------------------------------//]]></action>
			</edit>

			<edit>
				<find><![CDATA[				if ($reporter['user_id'] == ANONYMOUS)]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Update E-Mail -----------------------------------------------//
// Skip users that need to update their e-mail address.
				if (!empty($reporter['user_update_email']))
				{
					continue;
				}
//-- end: Prime Update E-Mail -----------------------------------------------//]]></action>
			</edit>
		</open>

		<open src="includes/ucp/ucp_groups.php">
			<edit>
				<find><![CDATA[										AND ug.group_id = $group_id";]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Update E-Mail -----------------------------------------------//
// Don't select users that need to update their e-mail address.
								include($phpbb_root_path . 'includes/prime_update_email.' . $phpEx);
								$prime_update_email->skip_bad_emails($sql, 'u');
//-- end: Prime Update E-Mail -----------------------------------------------//]]></action>
			</edit>
		</open>

		<open src="includes/ucp/ucp_profile.php">
			<edit>
				<find><![CDATA[			case 'reg_details':]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Update E-Mail -----------------------------------------------//
// Alert user that they need to update their e-mail address.
				include($phpbb_root_path . 'includes/prime_update_email.' . $phpEx);
				$prime_update_email->alert_user($error);
//-- end: Prime Update E-Mail -----------------------------------------------//]]></action>
			</edit>

			<edit>
				<find><![CDATA[							add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_EMAIL', $data['username'], $user->data['user_email'], $data['email']);]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Update E-Mail -----------------------------------------------//
// The user has changed their email address, so we reset the flag.
							$prime_update_email->reset_flag($sql_ary);
//-- end: Prime Update E-Mail -----------------------------------------------//]]></action>
			</edit>
		</open>

		<diy-instructions lang="en">As an alternative to manually executing the SQL statements, you can use the included
"db_install.php" (located in the contrib directory). Simply copy the file to the root
directory of your phpbb3 install, and point your web browser to the address. Make
sure you are logged in as an administrator before you do this, and make sure to
delete the file once you're done.

Go to the Users section of the Module Management area of the ACP and add the "Inactive
E-Mail Accounts" module by selecting it from the dropdown list and clicking the "Add
module" button. After that, click the "Enable" link next to activate it.</diy-instructions>
	</action-group>
</mod>
