[vhffs-dev] [929] Vhffs forum is now punbb-1.2. 15 complient! I also added a nice^W cute |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 929
Author: crafty
Date: 2007-09-19 16:36:39 +0000 (Wed, 19 Sep 2007)
Log Message:
-----------
Vhffs forum is now punbb-1.2.15 complient! I also added a nice^W cute
but uggly captcha on the public forums.
Added Paths:
-----------
trunk/vhffs-forum/antibot.tar.bz2
trunk/vhffs-forum/punbb-1.2.15_vhffs.patch
Added: trunk/vhffs-forum/antibot.tar.bz2
===================================================================
(Binary files differ)
Property changes on: trunk/vhffs-forum/antibot.tar.bz2
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/vhffs-forum/punbb-1.2.15_vhffs.patch
===================================================================
--- trunk/vhffs-forum/punbb-1.2.15_vhffs.patch (rev 0)
+++ trunk/vhffs-forum/punbb-1.2.15_vhffs.patch 2007-09-19 16:36:39 UTC (rev 929)
@@ -0,0 +1,1640 @@
+diff -Nru punbb-1.2.15/upload/cache/cache_bans.php punbb-1.2.15-VHFFS-patched/upload/cache/cache_bans.php
+--- punbb-1.2.15/upload/cache/cache_bans.php 1970-01-01 01:00:00.000000000 +0100
++++ punbb-1.2.15-VHFFS-patched/upload/cache/cache_bans.php 2007-09-19 14:56:51.000000000 +0200
+@@ -0,0 +1,8 @@
++<?php
++
++define('PUN_BANS_LOADED', 1);
++
++$pun_bans = array (
++);
++
++?>
+\ No newline at end of file
+diff -Nru punbb-1.2.15/upload/cache/cache_config.php punbb-1.2.15-VHFFS-patched/upload/cache/cache_config.php
+--- punbb-1.2.15/upload/cache/cache_config.php 1970-01-01 01:00:00.000000000 +0100
++++ punbb-1.2.15-VHFFS-patched/upload/cache/cache_config.php 2007-09-19 14:56:23.000000000 +0200
+@@ -0,0 +1,82 @@
++<?php
++
++define('PUN_CONFIG_LOADED', 1);
++
++$pun_config = array (
++ 'o_cur_version' => '1.2.14',
++ 'o_board_title' => 'PunBB patch for VHFFS test forum',
++ 'o_board_desc' => 'Patching, testing, re-patching, re-testing...',
++ 'o_server_timezone' => '0',
++ 'o_time_format' => 'H:i:s',
++ 'o_date_format' => 'Y-m-d',
++ 'o_timeout_visit' => '600',
++ 'o_timeout_online' => '300',
++ 'o_redirect_delay' => '1',
++ 'o_show_version' => '0',
++ 'o_show_user_info' => '1',
++ 'o_show_post_count' => '1',
++ 'o_smilies' => '1',
++ 'o_smilies_sig' => '1',
++ 'o_make_links' => '1',
++ 'o_default_lang' => 'French',
++ 'o_default_style' => 'Oxygen',
++ 'o_default_user_group' => '4',
++ 'o_topic_review' => '15',
++ 'o_disp_topics_default' => '30',
++ 'o_disp_posts_default' => '25',
++ 'o_indent_num_spaces' => '4',
++ 'o_quickpost' => '1',
++ 'o_users_online' => '1',
++ 'o_censoring' => '0',
++ 'o_ranks' => '1',
++ 'o_show_dot' => '1',
++ 'o_quickjump' => '1',
++ 'o_gzip' => '0',
++ 'o_additional_navlinks' => '',
++ 'o_report_method' => '0',
++ 'o_regs_report' => '0',
++ 'o_mailing_list' => 'crafty@xxxxxxxxxxxxx',
++ 'o_avatars' => '1',
++ 'o_avatars_dir' => 'img/avatars',
++ 'o_avatars_width' => '60',
++ 'o_avatars_height' => '60',
++ 'o_avatars_size' => '10240',
++ 'o_search_all_forums' => '1',
++ 'o_base_url' => 'http://forum.vhffs.org',
++ 'o_admin_email' => 'crafty@xxxxxxxxxxxxx',
++ 'o_webmaster_email' => 'crafty@xxxxxxxxxxxxx',
++ 'o_subscriptions' => '1',
++ 'o_smtp_host' => NULL,
++ 'o_smtp_user' => NULL,
++ 'o_smtp_pass' => NULL,
++ 'o_regs_allow' => '1',
++ 'o_regs_verify' => '0',
++ 'o_announcement' => '0',
++ 'o_announcement_message' => 'Enter your announcement here.',
++ 'o_rules' => '0',
++ 'o_rules_message' => 'Enter your rules here.',
++ 'o_maintenance' => '0',
++ 'o_maintenance_message' => 'The forums are temporarily down for maintenance. Please try again in a few minutes.<br />
++<br />
++/Administrator',
++ 'p_mod_edit_users' => '1',
++ 'p_mod_rename_users' => '0',
++ 'p_mod_change_passwords' => '0',
++ 'p_mod_ban_users' => '0',
++ 'p_message_bbcode' => '1',
++ 'p_message_img_tag' => '1',
++ 'p_message_all_caps' => '1',
++ 'p_subject_all_caps' => '1',
++ 'p_sig_all_caps' => '1',
++ 'p_sig_bbcode' => '1',
++ 'p_sig_img_tag' => '0',
++ 'p_sig_length' => '400',
++ 'p_sig_lines' => '4',
++ 'p_allow_banned_email' => '1',
++ 'p_allow_dupe_email' => '0',
++ 'p_force_guest_email' => '1',
++ 'o_pms_enabled' => '1',
++ 'o_pms_mess_per_page' => '10',
++);
++
++?>
+\ No newline at end of file
+diff -Nru punbb-1.2.15/upload/cache/cache_quickjump_3.php punbb-1.2.15-VHFFS-patched/upload/cache/cache_quickjump_3.php
+--- punbb-1.2.15/upload/cache/cache_quickjump_3.php 1970-01-01 01:00:00.000000000 +0100
++++ punbb-1.2.15-VHFFS-patched/upload/cache/cache_quickjump_3.php 2007-09-19 17:28:50.000000000 +0200
+@@ -0,0 +1,19 @@
++<?php
++
++if (!defined('PUN')) exit;
++define('PUN_QJ_LOADED', 1);
++
++?> <form id="qjump" method="get" action="viewforum.php">
++ <div><label><?php echo $lang_common['Jump to'] ?>
++
++ <br /><select name="id" onchange="window.location=('viewforum.php?id='+this.options[this.selectedIndex].value)">
++ <optgroup label="public">
++ <option value="2"<?php echo ($forum_id == 2) ? ' selected="selected"' : '' ?>>Need Help ?</option>
++ </optgroup>
++ <optgroup label="Test category">
++ <option value="1"<?php echo ($forum_id == 1) ? ' selected="selected"' : '' ?>>Test forum</option>
++ </optgroup>
++ </select>
++ <input type="submit" value="<?php echo $lang_common['Go'] ?>" accesskey="g" />
++ </label></div>
++ </form>
+diff -Nru punbb-1.2.15/upload/cache/cache_ranks.php punbb-1.2.15-VHFFS-patched/upload/cache/cache_ranks.php
+--- punbb-1.2.15/upload/cache/cache_ranks.php 1970-01-01 01:00:00.000000000 +0100
++++ punbb-1.2.15-VHFFS-patched/upload/cache/cache_ranks.php 2007-09-19 17:03:34.000000000 +0200
+@@ -0,0 +1,20 @@
++<?php
++
++define('PUN_RANKS_LOADED', 1);
++
++$pun_ranks = array (
++ 0 =>
++ array (
++ 'id' => '1',
++ 'rank' => 'New member',
++ 'min_posts' => '0',
++ ),
++ 1 =>
++ array (
++ 'id' => '2',
++ 'rank' => 'Member',
++ 'min_posts' => '10',
++ ),
++);
++
++?>
+\ No newline at end of file
+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 />© Copyright 2002–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 />© Copyright 2002–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 <?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 <?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 …'
++'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)',
++'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().', \''.$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))
+- {
+- $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&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&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&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