diff -r 8baccbad4a55 -r a932ce8c4827 punbb/admin/users.php
--- a/punbb/admin/users.php Sun Apr 06 00:35:38 2008 -0400
+++ b/punbb/admin/users.php Sun Jun 15 01:42:31 2008 -0400
@@ -748,8 +748,9 @@
$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
while (list($key, $input) = @each($form))
{
+ $e = ( $key == 'username' ) ? 'e' : '';
if ($input != '' && in_array($key, array('username', 'email', 'title', 'realname', 'url', 'jabber', 'icq', 'msn', 'aim', 'yahoo', 'location', 'signature', 'admin_note')))
- $conditions[] = 'u.'.$pun_db->escape($key).' '.$like_command.' \''.$pun_db->escape(str_replace('*', '%', $input)).'\'';
+ $conditions[] = $e . 'u.'.$pun_db->escape($key).' '.$like_command.' \''.$pun_db->escape(str_replace('*', '%', $input)).'\'';
}
if ($posts_greater != '')
@@ -769,16 +770,23 @@
// Find any users matching the conditions
$query = array(
- 'SELECT' => 'u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title',
- 'FROM' => 'users AS u',
+ 'SELECT' => 'u.id, eu.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title',
+ 'FROM' => $pun_db->prefix . 'users AS u',
'JOINS' => array(
array(
- 'LEFT JOIN' => 'groups AS g',
+ 'LEFT JOIN' => $pun_db->prefix . 'groups AS g',
'ON' => 'g.g_id=u.group_id'
- )
+ ),
+ array(
+ 'LEFT JOIN' => table_prefix . 'users AS eu',
+ 'ON' => 'eu.user_id = u.id'
+ )
),
'WHERE' => 'u.id>1 AND '.implode(' AND ', $conditions),
- 'ORDER BY' => $pun_db->escape($order_by).' '.$pun_db->escape($direction)
+ 'ORDER BY' => $pun_db->escape($order_by).' '.$pun_db->escape($direction),
+ 'PARAMS' => array(
+ 'NO_PREFIX' => ''
+ )
);
($hook = get_hook('aus_qr_find_users')) ? eval($hook) : null;
diff -r 8baccbad4a55 -r a932ce8c4827 punbb/footer.php
--- a/punbb/footer.php Sun Apr 06 00:35:38 2008 -0400
+++ b/punbb/footer.php Sun Jun 15 01:42:31 2008 -0400
@@ -215,7 +215,11 @@
$pun_db->close();
// Spit out the page
-global $template;
+global $template, $db;
$template->header();
echo($tpl_main);
$template->footer();
+
+$db->close();
+exit();
+
diff -r 8baccbad4a55 -r a932ce8c4827 punbb/header.php
--- a/punbb/header.php Sun Apr 06 00:35:38 2008 -0400
+++ b/punbb/header.php Sun Jun 15 01:42:31 2008 -0400
@@ -75,9 +75,9 @@
if (strpos(PUN_PAGE, 'profile') === 0)
echo '
'."\n";
-?>
-
-tpl_strings['PAGE_NAME'] = generate_crumbs(true);
// Should we output feed links?
if (PUN_PAGE == 'viewtopic')
@@ -132,8 +132,10 @@
($hook = get_hook('hd_head')) ? eval($hook) : null;
$tpl_temp = trim(ob_get_contents());
+
$template->add_header($tpl_temp);
ob_end_clean();
+
// END SUBST -
@@ -147,13 +149,13 @@
// END SUBST -
// START SUBST -
-$tpl_main = str_replace('', '
'."\n\t".'
'.htmlspecialchars($pun_config['o_board_title']).'
'."\n".'
'."\n", $tpl_main);
+$tpl_main = str_replace('', '', $tpl_main); // '
'."\n\t".'
'.htmlspecialchars($pun_config['o_board_title']).'
'."\n".'
'."\n", $tpl_main);
// END SUBST -
// START SUBST -
if ($pun_config['o_board_desc'] != '')
- $tpl_main = str_replace('', '
'."\n\t".'
'.htmlspecialchars($pun_config['o_board_desc']).'
'."\n".'
'."\n", $tpl_main);
+ $tpl_main = str_replace('', '', $tpl_main); // '
'."\n\t".'
'.htmlspecialchars($pun_config['o_board_desc']).'
'."\n".'
'."\n", $tpl_main);
// END SUBST -
diff -r 8baccbad4a55 -r a932ce8c4827 punbb/include/common_admin.php
--- a/punbb/include/common_admin.php Sun Apr 06 00:35:38 2008 -0400
+++ b/punbb/include/common_admin.php Sun Jun 15 01:42:31 2008 -0400
@@ -135,7 +135,7 @@
'FROM' => 'topics AS t',
'WHERE' => 't.forum_id='.$forum_id
);
-
+
if ($prune_date != -1)
$query['WHERE'] .= ' AND last_post<'.$prune_date;
if (!$prune_sticky)
diff -r 8baccbad4a55 -r a932ce8c4827 punbb/include/essentials.php
--- a/punbb/include/essentials.php Sun Apr 06 00:35:38 2008 -0400
+++ b/punbb/include/essentials.php Sun Jun 15 01:42:31 2008 -0400
@@ -24,7 +24,7 @@
// 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!
diff -r 8baccbad4a55 -r a932ce8c4827 punbb/include/functions.php
--- a/punbb/include/functions.php Sun Apr 06 00:35:38 2008 -0400
+++ b/punbb/include/functions.php Sun Jun 15 01:42:31 2008 -0400
@@ -90,7 +90,7 @@
// Check if there's a user matching $user and $password
$query = array(
- 'SELECT' => 'eu.username AS username_authoritative, u.*, u.username AS bla, g.*, o.logged, o.idle, o.csrf_token, o.prev_url',
+ 'SELECT' => 'u.*, eu.username, eu.user_id as id, g.*, o.logged, o.idle, o.csrf_token, o.prev_url',
'FROM' => $pun_db->prefix . 'users AS u',
'JOINS' => array(
array(
@@ -116,8 +116,13 @@
($hook = get_hook('fn_qr_get_user')) ? eval($hook) : null;
$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
+ $count = $pun_db->num_rows($result);
+ if ( $count < 1 )
+ {
+ set_default_user();
+ return false;
+ }
$pun_user = $pun_db->fetch_assoc($result);
- $pun_user['username'] =& $pun_user['username_authoritative'];
if (!$session->user_logged_in)
set_default_user();
@@ -517,6 +522,7 @@
function generate_navlinks()
{
global $pun_config, $lang_common, $pun_url, $pun_user;
+ global $db, $session, $paths, $template, $plugins; // Common objects
// Index should always be displayed
$links[] = '
'.$lang_common['Index'].'';
@@ -533,7 +539,7 @@
$links[] = '
'.$lang_common['Search'].'';
$links[] = '
'.$lang_common['Register'].'';
- $links[] = '
'.$lang_common['Login'].'';
+ $links[] = '
'.$lang_common['Login'].'';
}
else
{
@@ -1832,7 +1838,7 @@
function csrf_confirm_form()
{
global $pun_db, $pun_url, $lang_common, $pun_config, $base_url, $pun_start, $tpl_main, $pun_user, $pun_page, $pun_updates;
-
+
// User pressed the cancel button
if (isset($_POST['confirm_cancel']))
pun_redirect(htmlspecialchars($_POST['prev_url']), $lang_common['Cancel redirect']);
diff -r 8baccbad4a55 -r a932ce8c4827 punbb/install-mysql.sql
--- a/punbb/install-mysql.sql Sun Apr 06 00:35:38 2008 -0400
+++ b/punbb/install-mysql.sql Sun Jun 15 01:42:31 2008 -0400
@@ -303,8 +303,8 @@
INSERT INTO {{TABLE_PREFIX}}groups (g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, 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', 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0),
('Guest', NULL, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0),
- ('Members', NULL, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 300, 60, 30),
- ('Moderators', 'Moderator', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0);
+ ('Moderators', 'Moderator', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0),
+ ('Members', NULL, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 300, 60, 30);
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, {{NOW}}, 1, 'Enano', 1, 1);
INSERT INTO {{TABLE_PREFIX}}topics (poster, subject, posted, first_post_id, last_post, last_post_id, last_poster, forum_id) VALUES('Enano', 'Test post', {{NOW}}, 1, {{NOW}}, 1, 'Enano', 1);
diff -r 8baccbad4a55 -r a932ce8c4827 punbb/lang/English/admin.php
--- a/punbb/lang/English/admin.php Sun Apr 06 00:35:38 2008 -0400
+++ b/punbb/lang/English/admin.php Sun Jun 15 01:42:31 2008 -0400
@@ -154,6 +154,7 @@
'Extensions available' => 'Extensions available for install',
'Installed extensions' => 'Installed extensions',
'Installed extensions warn' => '
WARNING! If you uninstall an extension, any data associated with that extension will be permanently deleted from the database and cannot be restored by re-installing the extension. If you wish to retain the data then you should disable the extension instead.',
+'Installed extensions Enano compat warn' => '
WARNING! While the PunBB extension API is left mostly untouched in the Enano port, some core parts have been changed, the most prominent one being the transition from $db to $pun_db for the name of the database singleton. If you try to install an extension that hasn\'t been ported to the Enano bridge, you will likely experience problems.',
'Uninstall extension' => 'Uninstall extension',
'Uninstall' => 'Uninstall',
'Uninstall extension confirm' => 'Are you sure you want to uninstall the extension "%s"?',
diff -r 8baccbad4a55 -r a932ce8c4827 punbb/rewrite.php
--- a/punbb/rewrite.php Sun Apr 06 00:35:38 2008 -0400
+++ b/punbb/rewrite.php Sun Jun 15 01:42:31 2008 -0400
@@ -89,12 +89,12 @@
// If we don't know what to rewrite to, we show a bad request messsage
if (empty($rewritten_url))
{
- header('HTTP/1.x 404 Not Found');
+ header('HTTP/1.1 404 Not Found');
// Allow an extension to override the "Bad request" message with a custom 404 page
($hook = get_hook('re_page_not_found')) ? eval($hook) : null;
- exit('Bad request');
+ die_friendly('Page not found', '
You have requested a forum URL that is invalid. Please press your browser\'s Back button to return to the page from whence you came, or return to the forum index.
');
}
// We change $_SERVER['PHP_SELF'] so that it reflects the file we're actually loading