From 557887b0d1648aa26217e4e414ce44dc1f07e8b2 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 13 May 2001 16:49:41 +0000 Subject: [PATCH] Various updates git-svn-id: file:///svn/phpbb/trunk@282 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/db/mysql_basic.sql | 12 ++++++++---- phpBB/db/mysql_schema.sql | 8 ++++---- phpBB/db/odbc.php | 2 -- phpBB/includes/sessions.php | 8 ++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/phpBB/db/mysql_basic.sql b/phpBB/db/mysql_basic.sql index 6daa5507f9..719642c88c 100644 --- a/phpBB/db/mysql_basic.sql +++ b/phpBB/db/mysql_basic.sql @@ -16,11 +16,15 @@ INSERT INTO phpbb_forums VALUES (1,1,'Test Forum 1','This is just a test forum, INSERT INTO phpbb_forum_mods VALUES (1,1,0); # -- Users -INSERT INTO phpbb_users VALUES (1,1,'admin',NOW(),'21232f297a57a5a743894a0e4a801fc3','','','','-8','d M Y H:i','0','','4','admin@yourdomain.com','','','','','','This is just a stupid sig',1,1,'','','',0,1,0,0,0,'','',0); +INSERT INTO phpbb_users VALUES (1,1,'admin',NOW(),'','','','','-8','d M Y H:i','0','','4','admin@yourdomain.com','','','','','','This is just a stupid sig',1,1,'','','',0,1,0,0,0,'','',0); INSERT INTO phpbb_users VALUES (-1,1,'Anonymous',NOW(),'','','Default','','-8','d M Y H:i',0,'',1,'','','','','','','',0,1,'','','',0,0,0,0,0,'','',0); # -- Themes -INSERT INTO phpbb_themes (themes_id, themes_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, th_color1, th_color2, th_color3, td_color1, td_color2, td_color3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, img1, img2, img3, img4) VALUES ( '1', 'PSO-Wheat', '', '', 'FFFFFF', '000000', '002266', '004411', '', '', '', '', '', '001100', 'E5CCA5', 'D4A294', 'EBE4D9', 'DAD1C4', '', 'verdana,serif', 'arial,helvetica', 'courier', '1', '2', '3', '000000', '', '', '', '', '', ''); -INSERT INTO phpbb_themes_name (themes_id, tr_color1_name, tr_color2_name, tr_color3_name, th_color1_name, th_color2_name, th_color3_name, td_color1_name, td_color2_name, td_color3_name, fontface1_name, fontface2_name, fontface3_name, fontsize1_name, fontsize2_name, fontsize3_name, fontcolor1_name, fontcolor2_name, fontcolor3_name, img1_name, img2_name, img3_name, img4_name) VALUES ( '1', '', '', '', 'Table Background', 'Title Header', 'Category Header', 'Table background', 'Row Color 1', 'Row Color 2', 'Serif', 'Sans-serif', 'Courier', 'Smallest', 'Typical', 'Largest', 'All text', '', '', '', '', '', ''); -INSERT INTO phpbb_themes (themes_id, themes_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, th_color1, th_color2, th_color3, td_color1, td_color2, td_color3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, img1, img2, img3, img4) VALUES ( '2', 'PSO-Ocean', '', '', 'DFF5FF', '000000', '011001', '2100cc', '', '', '', '', '', '000000', 'A7C1CB', '7897A8', '83D7CC', 'A0CCE0', '', 'verdana,serif', 'arial,helvetica', 'courier', '1', '2', '3', '', '', '', '', '', '', ''); +INSERT INTO phpbb_themes (themes_id, themes_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, th_color1, th_color2, th_color3, td_color1, td_color2, td_color3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, img1, img2, img3, img4) VALUES ( '1', 'Default-Default', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'CCCCCC', 'DDDDDD', '', '', '', '', '0', '0', '0', '', '', '', '', '', '', ''); +INSERT INTO phpbb_themes_name (themes_id, tr_color1_name, tr_color2_name, tr_color3_name, th_color1_name, th_color2_name, th_color3_name, td_color1_name, td_color2_name, td_color3_name, fontface1_name, fontface2_name, fontface3_name, fontsize1_name, fontsize2_name, fontsize3_name, fontcolor1_name, fontcolor2_name, fontcolor3_name, img1_name, img2_name, img3_name, img4_name) VALUES ( '1', '', '', '', '', '', '', '', 'Row Color 1', 'Row Color 2', '', '', '', '', '', '', '', '', '', '', '', '', ''); +INSERT INTO phpbb_themes (themes_id, themes_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, th_color1, th_color2, th_color3, td_color1, td_color2, td_color3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, img1, img2, img3, img4) VALUES ( '2', 'PSO-Wheat', '', '', 'FFFFFF', '000000', '002266', '004411', '', '', '', '', '', '001100', 'E5CCA5', 'D4A294', 'EBE4D9', 'DAD1C4', '', 'verdana,serif', 'arial,helvetica', 'courier', '1', '2', '3', '000000', '', '', '', '', '', ''); INSERT INTO phpbb_themes_name (themes_id, tr_color1_name, tr_color2_name, tr_color3_name, th_color1_name, th_color2_name, th_color3_name, td_color1_name, td_color2_name, td_color3_name, fontface1_name, fontface2_name, fontface3_name, fontsize1_name, fontsize2_name, fontsize3_name, fontcolor1_name, fontcolor2_name, fontcolor3_name, img1_name, img2_name, img3_name, img4_name) VALUES ( '2', '', '', '', 'Table Background', 'Title Header', 'Category Header', 'Table background', 'Row Color 1', 'Row Color 2', 'Serif', 'Sans-serif', 'Courier', 'Smallest', 'Typical', 'Largest', 'All text', '', '', '', '', '', ''); +INSERT INTO phpbb_themes (themes_id, themes_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, th_color1, th_color2, th_color3, td_color1, td_color2, td_color3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, img1, img2, img3, img4) VALUES ( '3', 'PSO-Ocean', '', '', 'DFF5FF', '000000', '011001', '2100cc', '', '', '', '', '', '000000', 'A7C1CB', '7897A8', '83D7CC', 'A0CCE0', '', 'verdana,serif', 'arial,helvetica', 'courier', '1', '2', '3', '', '', '', '', '', '', ''); +INSERT INTO phpbb_themes_name (themes_id, tr_color1_name, tr_color2_name, tr_color3_name, th_color1_name, th_color2_name, th_color3_name, td_color1_name, td_color2_name, td_color3_name, fontface1_name, fontface2_name, fontface3_name, fontsize1_name, fontsize2_name, fontsize3_name, fontcolor1_name, fontcolor2_name, fontcolor3_name, img1_name, img2_name, img3_name, img4_name) VALUES ( '3', '', '', '', 'Table Background', 'Title Header', 'Category Header', 'Table background', 'Row Color 1', 'Row Color 2', 'Serif', 'Sans-serif', 'Courier', 'Smallest', 'Typical', 'Largest', 'All text', '', '', '', '', '', ''); +INSERT INTO phpbb_themes (themes_id, themes_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, th_color1, th_color2, th_color3, td_color1, td_color2, td_color3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, img1, img2, img3, img4) VALUES ( '4', 'PSO-Oranges and Lemons', '', '', 'F6FABC', '000000', '854F37', '488655', '', '', '', '', '', '000000', 'EAC33C', 'E8E660', 'F5ED91', 'FFEB8B', '', 'verdana,serif', 'arial,helvetica', 'courier', '1', '2', '3', '000000', '000000', '000000', '', '', '', ''); +INSERT INTO phpbb_themes_name (themes_id, tr_color1_name, tr_color2_name, tr_color3_name, th_color1_name, th_color2_name, th_color3_name, td_color1_name, td_color2_name, td_color3_name, fontface1_name, fontface2_name, fontface3_name, fontsize1_name, fontsize2_name, fontsize3_name, fontcolor1_name, fontcolor2_name, fontcolor3_name, img1_name, img2_name, img3_name, img4_name) VALUES ( '4', '', '', '', 'Table Background', 'Title Header', 'Category Header', 'Table background', 'Row Color 1', 'Row Color 2', 'Serif', 'Sans-serif', 'Courier', 'Smallest', 'Typical', 'Largest', 'All text', '', '', '', '', '', ''); diff --git a/phpBB/db/mysql_schema.sql b/phpBB/db/mysql_schema.sql index 2431a37d88..011b241910 100644 --- a/phpBB/db/mysql_schema.sql +++ b/phpBB/db/mysql_schema.sql @@ -1,7 +1,7 @@ # # phpBB2 - MySQL schema # -# $id: Exp $ +# $id: mysql_schema.sql,v 1.5 2001/03/23 15:57:52 psotfx Exp $ # @@ -213,7 +213,7 @@ CREATE TABLE phpbb_ranks ( DROP TABLE IF EXISTS phpbb_session; CREATE TABLE phpbb_session ( - session_id int(11) DEFAULT '0' NOT NULL, + session_id char(32) DEFAULT '' NOT NULL, session_user_id int(11) DEFAULT '0' NOT NULL, session_start int(11) DEFAULT '0' NOT NULL, session_time int(11) DEFAULT '0' NOT NULL, @@ -221,8 +221,8 @@ CREATE TABLE phpbb_session ( session_page int(11) DEFAULT '0' NOT NULL, session_logged_in tinyint(1) DEFAULT '0' NOT NULL, PRIMARY KEY (session_id), - KEY session_user_id (session_user_id), - KEY session_ip (session_ip) + INDEX session_user_id (session_user_id), + INDEX session_id_ip_user_id (session_id, session_ip, session_user_id) ); diff --git a/phpBB/db/odbc.php b/phpBB/db/odbc.php index 43bce3d096..c39e4a5a54 100644 --- a/phpBB/db/odbc.php +++ b/phpBB/db/odbc.php @@ -22,8 +22,6 @@ if(!defined("SQL_LAYER")) { -dl('odbc.so'); - define("SQL_LAYER","odbc"); class sql_db diff --git a/phpBB/includes/sessions.php b/phpBB/includes/sessions.php index f1cb80518b..91d1f0fcea 100644 --- a/phpBB/includes/sessions.php +++ b/phpBB/includes/sessions.php @@ -85,8 +85,8 @@ function session_begin($user_id, $user_ip, $page_id, $session_length, $login = 0 if( ( $login || $autologin ) && $user_id != ANONYMOUS && $user_id != DELETED ) { $sql_delete_same_user = "DELETE FROM ".SESSIONS_TABLE." - WHERE session_user_id = $user_id - AND session_ip <> '$int_ip' + WHERE session_ip <> '$int_ip' + AND session_user_id = $user_id AND session_logged_in = 1"; $result = $db->sql_query($sql_delete_same_user); } @@ -421,8 +421,8 @@ function session_end($session_id, $user_id) $sql = "UPDATE ".SESSIONS_TABLE." SET session_logged_in = 0, session_user_id = -1, session_time = $current_time - WHERE (session_user_id = $user_id) - AND (session_id = '$session_id')"; + WHERE (session_id = '$session_id') + AND (session_user_id = $user_id)"; $result = $db->sql_query($sql, $db); if (!$result) {