[phpBB] svn: r52 - in trunk/phpbb2: . patches

jeroen at wolffelaar.nl jeroen at wolffelaar.nl
Sun Feb 8 19:23:01 CET 2004


Author: jeroen
Date: 2004-02-08 19:22:39 +0100 (Sun, 08 Feb 2004)
New Revision: 52

Added:
   trunk/phpbb2/patches/
   trunk/phpbb2/patches/010_sane_defaults_with_autodetection.diff
Modified:
   trunk/phpbb2/README.Debian
   trunk/phpbb2/TODO
   trunk/phpbb2/control
   trunk/phpbb2/rules
Log:
Default install has now sane defaults, and phpbb enhanced with autodetection
for servername and board email and such. PHP version required now 4.1.0, as
even woody has 4.1.2, this should be no problem (and enables me to write
patches more easily).


Modified: trunk/phpbb2/README.Debian
===================================================================
--- trunk/phpbb2/README.Debian	2004-02-08 16:17:06 UTC (rev 51)
+++ trunk/phpbb2/README.Debian	2004-02-08 18:22:39 UTC (rev 52)
@@ -38,11 +38,14 @@
 
 Don't forget to reload the webserver config after installation of phpbb2!
 
-****** (re)gaining control of phpbb as administrator
+****** logging in for the first time
 
-Just look into the database for now and change your own account to become
-administrator and/or reset the password.
+If the database is setup properly, you can login with username 'admin' and
+password 'admin'. Change this immediately!
 
+Then, go to the administration panel to enable the board, and change
+preferences at will.
+
 ****** MOD's
 
 I'll include any useful mod found on phpbb's site, ensuring it's features can

Modified: trunk/phpbb2/TODO
===================================================================
--- trunk/phpbb2/TODO	2004-02-08 16:17:06 UTC (rev 51)
+++ trunk/phpbb2/TODO	2004-02-08 18:22:39 UTC (rev 52)
@@ -28,6 +28,8 @@
   translations themselves.
 - Debconf has half-baken support for backup... workaround someday/write a patch
 - Have #231186 fixed, and remove the workaround in this package
+- use dpatch or dbs or something like that, currently both are too
+  overengineered for my purposes (but that will change)
 
 Possible enhancements:
 - Have admin choose the database prefix - is this useful? Will only do it if

Modified: trunk/phpbb2/control
===================================================================
--- trunk/phpbb2/control	2004-02-08 16:17:06 UTC (rev 51)
+++ trunk/phpbb2/control	2004-02-08 18:22:39 UTC (rev 52)
@@ -7,7 +7,7 @@
 
 Package: phpbb2
 Architecture: all
-Depends: ${misc:Depends}, php4 (>= 4.0.6) | php4-cgi (>= 4.0.6), php4-mysql | php4-pgsql | php4-odbc, apache | httpd
+Depends: ${misc:Depends}, php4 (>= 4.1.0) | php4-cgi (>= 4.0.6), php4-mysql | php4-pgsql | php4-odbc, apache | httpd
 Recommends: phpbb2-conf-mysql
 Provides: phpbb
 Description: A fully featured and skinneable flat (non-threaded) webforum

