Got some basic security in there, admin panel works now, and most admin panel forms work (used regex mass search + replace)
--- a/plugins/PunBB.php Thu Jul 12 01:04:01 2007 -0400
+++ b/plugins/PunBB.php Thu Jul 12 15:00:35 2007 -0400
@@ -50,6 +50,7 @@
function page_Special_Forum()
{
+ global $db, $session, $paths, $template, $plugins; // Common objects
if ( getConfig('punbb_installed') != 'yes' )
{
punano_installer();
@@ -58,6 +59,10 @@
{
punano_upgrade();
}
+ else if ( preg_match('/^admin_/i', $paths->getParam(0)) )
+ {
+ punano_admin_console();
+ }
else
{
punano_main();
@@ -226,4 +231,42 @@
}
+function punano_admin_console()
+{
+ global $db, $session, $paths, $template, $plugins; // Common objects
+
+ $valid = array('categories', 'censoring', 'forums', 'groups', 'index', 'loader', 'maintenance', 'options', 'permissions', 'prune', 'ranks', 'reports', 'users');
+ $mod = array('bans', 'censoring', 'index', 'loader', 'reports', 'users');
+
+ $file = 'index';
+
+ if ( $x = $paths->getParam(0) )
+ {
+ $x = preg_replace('/\.php$/', '', $x);
+ $x = preg_replace('/^admin_/i', '', $x);
+ if ( in_array(strtolower($x), $valid) )
+ {
+ $file = strtolower($x);
+ }
+ }
+
+ if ( in_array($file, $mod) )
+ {
+ $need_level = USER_LEVEL_MOD;
+ }
+ else
+ {
+ $need_level = USER_LEVEL_ADMIN;
+ }
+
+ if ( $session->auth_level < $need_level )
+ {
+ redirect( makeUrlNS('Special', 'Login/' . $paths->fullpage, 'level=' . $need_level, false), 'Permission denied', 'You need to have permission level ' . $session->userlevel_to_string($need_level) . ' to use the PunBB administration console.', 2);
+ }
+
+ // Don't worry. This is sanitized.
+ require PUN_ROOT . 'admin_' . $file . '.php';
+
+}
+
?>
--- a/punbb/admin_bans.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/admin_bans.php Thu Jul 12 15:00:35 2007 -0400
@@ -288,7 +288,7 @@
<div class="blockform">
<h2><span>New ban</span></h2>
<div class="box">
- <form id="bans" method="post" action="admin_bans.php?action=more">
+ <form id="bans" method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_Bans', 'action=more', true); ?>">
<div class="inform">
<fieldset>
<legend>Add ban</legend>
--- a/punbb/admin_categories.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/admin_categories.php Thu Jul 12 15:00:35 2007 -0400
@@ -115,7 +115,7 @@
<div class="blockform">
<h2><span>Category delete</span></h2>
<div class="box">
- <form method="post" action="admin_categories.php">
+ <form method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_categories'); ?>">
<div class="inform">
<input type="hidden" name="cat_to_delete" value="<?php echo $cat_to_delete ?>" />
<fieldset>
@@ -187,7 +187,7 @@
<div class="blockform">
<h2><span>Add/remove/edit categories</span></h2>
<div class="box">
- <form method="post" action="admin_categories.php?action=foo">
+ <form method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_categories', 'action=foo', true); ?>">
<div class="inform">
<fieldset>
<legend>Add/delete categories</legend>
@@ -197,7 +197,7 @@
<th scope="row">Add a new category<div><input type="submit" name="add_cat" value="Add New" tabindex="2" /></div></th>
<td>
<input type="text" name="new_cat_name" size="35" maxlength="80" tabindex="1" />
- <span>The name of the new category you want to add. You can edit the name of the category later (see below).Go to <a href="admin_forums.php">Forums</a> to add forums to your new category.</span>
+ <span>The name of the new category you want to add. You can edit the name of the category later (see below). Go to <a href="<?php echo makeUrlNS('Special', 'Forum/Admin_forums'); ?>">Forums</a> to add forums to your new category.</span>
</td>
</tr>
<?php if ($num_cats): ?> <tr>
--- a/punbb/admin_censoring.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/admin_censoring.php Thu Jul 12 15:00:35 2007 -0400
@@ -97,7 +97,7 @@
<div class="blockform">
<h2><span>Censoring</span></h2>
<div class="box">
- <form id="censoring" method="post" action="admin_censoring.php?action=foo">
+ <form id="censoring" method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_censoring', 'action=foo', true); ?>">
<div class="inform">
<fieldset>
<legend>Add word</legend>
--- a/punbb/admin_forums.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/admin_forums.php Thu Jul 12 15:00:35 2007 -0400
@@ -110,7 +110,7 @@
<div class="blockform">
<h2><span>Confirm delete forum</span></h2>
<div class="box">
- <form method="post" action="admin_forums.php?del_forum=<?php echo $forum_id ?>">
+ <form method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_forums', 'del_forum=' . $forum_id, true); ?>">
<div class="inform">
<fieldset>
<legend>Important! Read before deleting</legend>
@@ -247,7 +247,7 @@
<div class="blockform">
<h2><span>Edit forum</span></h2>
<div class="box">
- <form id="edit_forum" method="post" action="admin_forums.php?edit_forum=<?php echo $forum_id ?>">
+ <form id="edit_forum" method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_forums', 'edit_forum=' . $forum_id, true); ?>">
<p class="submittop"><input type="submit" name="save" value="Save changes" tabindex="6" /></p>
<div class="inform">
<fieldset>
@@ -375,7 +375,7 @@
<div class="blockform">
<h2><span>Add forum</span></h2>
<div class="box">
- <form method="post" action="admin_forums.php?action=adddel">
+ <form method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_forums', 'action=adddel', true); ?>">
<div class="inform">
<fieldset>
<legend>Create a new forum</legend>
@@ -405,7 +405,7 @@
<h2 class="block2"><span>Edit forums</span></h2>
<div class="box">
- <form id="edforum" method="post" action="admin_forums.php?action=edit">
+ <form id="edforum" method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_forums', 'action=edit', true); ?>">
<p class="submittop"><input type="submit" name="update_positions" value="Update positions" tabindex="3" /></p>
<?php
@@ -435,7 +435,7 @@
?>
<tr>
- <th><a href="admin_forums.php?edit_forum=<?php echo $cur_forum['fid'] ?>">Edit</a> - <a href="admin_forums.php?del_forum=<?php echo $cur_forum['fid'] ?>">Delete</a></th>
+ <th><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_forums', 'edit_forum=' . $cur_forum['fid'], true); ?>">Edit</a> - <a href="<?php echo makeUrlNS('Special', 'Forum/Admin_forums', 'del_forum=' . $cur_forum['fid'], true); ?>">Delete</a></th>
<td>Position <input type="text" name="position[<?php echo $cur_forum['fid'] ?>]" size="3" maxlength="3" value="<?php echo $cur_forum['disp_position'] ?>" tabindex="<?php echo $tabindex_count ?>" />
<strong><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></strong></td>
</tr>
--- a/punbb/admin_groups.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/admin_groups.php Thu Jul 12 15:00:35 2007 -0400
@@ -329,7 +329,7 @@
<div class="blockform">
<h2><span>Remove group</span></h2>
<div class="box">
- <form id="groups" method="post" action="admin_groups.php?del_group=<?php echo $group_id ?>">
+ <form id="groups" method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_groups', 'del_group=' . $group_id, true); ?>">
<div class="inform">
<fieldset>
<legend>Move users currently in group</legend>
@@ -376,7 +376,7 @@
<div class="blockform">
<h2><span>Add/setup groups</span></h2>
<div class="box">
- <form id="groups" method="post" action="admin_groups.php?action=foo">
+ <form id="groups" method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_groups', 'action=foo', true); ?>">
<div class="inform">
<fieldset>
<legend>Add new group</legend>
--- a/punbb/admin_options.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/admin_options.php Thu Jul 12 15:00:35 2007 -0400
@@ -41,8 +41,9 @@
if (isset($_POST['form_sent']))
{
// Custom referrer check (so we can output a custom error message)
- if (!preg_match('#^'.preg_quote(str_replace('www.', '', $pun_config['o_base_url']).'/admin_options.php', '#').'#i', str_replace('www.', '', (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''))))
- message('Bad HTTP_REFERER. If you have moved these forums from one location to another or switched domains, you need to update the Base URL manually in the database (look for o_base_url in the config table) and then clear the cache by deleting all .php files in the /cache directory.');
+ // if (!preg_match('#^'.preg_quote(str_replace('www.', '', $pun_config['o_base_url']).'/admin_options.php', '#').'#i', str_replace('www.', '', (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''))))
+ // message('Bad HTTP_REFERER. If you have moved these forums from one location to another or switched domains, you need to update the Base URL manually in the database (look for o_base_url in the config table) and then clear the cache by deleting all .php files in the /cache directory.');
+ confirm_referrer('admin_options.php');
$form = array_map('trim', $_POST['form']);
@@ -155,7 +156,7 @@
<div class="blockform">
<h2><span>Options</span></h2>
<div class="box">
- <form method="post" action="admin_options.php?action=foo">
+ <form method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_Options', 'action=foo', true); ?>">
<p class="submittop"><input type="submit" name="save" value="Save changes" /></p>
<div class="inform">
<input type="hidden" name="form_sent" value="1" />
--- a/punbb/admin_prune.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/admin_prune.php Thu Jul 12 15:00:35 2007 -0400
@@ -127,7 +127,7 @@
<div class="blockform">
<h2><span>Prune</span></h2>
<div class="box">
- <form method="post" action="admin_prune.php?action=foo">
+ <form method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_prune', 'action=foo', true); ?>">
<div class="inform">
<input type="hidden" name="prune_days" value="<?php echo $prune_days ?>" />
<input type="hidden" name="prune_sticky" value="<?php echo $_POST['prune_sticky'] ?>" />
@@ -165,7 +165,7 @@
<div class="blockform">
<h2><span>Prune</span></h2>
<div class="box">
- <form id="prune" method="post" action="admin_prune.php?action=foo" onsubmit="return process_form(this)">
+ <form id="prune" method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_prune', 'action=foo', true); ?>" onsubmit="return process_form(this)">
<div class="inform">
<input type="hidden" name="form_sent" value="1" />
<fieldset>
--- a/punbb/admin_ranks.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/admin_ranks.php Thu Jul 12 15:00:35 2007 -0400
@@ -125,7 +125,7 @@
<div class="blockform">
<h2><span>Ranks</span></h2>
<div class="box">
- <form id="ranks" method="post" action="admin_ranks.php?action=foo">
+ <form id="ranks" method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_Ranks', 'action=foo', true); ?>">
<div class="inform">
<fieldset>
<legend>Add rank</legend>
--- a/punbb/admin_reports.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/admin_reports.php Thu Jul 12 15:00:35 2007 -0400
@@ -64,10 +64,10 @@
<div class="blockform">
<h2><span>New reports</span></h2>
<div class="box">
- <form method="post" action="admin_reports.php?action=zap">
+ <form method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_reports', 'action=zap', true); ?>">
<?php
-$result = $pun_db->query('SELECT r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.created, r.message, t.subject, f.forum_name, u.username AS reporter FROM '.$pun_db->prefix.'reports AS r LEFT JOIN '.$pun_db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$pun_db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.$pun_db->prefix.'users AS u ON r.reported_by=u.id WHERE r.zapped IS NULL ORDER BY created DESC') or error('Unable to fetch report list', __FILE__, __LINE__, $pun_db->error());
+$result = $pun_db->query('SELECT r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.created, r.message, t.subject, f.forum_name, u.username AS reporter FROM '.$pun_db->prefix.'reports AS r LEFT JOIN '.$pun_db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$pun_db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.table_prefix.'users AS u ON r.reported_by=u.user_id WHERE r.zapped IS NULL ORDER BY created DESC') or error('Unable to fetch report list', __FILE__, __LINE__, $pun_db->error());
if ($pun_db->num_rows($result))
{
@@ -115,7 +115,7 @@
<div class="fakeform">
<?php
-$result = $pun_db->query('SELECT r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.message, r.zapped, r.zapped_by AS zapped_by_id, t.subject, f.forum_name, u.username AS reporter, u2.username AS zapped_by FROM '.$pun_db->prefix.'reports AS r LEFT JOIN '.$pun_db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$pun_db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.$pun_db->prefix.'users AS u ON r.reported_by=u.id LEFT JOIN '.$pun_db->prefix.'users AS u2 ON r.zapped_by=u2.id WHERE r.zapped IS NOT NULL ORDER BY zapped DESC LIMIT 10') or error('Unable to fetch report list', __FILE__, __LINE__, $pun_db->error());
+$result = $pun_db->query('SELECT r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.message, r.zapped, r.zapped_by AS zapped_by_id, t.subject, f.forum_name, u.username AS reporter, u2.username AS zapped_by FROM '.$pun_db->prefix.'reports AS r LEFT JOIN '.$pun_db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$pun_db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.table_prefix.'users AS u ON r.reported_by=u.user_id LEFT JOIN '.table_prefix.'users AS u2 ON r.zapped_by=u2.user_id WHERE r.zapped IS NOT NULL ORDER BY zapped DESC LIMIT 10') or error('Unable to fetch report list', __FILE__, __LINE__, $pun_db->error());
if ($pun_db->num_rows($result))
{
--- a/punbb/admin_users.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/admin_users.php Thu Jul 12 15:00:35 2007 -0400
@@ -363,7 +363,7 @@
<div class="blockform">
<h2><span>User search</span></h2>
<div class="box">
- <form id="find_user" method="post" action="admin_users.php?action=find_user">
+ <form id="find_user" method="post" action="<?php echo makeUrlNS('Special', 'Forum/Admin_users', 'action=find_user', true); ?>">
<p class="submittop"><input type="submit" name="find_user" value="Submit search" tabindex="1" /></p>
<div class="inform">
<fieldset>
--- a/punbb/header.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/header.php Thu Jul 12 15:00:35 2007 -0400
@@ -58,7 +58,30 @@
// Load the template
if (defined('PUN_ADMIN_CONSOLE'))
{
- $tpl_main = file_get_contents(PUN_ROOT.'include/template/admin.tpl');
+ $inner = '<div id="punwrap">
+<div id="punadmin" class="pun">
+
+<div id="brdheader" class="block">
+ <div class="box">
+ <div id="brdtitle" class="inbox">
+ <pun_title>
+ <pun_desc>
+ </div>
+ <pun_navlinks>
+ <pun_status>
+ </div>
+</div>
+
+<pun_announcement>
+
+<pun_main>
+
+<pun_footer>
+
+</div>
+</div>';
+
+ $tpl_main = $template->getHeader() . $inner . $template->getFooter();
}
else if (defined('PUN_HELP'))
{
--- a/punbb/help.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/help.php Thu Jul 12 15:00:35 2007 -0400
@@ -148,7 +148,7 @@
}
}
- echo ' '.$lang_help['produces'].' <img src="img/smilies/'.$cur_img.'" width="15" height="15" alt="'.$cur_text.'" /><br />'."\n";
+ echo ' '.$lang_help['produces'].' <img src="' . scriptPath . '/punbb/img/smilies/'.$cur_img.'" width="15" height="15" alt="'.$cur_text.'" /><br />'."\n";
}
?>
--- a/punbb/include/common.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/include/common.php Thu Jul 12 15:00:35 2007 -0400
@@ -23,11 +23,11 @@
************************************************************************/
// Enable DEBUG mode by removing // from the following line
-//define('PUN_DEBUG', 1);
+define('PUN_DEBUG', 1);
// This displays all executed queries in the page footer.
// DO NOT enable this in a production environment!
-//define('PUN_SHOW_QUERIES', 1);
+define('PUN_SHOW_QUERIES', 1);
if (!defined('PUN_ROOT'))
exit('The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory.');
--- a/punbb/include/common_admin.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/include/common_admin.php Thu Jul 12 15:00:35 2007 -0400
@@ -43,19 +43,19 @@
<div class="box">
<div class="inbox">
<ul>
- <li<?php if ($page == 'index') echo ' class="isactive"'; ?>><a href="admin_index.php">Index</a></li>
-<?php if ($is_admin): ?> <li<?php if ($page == 'categories') echo ' class="isactive"'; ?>><a href="admin_categories.php">Categories</a></li>
-<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'forums') echo ' class="isactive"'; ?>><a href="admin_forums.php">Forums</a></li>
-<?php endif; ?> <li<?php if ($page == 'users') echo ' class="isactive"'; ?>><a href="admin_users.php">Users</a></li>
-<?php if ($is_admin): ?> <li<?php if ($page == 'groups') echo ' class="isactive"'; ?>><a href="admin_groups.php">User groups</a></li>
-<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'options') echo ' class="isactive"'; ?>><a href="admin_options.php">Options</a></li>
-<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'permissions') echo ' class="isactive"'; ?>><a href="admin_permissions.php">Permissions</a></li>
-<?php endif; ?> <li<?php if ($page == 'censoring') echo ' class="isactive"'; ?>><a href="admin_censoring.php">Censoring</a></li>
-<?php if ($is_admin): ?> <li<?php if ($page == 'ranks') echo ' class="isactive"'; ?>><a href="admin_ranks.php">Ranks</a></li>
-<?php endif; ?><?php if ($is_admin || $pun_config['p_mod_ban_users'] == '1'): ?> <li<?php if ($page == 'bans') echo ' class="isactive"'; ?>><a href="admin_bans.php">Bans</a></li>
-<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'prune') echo ' class="isactive"'; ?>><a href="admin_prune.php">Prune</a></li>
-<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'maintenance') echo ' class="isactive"'; ?>><a href="admin_maintenance.php">Maintenance</a></li>
-<?php endif; ?> <li<?php if ($page == 'reports') echo ' class="isactive"'; ?>><a href="admin_reports.php">Reports</a></li>
+ <li<?php if ($page == 'index') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Index'); ?>">Index</a></li>
+<?php if ($is_admin): ?> <li<?php if ($page == 'categories') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Categories'); ?>">Categories</a></li>
+<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'forums') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Forums'); ?>">Forums</a></li>
+<?php endif; ?> <li<?php if ($page == 'users') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Users'); ?>">Users</a></li>
+<?php if ($is_admin): ?> <li<?php if ($page == 'groups') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Groups'); ?>">User groups</a></li>
+<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'options') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Options'); ?>">Options</a></li>
+<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'permissions') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Permissions'); ?>">Permissions</a></li>
+<?php endif; ?> <li<?php if ($page == 'censoring') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Censoring'); ?>">Censoring</a></li>
+<?php if ($is_admin): ?> <li<?php if ($page == 'ranks') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Ranks'); ?>">Ranks</a></li>
+<?php endif; ?><?php if ($is_admin || $pun_config['p_mod_ban_users'] == '1'): ?> <li<?php if ($page == 'bans') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Bans'); ?>">Bans</a></li>
+<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'prune') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Prune'); ?>">Prune</a></li>
+<?php endif; ?><?php if ($is_admin): ?> <li<?php if ($page == 'maintenance') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Maintenance'); ?>">Maintenance</a></li>
+<?php endif; ?> <li<?php if ($page == 'reports') echo ' class="isactive"'; ?>><a href="<?php echo makeUrlNS('Special', 'Forum/Admin_Reports'); ?>">Reports</a></li>
</ul>
</div>
</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/punbb/include/enano_dbal.php Thu Jul 12 15:00:35 2007 -0400
@@ -0,0 +1,170 @@
+<?php
+/***********************************************************************
+
+ Copyright (C) 2002-2005 Dan Fuhry (dan@enanocms.org)
+
+ This file is part of the PunBB to Enano compatibility layer. No part
+ of this file is included with any official PunBB distribution.
+
+ 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
+
+************************************************************************/
+
+/**
+ * A compatibility layer to allow PunBB to use Enano's database abstraction layer.
+ * @package Punano
+ * @subpackage Database compatibility layer
+ * @copyright (C) 2007 Dan Fuhry
+ * @license GNU General Public License
+ */
+
+class PunBB_DBAL_Enano
+{
+
+ var $prefix;
+ var $link_id;
+ var $query_result;
+
+ var $saved_queries = array();
+ var $num_queries = 0;
+
+
+ function PunBB_DBAL_Enano($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
+ {
+ $this->prefix = table_prefix . 'pun_';
+ }
+
+ function start_transaction()
+ {
+ return;
+ }
+
+ function end_transaction()
+ {
+ return;
+ }
+
+ function query($sql, $unbuffered = false)
+ {
+ global $db;
+ if (defined('PUN_SHOW_QUERIES'))
+ $q_start = get_microtime();
+
+ if ($unbuffered)
+ $this->query_result = $db->sql_unbuffered_query($sql);
+ else
+ $this->query_result = $db->sql_query($sql);
+
+ if ($this->query_result)
+ {
+ if (defined('PUN_SHOW_QUERIES'))
+ $this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start));
+
+ ++$this->num_queries;
+
+ return $this->query_result;
+ }
+ else
+ {
+ if (defined('PUN_SHOW_QUERIES'))
+ $this->saved_queries[] = array($sql, 0);
+
+ return false;
+ }
+ }
+
+ function result($query_id = 0, $row = 0)
+ {
+ return ($query_id) ? @mysql_result($query_id, $row) : false;
+ }
+
+ function fetch_assoc($query_id = 0)
+ {
+ global $db;
+ return ($query_id) ? $db->fetchrow($query_id) : false;
+ }
+
+ function fetch_row($query_id = 0)
+ {
+ global $db;
+ return ($query_id) ? $db->fetchrow_num($query_id) : false;
+ }
+
+
+ function num_rows($query_id = 0)
+ {
+ global $db;
+ return ($query_id) ? @mysql_num_rows($query_id) : false;
+ }
+
+ function affected_rows()
+ {
+ global $db;
+ return ($db->_conn) ? @mysql_affected_rows($db->_conn) : false;
+ }
+
+ function insert_id()
+ {
+ global $db;
+ $ret = ($db->_conn) ? @mysql_insert_id($db->_conn) : false;
+ return $ret;
+ }
+
+ function get_num_queries()
+ {
+ return $this->num_queries;
+ }
+
+ function get_saved_queries()
+ {
+ return $this->saved_queries;
+ }
+
+ function free_result($query_id = false)
+ {
+ global $db;
+ return ($query_id) ? $db->free_result($query_id) : false;
+ }
+
+ function escape($str)
+ {
+ global $db;
+ if (is_array($str))
+ return '';
+ else if (function_exists('mysql_real_escape_string'))
+ return $db->escape($str);
+ else
+ return mysql_escape_string($str);
+ }
+
+
+ function error()
+ {
+ $result['error_sql'] = @current(@end($this->saved_queries));
+ $result['error_no'] = @mysql_errno($this->link_id);
+ $result['error_msg'] = @mysql_error($this->link_id);
+
+ return $result;
+ }
+
+
+ function close()
+ {
+ return false;
+ }
+
+}
+
--- a/punbb/include/functions.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/include/functions.php Thu Jul 12 15:00:35 2007 -0400
@@ -41,7 +41,7 @@
if($session->user_logged_in)
{
$result = $pun_db->query(
- 'SELECT eu.*, u.*, eu.real_name AS realname, eu.user_level AS g_id, g.*, o.logged, o.idle
+ 'SELECT eu.*, u.*, eu.real_name AS realname, g.*, eu.user_level AS g_id, o.logged, o.idle
FROM '.$pun_db->prefix.'users AS u
LEFT JOIN '.table_prefix.'users AS eu
ON eu.user_id=u.id
@@ -238,6 +238,7 @@
function generate_navlinks()
{
global $pun_config, $lang_common, $pun_user;
+ global $db, $session, $paths, $template, $plugins; // Common objects
// Index and Userlist should always be displayed
$links[] = '<li id="navindex"><a href="index.php">'.$lang_common['Index'].'</a>';
@@ -246,7 +247,7 @@
if ($pun_config['o_rules'] == '1')
$links[] = '<li id="navrules"><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>';
- if ($pun_user['is_guest'])
+ if ( !$session->user_logged_in )
{
if ($pun_user['g_search'] == '1')
$links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
@@ -258,7 +259,7 @@
}
else
{
- if ($pun_user['g_id'] < PUN_MOD)
+ if ($pun_user['g_id'] < USER_LEVEL_ADMIN)
{
if ($pun_user['g_search'] == '1')
$links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
@@ -642,8 +643,16 @@
function confirm_referrer($script)
{
global $pun_config, $lang_common;
+
+ $script = preg_replace('/\.php$/i', '', $script);
+
+ if ( isset($_SERVER['HTTP_REFERER']) )
+ $referrer = strtolower($_SERVER['HTTP_REFERER']);
- if (!preg_match('#^'.preg_quote(str_replace('www.', '', $pun_config['o_base_url']).'/'.$script, '#').'#i', str_replace('www.', '', (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''))))
+ $regex = '#^' . preg_quote(strtolower(str_replace('www.', '', $pun_config['o_base_url'])).'/'.$script, '#') . '#i';
+ $ref_check = str_replace('www.', '', (isset($referrer) ? $referrer : ''));
+
+ if ( !preg_match($regex, $ref_check) )
message($lang_common['Bad referrer']);
}
@@ -820,6 +829,12 @@
if ($destination_url == '')
$destination_url = 'index.php';
+
+ if ( preg_match('/^admin_([a-z0-9_]+?)\.php$/i', $destination_url, $match) )
+ {
+ $module = capitalize_first_letter($match[1]);
+ $destination_url = makeUrlNS('Special', 'Forum/Admin_' . $module);
+ }
// If the delay is 0 seconds, we might as well skip the redirect all together
if ($pun_config['o_redirect_delay'] == '0')
--- a/punbb/include/parser.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/include/parser.php Thu Jul 12 15:00:35 2007 -0400
@@ -363,7 +363,7 @@
$num_smilies = count($smiley_text);
for ($i = 0; $i < $num_smilies; ++$i)
- $text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);
+ $text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="' . scriptPath . '/punbb/img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);
return substr($text, 1, -1);
}
--- a/punbb/profile.php Thu Jul 12 01:04:01 2007 -0400
+++ b/punbb/profile.php Thu Jul 12 15:00:35 2007 -0400
@@ -686,7 +686,8 @@
$form['admin_note'] = trim($_POST['admin_note']);
// Are we allowed to change usernames?
- if ($pun_user['g_id'] == USER_LEVEL_ADMIN || ($pun_user['g_id'] == USER_LEVEL_MOD && $pun_config['p_mod_rename_users'] == '1'))
+ // In Enano, NO!
+ if ( false ) // ($pun_user['g_id'] == USER_LEVEL_ADMIN || ($pun_user['g_id'] == USER_LEVEL_MOD && $pun_config['p_mod_rename_users'] == '1'))
{
$form['username'] = trim($_POST['req_username']);
$old_username = trim($_POST['old_username']);
@@ -703,7 +704,7 @@
message($lang_prof_reg['Username BBCode']);
// Check that the username is not already registered
- $result = $pun_db->query('SELECT 1 FROM '.$pun_db->prefix.'users WHERE username=\''.$pun_db->escape($form['username']).'\' AND id!='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $pun_db->error());
+ $result = $pun_db->query('SELECT 1 FROM '.table_prefix.'users WHERE username=\''.$pun_db->escape($form['username']).'\' AND user_id!='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $pun_db->error());
if ($pun_db->num_rows($result))
message($lang_profile['Dupe username']);
@@ -1061,7 +1062,7 @@
{
if ($pun_user['g_id'] >= USER_LEVEL_MEMBER)
{
- if ($pun_user['g_id'] == USER_LEVEL_ADMIN || $pun_config['p_mod_rename_users'] == '1')
+ if ( false ) // NO RENAMING IN ENANO // ($pun_user['g_id'] == USER_LEVEL_ADMIN || $pun_config['p_mod_rename_users'] == '1')
$username_field = '<input type="hidden" name="old_username" value="'.pun_htmlspecialchars($user['username']).'" /><label><strong>'.$lang_common['Username'].'</strong><br /><input type="text" name="req_username" value="'.pun_htmlspecialchars($user['username']).'" size="25" maxlength="25" /><br /></label>'."\n";
else
$username_field = '<p>'.$lang_common['Username'].': '.pun_htmlspecialchars($user['username']).'</p>'."\n";
@@ -1092,7 +1093,7 @@
}
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
- $required_fields = array('req_username' => $lang_common['Username'], 'req_email' => $lang_common['E-mail']);
+ $GLOBALS['required_fields'] = array('req_username' => $lang_common['Username']);
require PUN_ROOT.'header.php';
generate_profile_menu('essentials');
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/punbb/schema.sql Thu Jul 12 15:00:35 2007 -0400
@@ -0,0 +1,281 @@
+-- Punano installation schema
+
+CREATE TABLE {{TABLE_PREFIX}}categories (
+ id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ cat_name VARCHAR(80) NOT NULL DEFAULT 'New Category',
+ disp_position INT(10) NOT NULL DEFAULT 0,
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}config (
+ conf_name VARCHAR(255) NOT NULL DEFAULT '',
+ conf_value TEXT,
+ PRIMARY KEY (conf_name)
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}forum_perms (
+ group_id INT(10) NOT NULL DEFAULT 0,
+ forum_id INT(10) NOT NULL DEFAULT 0,
+ read_forum TINYINT(1) NOT NULL DEFAULT 1,
+ post_replies TINYINT(1) NOT NULL DEFAULT 1,
+ post_topics TINYINT(1) NOT NULL DEFAULT 1,
+ PRIMARY KEY (group_id, forum_id)
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}forums (
+ id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ forum_name VARCHAR(80) NOT NULL DEFAULT 'New forum',
+ forum_desc TEXT,
+ redirect_url VARCHAR(100),
+ moderators TEXT,
+ num_topics MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+ num_posts MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+ last_post INT(10) UNSIGNED,
+ last_post_id INT(10) UNSIGNED,
+ last_poster VARCHAR(200),
+ sort_by TINYINT(1) NOT NULL DEFAULT 0,
+ disp_position INT(10) NOT NULL DEFAULT 0,
+ cat_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}groups (
+ g_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ g_title VARCHAR(50) NOT NULL DEFAULT '',
+ g_user_title VARCHAR(50),
+ g_read_board TINYINT(1) NOT NULL DEFAULT 1,
+ g_post_replies TINYINT(1) NOT NULL DEFAULT 1,
+ g_post_topics TINYINT(1) NOT NULL DEFAULT 1,
+ g_post_polls TINYINT(1) NOT NULL DEFAULT 1,
+ g_edit_posts TINYINT(1) NOT NULL DEFAULT 1,
+ g_delete_posts TINYINT(1) NOT NULL DEFAULT 1,
+ g_delete_topics TINYINT(1) NOT NULL DEFAULT 1,
+ g_set_title TINYINT(1) NOT NULL DEFAULT 1,
+ g_search TINYINT(1) NOT NULL DEFAULT 1,
+ g_search_users TINYINT(1) NOT NULL DEFAULT 1,
+ g_edit_subjects_interval SMALLINT(6) NOT NULL DEFAULT 300,
+ g_post_flood SMALLINT(6) NOT NULL DEFAULT 30,
+ g_search_flood SMALLINT(6) NOT NULL DEFAULT 30,
+ PRIMARY KEY (g_id)
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}online (
+ user_id INT(10) UNSIGNED NOT NULL DEFAULT 1,
+ ident VARCHAR(200) NOT NULL DEFAULT '',
+ logged INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ idle TINYINT(1) NOT NULL DEFAULT 0
+) TYPE=HEAP;
+
+CREATE TABLE {{TABLE_PREFIX}}posts (
+ id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ poster VARCHAR(200) NOT NULL DEFAULT '',
+ poster_id INT(10) UNSIGNED NOT NULL DEFAULT 1,
+ poster_ip VARCHAR(15),
+ poster_email VARCHAR(50),
+ message TEXT,
+ hide_smilies TINYINT(1) NOT NULL DEFAULT 0,
+ posted INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ edited INT(10) UNSIGNED,
+ edited_by VARCHAR(200),
+ topic_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}ranks (
+ id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ rank VARCHAR(50) NOT NULL DEFAULT '',
+ min_posts MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}reports (
+ id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ post_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ topic_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ reported_by INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ created INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ message TEXT,
+ zapped INT(10) UNSIGNED,
+ zapped_by INT(10) UNSIGNED,
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}search_cache (
+ id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ ident VARCHAR(200) NOT NULL DEFAULT '',
+ search_data TEXT,
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}search_matches (
+ post_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ word_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+ subject_match TINYINT(1) NOT NULL DEFAULT 0
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}search_words (
+ id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
+ word VARCHAR(20) BINARY NOT NULL DEFAULT '',
+ PRIMARY KEY (word),
+ KEY {{TABLE_PREFIX}}search_words_id_idx (id)
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}subscriptions (
+ user_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ topic_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ PRIMARY KEY (user_id, topic_id)
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}topics (
+ id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ poster VARCHAR(200) NOT NULL DEFAULT '',
+ subject VARCHAR(255) NOT NULL DEFAULT '',
+ posted INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ last_post INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ last_post_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ last_poster VARCHAR(200),
+ num_views MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+ num_replies MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+ closed TINYINT(1) NOT NULL DEFAULT 0,
+ sticky TINYINT(1) NOT NULL DEFAULT 0,
+ moved_to INT(10) UNSIGNED,
+ forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+
+CREATE TABLE {{TABLE_PREFIX}}users (
+ id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ group_id INT(10) UNSIGNED NOT NULL DEFAULT 4,
+ title VARCHAR(50),
+ realname VARCHAR(40),
+ url VARCHAR(100),
+ jabber VARCHAR(75),
+ icq VARCHAR(12),
+ msn VARCHAR(50),
+ aim VARCHAR(30),
+ yahoo VARCHAR(30),
+ location VARCHAR(30),
+ use_avatar TINYINT(1) NOT NULL DEFAULT 0,
+ signature TEXT,
+ disp_topics TINYINT(3) UNSIGNED,
+ disp_posts TINYINT(3) UNSIGNED,
+ email_setting TINYINT(1) NOT NULL DEFAULT 1,
+ save_pass TINYINT(1) NOT NULL DEFAULT 1,
+ notify_with_post TINYINT(1) NOT NULL DEFAULT 0,
+ show_smilies TINYINT(1) NOT NULL DEFAULT 1,
+ show_img TINYINT(1) NOT NULL DEFAULT 1,
+ show_img_sig TINYINT(1) NOT NULL DEFAULT 1,
+ show_avatars TINYINT(1) NOT NULL DEFAULT 1,
+ show_sig TINYINT(1) NOT NULL DEFAULT 1,
+ timezone FLOAT NOT NULL DEFAULT 0,
+ language VARCHAR(25) NOT NULL DEFAULT 'English',
+ style VARCHAR(25) NOT NULL DEFAULT 'Oxygen',
+ num_posts INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ last_post INT(10) UNSIGNED,
+ registered INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ registration_ip VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+ last_visit INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ admin_note VARCHAR(30),
+ activate_string VARCHAR(50),
+ activate_key VARCHAR(8),
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+
+ALTER TABLE {{TABLE_PREFIX}}online ADD UNIQUE INDEX {{TABLE_PREFIX}}online_user_id_ident_idx(user_id,ident);
+ALTER TABLE {{TABLE_PREFIX}}online ADD INDEX {{TABLE_PREFIX}}online_user_id_idx(user_id);
+ALTER TABLE {{TABLE_PREFIX}}posts ADD INDEX {{TABLE_PREFIX}}posts_topic_id_idx(topic_id);
+ALTER TABLE {{TABLE_PREFIX}}posts ADD INDEX {{TABLE_PREFIX}}posts_multi_idx(poster_id, topic_id);
+ALTER TABLE {{TABLE_PREFIX}}reports ADD INDEX {{TABLE_PREFIX}}reports_zapped_idx(zapped);
+ALTER TABLE {{TABLE_PREFIX}}search_matches ADD INDEX {{TABLE_PREFIX}}search_matches_word_id_idx(word_id);
+ALTER TABLE {{TABLE_PREFIX}}search_matches ADD INDEX {{TABLE_PREFIX}}search_matches_post_id_idx(post_id);
+ALTER TABLE {{TABLE_PREFIX}}topics ADD INDEX {{TABLE_PREFIX}}topics_forum_id_idx(forum_id);
+ALTER TABLE {{TABLE_PREFIX}}topics ADD INDEX {{TABLE_PREFIX}}topics_moved_to_idx(moved_to);
+ALTER TABLE {{TABLE_PREFIX}}users ADD INDEX {{TABLE_PREFIX}}users_registered_idx(registered);
+ALTER TABLE {{TABLE_PREFIX}}search_cache ADD INDEX {{TABLE_PREFIX}}search_cache_ident_idx(ident(8));
+
+INSERT INTO {{TABLE_PREFIX}}groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Administrators', 'Administrator', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0);
+INSERT INTO {{TABLE_PREFIX}}groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Moderators', 'Moderator', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0);
+INSERT INTO {{TABLE_PREFIX}}groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Guest', NULL, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0);
+INSERT INTO {{TABLE_PREFIX}}groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Members', NULL, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 300, 60, 30);
+
+INSERT INTO {{TABLE_PREFIX}}users (id, group_id) VALUES(1, 3);
+
+INSERT INTO {{TABLE_PREFIX}}config VALUES
+ ('o_cur_version', '{{PUN_VERSION}}'),
+ ('o_board_title', 'My PunBB forum'),
+ ('o_board_desc', 'Unfortunately no one can be told what PunBB is - you have to see it for yourself.'),
+ ('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', 'English'),
+ ('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', '0'),
+ ('o_quickjump', '1'),
+ ('o_gzip', '0'),
+ ('o_additional_navlinks', ''),
+ ('o_report_method', '0'),
+ ('o_regs_report', '0'),
+ ('o_mailing_list', '{{ENANO_ADMIN_EMAIL}}'),
+ ('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', ''),
+ ('o_admin_email', '{{ENANO_ADMIN_EMAIL}}'),
+ ('o_webmaster_email', '{{ENANO_ADMIN_EMAIL}}'),
+ ('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 />\\n<br />\\n--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');
+
+INSERT INTO {{TABLE_PREFIX}}categories (cat_name, disp_position) VALUES('Test category', 1);
+INSERT INTO {{TABLE_PREFIX}}forums (forum_name, forum_desc, num_topics, num_posts, last_post, last_post_id, last_poster, disp_position, cat_id) VALUES('Test forum', 'This is just a test forum', 1, 1, UNIX_TIMESTAMP(), 1, 'PunBB', 1, 1);
+INSERT INTO {{TABLE_PREFIX}}topics (poster, subject, posted, last_post, last_post_id, last_poster, forum_id) VALUES('PunBB', 'Test post', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 1, 'PunBB', 1);
+INSERT INTO {{TABLE_PREFIX}}posts (poster, poster_id, poster_ip, message, posted, topic_id) VALUES('PunBB', 2, '127.0.0.1', 'If you are looking at this (which I guess you are), the install of PunBB appears to have worked! Now log in and head over to the administration control panel to configure your forum.', UNIX_TIMESTAMP(), 1);
+INSERT INTO {{TABLE_PREFIX}}ranks (rank, min_posts) VALUES('New member', 0), ('Member', 10);
+