<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
<!--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="de">Agree privacy at first login</title>
		<title lang="en">Agree privacy at first login</title>
		
		<description lang="en">At first login new users have to agree to the privacy policy of the board. If they negotiate they get logged out.
When they log in again they'll be asked again to agree.</description>

		<description lang="de">Benutzer müssen beim ersten Einloggen den Datenschutzbestimmungen des Boards zustimmen.
Machen sie dies nicht, dann werden sie wieder ausgeloggt. Beim nächsten Loginversuch müssen sie wieder zustimmen.</description>
		
		<author-notes lang="en">Inspired by the mod accept terms from tas2580</author-notes>
		<author-notes lang="de">Inspiriert durch die Mod accept terms von tas2580</author-notes>
		
		<author-group>
			<author>
				<realname>Daniel Metz</realname>
				<username>Metzle</username>

				<homepage>http://www.metzimods.de</homepage>
				<email>metzle@metzimods.de</email>
			</author>
		</author-group>	
		
		<mod-version>1.0.4</mod-version>
		
		<installation>
			<level>easy</level>
			<time>300</time>

			<target-version>3.0.8</target-version>
		</installation>

		<history>
			<entry>
				<date>2011-02-02</date>
				<rev-version>1.0.4</rev-version>
				<changelog lang="en">
					<change>Update MODX to 1.2.5 and repacking of Mod</change>
				</changelog>
				<changelog lang="de">
					<change>Update auf MODX 1.2.5 und die Mod neu verpackt</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-08-20</date>
				<rev-version>1.0.3</rev-version>
				<changelog lang="en">
					<change>Final release</change>
					<change>Corrects spelling mistakes</change>
					<change>Changed text in language files</change>
					<change>Little changes of description</change>
				</changelog>
				<changelog lang="de">
					<change>Vorerst letzte Veröffentlichung</change>
					<change>Rechtschreibfehler behoben</change>
					<change>Änderung in den Sprachdateien</change>
					<change>Kleine Änderungen an der Modbeschreibung</change>
				</changelog>
			</entry>	
			<entry>
				<date>2008-08-14</date>
				<rev-version>1.0.2</rev-version>
				<changelog lang="en">
					<change>Add possibility to force all users have to agree to privacy policy in the ACP</change>
					<change>Mod supports the mod version check by Handyman -> also look at DIY-Instructions</change>
				</changelog>	
				<changelog lang="de">
					<change>Möglichkeit im ACP hinzugefügt, dass alle Benutzer den Datenschutzbestimmungen zustimmen müssen</change>
					<change>Die Mod unterstützt nun auch die Mod Mod Version Check von Handyman -> siehe auch Manuelle Vorgänge</change>
				</changelog>
			</entry>	
			<entry>
				<date>2008-08-13</date>
				<rev-version>1.0.1</rev-version>
				<changelog lang="en">
					<change>mod added to zip-file</change>
					<change>little codechanges</change>
					<change>root deleted in the mod-file</change>
				</changelog>
				<changelog lang="de">
					<change>Mod wurde in eine zip-Datei verlegt</change>
					<change>kleinere Codeänderungen</change>
					<change>root Ordner gelöscht</change>
				</changelog>	
			</entry>		
			<entry>
				<date>2008-08-13</date>
				<rev-version>1.0.0</rev-version>
				<changelog lang="en">
					<change>First release</change>
				</changelog>
				<changelog lang="de">
					<change>Erste Veröffentlichung</change>
				</changelog>
			</entry>	
		</history>
		<link-group>
			<link type="language" href="contrib/language/de.xml" lang="en">Manual for german language pack</link>
			<link type="language" href="contrib/language/de.xml" lang="de">Anleitung für deutsches Sprachpaket</link>
			<link type="contrib" href="contrib/versioncheck/versioncheck.xml" lang="en">Install of Mod Version Check</link>
			<link type="contrib" href="contrib/versioncheck/versioncheck.xml" lang="de">Anleitung für Mod Version Check</link>
			<link type="contrib" href="contrib/update 1.0.0 to 1.0.1/1.0.0 to 1.0.1.xml" lang="en">Update from 1.0.0 to 1.0.1</link>
			<link type="contrib" href="contrib/update 1.0.0 to 1.0.1/1.0.0 to 1.0.1.xml" lang="de">Update von 1.0.0 auf 1.0.1</link>
			<link type="contrib" href="contrib/update 1.0.1 to 1.0.2/1.0.1 to 1.0.2.xml" lang="en">Update from 1.0.1 to 1.0.2</link>
			<link type="contrib" href="contrib/update 1.0.1 to 1.0.2/1.0.1 to 1.0.2.xml" lang="de">Update von 1.0.1 auf 1.0.2</link>
			<link type="contrib" href="contrib/update 1.0.2 to 1.0.3-Final/1.0.2 to 1.0.3-Final.xml" lang="en">Update from 1.0.2 to 1.0.3-Final</link>
			<link type="contrib" href="contrib/update 1.0.2 to 1.0.3-Final/1.0.2 to 1.0.3-Final.xml" lang="de">Update von 1.0.2 auf 1.0.3-Final</link>
			<link type="contrib" href="contrib/update 1.0.3 to 1.0.4/1.0.3 to 1.0.4.xml" lang="en">Update from 1.0.3 to 1.0.4</link>
			<link type="contrib" href="contrib/update 1.0.3 to 1.0.4/1.0.3 to 1.0.4.xml" lang="de">Update von 1.0.3 auf 1.0.4</link>
		</link-group>
	</header>
	
	<action-group>
		<sql><![CDATA[ALTER TABLE phpbb_users ADD user_agree_privacy SMALLINT( 1 ) NOT NULL DEFAULT '0';]]></sql>
		
		<open src="includes/functions.php">
			<edit>
				<find><![CDATA[	header('Pragma: no-cache');]]></find>
				<action type="after-add"><![CDATA[	//Begin agree to privacy on first login Mod
	if ($user->data['user_agree_privacy'] == 0 && $user->data['is_registered'] && !$user->data['is_bot'] && (request_var('mode', '') != 'privacy'))
	{
		if (confirm_box(true))
		{
			$sql = 'UPDATE ' . USERS_TABLE . "
				SET user_agree_privacy = '1'
				WHERE user_id = " . $user->data['user_id'];
			$db->sql_query($sql);
		}
		else
		{
			confirm_box(false, sprintf($user->lang['AGREE_PRIVACY'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy') . '">', '</a>'));
			header("Location: " . append_sid("{$phpbb_root_path}ucp.$phpEx?mode=logout&sid=" . $user->session_id));
		}
	}
	//End agree to privacy on first login Mod]]></action>
			</edit>
		</open>
		<open src="language/en/common.php">
			<edit>
				<find><![CDATA[	'AGE'							=> 'Age',]]></find>
				<action type="after-add"><![CDATA[	'AGREE_PRIVACY'					=> 'You have to agree to the %sprivacy policy%s before 1st login or you have to because of a change!',
	'AGREE_UPDATE'					=> 'Privacy policy agreement',
	'AGREE_UPDATE_EXPLAIN'			=> 'After clicking all users of your board have to agree to privacy policy',
	'RESET_PRIVACY'					=> 'All users have to agree to privacy policy to use their account',]]></action>
			</edit>
		</open>
		<open src="adm/style/acp_main.html">
			<edit>
				<find><![CDATA[			<form id="action_db_track_form" method="post" action="{U_ACTION}">
					<dl>
						<dt><label for="action_db_track">{L_RESYNC_POST_MARKING}</label><br /><span>{L_RESYNC_POST_MARKING_EXPLAIN}</span></dt>
						<dd><input type="hidden" name="action" value="db_track" /><input class="button2" type="submit" id="action_db_track" name="action_db_track" value="{L_RUN}" /></dd>
					</dl>
			</form>]]></find>
				<action type="after-add"><![CDATA[			<form id="action_privacy_form" method="post" action="{U_ACTION}">
				<dl>
					<dt><label for="action_privacy">{L_AGREE_UPDATE}</label><br /><span>{L_AGREE_UPDATE_EXPLAIN}</span></dt>
					<dd><input type="hidden" name="action" value="privacy" /><input class="button2" type="submit" id="action_user" name="action_user" value="{L_RUN}" /></dd>
				</dl>
			</form>]]></action>
			</edit>	
		</open>
		<open src="includes/acp/acp_main.php">
			<edit>
				<find><![CDATA[					case 'purge_cache':
						if ((int) $user->data['user_type'] !== USER_FOUNDER)]]></find>
				<action type="before-add"><![CDATA[					case 'privacy':
						$sql = 'UPDATE ' . USERS_TABLE . "
							SET user_agree_privacy = '0'
							WHERE user_agree_privacy = '1'";
						$db->sql_query($sql);
						add_log('admin', 'RESET_PRIVACY');
					break;]]></action>
			</edit>
		</open>	
		
		<diy-instructions lang="en">Purge cache!

If you want to see the current version of the mod install mod version check from Handyman. 
The mod is located at: http://startrekguide.com/forum/viewtopic.php?f=87&amp;t=3584</diy-instructions>
		
		<diy-instructions lang="de">Cache leeren!
		
Wenn ihr immer auf dem neusten Versionsstand sein wollt, dann installiert euch die Mod Mod Version Check von Handyman.
Die Mod findet ihr unter: http://startrekguide.com/forum/viewtopic.php?f=87&amp;t=3584</diy-instructions>
	</action-group>

</mod>

