[vhffs-dev] [1664] ported VHFFS PunBB patch to PunBB 1.3.5, I have exhausted my yearly PHP safe dose...

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1664
Author:   gradator
Date:     2011-04-17 23:05:41 +0200 (Sun, 17 Apr 2011)
Log Message:
-----------
ported VHFFS PunBB patch to PunBB 1.3.5, I have exhausted my yearly PHP safe dose...

Modified Paths:
--------------
    trunk/vhffs-forum/Makefile.am

Added Paths:
-----------
    trunk/vhffs-forum/README
    trunk/vhffs-forum/punbb-1.3.5_vhffs.patch

Removed Paths:
-------------
    trunk/vhffs-forum/punbb-1.2.14_vhffs.patch
    trunk/vhffs-forum/punbb-1.2.15_vhffs.patch
    trunk/vhffs-forum/punbb-1.2.22_loginlength.path

Modified: trunk/vhffs-forum/Makefile.am
===================================================================
--- trunk/vhffs-forum/Makefile.am	2011-04-17 13:56:20 UTC (rev 1663)
+++ trunk/vhffs-forum/Makefile.am	2011-04-17 21:05:41 UTC (rev 1664)
@@ -2,7 +2,7 @@
 
 forumdir=@EXTRADIR@/forum
 dist_forum_DATA=antibot.tar.bz2 \
-	punbb-1.2.14_vhffs.patch \
-	punbb-1.2.15_vhffs.patch
+	punbb-1.3.5_vhffs.patch \
+	README
 
 endif

Added: trunk/vhffs-forum/README
===================================================================
--- trunk/vhffs-forum/README	                        (rev 0)
+++ trunk/vhffs-forum/README	2011-04-17 21:05:41 UTC (rev 1664)
@@ -0,0 +1,57 @@
+VHFFS PunBB patch by
+  Samuel Lesueur <crafty@xxxxxxxxxxxxx>
+  Sylvain Rochet <gradator@xxxxxxxxxxxx>
+
+
+
+The VHFFS patch needs some extra files for the antibot system. just copy 
+the 'antibot' directory in the 'img' folder of your new PunBB 
+installation
+
+
+Modifications:
+
+- login.php :
+
+	- New strings to explain login conditions
+	- Connection on VHFFS database
+	- Auth using VHFFS database
+	- Verification of user status in VHFFS database
+	- Create new user in PunBB Database with informations fetched 
+	  from VHFFS database
+	- Update user in PunBB Database with informations fetched from
+	  VHFFS database
+	- Lost password redirection to VHFFS panel
+	- Bad password redirection to VHFFS panel
+
+- include/dblayer/vhffs.php :
+
+	New DB class to connect to the VHFFS database
+	(based on pgsql.php PunBB class)
+
+- register.php :
+
+	- Redirection to VHFFS panel
+
+- profile.php :
+
+	- Restrictions on Username modifications and redirection to 
+	  VHFFS panel
+	- Restrictions on Mail modifications and redirection to VHFFS panel
+ 	- Restrictions on Real name modifications (Real name is fetched 
+	  from VHFFS database)
+
+- post.php:
+
+	-Anti bot system : capcha on public forums
+
+- footer.php :
+
+	- VHFFS powered link
+
+- lang/English/post.php
+	
+	- added strings for antibot
+
+
+Please visit http://www.vhffs.org for support and new versions