Added: trunk/phpbb2/patches/010_sane_defaults_with_autodetection.diff
===================================================================
--- trunk/phpbb2/patches/010_sane_defaults_with_autodetection.diff	2004-02-08 16:17:06 UTC (rev 51)
+++ trunk/phpbb2/patches/010_sane_defaults_with_autodetection.diff	2004-02-08 18:22:39 UTC (rev 52)
@@ -0,0 +1,109 @@
+diff -ur phpBB2.orig/admin/admin_board.php phpBB2/admin/admin_board.php
+--- phpBB2.orig/admin/admin_board.php	2003-07-20 17:42:23.000000000 +0200
++++ phpBB2/admin/admin_board.php	2004-02-08 18:56:25.000000000 +0100
+@@ -42,7 +42,7 @@
+ 	while( $row = $db->sql_fetchrow($result) )
+ 	{
+ 		$config_name = $row['config_name'];
+-		$config_value = $row['config_value'];
++		$config_value = $board_config[$config_name];
+ 		$default_config[$config_name] = $config_value;
+ 		
+ 		$new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];
+diff -ur phpBB2.orig/common.php phpBB2/common.php
+--- phpBB2.orig/common.php	2003-07-20 17:42:24.000000000 +0200
++++ phpBB2/common.php	2004-02-08 18:46:02.000000000 +0100
+@@ -171,6 +171,30 @@
+ 	$board_config[$row['config_name']] = $row['config_value'];
+ }
+ 
++// some auto-detection added by Jeroen, autodetection is better than
++// known-false values
++if (!$board_config['server_name']) {
++	$board_config['server_name'] = $_SERVER['SERVER_ADDR'];
++	if (@$_SERVER['SERVER_NAME']) {
++		$board_config['server_name'] = $_SERVER['SERVER_NAME'];
++	}
++	if (@$_SERVER['HTTP_HOST']) {
++		$board_config['server_name'] = $_SERVER['HTTP_HOST'];
++	}
++}
++if (!$board_config['server_port']) {
++	$board_config['server_name'] = $_SERVER['SERVER_PORT'];
++}
++if (!$board_config['script_path']) {
++	$board_config['script_path'] = preg_replace('#(?:admin/)[a-zA-Z0-9.]\\.php$#', '', $_SERVER['PHP_SELF']);
++}
++if (!$board_config['board_email']) {
++	$board_config['board_email'] = "webmaster@$board_config[server_name]";
++	if (@$_SERVER['SERVER_ADMIN']) {
++		$board_config['board_email'] = $_SERVER['SERVER_ADMIN'];
++	}
++}
++
+ if (file_exists('install') || file_exists('contrib'))
+ {
+ 	message_die(GENERAL_MESSAGE, 'Please ensure both the install/ and contrib/ directories are deleted');
+@@ -184,4 +208,4 @@
+ 	message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
+ }
+ 
+-?>
+\ No newline at end of file
++?>
+diff -ur phpBB2.orig/install/schemas/mysql_basic.sql phpBB2/install/schemas/mysql_basic.sql
+--- phpBB2.orig/install/schemas/mysql_basic.sql	2003-07-20 17:27:29.000000000 +0200
++++ phpBB2/install/schemas/mysql_basic.sql	2004-02-08 18:08:02.000000000 +0100
+@@ -5,9 +5,10 @@
+ 
+ # -- Config
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('config_id','1');
+-INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable','0');
+-INSERT INTO phpbb_config (config_name, config_value) VALUES ('sitename','yourdomain.com');
+-INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_desc','A _little_ text to describe your forum');
++INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable','1');
++INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_startdate',UNIX_TIMESTAMP());
++INSERT INTO phpbb_config (config_name, config_value) VALUES ('sitename','Your new phpBB2 forum');
++INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_desc','Powered by Debian');
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name','phpbb2mysql');
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_path','/');
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain','');
+@@ -34,7 +35,7 @@
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sentbox_privmsgs','25');
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_savebox_privmsgs','50');
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_sig','Thanks, The Management');
+-INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email','youraddress at yourdomain.com');
++INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email','');
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_delivery','0');
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host','');
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_username','');
+@@ -59,9 +60,9 @@
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_mail', '');
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('record_online_users', '0');
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('record_online_date', '0');
+-INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', 'www.myserver.tld');
+-INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', '80');
+-INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '/phpBB2/');
++INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', '');
++INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', '');
++INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '');
+ INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.0.6');
+ 
+ 
+@@ -74,7 +75,15 @@
+ 
+ 
+ # -- Users
+-INSERT INTO phpbb_users (user_id, username, user_level, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_viewemail, user_style, user_aim, user_yim, user_msnm, user_posts, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_pm, user_notify_pm, user_allow_viewonline, user_rank, user_avatar, user_lang, user_timezone, user_dateformat, user_actkey, user_newpasswd, user_notify, user_active) VALUES ( -1, 'Anonymous', 0, 0, '', '', '', '', '', '', '', '', 0, NULL, '', '', '', 0, 0, 1, 0, 1, 0, 1, 1, NULL, '', '', 0, '', '', '', 0, 0);
++INSERT INTO phpbb_users (user_id, username, user_level, user_regdate,
++user_password, user_email, user_icq, user_website, user_occ, user_from,
++user_interests, user_sig, user_viewemail, user_style, user_aim, user_yim,
++user_msnm, user_posts, user_attachsig, user_allowsmile, user_allowhtml,
++user_allowbbcode, user_allow_pm, user_notify_pm, user_allow_viewonline,
++user_rank, user_avatar, user_lang, user_timezone, user_dateformat,
++user_actkey, user_newpasswd, user_notify, user_active) VALUES ( -1,
++'Anonymous', 0, UNIX_TIMESTAMP(), '', '', '', '', '', '', '', '', 0, NULL, '',
++'', '', 0, 0, 1, 0, 1, 0, 1, 1, NULL, '', '', 0, '', '', '', 0, 0);
+ 
+ # -- username: admin    password: admin (change this or remove it once everything is working!)
+ INSERT INTO phpbb_users (user_id, username, user_level, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_viewemail, user_style, user_aim, user_yim, user_msnm, user_posts, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_pm, user_notify_pm, user_popup_pm, user_allow_viewonline, user_rank, user_avatar, user_lang, user_timezone, user_dateformat, user_actkey, user_newpasswd, user_notify, user_active) VALUES ( 2, 'Admin', 1, 0, '21232f297a57a5a743894a0e4a801fc3', 'admin at yourdomain.com', '', '', '', '', '', '', 1, 1, '', '', '', 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, '', 'english', 0, 'd M Y h:i a', '', '', 0, 1);

Modified: trunk/phpbb2/rules
===================================================================
--- trunk/phpbb2/rules	2004-02-08 16:17:06 UTC (rev 51)
+++ trunk/phpbb2/rules	2004-02-08 18:22:39 UTC (rev 52)
@@ -19,7 +19,7 @@
 	debian/get-orig-source $(UPSTREAM_VERSION)
 
 # Extract sources from the tarball and apply all upstream patches (aka mods)
-source: source-upstream-stamp source-patches-stamp
+source: source-upstream-stamp source-patch-stamp
 
 source-upstream-stamp:
 	dh_testdir
@@ -31,13 +31,16 @@
 	find debian/build/phpBB2 -type f -exec chmod a-x '{}' \;
 	@touch $@
 
-source-patches-stamp:
-	@touch $@
+source-patch-stamp:
+	for patch in debian/patches/*.diff; do \
+		patch -f -d debian/build -p0 < $$patch ; \
+	done
+	touch $@
 
-
 build: source
 
 clean:
+	@# No need to unpatch, as patched dir is cleaned anyway
 	dh_testdir
 
 	rm -f *-stamp *-stamp.log





More information about the phpBB-l mailing list