Deleted: trunk/vhffs-forum/punbb-1.2.14_vhffs.patch
===================================================================
--- trunk/vhffs-forum/punbb-1.2.14_vhffs.patch	2011-04-17 13:56:20 UTC (rev 1663)
+++ trunk/vhffs-forum/punbb-1.2.14_vhffs.patch	2011-04-17 21:05:41 UTC (rev 1664)
@@ -1,1417 +0,0 @@
-diff -Nru a/upload/VHFFS_PATCH-1.0_Changelog b/upload/VHFFS_PATCH-1.0_Changelog
---- a/upload/VHFFS_PATCH-1.0_Changelog	1970-01-01 01:00:00.000000000 +0100
-+++ b/upload/VHFFS_PATCH-1.0_Changelog	2006-10-29 21:06:01.000000000 +0100
-@@ -0,0 +1,38 @@
-+VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-+Version 1.0
-+
-+- login.php :
-+
-+	- New strings to explain login conditions
-+	- Connexion on VHFFS database
-+	- Auth by encrypt_md5 using VHFFS database
-+	- Verifying Object status in VHFFS database
-+	- Creating new user in PunBB Database with informations fetched from VHFFS database
-+	- Lost password redirection to VHFFS panel
-+	- Bad password redirection to VHFFS panel
-+
-+- vhffs_db.php :
-+
-+	New fontend for simultaneous Db connections (based on original pgsql.php)
-+
-+- register.php :
-+
-+	- Redirection to VHFFS panel
-+
-+- profile.php :
-+
-+	- Restrictions on Username modifications and redirection to VHFFS panel
-+	- Restrictions on Mail modifications and redirection to VHFFS panel
-+ 	- Restrictions on Real name modifications (Real name is fetched from VHFFS database)
-+
-+- footer.php :
-+
-+	- VHFFS powered link
-+
-+- install.php:
-+
-+	- Including VHFFS database configuration in config file
-+	- Including VHFFS <-> PunBB link options in config file 
-+
-+Please visit http://www.vhffs.org for support and new versions
-diff -Nru a/upload/footer.php b/upload/footer.php
---- a/upload/footer.php	2005-07-07 20:44:42.000000000 +0200
-+++ b/upload/footer.php	2006-10-29 21:06:01.000000000 +0100
-@@ -3,6 +3,8 @@
- 
-   Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
- 
-+  VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-   This file is part of PunBB.
- 
-   PunBB is free software; you can redistribute it and/or modify it
-@@ -106,7 +108,7 @@
- }
- 
- ?>
--			<p class="conr">Powered by <a href="http://www.punbb.org/";>PunBB</a><?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['o_cur_version']; ?><br />&copy; Copyright 2002&#8211;2005 Rickard Andersson</p>
-+			<p class="conr">Powered by <a href="http://www.punbb.org/";>PunBB</a> and <a href="http://www.vhffs.org/";>VHFFS</a><?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['o_cur_version']; ?><br />&copy; Copyright 2002&#8211;2005 Rickard Andersson</p>
- <?php
- 
- // Display debug info (if enabled/defined)
-diff -Nru a/upload/include/dblayer/vhffs_db.php b/upload/include/dblayer/vhffs_db.php
---- a/upload/include/dblayer/vhffs_db.php	1970-01-01 01:00:00.000000000 +0100
-+++ b/upload/include/dblayer/vhffs_db.php	2006-10-29 21:06:01.000000000 +0100
-@@ -0,0 +1,269 @@
-+<?php
-+/***********************************************************************
-+
-+  Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
-+
-+  VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-+  This file is part of PunBB.
-+
-+  PunBB is free software; you can redistribute it and/or modify it
-+  under the terms of the GNU General Public License as published
-+  by the Free Software Foundation; either version 2 of the License,
-+  or (at your option) any later version.
-+
-+  PunBB is distributed in the hope that it will be useful, but
-+  WITHOUT ANY WARRANTY; without even the implied warranty of
-+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+  GNU General Public License for more details.
-+
-+  You should have received a copy of the GNU General Public License
-+  along with this program; if not, write to the Free Software
-+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+  MA  02111-1307  USA
-+
-+************************************************************************/
-+
-+
-+// Make sure we have built in support for PostgreSQL
-+if (!function_exists('pg_connect'))
-+	exit('This PHP environment doesn\'t have PostgreSQL support built in. PostgreSQL support is required if you want to use a PostgreSQL database to run this forum. Consult the PHP documentation for further assistance.');
-+
-+
-+class vhffs_DBLayer
-+{
-+	var $prefix;
-+	var $link_id;
-+	var $query_result;
-+	var $last_query_text = array();
-+	var $in_transaction = 0;
-+
-+	var $saved_queries = array();
-+	var $num_queries = 0;
-+
-+	var $error_no = false;
-+	var $error_msg = 'Unknown';
-+
-+
-+	function vhffs_DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
-+	{
-+		$this->prefix = $db_prefix;
-+
-+		if ($db_host != '')
-+		{
-+			if (strpos($db_host, ':') !== false)
-+			{
-+				list($db_host, $dbport) = explode(':', $db_host);
-+				$connect_str[] = 'host='.$db_host.' port='.$dbport;
-+			}
-+			else
-+			{
-+				if ($db_host != 'localhost')
-+					$connect_str[] = 'host='.$db_host;
-+			}
-+		}
-+
-+		if ($db_name)
-+			$connect_str[] = 'dbname='.$db_name;
-+
-+		if ($db_username != '')
-+			$connect_str[] = 'user='.$db_username;
-+
-+		if ($db_password != '')
-+			$connect_str[] = 'password='.$db_password;
-+
-+		if ($p_connect)
-+			$this->link_id = @pg_pconnect(implode(' ', $connect_str));
-+		else
-+			$this->link_id = @pg_connect(implode(' ', $connect_str));
-+
-+		if (!$this->link_id)
-+			error('Unable to connect to VHFFS\'s PostgreSQL server verify connection settings...', __FILE__, __LINE__);
-+		else
-+			return $this->link_id;
-+	}
-+
-+
-+	function start_transaction()
-+	{
-+		++$this->in_transaction;
-+
-+		return (@pg_query($this->link_id, 'BEGIN')) ? true : false;
-+	}
-+
-+
-+	function end_transaction()
-+	{
-+		--$this->in_transaction;
-+
-+		if (@pg_query($this->link_id, 'COMMIT'))
-+			return true;
-+		else
-+		{
-+			@pg_query($this->link_id, 'ROLLBACK');
-+			return false;
-+		}
-+	}
-+
-+
-+	function query($sql, $unbuffered = false)	// $unbuffered is ignored since there is no pgsql_unbuffered_query()
-+	{
-+		if (strrpos($sql, 'LIMIT') !== false)
-+			$sql = preg_replace('#LIMIT ([0-9]+),([ 0-9]+)#', 'LIMIT \\2 OFFSET \\1', $sql);
-+
-+		if (defined('PUN_SHOW_QUERIES'))
-+			$q_start = get_microtime();
-+
-+		@pg_send_query($this->link_id, $sql);
-+		$this->query_result = @pg_get_result($this->link_id);
-+
-+		if (pg_result_status($this->query_result) != PGSQL_FATAL_ERROR)
-+		{
-+			if (defined('PUN_SHOW_QUERIES'))
-+				$this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start));
-+
-+			++$this->num_queries;
-+
-+			$this->last_query_text[$this->query_result] = $sql;
-+
-+			return $this->query_result;
-+		}
-+		else
-+		{
-+			if (defined('PUN_SHOW_QUERIES'))
-+				$this->saved_queries[] = array($sql, 0);
-+
-+			$this->error_msg = @pg_result_error($this->query_result);
-+
-+			if ($this->in_transaction)
-+				@pg_query($this->link_id, 'ROLLBACK');
-+
-+			--$this->in_transaction;
-+
-+			return false;
-+		}
-+	}
-+
-+
-+	function result($query_id = 0, $row = 0)
-+	{
-+		return ($query_id) ? @pg_fetch_result($query_id, $row, 0) : false;
-+	}
-+
-+
-+	function fetch_assoc($query_id = 0)
-+	{
-+		return ($query_id) ? @pg_fetch_assoc($query_id) : false;
-+	}
-+
-+
-+	function fetch_row($query_id = 0)
-+	{
-+		return ($query_id) ? @pg_fetch_row($query_id) : false;
-+	}
-+
-+
-+	function num_rows($query_id = 0)
-+	{
-+		return ($query_id) ? @pg_num_rows($query_id) : false;
-+	}
-+
-+
-+	function affected_rows()
-+	{
-+		return ($this->query_result) ? @pg_affected_rows($this->query_result) : false;
-+	}
-+
-+
-+	function insert_id()
-+	{
-+		$query_id = $this->query_result;
-+
-+		if ($query_id && $this->last_query_text[$query_id] != '')
-+		{
-+			if (preg_match('/^INSERT INTO ([a-z0-9\_\-]+)/is', $this->last_query_text[$query_id], $table_name))
-+			{
-+				// Hack (don't ask)
-+				if (substr($table_name[1], -6) == 'groups')
-+					$table_name[1] .= '_g';
-+
-+				$temp_q_id = @pg_query($this->link_id, 'SELECT currval(\''.$table_name[1].'_id_seq\')');
-+				return ($temp_q_id) ? intval(@pg_fetch_result($temp_q_id, 0)) : false;
-+			}
-+		}
-+
-+		return false;
-+	}
-+
-+
-+	function get_num_queries()
-+	{
-+		return $this->num_queries;
-+	}
-+
-+
-+	function get_saved_queries()
-+	{
-+		return $this->saved_queries;
-+	}
-+
-+
-+	function free_result($query_id = false)
-+	{
-+		if (!$query_id)
-+			$query_id = $this->query_result;
-+
-+		return ($query_id) ? @pg_free_result($query_id) : false;
-+	}
-+
-+
-+	function escape($str)
-+	{
-+		return pg_escape_string($str);
-+	}
-+
-+
-+	function error()
-+	{
-+		$result['error_sql'] = @current(@end($this->saved_queries));
-+		$result['error_no'] = false;
-+/*
-+		if (!empty($this->query_result))
-+		{
-+			$result['error_msg'] = trim(@pg_result_error($this->query_result));
-+			if ($result['error_msg'] != '')
-+				return $result;
-+		}
-+
-+		$result['error_msg'] = (!empty($this->link_id)) ? trim(@pg_last_error($this->link_id)) : trim(@pg_last_error());
-+*/
-+		$result['error_msg'] = $this->error_msg;
-+
-+		return $result;
-+	}
-+
-+
-+	function close()
-+	{
-+		if ($this->link_id)
-+		{
-+			if ($this->in_transaction)
-+			{
-+				if (defined('PUN_SHOW_QUERIES'))
-+					$this->saved_queries[] = array('COMMIT', 0);
-+
-+				@pg_query($this->link_id, 'COMMIT');
-+			}
-+
-+			if ($this->query_result)
-+				@pg_free_result($this->query_result);
-+
-+			return @pg_close($this->link_id);
-+		}
-+		else
-+			return false;
-+	}
-+}
-+
-+$vhffs_db = new vhffs_DBLayer($vhffs_db_host, $vhffs_db_username, $vhffs_db_password, $vhffs_db_name, $vhffs_db_prefix, $vhffs_p_connect);
-+
-diff -Nru a/upload/install.php b/upload/install.php
---- a/upload/install.php	2006-10-15 20:40:20.000000000 +0200
-+++ b/upload/install.php	2006-10-29 21:06:01.000000000 +0100
-@@ -3,6 +3,8 @@
- 
-   Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
- 
-+  VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-   This file is part of PunBB.
- 
-   PunBB is free software; you can redistribute it and/or modify it
-@@ -119,7 +121,7 @@
- 	<h2><span>PunBB Installation</span></h2>
- 	<div class="box">
- 		<div class="inbox">
--			<p>Welcome to PunBB installation! You are about to install PunBB. In order to install PunBB you must complete the form set out below. If you encounter any difficulties with the installation, please refer to the documentation.</p>
-+			<p>Welcome to PunBB with VHFFS patch installation! You are about to install PunBB for VHFFS. In order to install PunBB on your VHFFS platform you must complete the form set out below. If you encounter any difficulties with the installation, please refer to the documentation.</p>
- 		</div>
- 	</div>
- </div>
-@@ -131,7 +133,7 @@
- 		<div><input type="hidden" name="form_sent" value="1" /></div>
- 			<div class="inform">
- 				<div class="forminfo">
--					<h3>Database setup</h3>
-+					<h3>PunBB database setup</h3>
- 					<p>Please enter the requested information in order to setup your database for PunBB. You must know all the information asked for before proceeding with the installation.</p>
- 				</div>
- 				<fieldset>
-@@ -154,7 +156,7 @@
- 			</div>
- 			<div class="inform">
- 				<fieldset>
--					<legend>Enter your database server hostname</legend>
-+					<legend>Enter your database server hostname and port</legend>
- 					<div class="infldset">
- 						<p>The address of the database server (example: localhost, db.myhost.com or 192.168.0.15). You can specify a custom port number if your database doesn't run on the default port (example: localhost:3580). For SQLite support, just enter anything or leave it at 'localhost'.</p>
- 						<label><strong>Database server hostname</strong><br /><input type="text" name="req_db_host" value="localhost" size="50" maxlength="100" /><br /></label>
-@@ -192,6 +194,82 @@
- 			</div>
- 			<div class="inform">
- 				<div class="forminfo">
-+					<h3>VHFFS database setup</h3>
-+					<p>Please enter the requested information in order to setup your VHFFS patch for PunBB.</p>
-+				</div>
-+			</div>
-+			<div class="inform">
-+				<fieldset>
-+					<legend>Enter your VHFFS database server hostname</legend>
-+					<div class="infldset">
-+						<p>The address of the VHFFS database server (example: localhost, db.myhost.com or 192.168.0.15). You can specify a custom port number if your database doesn't run on the default port (example: localhost:3580).</p>
-+						<label><strong>VHFFS Database server hostname</strong><br /><input type="text" name="vhffs_db_host" value="localhost:5432" size="50" maxlength="100" /><br /></label>
-+					</div>
-+				</fieldset>
-+			</div>
-+			<div class="inform">
-+				<fieldset>
-+					<legend>Select VHFFS patch mode</legend>
-+					<div class="infldset">
-+						<p>You can chose between full or view mode. The full mode is accessing vhffs's database on read mode. If you don't want the forum to be able to read the whole VHFFS database (for security reasons) you might want to use the view mode. In view mode you have to create a view on the vhffs database with username, passwd, firstname, lastname, mail, state</p>
-+						<label for="vhffs_db_name"><strong>VHFFS Database name</strong><br /><input id="vhffs_db_name" type="text" name="vhffs_db_name" size="30" maxlength="50" /><br /></label>
-+					</div>
-+				</fieldset>
-+			</div>
-+			<div class="inform">
-+				<fieldset>
-+					<legend>Enter the name of your VHFFS database</legend>
-+					<div class="infldset">
-+						<p>The name of the database that your VHFFS system is using. The database must exist so VHFFS have to be installed first.</p>
-+						<label for="vhffs_db_name"><strong>VHFFS Database name</strong><br /><input id="vhffs_db_name" type="text" name="vhffs_db_name" size="30" maxlength="50" /><br /></label>
-+					</div>
-+				</fieldset>
-+			</div>
-+			<div class="inform">
-+				<fieldset>
-+					<legend>Enter your VHFFS database username and password</legend>
-+					<div class="infldset">
-+						<p>Enter the username and password which allows you to connect to the VHFFS database. You may want to use a read only account for security reasons.</p>
-+						<label class="conl">VHFFS Database username<br /><input type="text" name="vhffs_db_username" size="30" maxlength="50" /><br /></label>
-+						<label class="conl">VHFFS Database password<br /><input type="text" name="vhffs_db_password" size="30" maxlength="50" /><br /></label>
-+						<div class="clearer"></div>
-+					</div>
-+				</fieldset>
-+			</div>
-+			<div class="inform">
-+				<fieldset>
-+					<legend>Enter VHFFS database table prefix</legend>
-+					<div class="infldset">
-+						<p>That is the table prefix used by your VHFFS system. Do not change if you don't know precisely what you are doing.<p>
-+						<label>VHFFS Table prefix<br /><input id="vhffs_db_prefix" type="text" value="vhffs_" name="vhffs_db_prefix" size="20" maxlength="30" /><br /></label>
-+					</div>
-+				</fieldset>
-+			</div>
-+			<div class="inform">
-+				<div class="forminfo">
-+					<h3>VHFFS's panel options</h3>
-+					<p>Please enter the requested information in order to link the forum to your VHFFS panel.</p>
-+				</div>
-+				<fieldset>
-+					<legend>Enter your Team name</legend>
-+					<div class="infldset">
-+						<p>The team name is the name of the VHFFS Panel owner group. It will be displayed in login,registration and profile modification process.</p>
-+						<label><strong>Team name</strong><br /><input type="text" value="VHFFS" name="vhffs_team" size="25" maxlength="25" /><br /></label>
-+					</div>
-+				</fieldset>
-+			</div>
-+			<div class="inform">
-+				<fieldset>
-+					<legend>Enter the URL of your VHFFS panel</legend>
-+					<div class="infldset">
-+						<p>That is the table prefix used by your VHFFS system. Do not change if you don't know precisely what you are doing.<p>
-+						<label>VHFFS panel URL<br /><input id="vhffs_panel_url" type="text" value="panel.localhost" name="vhffs_panel_url" size="20" maxlength="30" /><br /></label>
-+					</div>
-+				</fieldset>
-+			</div>
-+
-+			<div class="inform">
-+				<div class="forminfo">
- 					<h3>Administration setup</h3>
- 					<p>Please enter the requested information in order to setup an administrator for your PunBB installation</p>
- 				</div>
-@@ -301,7 +379,15 @@
- 	$email = strtolower(trim($_POST['req_email']));
- 	$password1 = unescape(trim($_POST['req_password1']));
- 	$password2 = unescape(trim($_POST['req_password2']));
--
-+	
-+	//VHFFS MODIFICATION : verifying VHFFS parameters
-+	$vhffs_db_host = trim($_POST['vhffs_db_host']);
-+	$vhffs_db_name = trim($_POST['vhffs_db_name']);
-+       	$vhffs_db_username = unescape(trim($_POST['vhffs_db_username']));
-+        $vhffs_db_password = unescape(trim($_POST['vhffs_db_password']));
-+        $vhffs_db_prefix = trim($_POST['vhffs_db_prefix']);
-+	$vhffs_team = trim($_POST['vhffs_team']);
-+ 	$vhffs_panel_url = trim($_POST['vhffs_panel_url']);
- 
- 	// Make sure base_url doesn't end with a slash
- 	if (substr($_POST['req_base_url'], -1) == '/')
-@@ -1399,8 +1485,9 @@
- 		$alerts .= '<p style="font-size: 1.1em"><span style="color: #C03000"><strong>The avatar directory is currently not writable!</strong></span> If you want users to be able to upload their own avatar images you must see to it that the directory named <em>img/avatars</em> is writable by PHP. You can later choose to save avatar images in a different directory (see Admin/Options). Use chmod to set the appropriate directory permissions. If in doubt, chmod to 0777.</p>';
- 
- 
-+	// VHFFS MODIFICATION : use given parameters to generate VHFFS patch section in config file
- 	/// Display config.php and give further instructions
--	$config = '<?php'."\n\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.$db_name."';\n".'$db_username = \''.$db_username."';\n".'$db_password = \''.$db_password."';\n".'$db_prefix = \''.$db_prefix."';\n".'$p_connect = false;'."\n\n".'$cookie_name = '."'punbb_cookie';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n".'$cookie_seed = \''.substr(md5(time()), -8)."';\n\ndefine('PUN', 1);";
-+	$config = '<?php'."\n\\\\PunBB section\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.$db_name."';\n".'$db_username = \''.$db_username."';\n".'$db_password = \''.$db_password."';\n".'$db_prefix = \''.$db_prefix."';\n".'$p_connect = false;'."\n\n".'$cookie_name = '."'punbb_cookie';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n".'$cookie_seed = \''.substr(md5(time()), -8)."';\n\ndefine('PUN', 1);\n\n\////VHFFS patch section\n\n".'$vhffs_db_host = \''.$vhffs_db_host."';\n".'$vhffs_db_name = \''.$vhffs_db_name."';\n".'$vhffs_db_username = \''.$vhffs_db_username."';\n".'$vhffs_db_password = \''.$vhffs_db_password."';\n".'$vhffs_db_prefix = \''.$vhffs_db_prefix."';\n".'$vhffs_p_connect = true'.";\n".'$vhffs_team = \''.$vhffs_team."';\n".'$vhffs_panel_url = \''.$vhffs_panel_url."';\n\n".'?>';
- 
- 
- ?>
-@@ -1423,7 +1510,7 @@
- 		<div class="fakeform">
- 			<div class="inform">
- 				<div class="forminfo">
--					<p>To finalize the installation all you need to do is to <strong>copy and paste the text in the text box below into a file called config.php and then upload this file to the root directory of your PunBB installation</strong>. Make sure there are no linebreaks or spaces before &lt;?php. You can later edit config.php if you reconfigure your setup (e.g. change the database password or ).</p>
-+					<p>To finalize the installation all you need to do is to <strong>copy and paste the text in the text box below into a file called config.php and then upload this file to the root directory of your PunBB installation</strong>. Make sure there are no linebreaks or spaces before &lt;?php. You can later edit config.php if you reconfigure your setup (e.g. change the database password... ).</p>
- <?php if ($alerts != ''): ?>					<?php echo $alerts."\n" ?>
- <?php endif; ?>				</div>
- 				<fieldset>
-@@ -1435,7 +1522,7 @@
- 			</div>
- 			<div class="inform">
- 				<div class="forminfo">
--					<p>Once you have created config.php with the contents above, PunBB is installed!</p>
-+					<p>Once you have created config.php with the contents above, PunBB with VHFFS patch is installed!</p>
- 					<p><a href="index.php">Go to forum index</a></p>
- 				</div>
- 			</div>
-diff -Nru a/upload/lang/English/login.php b/upload/lang/English/login.php
---- a/upload/lang/English/login.php	2005-01-11 22:41:16.000000000 +0100
-+++ b/upload/lang/English/login.php	2006-10-29 21:06:01.000000000 +0100
-@@ -1,5 +1,7 @@
- <?php
- 
-+// VHFFS MODIFICATION : team's name in login strings
-+
- // Language definitions used in delete.php
- $lang_login = array(
- 
-@@ -13,8 +15,8 @@
- 'Request pass legend'	=>	'Enter the e-mail address with which you registered',
- 'Request pass info'		=>	'A new password together with a link to activate the new password will be sent to that address.',
- 'Not registered'		=>	'Not registered yet?',
--'Login legend'			=>	'Enter your username and password below',
--'Login info'			=>	'If you have not registered or have forgotten your password click on the appropriate link below.',
-+'Login legend'			=>	'Enter your '.$vhffs_team.' username and password below',
-+'Login info'			=>	'You need to have a '.$vhffs_team.' acount in order to login.',
- 
- // Forget password mail stuff
- 'Forget mail'			=>	'An e-mail has been sent to the specified address with instructions on how to change your password. If it does not arrive you can contact the forum administrator at'
-diff -Nru a/upload/login.php b/upload/login.php
---- a/upload/login.php	2006-05-20 19:52:04.000000000 +0200
-+++ b/upload/login.php	2006-10-29 21:06:01.000000000 +0100
-@@ -3,6 +3,8 @@
- 
-   Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
- 
-+  VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-   This file is part of PunBB.
- 
-   PunBB is free software; you can redistribute it and/or modify it
-@@ -29,6 +31,9 @@
- define('PUN_ROOT', './');
- require PUN_ROOT.'include/common.php';
- 
-+// VHFFS MODIFICATION : Load the vhffs specific database
-+
-+require PUN_ROOT.'include/dblayer/vhffs_db.php';
- 
- // Load the login.php language file
- require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
-@@ -42,31 +47,58 @@
- 
- 	$username_sql = ($db_type == 'mysql' || $db_type == 'mysqli') ? 'username=\''.$db->escape($form_username).'\'' : 'LOWER(username)=LOWER(\''.$db->escape($form_username).'\')';
- 
-+
-+	// VHFFS MODIFICATION : New login system, using VHFFS's database for auth and copying Personal data to Forum database
-+
-+	//looking for the user in the forum database
- 	$result = $db->query('SELECT id, group_id, password, save_pass FROM '.$db->prefix.'users WHERE '.$username_sql) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
- 	list($user_id, $group_id, $db_password_hash, $save_pass) = $db->fetch_row($result);
- 
-+	//looking for the user in View 
-+
-+	$vhffs_result = $vhffs_db->query('SELECT passwd, firstname, lastname, mail, date_creation, state FROM '.$vhffs_db->prefix.'forum WHERE '.$username_sql) or error('Unable to fetch user info in '.$vhffs_team.' database', __FILE__, __LINE__, $db->error());
-+       	list($vhffs_db_password_hash, $vhffs_user_firstname, $vhffs_user_lastname, $vhffs_user_mail, $vhffs_inscription_date, $vhffs_user_status) = $vhffs_db->fetch_row($vhffs_result);
-+
- 	$authorized = false;
- 
--	if (!empty($db_password_hash))
-+	if (empty($vhffs_db_password_hash))
-+	{
-+		message('User don\'t exist in '.$vhffs_team.' database. Please create an acount on <a href="'.$vhffs_panel_url.'">'.$vhffs_team.' \'s panel </a>', __FILE__, __LINE__);
-+	}
-+	else if ($vhffs_user_status != 6) //If user status is not "Activated"
-+	{
-+		message('User not Activated in '.$vhffs_team.' database. Is registration process complete ?', __FILE__, __LINE__);
-+	}
-+
-+	else if (empty($user_id))
- 	{
--		$sha1_in_db = (strlen($db_password_hash) == 40) ? true : false;
--		$sha1_available = (function_exists('sha1') || function_exists('mhash')) ? true : false;
-+		
-+		// defaults
-+		$intial_group_id = ($pun_config['o_regs_verify'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED;
-+		$language = 'English';
-+
-+		// creating new user in forum database
-+       		//echo "INSERT INTO ".$db->prefix."users (username, group_id, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit, realname) VALUES (\'".$db->escape($form_username)."\', ".$intial_group_id.", \'".$vhffs_user_mail."\', 1, 1, 0 , \'".$db->escape($language)."\', \'".$pun_config['o_default_style']."\', ".$vhffs_inscription_date.", \'".get_remote_address()."\', ".time().", \'".$vhffs_user_firstname."\ ".$vhffs_user_lastname."\' )";
-+       		$db->query('INSERT INTO '.$db->prefix.'users (username, password, group_id, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit, realname) VALUES (\''.$db->escape($form_username).'\', \'\','.$intial_group_id.', \''.$vhffs_user_mail.'\', 1, 1, 0 , \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$vhffs_inscription_date.', \''.get_remote_address().'\', '.time().', \''.$vhffs_user_firstname.'\ '.$vhffs_user_lastname.'\' )') or error('Unable to create user in forum database. Error: '.$db->error(), __FILE__, __LINE__, $db->error());
-+       		$user_id = $db->insert_id();
-+		$vhffs_user_import = true;
-+	}
- 
--		$form_password_hash = pun_hash($form_password);	// This could result in either an SHA-1 or an MD5 hash (depends on $sha1_available)
-+	if ((!empty($user_id)) && (!empty($vhffs_db_password_hash))) //as we want to delete passwords in forum database, we test the user id result instead of the password result
-+	{
-+		$CRYPT_MD5 = 1;
- 
--		if ($sha1_in_db && $sha1_available && $db_password_hash == $form_password_hash)
--			$authorized = true;
--		else if (!$sha1_in_db && $db_password_hash == md5($form_password))
-+		// VHFFS password verification
-+		if (crypt($form_password, $vhffs_db_password_hash) == $vhffs_db_password_hash)
- 		{
- 			$authorized = true;
--
--			if ($sha1_available)	// There's an MD5 hash in the database, but SHA1 hashing is available, so we update the DB
--				$db->query('UPDATE '.$db->prefix.'users SET password=\''.$form_password_hash.'\' WHERE id='.$user_id) or error('Unable to update user password', __FILE__, __LINE__, $db->error());
- 		}
- 	}
- 
-+
- 	if (!$authorized)
--		message($lang_login['Wrong user/pass'].' <a href="login.php?action=forget">'.$lang_login['Forgotten pass'].'</a>');
-+		message($lang_login['Wrong user/pass'].' <a href="'.$vhffs_panel_url.'/lost.pl">'.$lang_login['Forgotten pass'].'</a>');
- 
- 	// Update the status if this is the first time the user logged in
- 	if ($group_id == PUN_UNVERIFIED)
-@@ -105,85 +137,7 @@
- 
- else if ($action == 'forget' || $action == 'forget_2')
- {
--	if (!$pun_user['is_guest'])
--		header('Location: index.php');
--
--	if (isset($_POST['form_sent']))
--	{
--		require PUN_ROOT.'include/email.php';
--
--		// Validate the email-address
--		$email = strtolower(trim($_POST['req_email']));
--		if (!is_valid_email($email))
--			message($lang_common['Invalid e-mail']);
--
--		$result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($email).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--
--		if ($db->num_rows($result))
--		{
--			// Load the "activate password" template
--			$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_password.tpl'));
--
--			// The first row contains the subject
--			$first_crlf = strpos($mail_tpl, "\n");
--			$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
--			$mail_message = trim(substr($mail_tpl, $first_crlf));
--
--			// Do the generic replacements first (they apply to all e-mails sent out here)
--			$mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
--			$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
--
--			// Loop through users we found
--			while ($cur_hit = $db->fetch_assoc($result))
--			{
--				// Generate a new password and a new password activation code
--				$new_password = random_pass(8);
--				$new_password_key = random_pass(8);
--
--				$db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.pun_hash($new_password).'\', activate_key=\''.$new_password_key.'\' WHERE id='.$cur_hit['id']) or error('Unable to update activation data', __FILE__, __LINE__, $db->error());
--
--				// Do the user specific replacements to the template
--				$cur_mail_message = str_replace('<username>', $cur_hit['username'], $mail_message);
--				$cur_mail_message = str_replace('<activation_url>', $pun_config['o_base_url'].'/profile.php?id='.$cur_hit['id'].'&action=change_pass&key='.$new_password_key, $cur_mail_message);
--				$cur_mail_message = str_replace('<new_password>', $new_password, $cur_mail_message);
--
--				pun_mail($email, $mail_subject, $cur_mail_message);
--			}
--
--			message($lang_login['Forget mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
--		}
--		else
--			message($lang_login['No e-mail match'].' '.htmlspecialchars($email).'.');
--	}
--
--
--	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_login['Request pass'];
--	$required_fields = array('req_email' => $lang_common['E-mail']);
--	$focus_element = array('request_pass', 'req_email');
--	require PUN_ROOT.'header.php';
--
--?>
--<div class="blockform">
--	<h2><span><?php echo $lang_login['Request pass'] ?></span></h2>
--	<div class="box">
--		<form id="request_pass" method="post" action="login.php?action=forget_2" onsubmit="this.request_pass.disabled=true;if(process_form(this)){return true;}else{this.request_pass.disabled=false;return false;}">
--			<div class="inform">
--				<fieldset>
--					<legend><?php echo $lang_login['Request pass legend'] ?></legend>
--					<div class="infldset">
--						<input type="hidden" name="form_sent" value="1" />
--						<input id="req_email" type="text" name="req_email" size="50" maxlength="50" />
--						<p><?php echo $lang_login['Request pass info'] ?></p>
--					</div>
--				</fieldset>
--			</div>
--			<p><input type="submit" name="request_pass" value="<?php echo $lang_common['Submit'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
--		</form>
--	</div>
--</div>
--<?php
--
--	require PUN_ROOT.'footer.php';
-+	message('Please use the <a href="'.$vhffs_panel_url.'/lost.pl">'.$vhffs_team.' \'s panel </a> for password recovery.', __FILE__, __LINE__);
- }
- 
- 
-diff -Nru a/upload/profile.php b/upload/profile.php
---- a/upload/profile.php	2005-11-01 02:27:30.000000000 +0100
-+++ b/upload/profile.php	2006-10-29 21:06:01.000000000 +0100
-@@ -3,6 +3,8 @@
- 
-   Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
- 
-+  VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-   This file is part of PunBB.
- 
-   PunBB is free software; you can redistribute it and/or modify it
-@@ -43,257 +45,17 @@
- require PUN_ROOT.'lang/'.$pun_user['language'].'/profile.php';
- 
- 
-+// VHFFS MODIFICATION : password and email change disabled
-+
- if ($action == 'change_pass')
- {
--	if (isset($_GET['key']))
--	{
--		// If the user is already logged in we shouldn't be here :)
--		if (!$pun_user['is_guest'])
--		{
--			header('Location: index.php');
--			exit;
--		}
--
--		$key = $_GET['key'];
--
--		$result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch new password', __FILE__, __LINE__, $db->error());
--		list($new_password_hash, $new_password_key) = $db->fetch_row($result);
--
--		if ($key == '' || $key != $new_password_key)
--			message($lang_profile['Pass key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
--		else
--		{
--			$db->query('UPDATE '.$db->prefix.'users SET password=\''.$new_password_hash.'\', activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Unable to update password', __FILE__, __LINE__, $db->error());
--
--			message($lang_profile['Pass updated'], true);
--		}
--	}
--
--	// Make sure we are allowed to change this users password
--	if ($pun_user['id'] != $id)
--	{
--		if ($pun_user['g_id'] > PUN_MOD)	// A regular user trying to change another users password?
--			message($lang_common['No permission']);
--		else if ($pun_user['g_id'] == PUN_MOD)	// A moderator trying to change a users password?
--		{
--			$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--			if (!$db->num_rows($result))
--				message($lang_common['Bad request']);
--
--			if ($pun_config['p_mod_edit_users'] == '0' || $pun_config['p_mod_change_passwords'] == '0' || $db->result($result) < PUN_GUEST)
--				message($lang_common['No permission']);
--		}
--	}
--
--	if (isset($_POST['form_sent']))
--	{
--		$old_password = isset($_POST['req_old_password']) ? trim($_POST['req_old_password']) : '';
--		$new_password1 = trim($_POST['req_new_password1']);
--		$new_password2 = trim($_POST['req_new_password2']);
--
--		if ($new_password1 != $new_password2)
--			message($lang_prof_reg['Pass not match']);
--		if (strlen($new_password1) < 4)
--			message($lang_prof_reg['Pass too short']);
--
--		$result = $db->query('SELECT password, save_pass FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch password', __FILE__, __LINE__, $db->error());
--		list($db_password_hash, $save_pass) = $db->fetch_row($result);
--
--		$authorized = false;
--
--		if (!empty($db_password_hash))
--		{
--			$sha1_in_db = (strlen($db_password_hash) == 40) ? true : false;
--			$sha1_available = (function_exists('sha1') || function_exists('mhash')) ? true : false;
--
--			$old_password_hash = pun_hash($old_password);	// This could result in either an SHA-1 or an MD5 hash
--
--			if (($sha1_in_db && $sha1_available && $db_password_hash == $old_password_hash) ||
--				(!$sha1_in_db && $db_password_hash == md5($old_password)) ||
--				$pun_user['g_id'] < PUN_GUEST)
--				$authorized = true;
--		}
--
--		if (!$authorized)
--			message($lang_profile['Wrong pass']);
--
--		$new_password_hash = pun_hash($new_password1);
--
--		$db->query('UPDATE '.$db->prefix.'users SET password=\''.$new_password_hash.'\' WHERE id='.$id) or error('Unable to update password', __FILE__, __LINE__, $db->error());
--
--		if ($pun_user['id'] == $id)
--		{
--			$expire = ($save_pass == '1') ? time() + 31536000 : 0;
--			pun_setcookie($pun_user['id'], $new_password_hash, $expire);
--		}
--
--		redirect('profile.php?section=essentials&amp;id='.$id, $lang_profile['Pass updated redirect']);
--	}
--
--	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
--	$required_fields = array('req_old_password' => $lang_profile['Old pass'], 'req_new_password1' => $lang_profile['New pass'], 'req_new_password2' => $lang_profile['Confirm new pass']);
--	$focus_element = array('change_pass', (($pun_user['g_id'] > PUN_MOD) ? 'req_old_password' : 'req_new_password1'));
--	require PUN_ROOT.'header.php';
--
--?>
--<div class="blockform">
--	<h2><span><?php echo $lang_profile['Change pass'] ?></span></h2>
--	<div class="box">
--		<form id="change_pass" method="post" action="profile.php?action=change_pass&amp;id=<?php echo $id ?>" onsubmit="return process_form(this)">
--			<div class="inform">
--				<input type="hidden" name="form_sent" value="1" />
--				<fieldset>
--					<legend><?php echo $lang_profile['Change pass legend'] ?></legend>
--					<div class="infldset">
--<?php if ($pun_user['g_id'] > PUN_MOD): ?>						<label><strong><?php echo $lang_profile['Old pass'] ?></strong><br />
--						<input type="password" name="req_old_password" size="16" maxlength="16" /><br /></label>
--<?php endif; ?>						<label class="conl"><strong><?php echo $lang_profile['New pass'] ?></strong><br />
--						<input type="password" name="req_new_password1" size="16" maxlength="16" /><br /></label>
--						<label class="conl"><strong><?php echo $lang_profile['Confirm new pass'] ?></strong><br />
--						<input type="password" name="req_new_password2" size="16" maxlength="16" /><br /></label>
--						<div class="clearb"></div>
--					</div>
--				</fieldset>
--			</div>
--			<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
--		</form>
--	</div>
--</div>
--<?php
--
--	require PUN_ROOT.'footer.php';
-+	message('Please use the <a href="'.$vhffs_panel_url.'">'.$vhffs_team.'\'s panel </a> to modify your password.', __FILE__, __LINE__);
- }
- 
- 
- else if ($action == 'change_email')
- {
--	// Make sure we are allowed to change this users e-mail
--	if ($pun_user['id'] != $id)
--	{
--		if ($pun_user['g_id'] > PUN_MOD)	// A regular user trying to change another users e-mail?
--			message($lang_common['No permission']);
--		else if ($pun_user['g_id'] == PUN_MOD)	// A moderator trying to change a users e-mail?
--		{
--			$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--			if (!$db->num_rows($result))
--				message($lang_common['Bad request']);
--
--			if ($pun_config['p_mod_edit_users'] == '0' || $db->result($result) < PUN_GUEST)
--				message($lang_common['No permission']);
--		}
--	}
--
--	if (isset($_GET['key']))
--	{
--		$key = $_GET['key'];
--
--		$result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch activation data', __FILE__, __LINE__, $db->error());
--		list($new_email, $new_email_key) = $db->fetch_row($result);
--
--		if ($key != $new_email_key)
--			message($lang_profile['E-mail key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
--		else
--		{
--			$db->query('UPDATE '.$db->prefix.'users SET email=activate_string, activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Unable to update e-mail address', __FILE__, __LINE__, $db->error());
--
--			message($lang_profile['E-mail updated'], true);
--		}
--	}
--	else if (isset($_POST['form_sent']))
--	{
--		if (pun_hash($_POST['req_password']) !== $pun_user['password'])
--			message($lang_profile['Wrong pass']);
--
--		require PUN_ROOT.'include/email.php';
--
--		// Validate the email-address
--		$new_email = strtolower(trim($_POST['req_new_email']));
--		if (!is_valid_email($new_email))
--			message($lang_common['Invalid e-mail']);
--
--		// Check it it's a banned e-mail address
--		if (is_banned_email($new_email))
--		{
--			if ($pun_config['p_allow_banned_email'] == '0')
--				message($lang_prof_reg['Banned e-mail']);
--			else if ($pun_config['o_mailing_list'] != '')
--			{
--				$mail_subject = 'Alert - Banned e-mail detected';
--				$mail_message = 'User \''.$pun_user['username'].'\' changed to banned e-mail address: '.$new_email."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$id."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
--
--				pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
--			}
--		}
--
--		// Check if someone else already has registered with that e-mail address
--		$result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($new_email).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--		if ($db->num_rows($result))
--		{
--			if ($pun_config['p_allow_dupe_email'] == '0')
--				message($lang_prof_reg['Dupe e-mail']);
--			else if ($pun_config['o_mailing_list'] != '')
--			{
--				while ($cur_dupe = $db->fetch_assoc($result))
--					$dupe_list[] = $cur_dupe['username'];
--
--				$mail_subject = 'Alert - Duplicate e-mail detected';
--				$mail_message = 'User \''.$pun_user['username'].'\' changed to an e-mail address that also belongs to: '.implode(', ', $dupe_list)."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$id."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
--
--				pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
--			}
--		}
--
--
--		$new_email_key = random_pass(8);
--
--		$db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.$db->escape($new_email).'\', activate_key=\''.$new_email_key.'\' WHERE id='.$id) or error('Unable to update activation data', __FILE__, __LINE__, $db->error());
--
--		// Load the "activate e-mail" template
--		$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_email.tpl'));
--
--		// The first row contains the subject
--		$first_crlf = strpos($mail_tpl, "\n");
--		$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
--		$mail_message = trim(substr($mail_tpl, $first_crlf));
--
--		$mail_message = str_replace('<username>', $pun_user['username'], $mail_message);
--		$mail_message = str_replace('<base_url>', $pun_config['o_base_url'], $mail_message);
--		$mail_message = str_replace('<activation_url>', $pun_config['o_base_url'].'/profile.php?action=change_email&id='.$id.'&key='.$new_email_key, $mail_message);
--		$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
--
--		pun_mail($new_email, $mail_subject, $mail_message);
--
--		message($lang_profile['Activate e-mail sent'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
--	}
--
--	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
--	$required_fields = array('req_new_email' => $lang_profile['New e-mail'], 'req_password' => $lang_common['Password']);
--	$focus_element = array('change_email', 'req_new_email');
--	require PUN_ROOT.'header.php';
--
--?>
--<div class="blockform">
--	<h2><span><?php echo $lang_profile['Change e-mail'] ?></span></h2>
--	<div class="box">
--		<form id="change_email" method="post" action="profile.php?action=change_email&amp;id=<?php echo $id ?>" id="change_email" onsubmit="return process_form(this)">
--			<div class="inform">
--				<fieldset>
--					<legend><?php echo $lang_profile['E-mail legend'] ?></legend>
--					<div class="infldset">
--						<input type="hidden" name="form_sent" value="1" />
--						<label><strong><?php echo $lang_profile['New e-mail'] ?></strong><br /><input type="text" name="req_new_email" size="50" maxlength="50" /><br /></label>
--						<label><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password" size="16" maxlength="16" /><br /></label>
--						<p><?php echo $lang_profile['E-mail instructions'] ?></p>
--					</div>
--				</fieldset>
--			</div>
--			<p><input type="submit" name="new_email" value="<?php echo $lang_common['Submit'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
--		</form>
--	</div>
--</div>
--<?php
--
--	require PUN_ROOT.'footer.php';
-+ 	message('Please use the <a href="'.$vhffs_panel_url.'">'.$vhffs_team.'\'s panel </a> to modify your email.', __FILE__, __LINE__);
- }
- 
- 
-@@ -709,15 +471,6 @@
- 					$form['num_posts'] = intval($_POST['num_posts']);
- 			}
- 
--			if ($pun_config['o_regs_verify'] == '0' || $pun_user['g_id'] < PUN_GUEST)
--			{
--				require PUN_ROOT.'include/email.php';
--
--				// Validate the email-address
--				$form['email'] = strtolower(trim($_POST['req_email']));
--				if (!is_valid_email($form['email']))
--					message($lang_common['Invalid e-mail']);
--			}
- 
- 			// Make sure we got a valid language string
- 			if (isset($form['language']))
-@@ -1062,10 +815,8 @@
- 		{
- 			$username_field = '<p>'.$lang_common['Username'].': '.pun_htmlspecialchars($user['username']).'</p>'."\n";
- 
--			if ($pun_config['o_regs_verify'] == '1')
--				$email_field = '<p>'.$lang_common['E-mail'].': '.$user['email'].'&nbsp;-&nbsp;<a href="profile.php?action=change_email&amp;id='.$id.'">'.$lang_profile['Change e-mail'].'</a></p>'."\n";
--			else
--				$email_field = '<label><strong>'.$lang_common['E-mail'].'</strong><br /><input type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="50" /><br /></label>'."\n";
-+			// VHFFS Modif : as VHFFS users are not allowed to modify their email address, this field is disabled but displayed
-+			$email_field = '<label><strong>'.$lang_common['E-mail'].'</strong><br /><input disabled type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="50" /><br /></label>'."\n";
- 		}
- 
- 		if ($pun_user['g_id'] == PUN_ADMIN)
-@@ -1228,7 +979,7 @@
- 						<legend><?php echo $lang_profile['Personal details legend'] ?></legend>
- 						<div class="infldset">
- 							<input type="hidden" name="form_sent" value="1" />
--							<label><?php echo $lang_profile['Realname'] ?><br /><input type="text" name="form[realname]" value="<?php echo pun_htmlspecialchars($user['realname']) ?>" size="40" maxlength="40" /><br /></label>
-+							<label><?php echo $lang_profile['Realname'] ?><br /><input disabled type="text" name="form[realname]" value="<?php echo pun_htmlspecialchars($user['realname']) ?>" size="40" maxlength="40" /><br /></label>
- <?php if (isset($title_field)): ?>					<?php echo $title_field ?>
- <?php endif; ?>							<label><?php echo $lang_profile['Location'] ?><br /><input type="text" name="form[location]" value="<?php echo pun_htmlspecialchars($user['location']) ?>" size="30" maxlength="30" /><br /></label>
- 							<label><?php echo $lang_profile['Website'] ?><br /><input type="text" name="form[url]" value="<?php echo pun_htmlspecialchars($user['url']) ?>" size="50" maxlength="80" /><br /></label>
-diff -Nru a/upload/register.php b/upload/register.php
---- a/upload/register.php	2006-10-15 20:31:20.000000000 +0200
-+++ b/upload/register.php	2006-10-29 21:06:01.000000000 +0100
-@@ -3,6 +3,8 @@
- 
-   Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
- 
-+  VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-   This file is part of PunBB.
- 
-   PunBB is free software; you can redistribute it and/or modify it
-@@ -26,386 +28,8 @@
- define('PUN_ROOT', './');
- require PUN_ROOT.'include/common.php';
- 
-+//VHFFS MODIFICATION : Registering procces removed
- 
--// If we are logged in, we shouldn't be here
--if (!$pun_user['is_guest'])
--{
--	header('Location: index.php');
--	exit;
--}
--
--// Load the register.php language file
--require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
--
--// Load the register.php/profile.php language file
--require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
--
--if ($pun_config['o_regs_allow'] == '0')
--	message($lang_register['No new regs']);
--
--
--// User pressed the cancel button
--if (isset($_GET['cancel']))
--	redirect('index.php', $lang_register['Reg cancel redirect']);
--
--
--else if ($pun_config['o_rules'] == '1' && !isset($_GET['agree']) && !isset($_POST['form_sent']))
--{
--	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register'];
--	require PUN_ROOT.'header.php';
-+message('Registration is disabled on this forum. Please use the <a href="'.$vhffs_panel_url.'">'.$vhffs_team.'\'s panel </a>to register.', __FILE__, __LINE__);
- 
- ?>
--<div class="blockform">
--	<h2><span><?php echo $lang_register['Forum rules'] ?></span></h2>
--	<div class="box">
--		<form method="get" action="register.php">
--			<div class="inform">
--				<fieldset>
--					<legend><?php echo $lang_register['Rules legend'] ?></legend>
--					<div class="infldset">
--						<p><?php echo $pun_config['o_rules_message'] ?></p>
--					</div>
--				</fieldset>
--			</div>
--			<p><input type="submit" name="agree" value="<?php echo $lang_register['Agree'] ?>" /><input type="submit" name="cancel" value="<?php echo $lang_register['Cancel'] ?>" /></p>
--		</form>
--	</div>
--</div>
--<?php
--
--	require PUN_ROOT.'footer.php';
--}
--
--
--else if (isset($_POST['form_sent']))
--{
--	// Check that someone from this IP didn't register a user within the last hour (DoS prevention)
--	$result = $db->query('SELECT 1 FROM '.$db->prefix.'users WHERE registration_ip=\''.get_remote_address().'\' AND registered>'.(time() - 3600)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--
--	if ($db->num_rows($result))
--		message('A new user was registered with the same IP address as you within the last hour. To prevent registration flooding, at least an hour has to pass between registrations from the same IP. Sorry for the inconvenience.');
--
--
--	$username = pun_trim($_POST['req_username']);
--	$email1 = strtolower(trim($_POST['req_email1']));
--
--	if ($pun_config['o_regs_verify'] == '1')
--	{
--		$email2 = strtolower(trim($_POST['req_email2']));
--
--		$password1 = random_pass(8);
--		$password2 = $password1;
--	}
--	else
--	{
--		$password1 = trim($_POST['req_password1']);
--		$password2 = trim($_POST['req_password2']);
--	}
--
--	// Convert multiple whitespace characters into one (to prevent people from registering with indistinguishable usernames)
--	$username = preg_replace('#\s+#s', ' ', $username);
--
--	// Validate username and passwords
--	if (strlen($username) < 2)
--		message($lang_prof_reg['Username too short']);
--	else if (pun_strlen($username) > 25)	// This usually doesn't happen since the form element only accepts 25 characters
--	    message($lang_common['Bad request']);
--	else if (strlen($password1) < 4)
--		message($lang_prof_reg['Pass too short']);
--	else if ($password1 != $password2)
--		message($lang_prof_reg['Pass not match']);
--	else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest']))
--		message($lang_prof_reg['Username guest']);
--	else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
--		message($lang_prof_reg['Username IP']);
--	else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
--		message($lang_prof_reg['Username reserved chars']);
--	else if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
--		message($lang_prof_reg['Username BBCode']);
--
--	// Check username for any censored words
--	if ($pun_config['o_censoring'] == '1')
--	{
--		// If the censored username differs from the username
--		if (censor_words($username) != $username)
--			message($lang_register['Username censor']);
--	}
--
--	// Check that the username (or a too similar username) is not already registered
--	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE UPPER(username)=UPPER(\''.$db->escape($username).'\') OR UPPER(username)=UPPER(\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\')') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--
--	if ($db->num_rows($result))
--	{
--		$busy = $db->result($result);
--		message($lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2']);
--	}
--
--
--	// Validate e-mail
--	require PUN_ROOT.'include/email.php';
--
--	if (!is_valid_email($email1))
--		message($lang_common['Invalid e-mail']);
--	else if ($pun_config['o_regs_verify'] == '1' && $email1 != $email2)
--		message($lang_register['E-mail not match']);
--
--	// Check it it's a banned e-mail address
--	if (is_banned_email($email1))
--	{
--		if ($pun_config['p_allow_banned_email'] == '0')
--			message($lang_prof_reg['Banned e-mail']);
--
--		$banned_email = true;	// Used later when we send an alert e-mail
--	}
--	else
--		$banned_email = false;
--
--	// Check if someone else already has registered with that e-mail address
--	$dupe_list = array();
--
--	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE email=\''.$email1.'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--	if ($db->num_rows($result))
--	{
--		if ($pun_config['p_allow_dupe_email'] == '0')
--			message($lang_prof_reg['Dupe e-mail']);
--
--		while ($cur_dupe = $db->fetch_assoc($result))
--			$dupe_list[] = $cur_dupe['username'];
--	}
--
--	// Make sure we got a valid language string
--	if (isset($_POST['language']))
--	{
--		$language = preg_replace('#[\.\\\/]#', '', $_POST['language']);
--		if (!file_exists(PUN_ROOT.'lang/'.$language.'/common.php'))
--				message($lang_common['Bad request']);
--	}
--	else
--		$language = $pun_config['o_default_lang'];
--
--	$timezone = intval($_POST['timezone']);
--	$save_pass = (!isset($_POST['save_pass']) || $_POST['save_pass'] != '1') ? '0' : '1';
--
--	$email_setting = intval($_POST['email_setting']);
--	if ($email_setting < 0 || $email_setting > 2) $email_setting = 1;
--
--	// Insert the new user into the database. We do this now to get the last inserted id for later use.
--	$now = time();
--
--	$intial_group_id = ($pun_config['o_regs_verify'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED;
--	$password_hash = pun_hash($password1);
--
--	// Add the user
--	$db->query('INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit) VALUES(\''.$db->escape($username).'\', '.$intial_group_id.', \''.$password_hash.'\', \''.$email1.'\', '.$email_setting.', '.$save_pass.', '.$timezone.' , \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$now.', \''.get_remote_address().'\', '.$now.')') or error('Unable to create user', __FILE__, __LINE__, $db->error());
--	$new_uid = $db->insert_id();
--
--
--	// If we previously found out that the e-mail was banned
--	if ($banned_email && $pun_config['o_mailing_list'] != '')
--	{
--		$mail_subject = 'Alert - Banned e-mail detected';
--		$mail_message = 'User \''.$username.'\' registered with banned e-mail address: '.$email1."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
--
--		pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
--	}
--
--	// If we previously found out that the e-mail was a dupe
--	if (!empty($dupe_list) && $pun_config['o_mailing_list'] != '')
--	{
--		$mail_subject = 'Alert - Duplicate e-mail detected';
--		$mail_message = 'User \''.$username.'\' registered with an e-mail address that also belongs to: '.implode(', ', $dupe_list)."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
--
--		pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
--	}
--
--	// Should we alert people on the admin mailing list that a new user has registered?
--	if ($pun_config['o_regs_report'] == '1')
--	{
--		$mail_subject = 'Alert - New registration';
--		$mail_message = 'User \''.$username.'\' registered in the forums at '.$pun_config['o_base_url']."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
--
--		pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
--	}
--
--	// Must the user verify the registration or do we log him/her in right now?
--	if ($pun_config['o_regs_verify'] == '1')
--	{
--		// Load the "welcome" template
--		$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/welcome.tpl'));
--
--		// The first row contains the subject
--		$first_crlf = strpos($mail_tpl, "\n");
--		$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
--		$mail_message = trim(substr($mail_tpl, $first_crlf));
--
--		$mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
--		$mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
--		$mail_message = str_replace('<username>', $username, $mail_message);
--		$mail_message = str_replace('<password>', $password1, $mail_message);
--		$mail_message = str_replace('<login_url>', $pun_config['o_base_url'].'/login.php', $mail_message);
--		$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
--
--		pun_mail($email1, $mail_subject, $mail_message);
--
--		message($lang_register['Reg e-mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
--	}
--
--	pun_setcookie($new_uid, $password_hash, ($save_pass != '0') ? $now + 31536000 : 0);
--
--	redirect('index.php', $lang_register['Reg complete']);
--}
--
--
--$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register'];
--$required_fields = array('req_username' => $lang_common['Username'], 'req_password1' => $lang_common['Password'], 'req_password2' => $lang_prof_reg['Confirm pass'], 'req_email1' => $lang_common['E-mail'], 'req_email2' => $lang_common['E-mail'].' 2');
--$focus_element = array('register', 'req_username');
--require PUN_ROOT.'header.php';
--
--?>
--<div class="blockform">
--	<h2><span><?php echo $lang_register['Register'] ?></span></h2>
--	<div class="box">
--		<form id="register" method="post" action="register.php?action=register" onsubmit="this.register.disabled=true;if(process_form(this)){return true;}else{this.register.disabled=false;return false;}">
--			<div class="inform">
--				<div class="forminfo">
--					<h3><?php echo $lang_common['Important information'] ?></h3>
--					<p><?php echo $lang_register['Desc 1'] ?></p>
--					<p><?php echo $lang_register['Desc 2'] ?></p>
--				</div>
--				<fieldset>
--					<legend><?php echo $lang_register['Username legend'] ?></legend>
--					<div class="infldset">
--						<input type="hidden" name="form_sent" value="1" />
--						<label><strong><?php echo $lang_common['Username'] ?></strong><br /><input type="text" name="req_username" size="25" maxlength="25" /><br /></label>
--					</div>
--				</fieldset>
--			</div>
--<?php if ($pun_config['o_regs_verify'] == '0'): ?>			<div class="inform">
--				<fieldset>
--					<legend><?php echo $lang_register['Pass legend 1'] ?></legend>
--					<div class="infldset">
--						<label class="conl"><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password1" size="16" maxlength="16" /><br /></label>
--						<label class="conl"><strong><?php echo $lang_prof_reg['Confirm pass'] ?></strong><br /><input type="password" name="req_password2" size="16" maxlength="16" /><br /></label>
--						<p class="clearb"><?php echo $lang_register['Pass info'] ?></p>
--					</div>
--				</fieldset>
--			</div>
--<?php endif; ?>			<div class="inform">
--				<fieldset>
--					<legend><?php echo ($pun_config['o_regs_verify'] == '1') ? $lang_prof_reg['E-mail legend 2'] : $lang_prof_reg['E-mail legend'] ?></legend>
--					<div class="infldset">
--<?php if ($pun_config['o_regs_verify'] == '1'): ?>			<p><?php echo $lang_register['E-mail info'] ?></p>
--<?php endif; ?>					<label><strong><?php echo $lang_common['E-mail'] ?></strong><br />
--						<input type="text" name="req_email1" size="50" maxlength="50" /><br /></label>
--<?php if ($pun_config['o_regs_verify'] == '1'): ?>						<label><strong><?php echo $lang_register['Confirm e-mail'] ?></strong><br />
--						<input type="text" name="req_email2" size="50" maxlength="50" /><br /></label>
--<?php endif; ?>					</div>
--				</fieldset>
--			</div>
--			<div class="inform">
--				<fieldset>
--					<legend><?php echo $lang_prof_reg['Localisation legend'] ?></legend>
--					<div class="infldset">
--						<label><?php echo $lang_prof_reg['Timezone'] ?>: <?php echo $lang_prof_reg['Timezone info'] ?>
--						<br /><select id="time_zone" name="timezone">
--							<option value="-12"<?php if ($pun_config['o_server_timezone'] == -12 ) echo ' selected="selected"' ?>>-12</option>
--							<option value="-11"<?php if ($pun_config['o_server_timezone'] == -11) echo ' selected="selected"' ?>>-11</option>
--							<option value="-10"<?php if ($pun_config['o_server_timezone'] == -10) echo ' selected="selected"' ?>>-10</option>
--							<option value="-9.5"<?php if ($pun_config['o_server_timezone'] == -9.5) echo ' selected="selected"' ?>>-9.5</option>
--							<option value="-9"<?php if ($pun_config['o_server_timezone'] == -9 ) echo ' selected="selected"' ?>>-09</option>
--							<option value="-8.5"<?php if ($pun_config['o_server_timezone'] == -8.5) echo ' selected="selected"' ?>>-8.5</option>
--							<option value="-8"<?php if ($pun_config['o_server_timezone'] == -8 ) echo ' selected="selected"' ?>>-08 PST</option>
--							<option value="-7"<?php if ($pun_config['o_server_timezone'] == -7 ) echo ' selected="selected"' ?>>-07 MST</option>
--							<option value="-6"<?php if ($pun_config['o_server_timezone'] == -6 ) echo ' selected="selected"' ?>>-06 CST</option>
--							<option value="-5"<?php if ($pun_config['o_server_timezone'] == -5 ) echo ' selected="selected"' ?>>-05 EST</option>
--							<option value="-4"<?php if ($pun_config['o_server_timezone'] == -4 ) echo ' selected="selected"' ?>>-04 AST</option>
--							<option value="-3.5"<?php if ($pun_config['o_server_timezone'] == -3.5) echo ' selected="selected"' ?>>-3.5</option>
--							<option value="-3"<?php if ($pun_config['o_server_timezone'] == -3 ) echo ' selected="selected"' ?>>-03 ADT</option>
--							<option value="-2"<?php if ($pun_config['o_server_timezone'] == -2 ) echo ' selected="selected"' ?>>-02</option>
--							<option value="-1"<?php if ($pun_config['o_server_timezone'] == -1) echo ' selected="selected"' ?>>-01</option>
--							<option value="0"<?php if ($pun_config['o_server_timezone'] == 0) echo ' selected="selected"' ?>>00 GMT</option>
--							<option value="1"<?php if ($pun_config['o_server_timezone'] == 1) echo ' selected="selected"' ?>>+01 CET</option>
--							<option value="2"<?php if ($pun_config['o_server_timezone'] == 2 ) echo ' selected="selected"' ?>>+02</option>
--							<option value="3"<?php if ($pun_config['o_server_timezone'] == 3 ) echo ' selected="selected"' ?>>+03</option>
--							<option value="3.5"<?php if ($pun_config['o_server_timezone'] == 3.5 ) echo ' selected="selected"' ?>>+03.5</option>
--							<option value="4"<?php if ($pun_config['o_server_timezone'] == 4 ) echo ' selected="selected"' ?>>+04</option>
--							<option value="4.5"<?php if ($pun_config['o_server_timezone'] == 4.5 ) echo ' selected="selected"' ?>>+04.5</option>
--							<option value="5"<?php if ($pun_config['o_server_timezone'] == 5 ) echo ' selected="selected"' ?>>+05</option>
--							<option value="5.5"<?php if ($pun_config['o_server_timezone'] == 5.5 ) echo ' selected="selected"' ?>>+05.5</option>
--							<option value="6"<?php if ($pun_config['o_server_timezone'] == 6 ) echo ' selected="selected"' ?>>+06</option>
--							<option value="6.5"<?php if ($pun_config['o_server_timezone'] == 6.5 ) echo ' selected="selected"' ?>>+06.5</option>
--							<option value="7"<?php if ($pun_config['o_server_timezone'] == 7 ) echo ' selected="selected"' ?>>+07</option>
--							<option value="8"<?php if ($pun_config['o_server_timezone'] == 8 ) echo ' selected="selected"' ?>>+08</option>
--							<option value="9"<?php if ($pun_config['o_server_timezone'] == 9 ) echo ' selected="selected"' ?>>+09</option>
--							<option value="9.5"<?php if ($pun_config['o_server_timezone'] == 9.5 ) echo ' selected="selected"' ?>>+09.5</option>
--							<option value="10"<?php if ($pun_config['o_server_timezone'] == 10) echo ' selected="selected"' ?>>+10</option>
--							<option value="10.5"<?php if ($pun_config['o_server_timezone'] == 10.5 ) echo ' selected="selected"' ?>>+10.5</option>
--							<option value="11"<?php if ($pun_config['o_server_timezone'] == 11) echo ' selected="selected"' ?>>+11</option>
--							<option value="11.5"<?php if ($pun_config['o_server_timezone'] == 11.5 ) echo ' selected="selected"' ?>>+11.5</option>
--							<option value="12"<?php if ($pun_config['o_server_timezone'] == 12 ) echo ' selected="selected"' ?>>+12</option>
--							<option value="13"<?php if ($pun_config['o_server_timezone'] == 13 ) echo ' selected="selected"' ?>>+13</option>
--							<option value="14"<?php if ($pun_config['o_server_timezone'] == 14 ) echo ' selected="selected"' ?>>+14</option>
--						</select>
--						<br /></label>
--<?php
--
--		$languages = array();
--		$d = dir(PUN_ROOT.'lang');
--		while (($entry = $d->read()) !== false)
--		{
--			if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
--				$languages[] = $entry;
--		}
--		$d->close();
--
--		// Only display the language selection box if there's more than one language available
--		if (count($languages) > 1)
--		{
--
--?>
--							<label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?>
--							<br /><select name="language">
--<?php
--
--			while (list(, $temp) = @each($languages))
--			{
--				if ($pun_config['o_default_lang'] == $temp)
--					echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
--				else
--					echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
--			}
--
--?>
--							</select>
--							<br /></label>
--<?php
--
--		}
--?>
--					</div>
--				</fieldset>
--			</div>
--			<div class="inform">
--				<fieldset>
--					<legend><?php echo $lang_prof_reg['Privacy options legend'] ?></legend>
--					<div class="infldset">
--						<p><?php echo $lang_prof_reg['E-mail setting info'] ?></p>
--						<div class="rbox">
--							<label><input type="radio" name="email_setting" value="0" /><?php echo $lang_prof_reg['E-mail setting 1'] ?><br /></label>
--							<label><input type="radio" name="email_setting" value="1" checked="checked" /><?php echo $lang_prof_reg['E-mail setting 2'] ?><br /></label>
--							<label><input type="radio" name="email_setting" value="2" /><?php echo $lang_prof_reg['E-mail setting 3'] ?><br /></label>
--						</div>
--						<p><?php echo $lang_prof_reg['Save user/pass info'] ?></p>
--						<div class="rbox">
--							<label><input type="checkbox" name="save_pass" value="1" checked="checked" /><?php echo $lang_prof_reg['Save user/pass'] ?><br /></label>
--						</div>
--					</div>
--				</fieldset>
--			</div>
--			<p><input type="submit" name="register" value="<?php echo $lang_register['Register'] ?>" /></p>
--		</form>
--	</div>
--</div>
--<?php
--
--require PUN_ROOT.'footer.php';

Deleted: trunk/vhffs-forum/punbb-1.2.15_vhffs.patch
===================================================================
--- trunk/vhffs-forum/punbb-1.2.15_vhffs.patch	2011-04-17 13:56:20 UTC (rev 1663)
+++ trunk/vhffs-forum/punbb-1.2.15_vhffs.patch	2011-04-17 21:05:41 UTC (rev 1664)
@@ -1,1492 +0,0 @@
-diff -Nru punbb-1.2.15/upload/footer.php punbb-1.2.15-VHFFS-patched/upload/footer.php
---- punbb-1.2.15/upload/footer.php	2007-04-10 20:19:26.000000000 +0200
-+++ punbb-1.2.15-VHFFS-patched/upload/footer.php	2007-09-19 16:49:59.000000000 +0200
-@@ -3,6 +3,8 @@
- 
-   Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
- 
-+  VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-   This file is part of PunBB.
- 
-   PunBB is free software; you can redistribute it and/or modify it
-@@ -106,7 +108,7 @@
- }
- 
- ?>
--			<p class="conr">Powered by <a href="http://www.punbb.org/";>PunBB</a><?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['o_cur_version']; ?><br />&copy; Copyright 2002&#8211;2005 Rickard Andersson</p>
-+			<p class="conr">Powered by <a href="http://www.punbb.org/";>PunBB</a> and <a href="http://www.vhffs.org/";>VHFFS</a><?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['o_cur_version']; ?><br />&copy; Copyright 2002&#8211;2005 Rickard Andersson</p>
- <?php
- 
- // Display debug info (if enabled/defined)
-diff -Nru punbb-1.2.15/upload/include/dblayer/vhffs_db.php punbb-1.2.15-VHFFS-patched/upload/include/dblayer/vhffs_db.php
---- punbb-1.2.15/upload/include/dblayer/vhffs_db.php	1970-01-01 01:00:00.000000000 +0100
-+++ punbb-1.2.15-VHFFS-patched/upload/include/dblayer/vhffs_db.php	2007-09-19 15:05:49.000000000 +0200
-@@ -0,0 +1,269 @@
-+<?php
-+/***********************************************************************
-+
-+  Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
-+
-+  VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-+  This file is part of PunBB.
-+
-+  PunBB is free software; you can redistribute it and/or modify it
-+  under the terms of the GNU General Public License as published
-+  by the Free Software Foundation; either version 2 of the License,
-+  or (at your option) any later version.
-+
-+  PunBB is distributed in the hope that it will be useful, but
-+  WITHOUT ANY WARRANTY; without even the implied warranty of
-+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+  GNU General Public License for more details.
-+
-+  You should have received a copy of the GNU General Public License
-+  along with this program; if not, write to the Free Software
-+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+  MA  02111-1307  USA
-+
-+************************************************************************/
-+
-+
-+// Make sure we have built in support for PostgreSQL
-+if (!function_exists('pg_connect'))
-+	exit('This PHP environment doesn\'t have PostgreSQL support built in. PostgreSQL support is required if you want to use a PostgreSQL database to run this forum. Consult the PHP documentation for further assistance.');
-+
-+
-+class vhffs_DBLayer
-+{
-+	var $prefix;
-+	var $link_id;
-+	var $query_result;
-+	var $last_query_text = array();
-+	var $in_transaction = 0;
-+
-+	var $saved_queries = array();
-+	var $num_queries = 0;
-+
-+	var $error_no = false;
-+	var $error_msg = 'Unknown';
-+
-+
-+	function vhffs_DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
-+	{
-+		$this->prefix = $db_prefix;
-+
-+		if ($db_host != '')
-+		{
-+			if (strpos($db_host, ':') !== false)
-+			{
-+				list($db_host, $dbport) = explode(':', $db_host);
-+				$connect_str[] = 'host='.$db_host.' port='.$dbport;
-+			}
-+			else
-+			{
-+				if ($db_host != 'localhost')
-+					$connect_str[] = 'host='.$db_host;
-+			}
-+		}
-+
-+		if ($db_name)
-+			$connect_str[] = 'dbname='.$db_name;
-+
-+		if ($db_username != '')
-+			$connect_str[] = 'user='.$db_username;
-+
-+		if ($db_password != '')
-+			$connect_str[] = 'password='.$db_password;
-+
-+		if ($p_connect)
-+			$this->link_id = @pg_pconnect(implode(' ', $connect_str));
-+		else
-+			$this->link_id = @pg_connect(implode(' ', $connect_str));
-+
-+		if (!$this->link_id)
-+			error('Unable to connect to VHFFS\'s PostgreSQL server verify connection settings...', __FILE__, __LINE__);
-+		else
-+			return $this->link_id;
-+	}
-+
-+
-+	function start_transaction()
-+	{
-+		++$this->in_transaction;
-+
-+		return (@pg_query($this->link_id, 'BEGIN')) ? true : false;
-+	}
-+
-+
-+	function end_transaction()
-+	{
-+		--$this->in_transaction;
-+
-+		if (@pg_query($this->link_id, 'COMMIT'))
-+			return true;
-+		else
-+		{
-+			@pg_query($this->link_id, 'ROLLBACK');
-+			return false;
-+		}
-+	}
-+
-+
-+	function query($sql, $unbuffered = false)	// $unbuffered is ignored since there is no pgsql_unbuffered_query()
-+	{
-+		if (strrpos($sql, 'LIMIT') !== false)
-+			$sql = preg_replace('#LIMIT ([0-9]+),([ 0-9]+)#', 'LIMIT \\2 OFFSET \\1', $sql);
-+
-+		if (defined('PUN_SHOW_QUERIES'))
-+			$q_start = get_microtime();
-+
-+		@pg_send_query($this->link_id, $sql);
-+		$this->query_result = @pg_get_result($this->link_id);
-+
-+		if (pg_result_status($this->query_result) != PGSQL_FATAL_ERROR)
-+		{
-+			if (defined('PUN_SHOW_QUERIES'))
-+				$this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start));
-+
-+			++$this->num_queries;
-+
-+			$this->last_query_text[$this->query_result] = $sql;
-+
-+			return $this->query_result;
-+		}
-+		else
-+		{
-+			if (defined('PUN_SHOW_QUERIES'))
-+				$this->saved_queries[] = array($sql, 0);
-+
-+			$this->error_msg = @pg_result_error($this->query_result);
-+
-+			if ($this->in_transaction)
-+				@pg_query($this->link_id, 'ROLLBACK');
-+
-+			--$this->in_transaction;
-+
-+			return false;
-+		}
-+	}
-+
-+
-+	function result($query_id = 0, $row = 0)
-+	{
-+		return ($query_id) ? @pg_fetch_result($query_id, $row, 0) : false;
-+	}
-+
-+
-+	function fetch_assoc($query_id = 0)
-+	{
-+		return ($query_id) ? @pg_fetch_assoc($query_id) : false;
-+	}
-+
-+
-+	function fetch_row($query_id = 0)
-+	{
-+		return ($query_id) ? @pg_fetch_row($query_id) : false;
-+	}
-+
-+
-+	function num_rows($query_id = 0)
-+	{
-+		return ($query_id) ? @pg_num_rows($query_id) : false;
-+	}
-+
-+
-+	function affected_rows()
-+	{
-+		return ($this->query_result) ? @pg_affected_rows($this->query_result) : false;
-+	}
-+
-+
-+	function insert_id()
-+	{
-+		$query_id = $this->query_result;
-+
-+		if ($query_id && $this->last_query_text[$query_id] != '')
-+		{
-+			if (preg_match('/^INSERT INTO ([a-z0-9\_\-]+)/is', $this->last_query_text[$query_id], $table_name))
-+			{
-+				// Hack (don't ask)
-+				if (substr($table_name[1], -6) == 'groups')
-+					$table_name[1] .= '_g';
-+
-+				$temp_q_id = @pg_query($this->link_id, 'SELECT currval(\''.$table_name[1].'_id_seq\')');
-+				return ($temp_q_id) ? intval(@pg_fetch_result($temp_q_id, 0)) : false;
-+			}
-+		}
-+
-+		return false;
-+	}
-+
-+
-+	function get_num_queries()
-+	{
-+		return $this->num_queries;
-+	}
-+
-+
-+	function get_saved_queries()
-+	{
-+		return $this->saved_queries;
-+	}
-+
-+
-+	function free_result($query_id = false)
-+	{
-+		if (!$query_id)
-+			$query_id = $this->query_result;
-+
-+		return ($query_id) ? @pg_free_result($query_id) : false;
-+	}
-+
-+
-+	function escape($str)
-+	{
-+		return pg_escape_string($str);
-+	}
-+
-+
-+	function error()
-+	{
-+		$result['error_sql'] = @current(@end($this->saved_queries));
-+		$result['error_no'] = false;
-+/*
-+		if (!empty($this->query_result))
-+		{
-+			$result['error_msg'] = trim(@pg_result_error($this->query_result));
-+			if ($result['error_msg'] != '')
-+				return $result;
-+		}
-+
-+		$result['error_msg'] = (!empty($this->link_id)) ? trim(@pg_last_error($this->link_id)) : trim(@pg_last_error());
-+*/
-+		$result['error_msg'] = $this->error_msg;
-+
-+		return $result;
-+	}
-+
-+
-+	function close()
-+	{
-+		if ($this->link_id)
-+		{
-+			if ($this->in_transaction)
-+			{
-+				if (defined('PUN_SHOW_QUERIES'))
-+					$this->saved_queries[] = array('COMMIT', 0);
-+
-+				@pg_query($this->link_id, 'COMMIT');
-+			}
-+
-+			if ($this->query_result)
-+				@pg_free_result($this->query_result);
-+
-+			return @pg_close($this->link_id);
-+		}
-+		else
-+			return false;
-+	}
-+}
-+
-+$vhffs_db = new vhffs_DBLayer($vhffs_db_host, $vhffs_db_username, $vhffs_db_password, $vhffs_db_name, $vhffs_db_prefix, $vhffs_p_connect);
-+
-diff -Nru punbb-1.2.15/upload/install.php punbb-1.2.15-VHFFS-patched/upload/install.php
---- punbb-1.2.15/upload/install.php	2007-04-11 15:39:52.000000000 +0200
-+++ punbb-1.2.15-VHFFS-patched/upload/install.php	2007-09-19 16:48:20.000000000 +0200
-@@ -3,6 +3,8 @@
- 
-   Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
- 
-+  VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-   This file is part of PunBB.
- 
-   PunBB is free software; you can redistribute it and/or modify it
-@@ -24,7 +26,7 @@
- 
- 
- // The PunBB version this script installs
--$punbb_version = '1.2.15';
-+$punbb_version = '1.2.14';
- 
- 
- define('PUN_ROOT', './');
-@@ -119,7 +121,7 @@
- 	<h2><span>PunBB Installation</span></h2>
- 	<div class="box">
- 		<div class="inbox">
--			<p>Welcome to PunBB installation! You are about to install PunBB. In order to install PunBB you must complete the form set out below. If you encounter any difficulties with the installation, please refer to the documentation.</p>
-+			<p>Welcome to PunBB with VHFFS patch installation! You are about to install PunBB for VHFFS. In order to install PunBB on your VHFFS platform you must complete the form set out below. If you encounter any difficulties with the installation, please refer to the documentation.</p>
- 		</div>
- 	</div>
- </div>
-@@ -131,7 +133,7 @@
- 		<div><input type="hidden" name="form_sent" value="1" /></div>
- 			<div class="inform">
- 				<div class="forminfo">
--					<h3>Database setup</h3>
-+					<h3>PunBB database setup</h3>
- 					<p>Please enter the requested information in order to setup your database for PunBB. You must know all the information asked for before proceeding with the installation.</p>
- 				</div>
- 				<fieldset>
-@@ -154,7 +156,7 @@
- 			</div>
- 			<div class="inform">
- 				<fieldset>
--					<legend>Enter your database server hostname</legend>
-+					<legend>Enter your database server hostname and port</legend>
- 					<div class="infldset">
- 						<p>The address of the database server (example: localhost, db.myhost.com or 192.168.0.15). You can specify a custom port number if your database doesn't run on the default port (example: localhost:3580). For SQLite support, just enter anything or leave it at 'localhost'.</p>
- 						<label><strong>Database server hostname</strong><br /><input type="text" name="req_db_host" value="localhost" size="50" maxlength="100" /><br /></label>
-@@ -192,6 +194,82 @@
- 			</div>
- 			<div class="inform">
- 				<div class="forminfo">
-+					<h3>VHFFS database setup</h3>
-+					<p>Please enter the requested information in order to setup your VHFFS patch for PunBB.</p>
-+				</div>
-+			</div>
-+			<div class="inform">
-+				<fieldset>
-+					<legend>Enter your VHFFS database server hostname</legend>
-+					<div class="infldset">
-+						<p>The address of the VHFFS database server (example: localhost, db.myhost.com or 192.168.0.15). You can specify a custom port number if your database doesn't run on the default port (example: localhost:3580).</p>
-+						<label><strong>VHFFS Database server hostname</strong><br /><input type="text" name="vhffs_db_host" value="localhost:5432" size="50" maxlength="100" /><br /></label>
-+					</div>
-+				</fieldset>
-+			</div>
-+			<div class="inform">
-+				<fieldset>
-+					<legend>Select VHFFS patch mode</legend>
-+					<div class="infldset">
-+						<p>You can chose between full or view mode. The full mode is accessing vhffs's database on read mode. If you don't want the forum to be able to read the whole VHFFS database (for security reasons) you might want to use the view mode. In view mode you have to create a view on the vhffs database with username, passwd, firstname, lastname, mail, state</p>
-+						<label for="vhffs_db_name"><strong>VHFFS Database name</strong><br /><input id="vhffs_db_name" type="text" name="vhffs_db_name" size="30" maxlength="50" /><br /></label>
-+					</div>
-+				</fieldset>
-+			</div>
-+			<div class="inform">
-+				<fieldset>
-+					<legend>Enter the name of your VHFFS database</legend>
-+					<div class="infldset">
-+						<p>The name of the database that your VHFFS system is using. The database must exist so VHFFS have to be installed first.</p>
-+						<label for="vhffs_db_name"><strong>VHFFS Database name</strong><br /><input id="vhffs_db_name" type="text" name="vhffs_db_name" size="30" maxlength="50" /><br /></label>
-+					</div>
-+				</fieldset>
-+			</div>
-+			<div class="inform">
-+				<fieldset>
-+					<legend>Enter your VHFFS database username and password</legend>
-+					<div class="infldset">
-+						<p>Enter the username and password which allows you to connect to the VHFFS database. You may want to use a read only account for security reasons.</p>
-+						<label class="conl">VHFFS Database username<br /><input type="text" name="vhffs_db_username" size="30" maxlength="50" /><br /></label>
-+						<label class="conl">VHFFS Database password<br /><input type="text" name="vhffs_db_password" size="30" maxlength="50" /><br /></label>
-+						<div class="clearer"></div>
-+					</div>
-+				</fieldset>
-+			</div>
-+			<div class="inform">
-+				<fieldset>
-+					<legend>Enter VHFFS database table prefix</legend>
-+					<div class="infldset">
-+						<p>That is the table prefix used by your VHFFS system. Do not change if you don't know precisely what you are doing.<p>
-+						<label>VHFFS Table prefix<br /><input id="vhffs_db_prefix" type="text" value="vhffs_" name="vhffs_db_prefix" size="20" maxlength="30" /><br /></label>
-+					</div>
-+				</fieldset>
-+			</div>
-+			<div class="inform">
-+				<div class="forminfo">
-+					<h3>VHFFS's panel options</h3>
-+					<p>Please enter the requested information in order to link the forum to your VHFFS panel.</p>
-+				</div>
-+				<fieldset>
-+					<legend>Enter your Team name</legend>
-+					<div class="infldset">
-+						<p>The team name is the name of the VHFFS Panel owner group. It will be displayed in login,registration and profile modification process.</p>
-+						<label><strong>Team name</strong><br /><input type="text" value="VHFFS" name="vhffs_team" size="25" maxlength="25" /><br /></label>
-+					</div>
-+				</fieldset>
-+			</div>
-+			<div class="inform">
-+				<fieldset>
-+					<legend>Enter the URL of your VHFFS panel</legend>
-+					<div class="infldset">
-+						<p>That is the table prefix used by your VHFFS system. Do not change if you don't know precisely what you are doing.<p>
-+						<label>VHFFS panel URL<br /><input id="vhffs_panel_url" type="text" value="panel.localhost" name="vhffs_panel_url" size="20" maxlength="30" /><br /></label>
-+					</div>
-+				</fieldset>
-+			</div>
-+
-+			<div class="inform">
-+				<div class="forminfo">
- 					<h3>Administration setup</h3>
- 					<p>Please enter the requested information in order to setup an administrator for your PunBB installation</p>
- 				</div>
-@@ -301,7 +379,15 @@
- 	$email = strtolower(trim($_POST['req_email']));
- 	$password1 = unescape(trim($_POST['req_password1']));
- 	$password2 = unescape(trim($_POST['req_password2']));
--
-+	
-+	//VHFFS MODIFICATION : verifying VHFFS parameters
-+	$vhffs_db_host = trim($_POST['vhffs_db_host']);
-+	$vhffs_db_name = trim($_POST['vhffs_db_name']);
-+       	$vhffs_db_username = unescape(trim($_POST['vhffs_db_username']));
-+        $vhffs_db_password = unescape(trim($_POST['vhffs_db_password']));
-+        $vhffs_db_prefix = trim($_POST['vhffs_db_prefix']);
-+	$vhffs_team = trim($_POST['vhffs_team']);
-+ 	$vhffs_panel_url = trim($_POST['vhffs_panel_url']);
- 
- 	// Make sure base_url doesn't end with a slash
- 	if (substr($_POST['req_base_url'], -1) == '/')
-@@ -1234,7 +1320,6 @@
- 		case 'mysql':
- 		case 'mysqli':
- 			// We use MySQL's ALTER TABLE ... ADD INDEX syntax instead of CREATE INDEX to avoid problems with users lacking the INDEX privilege
--			$queries[] = 'ALTER TABLE '.$db_prefix.'online ADD UNIQUE INDEX '.$db_prefix.'online_user_id_ident_idx(user_id,ident)';
- 			$queries[] = 'ALTER TABLE '.$db_prefix.'online ADD INDEX '.$db_prefix.'online_user_id_idx(user_id)';
- 			$queries[] = 'ALTER TABLE '.$db_prefix.'posts ADD INDEX '.$db_prefix.'posts_topic_id_idx(topic_id)';
- 			$queries[] = 'ALTER TABLE '.$db_prefix.'posts ADD INDEX '.$db_prefix.'posts_multi_idx(poster_id, topic_id)';
-@@ -1400,8 +1485,9 @@
- 		$alerts .= '<p style="font-size: 1.1em"><span style="color: #C03000"><strong>The avatar directory is currently not writable!</strong></span> If you want users to be able to upload their own avatar images you must see to it that the directory named <em>img/avatars</em> is writable by PHP. You can later choose to save avatar images in a different directory (see Admin/Options). Use chmod to set the appropriate directory permissions. If in doubt, chmod to 0777.</p>';
- 
- 
-+	// VHFFS MODIFICATION : use given parameters to generate VHFFS patch section in config file
- 	/// Display config.php and give further instructions
--	$config = '<?php'."\n\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.$db_name."';\n".'$db_username = \''.$db_username."';\n".'$db_password = \''.$db_password."';\n".'$db_prefix = \''.$db_prefix."';\n".'$p_connect = false;'."\n\n".'$cookie_name = '."'punbb_cookie';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n".'$cookie_seed = \''.substr(md5(time()), -8)."';\n\ndefine('PUN', 1);";
-+	$config = '<?php'."\n\\\\PunBB section\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.$db_name."';\n".'$db_username = \''.$db_username."';\n".'$db_password = \''.$db_password."';\n".'$db_prefix = \''.$db_prefix."';\n".'$p_connect = false;'."\n\n".'$cookie_name = '."'punbb_cookie';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n".'$cookie_seed = \''.substr(md5(time()), -8)."';\n\ndefine('PUN', 1);\n\n\////VHFFS patch section\n\n".'$vhffs_db_host = \''.$vhffs_db_host."';\n".'$vhffs_db_name = \''.$vhffs_db_name."';\n".'$vhffs_db_username = \''.$vhffs_db_username."';\n".'$vhffs_db_password = \''.$vhffs_db_password."';\n".'$vhffs_db_prefix = \''.$vhffs_db_prefix."';\n".'$vhffs_p_connect = true'.";\n".'$vhffs_team = \''.$vhffs_team."';\n".'$vhffs_panel_url = \''.$vhffs_panel_url."';\n\n".'?>';
- 
- 
- ?>
-@@ -1424,7 +1510,7 @@
- 		<div class="fakeform">
- 			<div class="inform">
- 				<div class="forminfo">
--					<p>To finalize the installation all you need to do is to <strong>copy and paste the text in the text box below into a file called config.php and then upload this file to the root directory of your PunBB installation</strong>. Make sure there are no linebreaks or spaces before &lt;?php. You can later edit config.php if you reconfigure your setup (e.g. change the database password or ).</p>
-+					<p>To finalize the installation all you need to do is to <strong>copy and paste the text in the text box below into a file called config.php and then upload this file to the root directory of your PunBB installation</strong>. Make sure there are no linebreaks or spaces before &lt;?php. You can later edit config.php if you reconfigure your setup (e.g. change the database password... ).</p>
- <?php if ($alerts != ''): ?>					<?php echo $alerts."\n" ?>
- <?php endif; ?>				</div>
- 				<fieldset>
-@@ -1436,7 +1522,7 @@
- 			</div>
- 			<div class="inform">
- 				<div class="forminfo">
--					<p>Once you have created config.php with the contents above, PunBB is installed!</p>
-+					<p>Once you have created config.php with the contents above, PunBB with VHFFS patch is installed!</p>
- 					<p><a href="index.php">Go to forum index</a></p>
- 				</div>
- 			</div>
-diff -Nru punbb-1.2.15/upload/lang/English/post.php punbb-1.2.15-VHFFS-patched/upload/lang/English/post.php
---- punbb-1.2.15/upload/lang/English/post.php	2005-01-11 22:41:16.000000000 +0100
-+++ punbb-1.2.15-VHFFS-patched/upload/lang/English/post.php	2007-09-19 17:55:21.000000000 +0200
-@@ -28,6 +28,10 @@
- 'Edit post legend'		=>	'Edit the post and submit changes',
- 'Silent edit'			=>	'Silent edit (don\'t display "Edited by ..." in topic view)',
- 'Edit post'				=>	'Edit post',
--'Edit redirect'			=>	'Post updated. Redirecting &hellip;'
-+'Edit redirect'			=>	'Post updated. Redirecting &hellip;',
- 
-+// antibot
-+'Bot message'			=>	'Please write here the what you see in the image in order to verify that you are not one of those stupid spamming bots...',
-+'Bot warning'			=>	'(notice that there are only capitals and numbers)',
-+'Bot owned'                     =>	'Spammers go home!'
- );
-diff -Nru punbb-1.2.15/upload/login.php punbb-1.2.15-VHFFS-patched/upload/login.php
---- punbb-1.2.15/upload/login.php	2006-05-20 19:52:04.000000000 +0200
-+++ punbb-1.2.15-VHFFS-patched/upload/login.php	2007-09-19 17:03:17.000000000 +0200
-@@ -3,6 +3,8 @@
- 
-   Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
- 
-+  VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-   This file is part of PunBB.
- 
-   PunBB is free software; you can redistribute it and/or modify it
-@@ -29,6 +31,9 @@
- define('PUN_ROOT', './');
- require PUN_ROOT.'include/common.php';
- 
-+// VHFFS MODIFICATION : Load the vhffs specific database
-+
-+require PUN_ROOT.'include/dblayer/vhffs_db.php';
- 
- // Load the login.php language file
- require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
-@@ -42,31 +47,54 @@
- 
- 	$username_sql = ($db_type == 'mysql' || $db_type == 'mysqli') ? 'username=\''.$db->escape($form_username).'\'' : 'LOWER(username)=LOWER(\''.$db->escape($form_username).'\')';
- 
--	$result = $db->query('SELECT id, group_id, password, save_pass FROM '.$db->prefix.'users WHERE '.$username_sql) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-+	// VHFFS MODIFICATION : New login system, using VHFFS's database for auth and copying Personal data to Forum database
-+
-+	//looking for the user in the forum database
-+        $result = $db->query('SELECT id, group_id, password, save_pass FROM '.$db->prefix.'users WHERE '.$username_sql) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
- 	list($user_id, $group_id, $db_password_hash, $save_pass) = $db->fetch_row($result);
- 
-+	//looking for the user in View
-+
-+	$vhffs_result = $vhffs_db->query('SELECT passwd, firstname, lastname, mail, date_creation, state FROM '.$vhffs_db->prefix.'forum WHERE '.$username_sql) or error('Unable to fetch user info in '.$vhffs_team.' database', __FILE__, __LINE__, $db->error());
-+	list($vhffs_db_password_hash, $vhffs_user_firstname, $vhffs_user_lastname, $vhffs_user_mail, $vhffs_inscription_date, $vhffs_user_status) = $vhffs_db->fetch_row($vhffs_result);
-+
- 	$authorized = false;
- 
--	if (!empty($db_password_hash))
--	{
--		$sha1_in_db = (strlen($db_password_hash) == 40) ? true : false;
--		$sha1_available = (function_exists('sha1') || function_exists('mhash')) ? true : false;
-+       if (empty($vhffs_db_password_hash))
-+        {
-+                message('User don\'t exist in '.$vhffs_team.' database. Please create an acount on <a href="'.$vhffs_panel_url.'">'.$vhffs_team.' \'s panel </a>', __FILE__, __LINE__);
-+        }
-+        else if ($vhffs_user_status != 6) //If user status is not "Activated"
-+        {
-+                message('User not Activated in '.$vhffs_team.' database. Is registration process complete ?', __FILE__, __LINE__);
-+        }
-+
-+        else if (empty($user_id))
-+        {
-+               // defaults
-+                $intial_group_id = ($pun_config['o_regs_verify'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED;
-+                $language = 'English';
-+
-+                // creating new user in forum database
-+		$db->query('INSERT INTO '.$db->prefix.'users (username, password, group_id, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit, realname) VALUES (\''.$db->escape($form_username).'\', \'\','.$intial_group_id.', \''.$vhffs_user_mail.'\', 1, 1, 0 , \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$vhffs_inscription_date.', \''.get_remote_address().'\', '.time().', \''.$db->escape($vhffs_user_firstname).'\ '.$db->escape($vhffs_user_lastname).'\' )') or error('Unable to create user in forum database. Error: '.$db->error(), __FILE__, __LINE__, $db->error());
-+                $user_id = $db->insert_id();
-+                $vhffs_user_import = true;
-+        }
- 
--		$form_password_hash = pun_hash($form_password);	// This could result in either an SHA-1 or an MD5 hash (depends on $sha1_available)
-+	if ((!empty($user_id)) && (!empty($vhffs_db_password_hash))) //as we want to delete passwords in forum database, we test the user id result instead of the password result
-+	{
-+                $CRYPT_MD5 = 1;
- 
--		if ($sha1_in_db && $sha1_available && $db_password_hash == $form_password_hash)
--			$authorized = true;
--		else if (!$sha1_in_db && $db_password_hash == md5($form_password))
--		{
--			$authorized = true;
--
--			if ($sha1_available)	// There's an MD5 hash in the database, but SHA1 hashing is available, so we update the DB
--				$db->query('UPDATE '.$db->prefix.'users SET password=\''.$form_password_hash.'\' WHERE id='.$user_id) or error('Unable to update user password', __FILE__, __LINE__, $db->error());
--		}
--	}
-+                // VHFFS password verification
-+                if (crypt($form_password, $vhffs_db_password_hash) == $vhffs_db_password_hash)
-+                {
-+                        $authorized = true;
-+                }
-+        }
- 
- 	if (!$authorized)
--		message($lang_login['Wrong user/pass'].' <a href="login.php?action=forget">'.$lang_login['Forgotten pass'].'</a>');
-+	 message($lang_login['Wrong user/pass'].' <a href="'.$vhffs_panel_url.'/lost.pl">'.$lang_login['Forgotten pass'].'</a>');
-+
- 
- 	// Update the status if this is the first time the user logged in
- 	if ($group_id == PUN_UNVERIFIED)
-@@ -103,86 +131,11 @@
- }
- 
- 
-+//VHFFS modification : removing password recovery
-+
- else if ($action == 'forget' || $action == 'forget_2')
- {
--	if (!$pun_user['is_guest'])
--		header('Location: index.php');
--
--	if (isset($_POST['form_sent']))
--	{
--		require PUN_ROOT.'include/email.php';
--
--		// Validate the email-address
--		$email = strtolower(trim($_POST['req_email']));
--		if (!is_valid_email($email))
--			message($lang_common['Invalid e-mail']);
--
--		$result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($email).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--
--		if ($db->num_rows($result))
--		{
--			// Load the "activate password" template
--			$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_password.tpl'));
--
--			// The first row contains the subject
--			$first_crlf = strpos($mail_tpl, "\n");
--			$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
--			$mail_message = trim(substr($mail_tpl, $first_crlf));
--
--			// Do the generic replacements first (they apply to all e-mails sent out here)
--			$mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
--			$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
--
--			// Loop through users we found
--			while ($cur_hit = $db->fetch_assoc($result))
--			{
--				// Generate a new password and a new password activation code
--				$new_password = random_pass(8);
--				$new_password_key = random_pass(8);
--
--				$db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.pun_hash($new_password).'\', activate_key=\''.$new_password_key.'\' WHERE id='.$cur_hit['id']) or error('Unable to update activation data', __FILE__, __LINE__, $db->error());
--
--				// Do the user specific replacements to the template
--				$cur_mail_message = str_replace('<username>', $cur_hit['username'], $mail_message);
--				$cur_mail_message = str_replace('<activation_url>', $pun_config['o_base_url'].'/profile.php?id='.$cur_hit['id'].'&action=change_pass&key='.$new_password_key, $cur_mail_message);
--				$cur_mail_message = str_replace('<new_password>', $new_password, $cur_mail_message);
--
--				pun_mail($email, $mail_subject, $cur_mail_message);
--			}
--
--			message($lang_login['Forget mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
--		}
--		else
--			message($lang_login['No e-mail match'].' '.htmlspecialchars($email).'.');
--	}
--
--
--	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_login['Request pass'];
--	$required_fields = array('req_email' => $lang_common['E-mail']);
--	$focus_element = array('request_pass', 'req_email');
--	require PUN_ROOT.'header.php';
--
--?>
--<div class="blockform">
--	<h2><span><?php echo $lang_login['Request pass'] ?></span></h2>
--	<div class="box">
--		<form id="request_pass" method="post" action="login.php?action=forget_2" onsubmit="this.request_pass.disabled=true;if(process_form(this)){return true;}else{this.request_pass.disabled=false;return false;}">
--			<div class="inform">
--				<fieldset>
--					<legend><?php echo $lang_login['Request pass legend'] ?></legend>
--					<div class="infldset">
--						<input type="hidden" name="form_sent" value="1" />
--						<input id="req_email" type="text" name="req_email" size="50" maxlength="50" />
--						<p><?php echo $lang_login['Request pass info'] ?></p>
--					</div>
--				</fieldset>
--			</div>
--			<p><input type="submit" name="request_pass" value="<?php echo $lang_common['Submit'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
--		</form>
--	</div>
--</div>
--<?php
--
-+	message('Please use the <a href="'.$vhffs_panel_url.'/lost.pl">'.$vhffs_team.' \'s panel </a> for password recovery.', __FILE__, __LINE__);
- 	require PUN_ROOT.'footer.php';
- }
- 
-diff -Nru punbb-1.2.15/upload/post.php punbb-1.2.15-VHFFS-patched/upload/post.php
---- punbb-1.2.15/upload/post.php	2007-01-15 16:59:04.000000000 +0100
-+++ punbb-1.2.15-VHFFS-patched/upload/post.php	2007-09-19 18:00:51.000000000 +0200
-@@ -3,6 +3,8 @@
- 
-   Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
- 
-+  VHFFS Antibot by Samuel Lesueur crafty@xxxxxxxxxxxxx
-+
-   This file is part of PunBB.
- 
-   PunBB is free software; you can redistribute it and/or modify it
-@@ -141,6 +143,12 @@
- 			if (!is_valid_email($email))
- 				$errors[] = $lang_common['Invalid e-mail'];
- 		}
-+
-+                //Check that the antispam code is ok
-+                if(crypt($_POST['antibot_test'],$_POST['code'])!=$_POST['code'])
-+                {
-+                        $errors[] = $lang_post['Bot owned'];
-+                }
- 	}
- 
- 	// Clean up message from POST
-@@ -531,6 +539,39 @@
- 
- }
- 
-+//antispam :)
-+if ($pun_user['is_guest'])
-+{
-+?>
-+                        </div>
-+                        <div class="inform">
-+                                <fieldset>
-+                                        <legend>Antispam</legend>
-+                                        <div class="infldset">
-+                                                <div class="rbox">
-+                                                        <p>
-+                                                        <?php echo $lang_post['Bot message']."<br/>".$lang_post['Bot warning'] ?>
-+                                                        </p>
-+                                                        <?php
-+                                                                $antibot_code = '';
-+                                                                $antibot_text = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789';
-+                                                                for($i=0;$i<6;$i++)
-+                                                                {
-+                                                                        $antibot_num=rand(0,34);
-+                                                                        echo("<img alt='antibot' src='img/antibot/".$antibot_text[$antibot_num].".png'/>");
-+                                                                        $antibot_code=$antibot_code.$antibot_text[$antibot_num];
-+                                                                }
-+                                                        $antibot_code=crypt($antibot_code);
-+                                                        ?>
-+                                                        <input type='text' name='antibot_test' size='6' maxlength='6' />
-+                                                        <input type='hidden' value='<?php echo $antibot_code;?>' name='code'/>
-+                                                </div>
-+                                        </div>
-+                                </fieldset>
-+
-+<?php
-+}
-+
- ?>
- 			</div>
- 			<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" /><input type="submit" name="preview" value="<?php echo $lang_post['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
-@@ -593,4 +634,4 @@
- 
- }
- 
--require PUN_ROOT.'footer.php';
-\ No newline at end of file
-+require PUN_ROOT.'footer.php';
-diff -Nru punbb-1.2.15/upload/profile.php punbb-1.2.15-VHFFS-patched/upload/profile.php
---- punbb-1.2.15/upload/profile.php	2007-04-11 01:37:36.000000000 +0200
-+++ punbb-1.2.15-VHFFS-patched/upload/profile.php	2007-09-19 16:49:46.000000000 +0200
-@@ -3,6 +3,8 @@
- 
-   Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
- 
-+  VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-   This file is part of PunBB.
- 
-   PunBB is free software; you can redistribute it and/or modify it
-@@ -43,256 +45,18 @@
- require PUN_ROOT.'lang/'.$pun_user['language'].'/profile.php';
- 
- 
-+// VHFFS MODIFICATION : password and email change disabled
-+
- if ($action == 'change_pass')
- {
--	if (isset($_GET['key']))
--	{
--		// If the user is already logged in we shouldn't be here :)
--		if (!$pun_user['is_guest'])
--		{
--			header('Location: index.php');
--			exit;
--		}
--
--		$key = $_GET['key'];
--
--		$result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch new password', __FILE__, __LINE__, $db->error());
--		list($new_password_hash, $new_password_key) = $db->fetch_row($result);
--
--		if ($key == '' || $key != $new_password_key)
--			message($lang_profile['Pass key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
--		else
--		{
--			$db->query('UPDATE '.$db->prefix.'users SET password=\''.$new_password_hash.'\', activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Unable to update password', __FILE__, __LINE__, $db->error());
--
--			message($lang_profile['Pass updated'], true);
--		}
--	}
--
--	// Make sure we are allowed to change this users password
--	if ($pun_user['id'] != $id)
--	{
--		if ($pun_user['g_id'] > PUN_MOD)	// A regular user trying to change another users password?
--			message($lang_common['No permission']);
--		else if ($pun_user['g_id'] == PUN_MOD)	// A moderator trying to change a users password?
--		{
--			$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--			if (!$db->num_rows($result))
--				message($lang_common['Bad request']);
--
--			if ($pun_config['p_mod_edit_users'] == '0' || $pun_config['p_mod_change_passwords'] == '0' || $db->result($result) < PUN_GUEST)
--				message($lang_common['No permission']);
--		}
--	}
--
--	if (isset($_POST['form_sent']))
--	{
--		$old_password = isset($_POST['req_old_password']) ? trim($_POST['req_old_password']) : '';
--		$new_password1 = trim($_POST['req_new_password1']);
--		$new_password2 = trim($_POST['req_new_password2']);
--
--		if ($new_password1 != $new_password2)
--			message($lang_prof_reg['Pass not match']);
--		if (strlen($new_password1) < 4)
--			message($lang_prof_reg['Pass too short']);
--
--		$result = $db->query('SELECT password, save_pass FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch password', __FILE__, __LINE__, $db->error());
--		list($db_password_hash, $save_pass) = $db->fetch_row($result);
--
--		$authorized = false;
--
--		if (!empty($db_password_hash))
--		{
--			$sha1_in_db = (strlen($db_password_hash) == 40) ? true : false;
--			$sha1_available = (function_exists('sha1') || function_exists('mhash')) ? true : false;
--
--			$old_password_hash = pun_hash($old_password);	// This could result in either an SHA-1 or an MD5 hash
--
--			if (($sha1_in_db && $sha1_available && $db_password_hash == $old_password_hash) ||
--				(!$sha1_in_db && $db_password_hash == md5($old_password)) ||
--				$pun_user['g_id'] < PUN_GUEST)
--				$authorized = true;
--		}
--
--		if (!$authorized)
--			message($lang_profile['Wrong pass']);
--
--		$new_password_hash = pun_hash($new_password1);
--
--		$db->query('UPDATE '.$db->prefix.'users SET password=\''.$new_password_hash.'\' WHERE id='.$id) or error('Unable to update password', __FILE__, __LINE__, $db->error());
--
--		if ($pun_user['id'] == $id)
--		{
--			$expire = ($save_pass == '1') ? time() + 31536000 : 0;
--			pun_setcookie($pun_user['id'], $new_password_hash, $expire);
--		}
--
--		redirect('profile.php?section=essentials&amp;id='.$id, $lang_profile['Pass updated redirect']);
--	}
--
--	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
--	$required_fields = array('req_old_password' => $lang_profile['Old pass'], 'req_new_password1' => $lang_profile['New pass'], 'req_new_password2' => $lang_profile['Confirm new pass']);
--	$focus_element = array('change_pass', (($pun_user['g_id'] > PUN_MOD) ? 'req_old_password' : 'req_new_password1'));
--	require PUN_ROOT.'header.php';
--
--?>
--<div class="blockform">
--	<h2><span><?php echo $lang_profile['Change pass'] ?></span></h2>
--	<div class="box">
--		<form id="change_pass" method="post" action="profile.php?action=change_pass&amp;id=<?php echo $id ?>" onsubmit="return process_form(this)">
--			<div class="inform">
--				<input type="hidden" name="form_sent" value="1" />
--				<fieldset>
--					<legend><?php echo $lang_profile['Change pass legend'] ?></legend>
--					<div class="infldset">
--<?php if ($pun_user['g_id'] > PUN_MOD): ?>						<label><strong><?php echo $lang_profile['Old pass'] ?></strong><br />
--						<input type="password" name="req_old_password" size="16" maxlength="16" /><br /></label>
--<?php endif; ?>						<label class="conl"><strong><?php echo $lang_profile['New pass'] ?></strong><br />
--						<input type="password" name="req_new_password1" size="16" maxlength="16" /><br /></label>
--						<label class="conl"><strong><?php echo $lang_profile['Confirm new pass'] ?></strong><br />
--						<input type="password" name="req_new_password2" size="16" maxlength="16" /><br /></label>
--						<div class="clearb"></div>
--					</div>
--				</fieldset>
--			</div>
--			<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
--		</form>
--	</div>
--</div>
--<?php
--
-+	message('Please use the <a href="'.$vhffs_panel_url.'">'.$vhffs_team.'\'s panel </a> to modify your password.', __FILE__, __LINE__);
- 	require PUN_ROOT.'footer.php';
- }
- 
- 
- else if ($action == 'change_email')
- {
--	// Make sure we are allowed to change this users e-mail
--	if ($pun_user['id'] != $id)
--	{
--		if ($pun_user['g_id'] > PUN_MOD)	// A regular user trying to change another users e-mail?
--			message($lang_common['No permission']);
--		else if ($pun_user['g_id'] == PUN_MOD)	// A moderator trying to change a users e-mail?
--		{
--			$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--			if (!$db->num_rows($result))
--				message($lang_common['Bad request']);
--
--			if ($pun_config['p_mod_edit_users'] == '0' || $db->result($result) < PUN_GUEST)
--				message($lang_common['No permission']);
--		}
--	}
--
--	if (isset($_GET['key']))
--	{
--		$key = $_GET['key'];
--
--		$result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch activation data', __FILE__, __LINE__, $db->error());
--		list($new_email, $new_email_key) = $db->fetch_row($result);
--
--		if ($key == '' || $key != $new_email_key)
--			message($lang_profile['E-mail key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
--		else
--		{
--			$db->query('UPDATE '.$db->prefix.'users SET email=activate_string, activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Unable to update e-mail address', __FILE__, __LINE__, $db->error());
--
--			message($lang_profile['E-mail updated'], true);
--		}
--	}
--	else if (isset($_POST['form_sent']))
--	{
--		if (pun_hash($_POST['req_password']) !== $pun_user['password'])
--			message($lang_profile['Wrong pass']);
--
--		require PUN_ROOT.'include/email.php';
--
--		// Validate the email-address
--		$new_email = strtolower(trim($_POST['req_new_email']));
--		if (!is_valid_email($new_email))
--			message($lang_common['Invalid e-mail']);
--
--		// Check it it's a banned e-mail address
--		if (is_banned_email($new_email))
--		{
--			if ($pun_config['p_allow_banned_email'] == '0')
--				message($lang_prof_reg['Banned e-mail']);
--			else if ($pun_config['o_mailing_list'] != '')
--			{
--				$mail_subject = 'Alert - Banned e-mail detected';
--				$mail_message = 'User \''.$pun_user['username'].'\' changed to banned e-mail address: '.$new_email."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$id."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
--
--				pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
--			}
--		}
--
--		// Check if someone else already has registered with that e-mail address
--		$result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($new_email).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--		if ($db->num_rows($result))
--		{
--			if ($pun_config['p_allow_dupe_email'] == '0')
--				message($lang_prof_reg['Dupe e-mail']);
--			else if ($pun_config['o_mailing_list'] != '')
--			{
--				while ($cur_dupe = $db->fetch_assoc($result))
--					$dupe_list[] = $cur_dupe['username'];
--
--				$mail_subject = 'Alert - Duplicate e-mail detected';
--				$mail_message = 'User \''.$pun_user['username'].'\' changed to an e-mail address that also belongs to: '.implode(', ', $dupe_list)."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$id."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
--
--				pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
--			}
--		}
--
--
--		$new_email_key = random_pass(8);
--
--		$db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.$db->escape($new_email).'\', activate_key=\''.$new_email_key.'\' WHERE id='.$id) or error('Unable to update activation data', __FILE__, __LINE__, $db->error());
--
--		// Load the "activate e-mail" template
--		$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_email.tpl'));
--
--		// The first row contains the subject
--		$first_crlf = strpos($mail_tpl, "\n");
--		$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
--		$mail_message = trim(substr($mail_tpl, $first_crlf));
--
--		$mail_message = str_replace('<username>', $pun_user['username'], $mail_message);
--		$mail_message = str_replace('<base_url>', $pun_config['o_base_url'], $mail_message);
--		$mail_message = str_replace('<activation_url>', $pun_config['o_base_url'].'/profile.php?action=change_email&id='.$id.'&key='.$new_email_key, $mail_message);
--		$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
--
--		pun_mail($new_email, $mail_subject, $mail_message);
--
--		message($lang_profile['Activate e-mail sent'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
--	}
--
--	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
--	$required_fields = array('req_new_email' => $lang_profile['New e-mail'], 'req_password' => $lang_common['Password']);
--	$focus_element = array('change_email', 'req_new_email');
--	require PUN_ROOT.'header.php';
--
--?>
--<div class="blockform">
--	<h2><span><?php echo $lang_profile['Change e-mail'] ?></span></h2>
--	<div class="box">
--		<form id="change_email" method="post" action="profile.php?action=change_email&amp;id=<?php echo $id ?>" id="change_email" onsubmit="return process_form(this)">
--			<div class="inform">
--				<fieldset>
--					<legend><?php echo $lang_profile['E-mail legend'] ?></legend>
--					<div class="infldset">
--						<input type="hidden" name="form_sent" value="1" />
--						<label><strong><?php echo $lang_profile['New e-mail'] ?></strong><br /><input type="text" name="req_new_email" size="50" maxlength="50" /><br /></label>
--						<label><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password" size="16" maxlength="16" /><br /></label>
--						<p><?php echo $lang_profile['E-mail instructions'] ?></p>
--					</div>
--				</fieldset>
--			</div>
--			<p><input type="submit" name="new_email" value="<?php echo $lang_common['Submit'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
--		</form>
--	</div>
--</div>
--<?php
--
-+	message('Please use the <a href="'.$vhffs_panel_url.'">'.$vhffs_team.'\'s panel </a> to modify your email.', __FILE__, __LINE__);
- 	require PUN_ROOT.'footer.php';
- }
- 
-@@ -1056,7 +820,8 @@
- 			else
- 				$username_field = '<p>'.$lang_common['Username'].': '.pun_htmlspecialchars($user['username']).'</p>'."\n";
- 
--			$email_field = '<label><strong>'.$lang_common['E-mail'].'</strong><br /><input type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="50" /><br /></label><p><a href="misc.php?email='.$id.'">'.$lang_common['Send e-mail'].'</a></p>'."\n";
-+			// VHFFS Modif : as VHFFS users are not allowed to modify their email address, this field is disabled but displayed
-+			$email_field = '<label><strong>'.$lang_common['E-mail'].'</strong><br /><input disabled type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="50" /><br /></label><p><a href="misc.php?email='.$id.'">'.$lang_common['Send e-mail'].'</a></p>'."\n";
- 		}
- 		else
- 		{
-diff -Nru punbb-1.2.15/upload/register.php punbb-1.2.15-VHFFS-patched/upload/register.php
---- punbb-1.2.15/upload/register.php	2007-01-15 01:58:18.000000000 +0100
-+++ punbb-1.2.15-VHFFS-patched/upload/register.php	2007-09-19 16:49:33.000000000 +0200
-@@ -3,6 +3,9 @@
- 
-   Copyright (C) 2002-2005  Rickard Andersson (rickard@xxxxxxxxx)
- 
-+  VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-+
-   This file is part of PunBB.
- 
-   PunBB is free software; you can redistribute it and/or modify it
-@@ -27,385 +30,10 @@
- require PUN_ROOT.'include/common.php';
- 
- 
--// If we are logged in, we shouldn't be here
--if (!$pun_user['is_guest'])
--{
--	header('Location: index.php');
--	exit;
--}
--
--// Load the register.php language file
--require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
--
--// Load the register.php/profile.php language file
--require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
--
--if ($pun_config['o_regs_allow'] == '0')
--	message($lang_register['No new regs']);
--
--
--// User pressed the cancel button
--if (isset($_GET['cancel']))
--	redirect('index.php', $lang_register['Reg cancel redirect']);
--
--
--else if ($pun_config['o_rules'] == '1' && !isset($_GET['agree']) && !isset($_POST['form_sent']))
--{
--	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register'];
--	require PUN_ROOT.'header.php';
-+//VHFFS MODIFICATION : Registering procces removed
- 
--?>
--<div class="blockform">
--	<h2><span><?php echo $lang_register['Forum rules'] ?></span></h2>
--	<div class="box">
--		<form method="get" action="register.php">
--			<div class="inform">
--				<fieldset>
--					<legend><?php echo $lang_register['Rules legend'] ?></legend>
--					<div class="infldset">
--						<p><?php echo $pun_config['o_rules_message'] ?></p>
--					</div>
--				</fieldset>
--			</div>
--			<p><input type="submit" name="agree" value="<?php echo $lang_register['Agree'] ?>" /><input type="submit" name="cancel" value="<?php echo $lang_register['Cancel'] ?>" /></p>
--		</form>
--	</div>
--</div>
--<?php
--
--	require PUN_ROOT.'footer.php';
--}
--
--
--else if (isset($_POST['form_sent']))
--{
--	// Check that someone from this IP didn't register a user within the last hour (DoS prevention)
--	$result = $db->query('SELECT 1 FROM '.$db->prefix.'users WHERE registration_ip=\''.get_remote_address().'\' AND registered>'.(time() - 3600)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--
--	if ($db->num_rows($result))
--		message('A new user was registered with the same IP address as you within the last hour. To prevent registration flooding, at least an hour has to pass between registrations from the same IP. Sorry for the inconvenience.');
--
--
--	$username = pun_trim($_POST['req_username']);
--	$email1 = strtolower(trim($_POST['req_email1']));
--
--	if ($pun_config['o_regs_verify'] == '1')
--	{
--		$email2 = strtolower(trim($_POST['req_email2']));
--
--		$password1 = random_pass(8);
--		$password2 = $password1;
--	}
--	else
--	{
--		$password1 = trim($_POST['req_password1']);
--		$password2 = trim($_POST['req_password2']);
--	}
--
--	// Convert multiple whitespace characters into one (to prevent people from registering with indistinguishable usernames)
--	$username = preg_replace('#\s+#s', ' ', $username);
--
--	// Validate username and passwords
--	if (strlen($username) < 2)
--		message($lang_prof_reg['Username too short']);
--	else if (pun_strlen($username) > 25)	// This usually doesn't happen since the form element only accepts 25 characters
--	    message($lang_common['Bad request']);
--	else if (strlen($password1) < 4)
--		message($lang_prof_reg['Pass too short']);
--	else if ($password1 != $password2)
--		message($lang_prof_reg['Pass not match']);
--	else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest']))
--		message($lang_prof_reg['Username guest']);
--	else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
--		message($lang_prof_reg['Username IP']);
--	else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
--		message($lang_prof_reg['Username reserved chars']);
--	else if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
--		message($lang_prof_reg['Username BBCode']);
--
--	// Check username for any censored words
--	if ($pun_config['o_censoring'] == '1')
--	{
--		// If the censored username differs from the username
--		if (censor_words($username) != $username)
--			message($lang_register['Username censor']);
--	}
--
--	// Check that the username (or a too similar username) is not already registered
--	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE UPPER(username)=UPPER(\''.$db->escape($username).'\') OR UPPER(username)=UPPER(\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\')') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--
--	if ($db->num_rows($result))
--	{
--		$busy = $db->result($result);
--		message($lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2']);
--	}
--
--
--	// Validate e-mail
--	require PUN_ROOT.'include/email.php';
--
--	if (!is_valid_email($email1))
--		message($lang_common['Invalid e-mail']);
--	else if ($pun_config['o_regs_verify'] == '1' && $email1 != $email2)
--		message($lang_register['E-mail not match']);
--
--	// Check it it's a banned e-mail address
--	if (is_banned_email($email1))
--	{
--		if ($pun_config['p_allow_banned_email'] == '0')
--			message($lang_prof_reg['Banned e-mail']);
--
--		$banned_email = true;	// Used later when we send an alert e-mail
--	}
--	else
--		$banned_email = false;
--
--	// Check if someone else already has registered with that e-mail address
--	$dupe_list = array();
--
--	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE email=\''.$email1.'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
--	if ($db->num_rows($result))
--	{
--		if ($pun_config['p_allow_dupe_email'] == '0')
--			message($lang_prof_reg['Dupe e-mail']);
--
--		while ($cur_dupe = $db->fetch_assoc($result))
--			$dupe_list[] = $cur_dupe['username'];
--	}
--
--	// Make sure we got a valid language string
--	if (isset($_POST['language']))
--	{
--		$language = preg_replace('#[\.\\\/]#', '', $_POST['language']);
--		if (!file_exists(PUN_ROOT.'lang/'.$language.'/common.php'))
--				message($lang_common['Bad request']);
--	}
--	else
--		$language = $pun_config['o_default_lang'];
--
--	$timezone = round($_POST['timezone'], 1);
--	$save_pass = (!isset($_POST['save_pass']) || $_POST['save_pass'] != '1') ? '0' : '1';
--
--	$email_setting = intval($_POST['email_setting']);
--	if ($email_setting < 0 || $email_setting > 2) $email_setting = 1;
--
--	// Insert the new user into the database. We do this now to get the last inserted id for later use.
--	$now = time();
--
--	$intial_group_id = ($pun_config['o_regs_verify'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED;
--	$password_hash = pun_hash($password1);
--
--	// Add the user
--	$db->query('INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit) VALUES(\''.$db->escape($username).'\', '.$intial_group_id.', \''.$password_hash.'\', \''.$email1.'\', '.$email_setting.', '.$save_pass.', '.$timezone.' , \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$now.', \''.get_remote_address().'\', '.$now.')') or error('Unable to create user', __FILE__, __LINE__, $db->error());
--	$new_uid = $db->insert_id();
--
--
--	// If we previously found out that the e-mail was banned
--	if ($banned_email && $pun_config['o_mailing_list'] != '')
--	{
--		$mail_subject = 'Alert - Banned e-mail detected';
--		$mail_message = 'User \''.$username.'\' registered with banned e-mail address: '.$email1."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
--
--		pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
--	}
--
--	// If we previously found out that the e-mail was a dupe
--	if (!empty($dupe_list) && $pun_config['o_mailing_list'] != '')
--	{
--		$mail_subject = 'Alert - Duplicate e-mail detected';
--		$mail_message = 'User \''.$username.'\' registered with an e-mail address that also belongs to: '.implode(', ', $dupe_list)."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
--
--		pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
--	}
--
--	// Should we alert people on the admin mailing list that a new user has registered?
--	if ($pun_config['o_regs_report'] == '1')
--	{
--		$mail_subject = 'Alert - New registration';
--		$mail_message = 'User \''.$username.'\' registered in the forums at '.$pun_config['o_base_url']."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
--
--		pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
--	}
--
--	// Must the user verify the registration or do we log him/her in right now?
--	if ($pun_config['o_regs_verify'] == '1')
--	{
--		// Load the "welcome" template
--		$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/welcome.tpl'));
--
--		// The first row contains the subject
--		$first_crlf = strpos($mail_tpl, "\n");
--		$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
--		$mail_message = trim(substr($mail_tpl, $first_crlf));
--
--		$mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
--		$mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
--		$mail_message = str_replace('<username>', $username, $mail_message);
--		$mail_message = str_replace('<password>', $password1, $mail_message);
--		$mail_message = str_replace('<login_url>', $pun_config['o_base_url'].'/login.php', $mail_message);
--		$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
--
--		pun_mail($email1, $mail_subject, $mail_message);
--
--		message($lang_register['Reg e-mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
--	}
--
--	pun_setcookie($new_uid, $password_hash, ($save_pass != '0') ? $now + 31536000 : 0);
--
--	redirect('index.php', $lang_register['Reg complete']);
--}
--
--
--$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register'];
--$required_fields = array('req_username' => $lang_common['Username'], 'req_password1' => $lang_common['Password'], 'req_password2' => $lang_prof_reg['Confirm pass'], 'req_email1' => $lang_common['E-mail'], 'req_email2' => $lang_common['E-mail'].' 2');
--$focus_element = array('register', 'req_username');
--require PUN_ROOT.'header.php';
--
--?>
--<div class="blockform">
--	<h2><span><?php echo $lang_register['Register'] ?></span></h2>
--	<div class="box">
--		<form id="register" method="post" action="register.php?action=register" onsubmit="this.register.disabled=true;if(process_form(this)){return true;}else{this.register.disabled=false;return false;}">
--			<div class="inform">
--				<div class="forminfo">
--					<h3><?php echo $lang_common['Important information'] ?></h3>
--					<p><?php echo $lang_register['Desc 1'] ?></p>
--					<p><?php echo $lang_register['Desc 2'] ?></p>
--				</div>
--				<fieldset>
--					<legend><?php echo $lang_register['Username legend'] ?></legend>
--					<div class="infldset">
--						<input type="hidden" name="form_sent" value="1" />
--						<label><strong><?php echo $lang_common['Username'] ?></strong><br /><input type="text" name="req_username" size="25" maxlength="25" /><br /></label>
--					</div>
--				</fieldset>
--			</div>
--<?php if ($pun_config['o_regs_verify'] == '0'): ?>			<div class="inform">
--				<fieldset>
--					<legend><?php echo $lang_register['Pass legend 1'] ?></legend>
--					<div class="infldset">
--						<label class="conl"><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password1" size="16" maxlength="16" /><br /></label>
--						<label class="conl"><strong><?php echo $lang_prof_reg['Confirm pass'] ?></strong><br /><input type="password" name="req_password2" size="16" maxlength="16" /><br /></label>
--						<p class="clearb"><?php echo $lang_register['Pass info'] ?></p>
--					</div>
--				</fieldset>
--			</div>
--<?php endif; ?>			<div class="inform">
--				<fieldset>
--					<legend><?php echo ($pun_config['o_regs_verify'] == '1') ? $lang_prof_reg['E-mail legend 2'] : $lang_prof_reg['E-mail legend'] ?></legend>
--					<div class="infldset">
--<?php if ($pun_config['o_regs_verify'] == '1'): ?>			<p><?php echo $lang_register['E-mail info'] ?></p>
--<?php endif; ?>					<label><strong><?php echo $lang_common['E-mail'] ?></strong><br />
--						<input type="text" name="req_email1" size="50" maxlength="50" /><br /></label>
--<?php if ($pun_config['o_regs_verify'] == '1'): ?>						<label><strong><?php echo $lang_register['Confirm e-mail'] ?></strong><br />
--						<input type="text" name="req_email2" size="50" maxlength="50" /><br /></label>
--<?php endif; ?>					</div>
--				</fieldset>
--			</div>
--			<div class="inform">
--				<fieldset>
--					<legend><?php echo $lang_prof_reg['Localisation legend'] ?></legend>
--					<div class="infldset">
--						<label><?php echo $lang_prof_reg['Timezone'] ?>: <?php echo $lang_prof_reg['Timezone info'] ?>
--						<br /><select id="time_zone" name="timezone">
--							<option value="-12"<?php if ($pun_config['o_server_timezone'] == -12 ) echo ' selected="selected"' ?>>-12</option>
--							<option value="-11"<?php if ($pun_config['o_server_timezone'] == -11) echo ' selected="selected"' ?>>-11</option>
--							<option value="-10"<?php if ($pun_config['o_server_timezone'] == -10) echo ' selected="selected"' ?>>-10</option>
--							<option value="-9.5"<?php if ($pun_config['o_server_timezone'] == -9.5) echo ' selected="selected"' ?>>-9.5</option>
--							<option value="-9"<?php if ($pun_config['o_server_timezone'] == -9 ) echo ' selected="selected"' ?>>-09</option>
--							<option value="-8.5"<?php if ($pun_config['o_server_timezone'] == -8.5) echo ' selected="selected"' ?>>-8.5</option>
--							<option value="-8"<?php if ($pun_config['o_server_timezone'] == -8 ) echo ' selected="selected"' ?>>-08 PST</option>
--							<option value="-7"<?php if ($pun_config['o_server_timezone'] == -7 ) echo ' selected="selected"' ?>>-07 MST</option>
--							<option value="-6"<?php if ($pun_config['o_server_timezone'] == -6 ) echo ' selected="selected"' ?>>-06 CST</option>
--							<option value="-5"<?php if ($pun_config['o_server_timezone'] == -5 ) echo ' selected="selected"' ?>>-05 EST</option>
--							<option value="-4"<?php if ($pun_config['o_server_timezone'] == -4 ) echo ' selected="selected"' ?>>-04 AST</option>
--							<option value="-3.5"<?php if ($pun_config['o_server_timezone'] == -3.5) echo ' selected="selected"' ?>>-3.5</option>
--							<option value="-3"<?php if ($pun_config['o_server_timezone'] == -3 ) echo ' selected="selected"' ?>>-03 ADT</option>
--							<option value="-2"<?php if ($pun_config['o_server_timezone'] == -2 ) echo ' selected="selected"' ?>>-02</option>
--							<option value="-1"<?php if ($pun_config['o_server_timezone'] == -1) echo ' selected="selected"' ?>>-01</option>
--							<option value="0"<?php if ($pun_config['o_server_timezone'] == 0) echo ' selected="selected"' ?>>00 GMT</option>
--							<option value="1"<?php if ($pun_config['o_server_timezone'] == 1) echo ' selected="selected"' ?>>+01 CET</option>
--							<option value="2"<?php if ($pun_config['o_server_timezone'] == 2 ) echo ' selected="selected"' ?>>+02</option>
--							<option value="3"<?php if ($pun_config['o_server_timezone'] == 3 ) echo ' selected="selected"' ?>>+03</option>
--							<option value="3.5"<?php if ($pun_config['o_server_timezone'] == 3.5 ) echo ' selected="selected"' ?>>+03.5</option>
--							<option value="4"<?php if ($pun_config['o_server_timezone'] == 4 ) echo ' selected="selected"' ?>>+04</option>
--							<option value="4.5"<?php if ($pun_config['o_server_timezone'] == 4.5 ) echo ' selected="selected"' ?>>+04.5</option>
--							<option value="5"<?php if ($pun_config['o_server_timezone'] == 5 ) echo ' selected="selected"' ?>>+05</option>
--							<option value="5.5"<?php if ($pun_config['o_server_timezone'] == 5.5 ) echo ' selected="selected"' ?>>+05.5</option>
--							<option value="6"<?php if ($pun_config['o_server_timezone'] == 6 ) echo ' selected="selected"' ?>>+06</option>
--							<option value="6.5"<?php if ($pun_config['o_server_timezone'] == 6.5 ) echo ' selected="selected"' ?>>+06.5</option>
--							<option value="7"<?php if ($pun_config['o_server_timezone'] == 7 ) echo ' selected="selected"' ?>>+07</option>
--							<option value="8"<?php if ($pun_config['o_server_timezone'] == 8 ) echo ' selected="selected"' ?>>+08</option>
--							<option value="9"<?php if ($pun_config['o_server_timezone'] == 9 ) echo ' selected="selected"' ?>>+09</option>
--							<option value="9.5"<?php if ($pun_config['o_server_timezone'] == 9.5 ) echo ' selected="selected"' ?>>+09.5</option>
--							<option value="10"<?php if ($pun_config['o_server_timezone'] == 10) echo ' selected="selected"' ?>>+10</option>
--							<option value="10.5"<?php if ($pun_config['o_server_timezone'] == 10.5 ) echo ' selected="selected"' ?>>+10.5</option>
--							<option value="11"<?php if ($pun_config['o_server_timezone'] == 11) echo ' selected="selected"' ?>>+11</option>
--							<option value="11.5"<?php if ($pun_config['o_server_timezone'] == 11.5 ) echo ' selected="selected"' ?>>+11.5</option>
--							<option value="12"<?php if ($pun_config['o_server_timezone'] == 12 ) echo ' selected="selected"' ?>>+12</option>
--							<option value="13"<?php if ($pun_config['o_server_timezone'] == 13 ) echo ' selected="selected"' ?>>+13</option>
--							<option value="14"<?php if ($pun_config['o_server_timezone'] == 14 ) echo ' selected="selected"' ?>>+14</option>
--						</select>
--						<br /></label>
--<?php
--
--		$languages = array();
--		$d = dir(PUN_ROOT.'lang');
--		while (($entry = $d->read()) !== false)
--		{
--			if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
--				$languages[] = $entry;
--		}
--		$d->close();
--
--		// Only display the language selection box if there's more than one language available
--		if (count($languages) > 1)
--		{
--
--?>
--							<label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?>
--							<br /><select name="language">
--<?php
--
--			while (list(, $temp) = @each($languages))
--			{
--				if ($pun_config['o_default_lang'] == $temp)
--					echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
--				else
--					echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
--			}
-+message('Registration is disabled on this forum. Please use the <a href="'.$vhffs_panel_url.'">'.$vhffs_team.'\'s panel </a>to register.', __FILE__, __LINE__);
- 
--?>
--							</select>
--							<br /></label>
--<?php
-+require PUN_ROOT.'footer.php';
- 
--		}
- ?>
--					</div>
--				</fieldset>
--			</div>
--			<div class="inform">
--				<fieldset>
--					<legend><?php echo $lang_prof_reg['Privacy options legend'] ?></legend>
--					<div class="infldset">
--						<p><?php echo $lang_prof_reg['E-mail setting info'] ?></p>
--						<div class="rbox">
--							<label><input type="radio" name="email_setting" value="0" /><?php echo $lang_prof_reg['E-mail setting 1'] ?><br /></label>
--							<label><input type="radio" name="email_setting" value="1" checked="checked" /><?php echo $lang_prof_reg['E-mail setting 2'] ?><br /></label>
--							<label><input type="radio" name="email_setting" value="2" /><?php echo $lang_prof_reg['E-mail setting 3'] ?><br /></label>
--						</div>
--						<p><?php echo $lang_prof_reg['Save user/pass info'] ?></p>
--						<div class="rbox">
--							<label><input type="checkbox" name="save_pass" value="1" checked="checked" /><?php echo $lang_prof_reg['Save user/pass'] ?><br /></label>
--						</div>
--					</div>
--				</fieldset>
--			</div>
--			<p><input type="submit" name="register" value="<?php echo $lang_register['Register'] ?>" /></p>
--		</form>
--	</div>
--</div>
--<?php
--
--require PUN_ROOT.'footer.php';
-diff -Nru punbb-1.2.15/VHFFS_PATCH-1.1_Changelog punbb-1.2.15-VHFFS-patched/VHFFS_PATCH-1.1_Changelog
---- punbb-1.2.15/VHFFS_PATCH-1.1_Changelog	1970-01-01 01:00:00.000000000 +0100
-+++ punbb-1.2.15-VHFFS-patched/VHFFS_PATCH-1.1_Changelog	2007-09-19 18:15:14.000000000 +0200
-@@ -0,0 +1,47 @@
-+VHFFS patch by Samuel Lesueur (crafty@xxxxxxxxxxxxx)
-+
-+Version 1.1 (for PunBB 1.2.15)
-+
-+- login.php :
-+
-+	- New strings to explain login conditions
-+	- Connexion on VHFFS database
-+	- Auth by encrypt_md5 using VHFFS database
-+	- Verifying Object status in VHFFS database
-+	- Creating new user in PunBB Database with informations fetched from VHFFS database
-+	- Lost password redirection to VHFFS panel
-+	- Bad password redirection to VHFFS panel
-+
-+- vhffs_db.php :
-+
-+	New fontend for simultaneous Db connections (based on original pgsql.php)
-+
-+- register.php :
-+
-+	- Redirection to VHFFS panel
-+
-+- profile.php :
-+
-+	- Restrictions on Username modifications and redirection to VHFFS panel
-+	- Restrictions on Mail modifications and redirection to VHFFS panel
-+ 	- Restrictions on Real name modifications (Real name is fetched from VHFFS database)
-+
-+- post.php:
-+
-+	-Anti bot system : capcha on public forums
-+
-+- footer.php :
-+
-+	- VHFFS powered link
-+
-+- install.php:
-+
-+	- Including VHFFS database configuration in config file
-+	- Including VHFFS <-> PunBB link options in config file 
-+
-+- lang/English/post.php
-+	
-+	- added strings for antibot
-+
-+
-+Please visit http://www.vhffs.org for support and new versions
-diff -Nru punbb-1.2.15/VHFFS_PATCH_INSTALL punbb-1.2.15-VHFFS-patched/VHFFS_PATCH_INSTALL
---- punbb-1.2.15/VHFFS_PATCH_INSTALL	1970-01-01 01:00:00.000000000 +0100
-+++ punbb-1.2.15-VHFFS-patched/VHFFS_PATCH_INSTALL	2007-09-19 18:20:40.000000000 +0200
-@@ -0,0 +1,2 @@
-+
-+The VHFFS patch needs some extra files for the antibot system. just untar the 'antibot.tar.bz2' archive in the 'img' folder of your new punBB installation

Deleted: trunk/vhffs-forum/punbb-1.2.22_loginlength.path
===================================================================
--- trunk/vhffs-forum/punbb-1.2.22_loginlength.path	2011-04-17 13:56:20 UTC (rev 1663)
+++ trunk/vhffs-forum/punbb-1.2.22_loginlength.path	2011-04-17 21:05:41 UTC (rev 1664)
@@ -1,14 +0,0 @@
-diff -Nru punbb-1.2.22.orig/upload/login.php punbb-1.2.22/upload/login.php
---- punbb-1.2.22.orig/upload/login.php	2008-10-23 09:49:10.000000000 +0200
-+++ punbb-1.2.22/upload/login.php	2010-02-15 14:55:33.000000000 +0100
-@@ -209,8 +209,8 @@
- 						<div class="infldset">
- 							<input type="hidden" name="form_sent" value="1" />
- 							<input type="hidden" name="redirect_url" value="<?php echo $redirect_url ?>" />
--							<label class="conl"><strong><?php echo $lang_common['Username'] ?></strong><br /><input type="text" name="req_username" size="25" maxlength="25" tabindex="1" /><br /></label>
--							<label class="conl"><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password" size="16" maxlength="16" tabindex="2" /><br /></label>
-+							<label class="conl"><strong><?php echo $lang_common['Username'] ?></strong><br /><input type="text" name="req_username" size="32" maxlength="32" tabindex="1" /><br /></label>
-+							<label class="conl"><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password" size="32" maxlength="32" tabindex="2" /><br /></label>
- 							<p class="clearb"><?php echo $lang_login['Login info'] ?></p>
- 							<p><a href="register.php" tabindex="4"><?php echo $lang_login['Not registered'] ?></a>&nbsp;&nbsp;
- 							<a href="login.php?action=forget" tabindex="5"><?php echo $lang_login['Forgotten pass'] ?></a></p>

Added: trunk/vhffs-forum/punbb-1.3.5_vhffs.patch
===================================================================
--- trunk/vhffs-forum/punbb-1.3.5_vhffs.patch	                        (rev 0)
+++ trunk/vhffs-forum/punbb-1.3.5_vhffs.patch	2011-04-17 21:05:41 UTC (rev 1664)
@@ -0,0 +1,1716 @@
+diff -Nru a/config.php b/config.php
+--- a/config.php	2011-04-17 17:35:24.000000000 +0200
++++ b/config.php	2011-04-17 22:13:17.000000000 +0200
+@@ -16,3 +16,14 @@
+ $cookie_secure = 0;
+ 
+ define('FORUM', 1);
++
++// VHFFS config
++$vhffs_db_host = '127.0.0.1';
++$vhffs_db_name = 'vhffs';
++$vhffs_db_username = 'vhffs';
++$vhffs_db_password = 'vhffs';
++$vhffs_p_connect = false;
++$vhffs_team = 'My Service Name';
++$vhffs_panel_url = 'https://panel.yourhost';
++$vhffs_hoster_url = 'http://yourhost';
++
+diff -Nru a/footer.php b/footer.php
+--- a/footer.php	2009-05-20 11:09:23.000000000 +0200
++++ b/footer.php	2011-04-17 17:44:20.000000000 +0200
+@@ -38,7 +38,7 @@
+ ($hook = get_hook('ft_about_pre_copyright')) ? eval($hook) : null;
+ 
+ ?>
+-	<p id="copyright"><?php echo sprintf($lang_common['Powered by'], '<a href="http://punbb.informer.com/";>PunBB</a>'.($forum_config['o_show_version'] == '1' ? ' '.$forum_config['o_cur_version'] : ''), '<a href="http://www.informer.com/";>Informer Technologies, Inc</a>') ?></p>
++	<p id="copyright"><?php echo sprintf($lang_common['Powered by'], '<a href="http://punbb.informer.com/";>PunBB</a>'.($forum_config['o_show_version'] == '1' ? ' '.$forum_config['o_cur_version'] : ''), '<a href="http://www.vhffs.org/";>VHFFS</a>') ?></p>
+ <?php
+ 
+ ($hook = get_hook('ft_about_end')) ? eval($hook) : null;
+diff -Nru a/include/dblayer/vhffs.php b/include/dblayer/vhffs.php
+--- a/include/dblayer/vhffs.php	1970-01-01 01:00:00.000000000 +0100
++++ b/include/dblayer/vhffs.php	2011-04-17 20:06:47.000000000 +0200
+@@ -0,0 +1,201 @@
++<?php
++/**
++ * A database layer class to access VHFFS database that relies on the PostgreSQL PHP extension.
++ *
++ * @copyright (C) 2008-2009 PunBB, partially based on code (C) 2008-2009 FluxBB.org
++ * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
++ * @package PunBB
++ *
++ * VHFFS patch by
++ *   Samuel Lesueur <crafty@xxxxxxxxxxxxx>
++ *   Sylvain Rochet <gradator@xxxxxxxxxxxx>
++ *
++ * Based on PunBB pgsql.php database layer class.
++ *
++ */
++
++
++// Make sure we have built in support for PostgreSQL
++if (!function_exists('pg_connect'))
++	exit('This PHP environment doesn\'t have PostgreSQL support built in. PostgreSQL support is required if you want to use a PostgreSQL database to run this forum. Consult the PHP documentation for further assistance.');
++
++
++class vhffs_DBLayer
++{
++	var $prefix;
++	var $link_id;
++	var $query_result;
++	var $last_query_text = array();
++
++	var $saved_queries = array();
++	var $num_queries = 0;
++
++	var $error_no = false;
++	var $error_msg = 'Unknown';
++
++	function vhffs_DBLayer($db_host, $db_username, $db_password, $db_name, $p_connect)
++	{
++		if ($db_host)
++		{
++			if (strpos($db_host, ':') !== false)
++			{
++				list($db_host, $dbport) = explode(':', $db_host);
++				$connect_str[] = 'host='.$db_host.' port='.$dbport;
++			}
++			else
++				$connect_str[] = 'host='.$db_host;
++		}
++
++		if ($db_name)
++			$connect_str[] = 'dbname='.$db_name;
++
++		if ($db_username)
++			$connect_str[] = 'user='.$db_username;
++
++		if ($db_password)
++			$connect_str[] = 'password='.$db_password;
++
++		if ($p_connect)
++			$this->link_id = @pg_pconnect(implode(' ', $connect_str));
++		else
++			$this->link_id = @pg_connect(implode(' ', $connect_str));
++
++		if (!$this->link_id)
++			error('Unable to connect to PostgreSQL server.', __FILE__, __LINE__);
++
++		// Setup the client-server character set (UTF-8)
++		$this->query('SET CLIENT ENCODING \'UTF-8\'');
++
++		return $this->link_id;
++	}
++
++
++	function query($sql, $unbuffered = false)	// $unbuffered is ignored since there is no pgsql_unbuffered_query()
++	{
++		if (strlen($sql) > 140000)
++			exit('Insane query. Aborting.');
++
++		if (strrpos($sql, 'LIMIT') !== false)
++			$sql = preg_replace('#LIMIT ([0-9]+),([ 0-9]+)#', 'LIMIT \\2 OFFSET \\1', $sql);
++
++		if (defined('FORUM_SHOW_QUERIES'))
++			$q_start = get_microtime();
++
++		@pg_send_query($this->link_id, $sql);
++		$this->query_result = @pg_get_result($this->link_id);
++
++		if (pg_result_status($this->query_result) != PGSQL_FATAL_ERROR)
++		{
++			if (defined('FORUM_SHOW_QUERIES'))
++				$this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start));
++
++			++$this->num_queries;
++
++			$this->last_query_text[$this->query_result] = $sql;
++
++			return $this->query_result;
++		}
++		else
++		{
++			if (defined('FORUM_SHOW_QUERIES'))
++				$this->saved_queries[] = array($sql, 0);
++
++			$this->error_msg = @pg_result_error($this->query_result);
++
++			return false;
++		}
++	}
++
++	function result($query_id = 0, $row = 0, $col = 0)
++	{
++		return ($query_id) ? @pg_fetch_result($query_id, $row, $col) : false;
++	}
++
++
++	function fetch_assoc($query_id = 0)
++	{
++		return ($query_id) ? @pg_fetch_assoc($query_id) : false;
++	}
++
++
++	function fetch_row($query_id = 0)
++	{
++		return ($query_id) ? @pg_fetch_row($query_id) : false;
++	}
++
++
++	function num_rows($query_id = 0)
++	{
++		return ($query_id) ? @pg_num_rows($query_id) : false;
++	}
++
++
++	function get_num_queries()
++	{
++		return $this->num_queries;
++	}
++
++
++	function get_saved_queries()
++	{
++		return $this->saved_queries;
++	}
++
++
++	function free_result($query_id = false)
++	{
++		if (!$query_id)
++			$query_id = $this->query_result;
++
++		return ($query_id) ? @pg_free_result($query_id) : false;
++	}
++
++
++	function escape($str)
++	{
++		return is_array($str) ? '' : pg_escape_string($str);
++	}
++
++
++	function error()
++	{
++		$result['error_sql'] = @current(@end($this->saved_queries));
++		$result['error_no'] = false;
++		$result['error_msg'] = $this->error_msg;
++
++		return $result;
++	}
++
++
++	function close()
++	{
++		if ($this->link_id)
++		{
++			if ($this->in_transaction)
++			{
++				if (defined('FORUM_SHOW_QUERIES'))
++					$this->saved_queries[] = array('COMMIT', 0);
++
++				@pg_query($this->link_id, 'COMMIT');
++			}
++
++			if ($this->query_result)
++				@pg_free_result($this->query_result);
++
++			return @pg_close($this->link_id);
++		}
++		else
++			return false;
++	}
++
++
++	function get_version()
++	{
++		$result = $this->query('SELECT VERSION()');
++
++		return array(
++			'name'		=> 'PostgreSQL',
++			'version'	=> preg_replace('/^[^0-9]+([^\s,-]+).*$/', '\\1', $this->result($result))
++		);
++	}
++}
+diff -Nru a/lang/English/common.php b/lang/English/common.php
+--- a/lang/English/common.php	2011-03-16 09:43:12.000000000 +0100
++++ b/lang/English/common.php	2011-04-17 17:43:25.000000000 +0200
+@@ -85,7 +85,7 @@
+ 'Item info single'			=>	'%s [ %s ]',
+ 'Item info plural'			=>	'%s [ %s to %s of %s ]', // e.g. Topics [ 10 to 20 of 30 ]
+ 'Info separator'			=>	' ', // e.g. 1 Page | 10 Topics
+-'Powered by'				=>	'Powered by <strong>%s</strong>, supported by <strong>%s</strong>.',
++'Powered by'				=>	'Powered by <strong>%s</strong> and <strong>%s</strong>.',
+ 'Maintenance'				=>	'Maintenance',
+ 'Installed extension'		=>	'The %s official extension is installed. Copyright &copy; 2003&ndash;2011 <a href="http://punbb.informer.com/";>PunBB</a>.',
+ 'Installed extensions'		=>	'Currently installed <span id="extensions-used" title="%s">%s official extensions</span>. Copyright &copy; 2003&ndash;2011 <a href="http://punbb.informer.com/";>PunBB</a>.',
+diff -Nru a/lang/English/post.php b/lang/English/post.php
+--- a/lang/English/post.php	2008-11-26 13:46:21.000000000 +0100
++++ b/lang/English/post.php	2011-04-17 22:04:15.000000000 +0200
+@@ -55,6 +55,11 @@
+ 'Silent edit'			=>	'Silent edit (don\'t display "Last edited by…" in topic view for this edit).',
+ 'Preview edited topic'	=>	'Preview of your edited topic',
+ 'Preview edited reply'	=>	'Preview of your edited reply',
+-'Edit redirect'			=>	'Post updated. Redirecting…'
++'Edit redirect'			=>	'Post updated. Redirecting…',
++
++// antibot
++'Bot message'			=>	'Please write here the what you see in the image in order to verify that you are not one of those stupid spamming bots...',
++'Bot warning'			=>	'(notice that there are only capitals and numbers)',
++'Captcha failed'		=>	'Captcha verification failed'
+ 
+ );
+diff -Nru a/login.php b/login.php
+--- a/login.php	2011-03-04 17:41:48.000000000 +0100
++++ b/login.php	2011-04-17 21:59:19.000000000 +0200
+@@ -5,6 +5,10 @@
+  * @copyright (C) 2008-2009 PunBB, partially based on code (C) 2008-2009 FluxBB.org
+  * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
+  * @package PunBB
++ *
++ * VHFFS patch by
++ *   Samuel Lesueur <crafty@xxxxxxxxxxxxx>
++ *   Sylvain Rochet <gradator@xxxxxxxxxxxx>
+  */
+ 
+ 
+@@ -20,6 +24,9 @@
+ // Load the login.php language file
+ require FORUM_ROOT.'lang/'.$forum_user['language'].'/login.php';
+ 
++// VHFFS MODIFICATION : Load the VHFFS database class
++require FORUM_ROOT.'include/dblayer/vhffs.php';
++
+ 
+ $action = isset($_GET['action']) ? $_GET['action'] : null;
+ $errors = array();
+@@ -44,43 +51,47 @@
+ 	else
+ 		$query['WHERE'] = 'LOWER(username)=LOWER(\''.$forum_db->escape($form_username).'\')';
+ 
++	// VHFFS MODIFICATION : New login system, using VHFFS's database for auth and copy personal data to forum database
++
++	//looking for the user in the forum database
+ 	($hook = get_hook('li_login_qr_get_login_data')) ? eval($hook) : null;
+ 	$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
+ 	list($user_id, $group_id, $db_password_hash, $salt) = $forum_db->fetch_row($result);
+ 
+-	$authorized = false;
+-	if (!empty($db_password_hash))
+-	{
+-		$sha1_in_db = (strlen($db_password_hash) == 40) ? true : false;
+-		$form_password_hash = forum_hash($form_password, $salt);
+-
+-		if ($sha1_in_db && $db_password_hash == $form_password_hash)
+-			$authorized = true;
+-		else if ((!$sha1_in_db && $db_password_hash == md5($form_password)) || ($sha1_in_db && $db_password_hash == sha1($form_password)))
+-		{
+-			$authorized = true;
+-
+-			$salt = random_key(12);
+-			$form_password_hash = forum_hash($form_password, $salt);
+-
+-			// There's an old MD5 hash or an unsalted SHA1 hash in the database, so we replace it
+-			// with a randomly generated salt and a new, salted SHA1 hash
+-			$query = array(
+-				'UPDATE'	=> 'users',
+-				'SET'		=> 'password=\''.$form_password_hash.'\', salt=\''.$forum_db->escape($salt).'\'',
+-				'WHERE'		=> 'id='.$user_id
+-			);
++	//looking for the user in the VHFFS database
++	$vhffs_db = new vhffs_DBLayer($vhffs_db_host, $vhffs_db_username, $vhffs_db_password, $vhffs_db_name, $vhffs_p_connect);
++	$vhffs_result = $vhffs_db->query('SELECT passwd, firstname, lastname, mail, date_creation, state FROM vhffs_forum WHERE username=\''.$vhffs_db->escape($form_username).'\'');
++	list($vhffs_db_password_hash, $vhffs_user_firstname, $vhffs_user_lastname, $vhffs_user_mail, $vhffs_inscription_date, $vhffs_user_status) = $vhffs_db->fetch_row($vhffs_result);
++
++	if( !$vhffs_result ) {
++		$dberr = $vhffs_db->error();
++		$errors[] = 'Unable to fetch user info in '.$vhffs_team.' database. Error: '.$dberr['error_sql'].' : '.$dberr['error_msg'];
++	}
++	else if( empty($vhffs_db_password_hash) )  {
++		$errors[] = 'User doesn\'t exist in '.$vhffs_team.' database. Please create an account on <a href="'.$vhffs_hoster_url.'">'.$vhffs_team.'\'s panel </a>';
++	}
++	else if( $vhffs_user_status != 6 ) {  // If user status is not "Activated"
++		$errors[] = 'User not activated in '.$vhffs_team.' database. Is registration process complete ?';
++	}
++	else if( crypt($form_password, $vhffs_db_password_hash) != $vhffs_db_password_hash) {  // VHFFS password verification
++		$errors[] = sprintf($lang_login['Wrong user/pass']);
++	}
++	else if(empty($user_id)) { // new user 
++		$initial_group_id = ($forum_config['o_regs_verify'] == '0') ? $forum_config['o_default_user_group'] : FORUM_UNVERIFIED;
++		if( $forum_db->query('INSERT INTO '.$forum_db->prefix.'users (group_id, username, email, realname, registered, registration_ip, last_visit) VALUES ( '.$initial_group_id.' , \''.$forum_db->escape($form_username).'\', \''.$forum_db->escape($vhffs_user_mail).'\', \''.$forum_db->escape($vhffs_user_firstname).' '. $forum_db->escape($vhffs_user_lastname).'\', '.$vhffs_inscription_date.', \''.get_remote_address().'\', '.time().' )' ) ) {
+ 
+-			($hook = get_hook('li_login_qr_update_user_hash')) ? eval($hook) : null;
+-			$forum_db->query_build($query) or error(__FILE__, __LINE__);
++			$dberr = $forum_db->error();
++			$errors[] = 'Unable to create user in forum database. Error: '.$dberr['error_sql'].' : '.$dberr['error_msg'];
++		}
++		else {
++			$user_id = $forum_db->insert_id();
+ 		}
++	} else { // update user
++		$forum_db->query('UPDATE '.$forum_db->prefix.'users SET email=\''.$forum_db->escape($vhffs_user_mail).'\', realname=\''.$forum_db->escape($vhffs_user_firstname).' '. $forum_db->escape($vhffs_user_lastname).'\' WHERE id='.$user_id );
+ 	}
+ 
+ 	($hook = get_hook('li_login_pre_auth_message')) ? eval($hook) : null;
+ 
+-	if (!$authorized)
+-		$errors[] = sprintf($lang_login['Wrong user/pass']);
+-
+ 	// Did everything go according to plan?
+ 	if (empty($errors))
+ 	{
+@@ -165,188 +176,6 @@
+ 	redirect(forum_link($forum_url['index']), $lang_login['Logout redirect']);
+ }
+ 
+-
+-// New password
+-else if ($action == 'forget' || $action == 'forget_2')
+-{
+-	if (!$forum_user['is_guest'])
+-		header('Location: '.forum_link($forum_url['index']));
+-
+-	($hook = get_hook('li_forgot_pass_selected')) ? eval($hook) : null;
+-
+-	if (isset($_POST['form_sent']))
+-	{
+-		// User pressed the cancel button
+-		if (isset($_POST['cancel']))
+-			redirect(forum_link($forum_url['index']), $lang_login['New password cancel redirect']);
+-
+-		if (!defined('FORUM_EMAIL_FUNCTIONS_LOADED'))
+-			require FORUM_ROOT.'include/email.php';
+-
+-		// Validate the email-address
+-		$email = strtolower(forum_trim($_POST['req_email']));
+-		if (!is_valid_email($email))
+-			$errors[] = $lang_login['Invalid e-mail'];
+-
+-		($hook = get_hook('li_forgot_pass_end_validation')) ? eval($hook) : null;
+-
+-		// Did everything go according to plan?
+-		if (empty($errors))
+-		{
+-			// Fetch user matching $email
+-			$query = array(
+-				'SELECT'	=> 'u.id, u.username, u.salt, u.last_email_sent',
+-				'FROM'		=> 'users AS u',
+-				'WHERE'		=> 'u.email=\''.$forum_db->escape($email).'\''
+-			);
+-
+-			($hook = get_hook('li_forgot_pass_qr_get_user_data')) ? eval($hook) : null;
+-			$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
+-			if ($forum_db->num_rows($result))
+-			{
+-				($hook = get_hook('li_forgot_pass_pre_email')) ? eval($hook) : null;
+-
+-				// Load the "activate password" template
+-				$mail_tpl = forum_trim(file_get_contents(FORUM_ROOT.'lang/'.$forum_user['language'].'/mail_templates/activate_password.tpl'));
+-
+-				// The first row contains the subject
+-				$first_crlf = strpos($mail_tpl, "\n");
+-				$mail_subject = forum_trim(substr($mail_tpl, 8, $first_crlf-8));
+-				$mail_message = forum_trim(substr($mail_tpl, $first_crlf));
+-
+-				// Do the generic replacements first (they apply to all e-mails sent out here)
+-				$mail_message = str_replace('<base_url>', $base_url.'/', $mail_message);
+-				$mail_message = str_replace('<board_mailer>', sprintf($lang_common['Forum mailer'], $forum_config['o_board_title']), $mail_message);
+-
+-				($hook = get_hook('li_forgot_pass_new_general_replace_data')) ? eval($hook) : null;
+-
+-				// Loop through users we found
+-				while ($cur_hit = $forum_db->fetch_assoc($result))
+-				{
+-					$forgot_pass_timeout = 3600;
+-
+-					($hook = get_hook('li_forgot_pass_pre_flood_check')) ? eval($hook) : null;
+-
+-					if ($cur_hit['last_email_sent'] != '' && (time() - $cur_hit['last_email_sent']) < $forgot_pass_timeout && (time() - $cur_hit['last_email_sent']) >= 0)
+-						message(sprintf($lang_login['Email flood'], $forgot_pass_timeout));
+-
+-					// Generate a new password activation key
+-					$new_password_key = random_key(8, true);
+-
+-					$query = array(
+-						'UPDATE'	=> 'users',
+-						'SET'		=> 'activate_key=\''.$new_password_key.'\', last_email_sent = '.time(),
+-						'WHERE'		=> 'id='.$cur_hit['id']
+-					);
+-
+-					($hook = get_hook('li_forgot_pass_qr_set_activate_key')) ? eval($hook) : null;
+-					$forum_db->query_build($query) or error(__FILE__, __LINE__);
+-
+-					// Do the user specific replacements to the template
+-					$cur_mail_message = str_replace('<username>', $cur_hit['username'], $mail_message);
+-					$cur_mail_message = str_replace('<activation_url>', str_replace('&amp;', '&', forum_link($forum_url['change_password_key'], array($cur_hit['id'], $new_password_key))), $cur_mail_message);
+-
+-					($hook = get_hook('li_forgot_pass_new_user_replace_data')) ? eval($hook) : null;
+-
+-					forum_mail($email, $mail_subject, $cur_mail_message);
+-				}
+-
+-				message(sprintf($lang_login['Forget mail'], '<a href="mailto:'.forum_htmlencode($forum_config['o_admin_email']).'">'.forum_htmlencode($forum_config['o_admin_email']).'</a>'));
+-			}
+-			else
+-				$errors[] = sprintf($lang_login['No e-mail match'], forum_htmlencode($email));
+-		}
+-	}
+-
+-	// Setup form
+-	$forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0;
+-	$forum_page['form_action'] = forum_link($forum_url['request_password']);
+-
+-	// Setup breadcrumbs
+-	$forum_page['crumbs'] = array(
+-		array($forum_config['o_board_title'], forum_link($forum_url['index'])),
+-		array($lang_login['New password request'], forum_link($forum_url['request_password']))
+-	);
+-
+-	($hook = get_hook('li_forgot_pass_pre_header_load')) ? eval($hook) : null;
+-
+-	define ('FORUM_PAGE', 'reqpass');
+-	require FORUM_ROOT.'header.php';
+-
+-	// START SUBST - <!-- forum_main -->
+-	ob_start();
+-
+-	($hook = get_hook('li_forgot_pass_output_start')) ? eval($hook) : null;
+-
+-?>
+-	<div class="main-head">
+-		<h2 class="hn"><span><?php echo $lang_login['New password request'] ?></span></h2>
+-	</div>
+-	<div class="main-content main-frm">
+-		<div class="ct-box info-box">
+-			<p class="important"><?php echo $lang_login['New password info'] ?></p>
+-		</div>
+-<?php
+-
+-	// If there were any errors, show them
+-	if (!empty($errors))
+-	{
+-		$forum_page['errors'] = array();
+-		foreach ($errors as $cur_error)
+-			$forum_page['errors'][] = '<li class="warn"><span>'.$cur_error.'</span></li>';
+-
+-		($hook = get_hook('li_forgot_pass_pre_new_password_errors')) ? eval($hook) : null;
+-
+-?>
+-		<div class="ct-box error-box">
+-			<h2 class="warn hn"><?php echo $lang_login['New password errors'] ?></h2>
+-			<ul class="error-list">
+-				<?php echo implode("\n\t\t\t\t", $forum_page['errors'])."\n" ?>
+-			</ul>
+-		</div>
+-<?php
+-
+-	}
+-
+-?>
+-		<div id="req-msg" class="req-warn ct-box error-box">
+-			<p class="important"><?php printf($lang_common['Required warn'], '<em>'.$lang_common['Required'].'</em>') ?></p>
+-		</div>
+-		<form id="afocus" class="frm-form" method="post" accept-charset="utf-8" action="<?php echo $forum_page['form_action'] ?>">
+-			<div class="hidden">
+-				<input type="hidden" name="form_sent" value="1" />
+-				<input type="hidden" name="csrf_token" value="<?php echo generate_form_token($forum_page['form_action']) ?>" />
+-			</div>
+-<?php ($hook = get_hook('li_forgot_pass_pre_group')) ? eval($hook) : null; ?>
+-			<div class="frm-group group<?php echo ++$forum_page['group_count'] ?>">
+-<?php ($hook = get_hook('li_forgot_pass_pre_email')) ? eval($hook) : null; ?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_login['E-mail address'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_login['E-mail address help'] ?></small></label><br />
+-						<span class="fld-input"><input id="fld<?php echo $forum_page['fld_count'] ?>" type="text" name="req_email" value="<?php echo isset($_POST['req_email']) ? forum_htmlencode($_POST['req_email']) : '' ?>" size="35" maxlength="80" /></span>
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('li_forgot_pass_pre_group_end')) ? eval($hook) : null; ?>
+-			</div>
+-<?php ($hook = get_hook('li_forgot_pass_group_end')) ? eval($hook) : null; ?>
+-			<div class="frm-buttons">
+-				<span class="submit"><input type="submit" name="request_pass" value="<?php echo $lang_login['Submit password request'] ?>" /></span>
+-				<span class="cancel"><input type="submit" name="cancel" value="<?php echo $lang_common['Cancel'] ?>" /></span>
+-			</div>
+-		</form>
+-	</div>
+-<?php
+-
+-	($hook = get_hook('li_forgot_pass_end')) ? eval($hook) : null;
+-
+-	$tpl_temp = forum_trim(ob_get_contents());
+-	$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
+-	ob_end_clean();
+-	// END SUBST - <!-- forum_main -->
+-
+-	require FORUM_ROOT.'footer.php';
+-}
+-
+ if (!$forum_user['is_guest'])
+ 	header('Location: '.forum_link($forum_url['index']));
+ 
+@@ -382,7 +211,7 @@
+ 	</div>
+ 	<div class="main-content main-frm">
+ 		<div class="content-head">
+-			<p class="hn"><?php printf($lang_login['Login options'], '<a href="'.forum_link($forum_url['register']).'">'.$lang_login['register'].'</a>', '<a href="'.forum_link($forum_url['request_password']).'">'.$lang_login['Obtain pass'].'</a>') ?></p>
++			<p class="hn"><?php printf($lang_login['Login options'], '<a href="'.$vhffs_hoster_url.'">'.$lang_login['register'].'</a>', '<a href="'.$vhffs_panel_url.'/lost.pl">'.$lang_login['Obtain pass'].'</a>') ?></p>
+ 		</div>
+ <?php
+ 
+diff -Nru a/post.php b/post.php
+--- a/post.php	2011-03-07 21:13:25.000000000 +0100
++++ b/post.php	2011-04-17 22:12:05.000000000 +0200
+@@ -5,6 +5,11 @@
+  * @copyright (C) 2008-2009 PunBB, partially based on code (C) 2008-2009 FluxBB.org
+  * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
+  * @package PunBB
++ * 
++ * VHFFS Antibot patch by
++ *   Samuel Lesueur <crafty@xxxxxxxxxxxxx>
++ *   Sylvain Rochet <gradator@xxxxxxxxxxxx>
++ * 
+  */
+ 
+ define('FORUM_SKIP_CSRF_CONFIRM', 1);
+@@ -163,6 +168,12 @@
+ 	if ($forum_user['is_admmod'] && (!isset($_POST['csrf_token']) || $_POST['csrf_token'] !== generate_form_token(get_current_url())))
+ 		$errors[] = $lang_post['CSRF token mismatch'];
+ 
++	//Check that the antispam code is ok
++	if( crypt($_POST['antibot_test'] , $_POST['code']) != $_POST['code'])
++	{
++		$errors[] = $lang_post['Captcha failed'];
++	}
++
+ 	// Clean up message from POST
+ 	$message = forum_linebreaks(forum_trim($_POST['req_message']));
+ 
+@@ -443,6 +454,25 @@
+ 					</div>
+ 				</div>
+ <?php ($hook = get_hook('po_pre_guest_info_fieldset_end')) ? eval($hook) : null; ?>
++				<div class="txt-set set<?php echo ++$forum_page['item_count'] ?>">
++					<div class="txt-box textarea required">
++						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span>Antispam <em>(Required)</em></span></label><br />
++						<p><?php echo $lang_post['Bot message'] ?></p><p>
++						<?php
++							$antibot_code = '';
++							$antibot_text = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789';
++							for($i=0;$i<6;$i++) {
++								$antibot_chr=$antibot_text[ rand(0,34) ];
++								echo("<img alt='antibot' src='img/antibot/".$antibot_chr.".png'/>");
++								$antibot_code .= $antibot_chr;
++							}
++							$antibot_code=crypt($antibot_code , 'a4' );
++						?>
++						<input type='text' name='antibot_test' size='6' maxlength='6' /></p>
++						<input type='hidden' value='<?php echo $antibot_code;?>' name='code'/>
++						<p><?php echo $lang_post['Bot warning'] ?></p>
++					</div>
++				</div>
+ 			</fieldset>
+ <?php
+ 
+diff -Nru a/profile.php b/profile.php
+--- a/profile.php	2011-03-11 19:46:44.000000000 +0100
++++ b/profile.php	2011-04-17 22:14:32.000000000 +0200
+@@ -5,6 +5,11 @@
+  * @copyright (C) 2008-2009 PunBB, partially based on code (C) 2008-2009 FluxBB.org
+  * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
+  * @package PunBB
++ *
++ * VHFFS patch by
++ *   Samuel Lesueur <crafty@xxxxxxxxxxxxx>
++ *   Sylvain Rochet <gradator@xxxxxxxxxxxx>
++ *
+  */
+ 
+ 
+@@ -55,583 +60,14 @@
+ $user = $forum_db->fetch_assoc($result);
+ 
+ 
+-if ($action == 'change_pass')
+-{
+-	($hook = get_hook('pf_change_pass_selected')) ? eval($hook) : null;
+-
+-	// User pressed the cancel button
+-	if (isset($_POST['cancel']))
+-		redirect(forum_link($forum_url['profile_about'], $id), $lang_common['Cancel redirect']);
+-
+-	if (isset($_GET['key']))
+-	{
+-		$key = $_GET['key'];
+-
+-		// If the user is already logged in we shouldn't be here :)
+-		if (!$forum_user['is_guest'])
+-			message($lang_profile['Pass logout']);
+-
+-		($hook = get_hook('pf_change_pass_key_supplied')) ? eval($hook) : null;
+-
+-		if ($key == '' || $key != $user['activate_key'])
+-			message(sprintf($lang_profile['Pass key bad'], '<a href="mailto:'.forum_htmlencode($forum_config['o_admin_email']).'">'.forum_htmlencode($forum_config['o_admin_email']).'</a>'));
+-		else
+-		{
+-			if (isset($_POST['form_sent']))
+-			{
+-				($hook = get_hook('pf_change_pass_key_form_submitted')) ? eval($hook) : null;
+-
+-				$new_password1 = forum_trim($_POST['req_new_password1']);
+-				$new_password2 = forum_trim($_POST['req_new_password2']);
+-
+-				if (utf8_strlen($new_password1) < 4)
+-					$errors[] = $lang_profile['Pass too short'];
+-				else if ($new_password1 != $new_password2)
+-					$errors[] = $lang_profile['Pass not match'];
+-
+-				// Did everything go according to plan?
+-				if (empty($errors))
+-				{
+-					$new_password_hash = forum_hash($new_password1, $user['salt']);
+-
+-					$query = array(
+-						'UPDATE'	=> 'users',
+-						'SET'		=> 'password=\''.$new_password_hash.'\', activate_key=NULL',
+-						'WHERE'		=> 'id='.$id
+-					);
+-
+-					($hook = get_hook('pf_change_pass_key_qr_update_password')) ? eval($hook) : null;
+-					$forum_db->query_build($query) or error(__FILE__, __LINE__);
+-
+-					($hook = get_hook('pf_change_pass_key_pre_redirect')) ? eval($hook) : null;
+-
+-					redirect(forum_link($forum_url['index']), $lang_profile['Pass updated']);
+-				}
+-			}
+-
+-			// Is this users own profile
+-			$forum_page['own_profile'] = ($forum_user['id'] == $id) ? true : false;
+-
+-			// Setup form
+-			$forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0;
+-			$forum_page['form_action'] = forum_link($forum_url['change_password_key'], array($id, $key));
+-
+-			// Setup breadcrumbs
+-			$forum_page['crumbs'] = array(
+-				array($forum_config['o_board_title'], forum_link($forum_url['index'])),
+-				array(sprintf($lang_profile['Users profile'], $user['username'], $lang_profile['Section about']), forum_link($forum_url['profile_about'], $id)),
+-				($forum_page['own_profile']) ? array($lang_profile['Change your password'], forum_link($forum_url['change_password'], $id)) : array(sprintf($lang_profile['Change user password'], forum_htmlencode($user['username'])),forum_link($forum_url['change_password']), $id)
+-			);
+-
+-			($hook = get_hook('pf_change_pass_key_pre_header_load')) ? eval($hook) : null;
+-
+-			define('FORUM_PAGE', 'profile-changepass');
+-			require FORUM_ROOT.'header.php';
+-
+-			// START SUBST - <!-- forum_main -->
+-			ob_start();
+-
+-			($hook = get_hook('pf_change_pass_key_output_start')) ? eval($hook) : null;
+-
+-?>
+-	<div class="main-head">
+-		<h2 class="hn"><span><?php echo $forum_page['own_profile'] ? $lang_profile['Change your password'] : sprintf($lang_profile['Change user password'], forum_htmlencode($user['username'])) ?></span></h2>
+-	</div>
+-	<div class="main-content main-frm">
+-<?php
+-
+-			// If there were any errors, show them
+-			if (!empty($errors))
+-			{
+-				$forum_page['errors'] = array();
+-				foreach ($errors as $cur_error)
+-					$forum_page['errors'][] = '<li class="warn"><span>'.$cur_error.'</span></li>';
+-
+-				($hook = get_hook('pf_change_pass_key_pre_errors')) ? eval($hook) : null;
+-
+-?>
+-		<div class="ct-box error-box">
+-			<h2 class="warn hn"><?php echo $lang_profile['Change pass errors'] ?></h2>
+-			<ul class="error-list">
+-				<?php echo implode("\n\t\t\t\t", $forum_page['errors'])."\n" ?>
+-			</ul>
+-		</div>
+-<?php
+-
+-			}
+-
+-?>
+-		<div id="req-msg" class="req-warn ct-box error-box">
+-			<p class="important"><?php printf($lang_common['Required warn'], '<em>'.$lang_common['Required'].'</em>') ?></p>
+-		</div>
+-		<form id="afocus" class="frm-form" method="post" accept-charset="utf-8" action="<?php echo $forum_page['form_action'] ?>">
+-			<div class="hidden">
+-				<input type="hidden" name="form_sent" value="1" />
+-				<input type="hidden" name="csrf_token" value="<?php echo generate_form_token($forum_page['form_action']) ?>" />
+-			</div>
+-<?php ($hook = get_hook('pf_change_pass_key_pre_fieldset')) ? eval($hook) : null; ?>
+-			<fieldset class="frm-group group<?php echo ++$forum_page['group_count'] ?>">
+-				<legend class="group-legend"><strong><?php echo $lang_common['Required information'] ?></strong></legend>
+-<?php ($hook = get_hook('pf_change_pass_key_pre_new_password')) ? eval($hook) : null; ?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['New password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Password help'] ?></small></label><br />
+-						<span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_password1" size="35" value="<?php echo(isset($_POST['req_new_password1']) ? forum_htmlencode($_POST['req_new_password1']) : ''); ?>"/></span><br />
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('pf_change_pass_key_pre_new_password_confirm')) ? eval($hook) : null; ?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Confirm new password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Confirm password help'] ?></small></label><br />
+-						<span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_password2" size="35" value="<?php echo(isset($_POST['req_new_password2']) ? forum_htmlencode($_POST['req_new_password2']) : ''); ?>"/></span><br />
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('pf_change_pass_key_pre_fieldset_end')) ? eval($hook) : null; ?>
+-			</fieldset>
+-<?php ($hook = get_hook('pf_change_pass_key_fieldset_end')) ? eval($hook) : null; ?>
+-			<div class="frm-buttons">
+-				<span class="submit"><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /></span>
+-				<span class="cancel"><input type="submit" name="cancel" value="<?php echo $lang_common['Cancel'] ?>" /></span>
+-			</div>
+-		</form>
+-	</div>
+-
+-<?php
+-
+-			($hook = get_hook('pf_change_pass_key_end')) ? eval($hook) : null;
+-
+-			$tpl_temp = forum_trim(ob_get_contents());
+-			$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
+-			ob_end_clean();
+-			// END SUBST - <!-- forum_main -->
+-
+-			require FORUM_ROOT.'footer.php';
+-		}
+-	}
+-
+-	// Make sure we are allowed to change this user's password
+-	if ($forum_user['id'] != $id &&
+-		$forum_user['g_id'] != FORUM_ADMIN &&
+-		($forum_user['g_moderator'] != '1' || $forum_user['g_mod_edit_users'] == '0' || $forum_user['g_mod_change_passwords'] == '0' || $user['g_id'] == FORUM_ADMIN || $user['g_moderator'] == '1'))
+-		message($lang_common['No permission']);
++// VHFFS MODIFICATION : password and email change disabled
+ 
+-	if (isset($_POST['form_sent']))
+-	{
+-		($hook = get_hook('pf_change_pass_normal_form_submitted')) ? eval($hook) : null;
+-
+-		$old_password = isset($_POST['req_old_password']) ? forum_trim($_POST['req_old_password']) : '';
+-		$new_password1 = forum_trim($_POST['req_new_password1']);
+-		$new_password2 = forum_trim($_POST['req_new_password2']);
+-
+-		if (utf8_strlen($new_password1) < 4)
+-			$errors[] = $lang_profile['Pass too short'];
+-		else if ($new_password1 != $new_password2)
+-			$errors[] = $lang_profile['Pass not match'];
+-
+-		$authorized = false;
+-		if (!empty($user['password']))
+-		{
+-			$old_password_hash = forum_hash($old_password, $user['salt']);
+-
+-			if (($user['password'] == $old_password_hash) || $forum_user['is_admmod'])
+-				$authorized = true;
+-		}
+-
+-		if (!$authorized)
+-			$errors[] = $lang_profile['Wrong old password'];
+-
+-		// Did everything go according to plan?
+-		if (empty($errors))
+-		{
+-			$new_password_hash = forum_hash($new_password1, $user['salt']);
+-
+-			$query = array(
+-				'UPDATE'	=> 'users',
+-				'SET'		=> 'password=\''.$new_password_hash.'\'',
+-				'WHERE'		=> 'id='.$id
+-			);
+-
+-			($hook = get_hook('pf_change_pass_normal_qr_update_password')) ? eval($hook) : null;
+-			$forum_db->query_build($query) or error(__FILE__, __LINE__);
+-
+-			if ($forum_user['id'] == $id)
+-			{
+-				$cookie_data = @explode('|', base64_decode($_COOKIE[$cookie_name]));
+-
+-				$expire = ($cookie_data[2] > time() + $forum_config['o_timeout_visit']) ? time() + 1209600 : time() + $forum_config['o_timeout_visit'];
+-				forum_setcookie($cookie_name, base64_encode($forum_user['id'].'|'.$new_password_hash.'|'.$expire.'|'.sha1($user['salt'].$new_password_hash.forum_hash($expire, $user['salt']))), $expire);
+-			}
+-
+-			($hook = get_hook('pf_change_pass_normal_pre_redirect')) ? eval($hook) : null;
+-
+-			redirect(forum_link($forum_url['profile_about'], $id), $lang_profile['Pass updated redirect']);
+-		}
+-	}
+-
+-	// Is this users own profile
+-	$forum_page['own_profile'] = ($forum_user['id'] == $id) ? true : false;
+-
+-	// Setup form
+-	$forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0;
+-	$forum_page['form_action'] = forum_link($forum_url['change_password'], $id);
+-
+-	$forum_page['hidden_fields'] = array(
+-		'form_sent'		=> '<input type="hidden" name="form_sent" value="1" />',
+-		'csrf_token'	=> '<input type="hidden" name="csrf_token" value="'.generate_form_token($forum_page['form_action']).'" />'
+-	);
+-
+-	// Setup breadcrumbs
+-	$forum_page['crumbs'] = array(
+-		array($forum_config['o_board_title'], forum_link($forum_url['index'])),
+-		array(sprintf($lang_profile['Users profile'], $user['username']), forum_link($forum_url['profile_about'], $id)),
+-		($forum_page['own_profile']) ? array($lang_profile['Change your password'], forum_link($forum_url['change_password'], $id)) : array(sprintf($lang_profile['Change user password'], forum_htmlencode($user['username'])),forum_link($forum_url['change_password'], $id))
+-	);
+-
+-	($hook = get_hook('pf_change_pass_normal_pre_header_load')) ? eval($hook) : null;
+-
+-	define('FORUM_PAGE', 'profile-changepass');
+-	require FORUM_ROOT.'header.php';
+-
+-	// START SUBST - <!-- forum_main -->
+-	ob_start();
+-
+-	($hook = get_hook('pf_change_pass_normal_output_start')) ? eval($hook) : null;
+-
+-?>
+-	<div class="main-head">
+-		<h2 class="hn"><span><?php echo $forum_page['own_profile'] ? $lang_profile['Change your password'] : sprintf($lang_profile['Change user password'], forum_htmlencode($user['username'])) ?></span></h2>
+-	</div>
+-	<div class="main-content main-frm">
+-<?php
+-
+-	// If there were any errors, show them
+-	if (!empty($errors))
+-	{
+-		$forum_page['errors'] = array();
+-		foreach ($errors as $cur_error)
+-			$forum_page['errors'][] = '<li class="warn"><span>'.$cur_error.'</span></li>';
+-
+-		($hook = get_hook('pf_change_pass_normal_pre_errors')) ? eval($hook) : null;
+-
+-?>
+-		<div class="ct-box error-box">
+-			<h2 class="warn hn"><?php echo $lang_profile['Change pass errors'] ?></h2>
+-			<ul class="error-list">
+-				<?php echo implode("\n\t\t\t\t", $forum_page['errors'])."\n" ?>
+-			</ul>
+-		</div>
+-<?php
+-
+-	}
+-
+-?>
+-		<div id="req-msg" class="req-warn ct-box error-box">
+-			<p class="important"><?php printf($lang_common['Required warn'], '<em>'.$lang_common['Required'].'</em>') ?></p>
+-		</div>
+-		<form id="afocus" class="frm-form" method="post" accept-charset="utf-8" action="<?php echo $forum_page['form_action']  ?>">
+-			<div class="hidden">
+-				<?php echo implode("\n\t\t\t\t", $forum_page['hidden_fields'])."\n" ?>
+-			</div>
+-<?php ($hook = get_hook('pf_change_pass_normal_pre_fieldset')) ? eval($hook) : null; ?>
+-			<fieldset class="frm-group group<?php echo ++$forum_page['group_count'] ?>">
+-				<legend class="group-legend"><strong><?php echo $lang_common['Required information'] ?></strong></legend>
+-<?php ($hook = get_hook('pf_change_pass_normal_pre_old_password')) ? eval($hook) : null; ?>
+-<?php if (!$forum_user['is_admmod'] || $forum_user['id'] == $id): ?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Old password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Old password help'] ?></small></label><br />
+-						<span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_old_password" size="35" value="<?php echo(isset($_POST['req_old_password']) ? forum_htmlencode($_POST['req_old_password']) : ''); ?>"/></span>
+-					</div>
+-				</div>
+-<?php endif; ($hook = get_hook('pf_change_pass_normal_pre_new_password')) ? eval($hook) : null; ?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['New password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Password help'] ?></small></label><br />
+-						<span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_password1" size="35" value="<?php echo(isset($_POST['req_new_password1']) ? forum_htmlencode($_POST['req_new_password1']) : ''); ?>"/></span><br />
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('pf_change_pass_normal_pre_new_password_confirm')) ? eval($hook) : null; ?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Confirm new password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Confirm password help'] ?></small></label><br />
+-						<span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_password2" size="35" value="<?php echo(isset($_POST['req_new_password2']) ? forum_htmlencode($_POST['req_new_password2']) : ''); ?>"/></span><br />
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('pf_change_pass_normal_pre_fieldset_end')) ? eval($hook) : null; ?>
+-			</fieldset>
+-<?php ($hook = get_hook('pf_change_pass_normal_fieldset_end')) ? eval($hook) : null; ?>
+-			<div class="frm-buttons">
+-				<span class="submit"><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /></span>
+-				<span class="cancel"><input type="submit" name="cancel" value="<?php echo $lang_common['Cancel'] ?>" /></span>
+-			</div>
+-		</form>
+-	</div>
+-<?php
+-
+-	($hook = get_hook('pf_change_pass_normal_end')) ? eval($hook) : null;
+-
+-	$tpl_temp = forum_trim(ob_get_contents());
+-	$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
+-	ob_end_clean();
+-	// END SUBST - <!-- forum_main -->
+-
+-	require FORUM_ROOT.'footer.php';
++if ($action == 'change_pass') {
++	message('Please use the <a href="'.$vhffs_panel_url.'">'.$vhffs_team.'\'s panel </a> to modify your password.' );
+ }
+ 
+-
+-else if ($action == 'change_email')
+-{
+-	// Make sure we are allowed to change this user's e-mail
+-	if ($forum_user['id'] != $id &&
+-		$forum_user['g_id'] != FORUM_ADMIN &&
+-		($forum_user['g_moderator'] != '1' || $forum_user['g_mod_edit_users'] == '0' || $user['g_id'] == FORUM_ADMIN || $user['g_moderator'] == '1'))
+-		message($lang_common['No permission']);
+-
+-	($hook = get_hook('pf_change_email_selected')) ? eval($hook) : null;
+-
+-	// User pressed the cancel button
+-	if (isset($_POST['cancel']))
+-		redirect(forum_link($forum_url['profile_about'], $id), $lang_common['Cancel redirect']);
+-
+-	if (isset($_GET['key']))
+-	{
+-		$key = $_GET['key'];
+-
+-		($hook = get_hook('pf_change_email_key_supplied')) ? eval($hook) : null;
+-
+-		if ($key == '' || $key != $user['activate_key'])
+-			message(sprintf($lang_profile['E-mail key bad'], '<a href="mailto:'.forum_htmlencode($forum_config['o_admin_email']).'">'.forum_htmlencode($forum_config['o_admin_email']).'</a>'));
+-		else
+-		{
+-			$query = array(
+-				'UPDATE'	=> 'users',
+-				'SET'		=> 'email=activate_string, activate_string=NULL, activate_key=NULL',
+-				'WHERE'		=> 'id='.$id
+-			);
+-
+-			($hook = get_hook('pf_change_email_key_qr_update_email')) ? eval($hook) : null;
+-			$forum_db->query_build($query) or error(__FILE__, __LINE__);
+-
+-			message($lang_profile['E-mail updated']);
+-		}
+-	}
+-	else if (isset($_POST['form_sent']))
+-	{
+-		($hook = get_hook('pf_change_email_normal_form_submitted')) ? eval($hook) : null;
+-
+-		if (forum_hash($_POST['req_password'], $forum_user['salt']) !== $forum_user['password'])
+-			$errors[] = $lang_profile['Wrong password'];
+-
+-		if (!defined('FORUM_EMAIL_FUNCTIONS_LOADED'))
+-			require FORUM_ROOT.'include/email.php';
+-
+-		// Validate the email-address
+-		$new_email = strtolower(forum_trim($_POST['req_new_email']));
+-		if (!is_valid_email($new_email))
+-			$errors[] = $lang_common['Invalid e-mail'];
+-
+-		// Check if it's a banned e-mail address
+-		if (is_banned_email($new_email))
+-		{
+-			($hook = get_hook('pf_change_email_normal_banned_email')) ? eval($hook) : null;
+-
+-			if ($forum_config['p_allow_banned_email'] == '0')
+-				$errors[] = $lang_profile['Banned e-mail'];
+-			else if ($forum_config['o_mailing_list'] != '')
+-			{
+-				$mail_subject = 'Alert - Banned e-mail detected';
+-				$mail_message = 'User \''.$forum_user['username'].'\' changed to banned e-mail address: '.$new_email."\n\n".'User profile: '.forum_link($forum_url['user'], $id)."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
+-
+-				forum_mail($forum_config['o_mailing_list'], $mail_subject, $mail_message);
+-			}
+-		}
+-
+-		// Check if someone else already has registered with that e-mail address
+-		$query = array(
+-			'SELECT'	=> 'u.id, u.username',
+-			'FROM'		=> 'users AS u',
+-			'WHERE'		=> 'u.email=\''.$forum_db->escape($new_email).'\''
+-		);
+-
+-		($hook = get_hook('pf_change_email_normal_qr_check_email_dupe')) ? eval($hook) : null;
+-		$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
+-		if ($forum_db->num_rows($result))
+-		{
+-			($hook = get_hook('pf_change_email_normal_dupe_email')) ? eval($hook) : null;
+-
+-			if ($forum_config['p_allow_dupe_email'] == '0')
+-				$errors[] = $lang_profile['Dupe e-mail'];
+-			else if (($forum_config['o_mailing_list'] != '') && empty($errors))
+-			{
+-				while ($cur_dupe = $forum_db->fetch_assoc($result))
+-					$dupe_list[] = $cur_dupe['username'];
+-
+-				$mail_subject = 'Alert - Duplicate e-mail detected';
+-				$mail_message = 'User \''.$forum_user['username'].'\' changed to an e-mail address that also belongs to: '.implode(', ', $dupe_list)."\n\n".'User profile: '.forum_link($forum_url['user'], $id)."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
+-
+-				forum_mail($forum_config['o_mailing_list'], $mail_subject, $mail_message);
+-			}
+-		}
+-
+-		// Did everything go according to plan?
+-		if (empty($errors))
+-		{
+-			if ($forum_config['o_regs_verify'] != '1')
+-			{
+-				// We have no confirmed e-mail so we change e-mail right now
+-				$query = array(
+-					'UPDATE'	=> 'users',
+-					'SET'		=> 'email=\''.$forum_db->escape($new_email).'\'',
+-					'WHERE'		=> 'id='.$id
+-				);
+-
+-				($hook = get_hook('pf_change_email_key_qr_update_email')) ? eval($hook) : null;
+-				$forum_db->query_build($query) or error(__FILE__, __LINE__);
+-
+-				redirect(forum_link($forum_url['profile_about'], $id), $lang_profile['E-mail updated redirect']);
+-			}
+-
+-			// We have a confirmed e-mail so we going to send an activation link
+-
+-			$new_email_key = random_key(8, true);
+-
+-			// Save new e-mail and activation key
+-			$query = array(
+-				'UPDATE'	=> 'users',
+-				'SET'		=> 'activate_string=\''.$forum_db->escape($new_email).'\', activate_key=\''.$new_email_key.'\'',
+-				'WHERE'		=> 'id='.$id
+-			);
+-
+-			($hook = get_hook('pf_change_email_normal_qr_update_email_activation')) ? eval($hook) : null;
+-			$forum_db->query_build($query) or error(__FILE__, __LINE__);
+-
+-			// Load the "activate e-mail" template
+-			$mail_tpl = forum_trim(file_get_contents(FORUM_ROOT.'lang/'.$forum_user['language'].'/mail_templates/activate_email.tpl'));
+-
+-			// The first row contains the subject
+-			$first_crlf = strpos($mail_tpl, "\n");
+-			$mail_subject = forum_trim(substr($mail_tpl, 8, $first_crlf-8));
+-			$mail_message = forum_trim(substr($mail_tpl, $first_crlf));
+-
+-			$mail_message = str_replace('<username>', $forum_user['username'], $mail_message);
+-			$mail_message = str_replace('<base_url>', $base_url.'/', $mail_message);
+-			$mail_message = str_replace('<activation_url>', str_replace('&amp;', '&', forum_link($forum_url['change_email_key'], array($id, $new_email_key))), $mail_message);
+-			$mail_message = str_replace('<board_mailer>', sprintf($lang_common['Forum mailer'], $forum_config['o_board_title']), $mail_message);
+-
+-			($hook = get_hook('pf_change_email_normal_pre_activation_email_sent')) ? eval($hook) : null;
+-
+-			forum_mail($new_email, $mail_subject, $mail_message);
+-
+-			message(sprintf($lang_profile['Activate e-mail sent'], '<a href="mailto:'.forum_htmlencode($forum_config['o_admin_email']).'">'.forum_htmlencode($forum_config['o_admin_email']).'</a>'));
+-		}
+-	}
+-
+-	// Is this users own profile
+-	$forum_page['own_profile'] = ($forum_user['id'] == $id) ? true : false;
+-
+-	// Setup form
+-	$forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0;
+-	$forum_page['form_action'] = forum_link($forum_url['change_email'], $id);
+-
+-	$forum_page['hidden_fields'] = array(
+-		'form_sent'		=> '<input type="hidden" name="form_sent" value="1" />',
+-		'csrf_token'	=> '<input type="hidden" name="csrf_token" value="'.generate_form_token($forum_page['form_action']).'" />'
+-	);
+-
+-	// Setup form information
+-	$forum_page['frm_info'] = '<p class="important"><span>'.$lang_profile['E-mail info'].'</span></p>';
+-
+-	// Setup breadcrumbs
+-	$forum_page['crumbs'] = array(
+-		array($forum_config['o_board_title'], forum_link($forum_url['index'])),
+-		array(sprintf($lang_profile['Users profile'], $user['username'], $lang_profile['Section about']), forum_link($forum_url['profile_about'], $id)),
+-		($forum_page['own_profile']) ? array($lang_profile['Change your e-mail'], forum_link($forum_url['change_email'], $id)) : array(sprintf($lang_profile['Change user e-mail'], forum_htmlencode($user['username'])), forum_link($forum_url['change_email'], $id))
+-	);
+-
+-	($hook = get_hook('pf_change_email_normal_pre_header_load')) ? eval($hook) : null;
+-
+-	define('FORUM_PAGE', 'profile-changemail');
+-	require FORUM_ROOT.'header.php';
+-
+-	// START SUBST - <!-- forum_main -->
+-	ob_start();
+-
+-	($hook = get_hook('pf_change_email_normal_output_start')) ? eval($hook) : null;
+-
+-?>
+-	<div class="main-head">
+-		<h2 class="hn"><span><?php printf(($forum_user['id'] == $id) ? $lang_profile['Profile welcome'] : $lang_profile['Profile welcome user'], forum_htmlencode($user['username'])) ?></span></h2>
+-	</div>
+-	<div class="main-content main-frm">
+-		<div class="ct-box info-box">
+-			<?php echo $forum_page['frm_info']."\n" ?>
+-		</div>
+-<?php
+-
+-	// If there were any errors, show them
+-	if (!empty($errors))
+-	{
+-		$forum_page['errors'] = array();
+-		foreach ($errors as $cur_error)
+-			$forum_page['errors'][] = '<li class="warn"><span>'.$cur_error.'</span></li>';
+-
+-		($hook = get_hook('pf_change_email_pre_errors')) ? eval($hook) : null;
+-
+-?>
+-		<div class="ct-box error-box">
+-			<h2 class="warn hn"><?php echo $lang_profile['Change e-mail errors'] ?></h2>
+-			<ul class="error-list">
+-				<?php echo implode("\n\t\t\t\t", $forum_page['errors'])."\n" ?>
+-			</ul>
+-		</div>
+-<?php
+-
+-	}
+-
+-?>
+-		<div id="req-msg" class="req-warn ct-box error-box">
+-			<p class="important"><?php printf($lang_common['Required warn'], '<em>'.$lang_common['Required'].'</em>') ?></p>
+-		</div>
+-		<form id="afocus" class="frm-form" method="post" accept-charset="utf-8" action="<?php echo $forum_page['form_action'] ?>">
+-			<div class="hidden">
+-				<?php echo implode("\n\t\t\t", $forum_page['hidden_fields'])."\n" ?>
+-			</div>
+-<?php ($hook = get_hook('pf_change_email_normal_pre_fieldset')) ? eval($hook) : null; ?>
+-			<fieldset class="frm-group group<?php echo ++$forum_page['group_count'] ?>">
+-				<legend class="group-legend"><strong><?php echo $lang_common['Required information'] ?></strong></legend>
+-<?php ($hook = get_hook('pf_change_email_normal_pre_new_email')) ? eval($hook) : null; ?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['New e-mail'] ?> <em><?php echo $lang_common['Required'] ?></em></span></label><br />
+-						<span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_email" size="50" maxlength="80" value="<?php echo(isset($_POST['req_new_email']) ? forum_htmlencode($_POST['req_new_email']) : ''); ?>"/></span>
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('pf_change_email_normal_pre_password')) ? eval($hook) : null; ?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Password'] ?> <em><?php echo $lang_common['Required'] ?></em></span></label><br />
+-						<span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_password" size="25" value="<?php echo(isset($_POST['req_password']) ? forum_htmlencode($_POST['req_password']) : ''); ?>"/></span>
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('pf_change_email_normal_pre_fieldset_end')) ? eval($hook) : null; ?>
+-			</fieldset>
+-<?php ($hook = get_hook('pf_change_email_normal_fieldset_end')) ? eval($hook) : null; ?>
+-			<div class="frm-buttons">
+-				<span class="submit"><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /></span>
+-				<span class="cancel"><input type="submit" name="cancel" value="<?php echo $lang_common['Cancel'] ?>" /></span>
+-			</div>
+-		</form>
+-	</div>
+-<?php
+-
+-	($hook = get_hook('pf_change_email_normal_end')) ? eval($hook) : null;
+-
+-	$tpl_temp = forum_trim(ob_get_contents());
+-	$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
+-	ob_end_clean();
+-	// END SUBST - <!-- forum_main -->
+-
+-	require FORUM_ROOT.'footer.php';
++else if ($action == 'change_email') {
++	message('Please use the <a href="'.$vhffs_panel_url.'">'.$vhffs_team.'\'s panel </a> to modify your email.' );
+ }
+ 
+ else if ($action == 'delete_user' || isset($_POST['delete_user_comply']) || isset($_POST['cancel']))
+diff -Nru a/register.php b/register.php
+--- a/register.php	2011-03-10 08:44:00.000000000 +0100
++++ b/register.php	2011-04-17 21:11:52.000000000 +0200
+@@ -5,6 +5,10 @@
+  * @copyright (C) 2008-2009 PunBB, partially based on code (C) 2008-2009 FluxBB.org
+  * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
+  * @package PunBB
++ * 
++ * VHFFS patch by
++ *   Samuel Lesueur <crafty@xxxxxxxxxxxxx>
++ *   Sylvain Rochet <gradator@xxxxxxxxxxxx>
+  */
+ 
+ 
+@@ -12,481 +16,7 @@
+ 	define('FORUM_ROOT', './');
+ require FORUM_ROOT.'include/common.php';
+ 
+-($hook = get_hook('rg_start')) ? eval($hook) : null;
+-
+-// If we are logged in, we shouldn't be here
+-if (!$forum_user['is_guest'])
+-{
+-	header('Location: '.forum_link($forum_url['index']));
+-	exit;
+-}
+-
+-// Load the profile.php language file
+-require FORUM_ROOT.'lang/'.$forum_user['language'].'/profile.php';
+-
+-if ($forum_config['o_regs_allow'] == '0')
+-	message($lang_profile['No new regs']);
+-
+-$errors = array();
+-
+-
+-// User pressed the cancel button
+-if (isset($_GET['cancel']))
+-	redirect(forum_link($forum_url['index']), $lang_profile['Reg cancel redirect']);
+-
+-// User pressed agree but failed to tick checkbox
+-else if (isset($_GET['agree']) && !isset($_GET['req_agreement']))
+-	redirect(forum_link($forum_url['index']), $lang_profile['Reg cancel redirect']);
+-
+-// Show the rules
+-else if ($forum_config['o_rules'] == '1' && !isset($_GET['agree']) && !isset($_POST['form_sent']))
+-{
+-	// Setup form
+-	$forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0;
+-
+-	// Setup breadcrumbs
+-	$forum_page['crumbs'] = array(
+-		array($forum_config['o_board_title'], forum_link($forum_url['index'])),
+-		array($lang_common['Register'], forum_link($forum_url['register'])),
+-		$lang_common['Rules']
+-	);
+-
+-	($hook = get_hook('rg_rules_pre_header_load')) ? eval($hook) : null;
+-
+-	define('FORUM_PAGE', 'rules');
+-	require FORUM_ROOT.'header.php';
+-
+-	// START SUBST - <!-- forum_main -->
+-	ob_start();
+-
+-	($hook = get_hook('rg_rules_output_start')) ? eval($hook) : null;
+-
+-	$forum_page['set_count'] = $forum_page['fld_count'] = 0;
+-
+-?>
+-	<div class="main-head">
+-		<h2 class="hn"><span><?php echo sprintf($lang_profile['Register at'], $forum_config['o_board_title']) ?></span></h2>
+-	</div>
+-	<div class="main-subhead">
+-		<h2 class="hn"><span><?php echo $lang_profile['Reg rules head'] ?></span></h2>
+-	</div>
+-	<div class="main-content main-frm">
+-		<div class="ct-box user-box">
+-			<?php echo $forum_config['o_rules_message'] ?>
+-		</div>
+-		<form class="frm-form" method="get" accept-charset="utf-8" action="<?php echo forum_link($forum_url['register']) ?>">
+-<?php ($hook = get_hook('rg_rules_pre_group')) ? eval($hook) : null; ?>
+-			<div class="frm-group group<?php echo ++$forum_page['group_count'] ?>">
+-<?php ($hook = get_hook('rg_rules_pre_agree_checkbox')) ? eval($hook) : null; ?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box checkbox">
+-						<span class="fld-input"><input type="checkbox" id="fld<?php echo ++$forum_page['fld_count'] ?>" name="req_agreement" value="1" /></span>
+-						<label for="fld<?php echo $forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Agreement'] ?></span> <?php echo $lang_profile['Agreement label'] ?></label>
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('rg_rules_pre_group_end')) ? eval($hook) : null; ?>
+-			</div>
+-<?php ($hook = get_hook('rg_rules_group_end')) ? eval($hook) : null; ?>
+-			<div class="frm-buttons">
+-				<span class="submit"><input type="submit" name="agree" value="<?php echo $lang_profile['Agree'] ?>" /></span>
+-				<span class="cancel"><input type="submit" name="cancel" value="<?php echo $lang_common['Cancel'] ?>" /></span>
+-			</div>
+-		</form>
+-	</div>
+-<?php
+-
+-	($hook = get_hook('rg_rules_end')) ? eval($hook) : null;
+-
+-	$tpl_temp = forum_trim(ob_get_contents());
+-	$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
+-	ob_end_clean();
+-	// END SUBST - <!-- forum_main -->
+-
+-	require FORUM_ROOT.'footer.php';
+-}
+-
+-else if (isset($_POST['form_sent']))
+-{
+-	($hook = get_hook('rg_register_form_submitted')) ? eval($hook) : null;
+-
+-	// Check that someone from this IP didn't register a user within the last hour (DoS prevention)
+-	$query = array(
+-		'SELECT'	=> '1',
+-		'FROM'		=> 'users AS u',
+-		'WHERE'		=> 'u.registration_ip=\''.$forum_db->escape(get_remote_address()).'\' AND u.registered>'.(time() - 3600)
+-	);
+-
+-	($hook = get_hook('rg_register_qr_check_register_flood')) ? eval($hook) : null;
+-	$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
+-	if ($forum_db->num_rows($result))
+-		$errors[] = $lang_profile['Registration flood'];
+-
+-	// Did everything go according to plan so far?
+-	if (empty($errors))
+-	{
+-		$username = forum_trim($_POST['req_username']);
+-		$email1 = strtolower(forum_trim($_POST['req_email1']));
+-
+-		if ($forum_config['o_regs_verify'] == '1')
+-		{
+-			$email2 = strtolower(forum_trim($_POST['req_email2']));
+-
+-			$password1 = random_key(8, true);
+-			$password2 = $password1;
+-		}
+-		else
+-		{
+-			$password1 = forum_trim($_POST['req_password1']);
+-			$password2 = forum_trim($_POST['req_password2']);
+-		}
+-
+-		// Validate the username
+-		$errors = array_merge($errors, validate_username($username));
+-
+-		// ... and the password
+-		if (utf8_strlen($password1) < 4)
+-			$errors[] = $lang_profile['Pass too short'];
+-		else if ($password1 != $password2)
+-			$errors[] = $lang_profile['Pass not match'];
+-
+-		// ... and the e-mail address
+-		if (!defined('FORUM_EMAIL_FUNCTIONS_LOADED'))
+-			require FORUM_ROOT.'include/email.php';
+-
+-		if (!is_valid_email($email1))
+-			$errors[] = $lang_profile['Invalid e-mail'];
+-		else if ($forum_config['o_regs_verify'] == '1' && $email1 != $email2)
+-			$errors[] = $lang_profile['E-mail not match'];
+-
+-		// Check if it's a banned e-mail address
+-		$banned_email = is_banned_email($email1);
+-		if ($banned_email && $forum_config['p_allow_banned_email'] == '0')
+-			$errors[] = $lang_profile['Banned e-mail'];
+-
+-		// Clean old unverified registrators - delete older than 72 hours
+-		$query = array(
+-			'DELETE'	=> 'users',
+-			'WHERE'		=> 'group_id='.FORUM_UNVERIFIED.' AND activate_key IS NOT NULL AND registered < '.(time() - 259200)
+-		);
+-		($hook = get_hook('rg_register_qr_delete_unverified')) ? eval($hook) : null;
+-		$forum_db->query_build($query) or error(__FILE__, __LINE__);
+-
+-		// Check if someone else already has registered with that e-mail address
+-		$dupe_list = array();
+-
+-		$query = array(
+-			'SELECT'	=> 'u.username',
+-			'FROM'		=> 'users AS u',
+-			'WHERE'		=> 'u.email=\''.$forum_db->escape($email1).'\''
+-		);
+-
+-		($hook = get_hook('rg_register_qr_check_email_dupe')) ? eval($hook) : null;
+-		$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
+-		if ($forum_db->num_rows($result) && empty($errors))
+-		{
+-			if ($forum_config['p_allow_dupe_email'] == '0')
+-				$errors[] = $lang_profile['Dupe e-mail'];
+-
+-			while ($cur_dupe = $forum_db->fetch_assoc($result))
+-				$dupe_list[] = $cur_dupe['username'];
+-		}
+-
+-		($hook = get_hook('rg_register_end_validation')) ? eval($hook) : null;
+-
+-		// Did everything go according to plan so far?
+-		if (empty($errors))
+-		{
+-			// Make sure we got a valid language string
+-			if (isset($_POST['language']))
+-			{
+-				$language = preg_replace('#[\.\\\/]#', '', $_POST['language']);
+-				if (!file_exists(FORUM_ROOT.'lang/'.$language.'/common.php'))
+-					message($lang_common['Bad request']);
+-			}
+-			else
+-				$language = $forum_config['o_default_lang'];
+-
+-			$initial_group_id = ($forum_config['o_regs_verify'] == '0') ? $forum_config['o_default_user_group'] : FORUM_UNVERIFIED;
+-			$salt = random_key(12);
+-			$password_hash = forum_hash($password1, $salt);
+-
+-			// Insert the new user into the database. We do this now to get the last inserted id for later use.
+-			$user_info = array(
+-				'username'				=>	$username,
+-				'group_id'				=>	$initial_group_id,
+-				'salt'					=>	$salt,
+-				'password'				=>	$password1,
+-				'password_hash'			=>	$password_hash,
+-				'email'					=>	$email1,
+-				'email_setting'			=>	$forum_config['o_default_email_setting'],
+-				'timezone'				=>	$_POST['timezone'],
+-				'dst'					=>	isset($_POST['dst']) ? '1' : '0',
+-				'language'				=>	$language,
+-				'style'					=>	$forum_config['o_default_style'],
+-				'registered'			=>	time(),
+-				'registration_ip'		=>	get_remote_address(),
+-				'activate_key'			=>	($forum_config['o_regs_verify'] == '1') ? '\''.random_key(8, true).'\'' : 'NULL',
+-				'require_verification'	=>	($forum_config['o_regs_verify'] == '1'),
+-				'notify_admins'			=>	($forum_config['o_regs_report'] == '1')
+-			);
+-
+-			($hook = get_hook('rg_register_pre_add_user')) ? eval($hook) : null;
+-			add_user($user_info, $new_uid);
+-
+-			// If we previously found out that the e-mail was banned
+-			if ($banned_email && $forum_config['o_mailing_list'] != '')
+-			{
+-				$mail_subject = 'Alert - Banned e-mail detected';
+-				$mail_message = 'User \''.$username.'\' registered with banned e-mail address: '.$email1."\n\n".'User profile: '.forum_link($forum_url['user'], $new_uid)."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
+-
+-				($hook = get_hook('rg_register_banned_email')) ? eval($hook) : null;
+-
+-				forum_mail($forum_config['o_mailing_list'], $mail_subject, $mail_message);
+-			}
+-
+-			// If we previously found out that the e-mail was a dupe
+-			if (!empty($dupe_list) && $forum_config['o_mailing_list'] != '')
+-			{
+-				$mail_subject = 'Alert - Duplicate e-mail detected';
+-				$mail_message = 'User \''.$username.'\' registered with an e-mail address that also belongs to: '.implode(', ', $dupe_list)."\n\n".'User profile: '.forum_link($forum_url['user'], $new_uid)."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';
+-
+-				($hook = get_hook('rg_register_dupe_email')) ? eval($hook) : null;
+-
+-				forum_mail($forum_config['o_mailing_list'], $mail_subject, $mail_message);
+-			}
+-
+-			($hook = get_hook('rg_register_pre_login_redirect')) ? eval($hook) : null;
+-
+-			// Must the user verify the registration or do we log him/her in right now?
+-			if ($forum_config['o_regs_verify'] == '1')
+-				message(sprintf($lang_profile['Reg e-mail'], '<a href="mailto:'.forum_htmlencode($forum_config['o_admin_email']).'">'.forum_htmlencode($forum_config['o_admin_email']).'</a>'));
+-
+-			$expire = time() + $forum_config['o_timeout_visit'];
+-
+-			forum_setcookie($cookie_name, base64_encode($new_uid.'|'.$password_hash.'|'.$expire.'|'.sha1($salt.$password_hash.forum_hash($expire, $salt))), $expire);
+-
+-			redirect(forum_link($forum_url['index']), $lang_profile['Reg complete']);
+-		}
+-	}
+-}
+-
+-// Setup form
+-$forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0;
+-$forum_page['form_action'] = forum_link($forum_url['register']).'?action=register';
+-
+-// Setup form information
+-$forum_page['frm_info']['intro'] = '<p>'.$lang_profile['Register intro'].'</p>';
+-if ($forum_config['o_regs_verify'] != '0')
+-	$forum_page['frm_info']['email'] = '<p class="warn">'.$lang_profile['Reg e-mail info'].'</p>';
+-
+-// Setup breadcrumbs
+-$forum_page['crumbs'] = array(
+-	array($forum_config['o_board_title'], forum_link($forum_url['index'])),
+-	array(sprintf($lang_profile['Register at'], $forum_config['o_board_title']), forum_link($forum_url['register'])),
+-
+-);
+-
+-($hook = get_hook('rg_register_pre_header_load')) ? eval($hook) : null;
+-
+-define('FORUM_PAGE', 'register');
+-require FORUM_ROOT.'header.php';
+-
+-// START SUBST - <!-- forum_main -->
+-ob_start();
+-
+-($hook = get_hook('rg_register_output_start')) ? eval($hook) : null;
+-
+-?>
+-	<div class="main-head">
+-		<h2 class="hn"><span><?php echo sprintf($lang_profile['Register at'], $forum_config['o_board_title']) ?></span></h2>
+-	</div>
+-	<div class="main-content main-frm">
+-		<div class="ct-box info-box">
+-			<?php echo implode("\n\t\t\t", $forum_page['frm_info'])."\n" ?>
+-		</div>
+-<?php
+-
+-	// If there were any errors, show them
+-	if (!empty($errors))
+-	{
+-		$forum_page['errors'] = array();
+-		foreach ($errors as $cur_error)
+-			$forum_page['errors'][] = '<li class="warn"><span>'.$cur_error.'</span></li>';
+-
+-		($hook = get_hook('rg_pre_register_errors')) ? eval($hook) : null;
+-
+-?>
+-		<div class="ct-box error-box">
+-			<h2 class="warn hn"><span><?php echo $lang_profile['Register errors'] ?></span></h2>
+-			<ul class="error-list">
+-				<?php echo implode("\n\t\t\t\t", $forum_page['errors'])."\n" ?>
+-			</ul>
+-		</div>
+-<?php
+-
+-	}
+-
+-?>
+-		<div id="req-msg" class="req-warn ct-box error-box">
+-			<p class="important"><?php printf($lang_common['Required warn'], '<em>'.$lang_common['Required'].'</em>') ?></p>
+-		</div>
+-		<form class="frm-form" id="afocus" method="post" accept-charset="utf-8" action="<?php echo $forum_page['form_action'] ?>">
+-			<div class="hidden">
+-				<input type="hidden" name="form_sent" value="1" />
+-				<input type="hidden" name="csrf_token" value="<?php echo generate_form_token($forum_page['form_action']) ?>" />
+-			</div>
+-<?php ($hook = get_hook('rg_register_pre_group')) ? eval($hook) : null; ?>
+-			<div class="frm-group group<?php echo ++$forum_page['group_count'] ?>">
+-<?php ($hook = get_hook('rg_register_pre_username')) ? eval($hook) : null; ?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Username'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Username help'] ?></small></label><br />
+-						<span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_username" value="<?php echo(isset($_POST['req_username']) ? forum_htmlencode($_POST['req_username']) : '') ?>" size="35" maxlength="25" /></span>
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('rg_register_pre_password')) ? eval($hook) : null; ?>
+-<?php if ($forum_config['o_regs_verify'] == '0'): ?>				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Password help'] ?></small></label><br />
+-						<span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_password1" size="35" /></span>
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('rg_register_pre_confirm_password')) ? eval($hook) : null; ?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Confirm password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Confirm password help'] ?></small></label><br />
+-						<span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_password2" size="35" /></span>
+-					</div>
+-				</div>
+-<?php endif; ($hook = get_hook('rg_register_pre_email')) ? eval($hook) : null; ?>				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['E-mail'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['E-mail help'] ?></small></label><br />
+-						<span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_email1" value="<?php echo(isset($_POST['req_email1']) ? forum_htmlencode($_POST['req_email1']) : '') ?>" size="35" maxlength="80" /></span>
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('rg_register_pre_email_confirm')) ? eval($hook) : null; ?>
+-<?php if ($forum_config['o_regs_verify'] == '1'): ?>				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box text required">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Confirm e-mail'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Confirm e-mail help'] ?></small></label><br />
+-						<span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_email2" value="<?php echo(isset($_POST['req_email2']) ? forum_htmlencode($_POST['req_email2']) : '') ?>" size="35" maxlength="80" /></span>
+-					</div>
+-				</div>
+-<?php endif;
+-
+-		$languages = array();
+-		$d = dir(FORUM_ROOT.'lang');
+-		while (($entry = $d->read()) !== false)
+-		{
+-			if ($entry != '.' && $entry != '..' && is_dir(FORUM_ROOT.'lang/'.$entry) && file_exists(FORUM_ROOT.'lang/'.$entry.'/common.php'))
+-				$languages[] = $entry;
+-		}
+-		$d->close();
+-
+-		($hook = get_hook('rg_register_pre_language')) ? eval($hook) : null;
+-
+-		// Only display the language selection box if there's more than one language available
+-		if (count($languages) > 1)
+-		{
+-			natcasesort($languages);
+-
+-?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box select">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Language'] ?></span></label><br />
+-						<span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name="language">
+-<?php
+-
+-			$select_lang = isset($_POST['language']) ? $_POST['language'] : $forum_config['o_default_lang'];
+-			foreach ($languages as $lang)
+-			{
+-				if ($select_lang == $lang)
+-					echo "\t\t\t\t\t\t".'<option value="'.$lang.'" selected="selected">'.$lang.'</option>'."\n";
+-				else
+-					echo "\t\t\t\t\t\t".'<option value="'.$lang.'">'.$lang.'</option>'."\n";
+-			}
+-
+-?>
+-						</select></span>
+-					</div>
+-				</div>
+-<?php
+-
+-		}
+-
+-		$select_timezone = isset($_POST['timezone']) ? $_POST['timezone'] : $forum_config['o_default_timezone'];
+-		$select_dst = isset($_POST['form_sent']) ? isset($_POST['dst']) : $forum_config['o_default_dst'];
+-
+-		($hook = get_hook('rg_register_pre_timezone')) ? eval($hook) : null;
+-
+-?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box select">
+-						<label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Timezone'] ?></span></label><br />
+-						<span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name="timezone">
+-						<option value="-12"<?php if ($select_timezone == -12) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-12:00'] ?></option>
+-						<option value="-11"<?php if ($select_timezone == -11) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-11:00'] ?></option>
+-						<option value="-10"<?php if ($select_timezone == -10) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-10:00'] ?></option>
+-						<option value="-9.5"<?php if ($select_timezone == -9.5) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-09:30'] ?></option>
+-						<option value="-9"<?php if ($select_timezone == -9) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-09:00'] ?></option>
+-						<option value="-8"<?php if ($select_timezone == -8) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-08:00'] ?></option>
+-						<option value="-7"<?php if ($select_timezone == -7) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-07:00'] ?></option>
+-						<option value="-6"<?php if ($select_timezone == -6) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-06:00'] ?></option>
+-						<option value="-5"<?php if ($select_timezone == -5) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-05:00'] ?></option>
+-						<option value="-4"<?php if ($select_timezone == -4) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-04:00'] ?></option>
+-						<option value="-3.5"<?php if ($select_timezone == -3.5) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-03:30'] ?></option>
+-						<option value="-3"<?php if ($select_timezone == -3) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-03:00'] ?></option>
+-						<option value="-2"<?php if ($select_timezone == -2) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-02:00'] ?></option>
+-						<option value="-1"<?php if ($select_timezone == -1) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC-01:00'] ?></option>
+-						<option value="0"<?php if ($select_timezone == 0) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC'] ?></option>
+-						<option value="1"<?php if ($select_timezone == 1) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+01:00'] ?></option>
+-						<option value="2"<?php if ($select_timezone == 2) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+02:00'] ?></option>
+-						<option value="3"<?php if ($select_timezone == 3) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+03:00'] ?></option>
+-						<option value="3.5"<?php if ($select_timezone == 3.5) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+03:30'] ?></option>
+-						<option value="4"<?php if ($select_timezone == 4) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+04:00'] ?></option>
+-						<option value="4.5"<?php if ($select_timezone == 4.5) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+04:30'] ?></option>
+-						<option value="5"<?php if ($select_timezone == 5) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+05:00'] ?></option>
+-						<option value="5.5"<?php if ($select_timezone == 5.5) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+05:30'] ?></option>
+-						<option value="5.75"<?php if ($select_timezone == 5.75) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+05:45'] ?></option>
+-						<option value="6"<?php if ($select_timezone == 6) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+06:00'] ?></option>
+-						<option value="6.5"<?php if ($select_timezone == 6.5) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+06:30'] ?></option>
+-						<option value="7"<?php if ($select_timezone == 7) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+07:00'] ?></option>
+-						<option value="8"<?php if ($select_timezone == 8) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+08:00'] ?></option>
+-						<option value="8.75"<?php if ($select_timezone == 8.75) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+08:45'] ?></option>
+-						<option value="9"<?php if ($select_timezone == 9) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+09:00'] ?></option>
+-						<option value="9.5"<?php if ($select_timezone == 9.5) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+09:30'] ?></option>
+-						<option value="10"<?php if ($select_timezone == 10) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+10:00'] ?></option>
+-						<option value="10.5"<?php if ($select_timezone == 10.5) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+10:30'] ?></option>
+-						<option value="11"<?php if ($select_timezone == 11) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+11:00'] ?></option>
+-						<option value="11.5"<?php if ($select_timezone == 11.5) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+11:30'] ?></option>
+-						<option value="12"<?php if ($select_timezone == 12) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+12:00'] ?></option>
+-						<option value="12.75"<?php if ($select_timezone == 12.75) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+12:45'] ?></option>
+-						<option value="13"<?php if ($select_timezone == 13) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+13:00'] ?></option>
+-						<option value="14"<?php if ($select_timezone == 14) echo ' selected="selected"' ?>><?php echo $lang_profile['UTC+14:00'] ?></option>
+-						</select></span>
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('rg_register_pre_dst_checkbox')) ? eval($hook) : null; ?>
+-				<div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
+-					<div class="sf-box checkbox">
+-						<span class="fld-input"><input type="checkbox" id="fld<?php echo ++$forum_page['fld_count'] ?>" name="dst"<?php if ($select_dst) echo ' checked="checked"' ?> /></span>
+-						<label for="fld<?php echo $forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Adjust for DST'] ?></span> <?php echo $lang_profile['DST label'] ?></label>
+-					</div>
+-				</div>
+-<?php ($hook = get_hook('rg_register_pre_group_end')) ? eval($hook) : null; ?>
+-			</div>
+-<?php ($hook = get_hook('rg_register_group_end')) ? eval($hook) : null; ?>
+-			<div class="frm-buttons">
+-				<span class="submit"><input type="submit" name="register" value="<?php echo $lang_profile['Register'] ?>" /></span>
+-			</div>
+-		</form>
+-	</div>
+-<?php
+-
+-($hook = get_hook('rg_end')) ? eval($hook) : null;
+-
+-$tpl_temp = forum_trim(ob_get_contents());
+-$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
+-ob_end_clean();
+-// END SUBST - <!-- forum_main -->
++//VHFFS MODIFICATION : Registering process removed
++message('Registration is disabled on this forum. Please use the <a href="'.$vhffs_panel_url.'">'.$vhffs_team.'\'s panel </a>to register.');
+ 
+ require FORUM_ROOT.'footer.php';


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/