Revision: 1041
http://mrbs.svn.sourceforge.net/mrbs/?rev=1041&view=rev
Author: jberanek
Date: 2009-03-02 14:30:23 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
* Changed most 'include' statements to be 'require_once' as this is
really what they are.
* Changed all but one page completions to use print_footer().
* Removed stale file, 'pgsql.before_php42.inc'. If you use Postgresql
you must have PHP 4.2 or higher.
* Added 'require_once "functions.inc"' into grab_globals.inc as
it uses a function (unslashes) from that file. This fixes a bug I
encountered during testing.
Modified Paths:
--------------
mrbs/trunk/checklang.php
mrbs/trunk/convert_db_to_utf8.php
mrbs/trunk/testdata.php
mrbs/trunk/web/add.php
mrbs/trunk/web/admin.php
mrbs/trunk/web/auth_ext.inc
mrbs/trunk/web/day.php
mrbs/trunk/web/dbsys.inc
mrbs/trunk/web/del.php
mrbs/trunk/web/del_entry.php
mrbs/trunk/web/edit_area_room.php
mrbs/trunk/web/edit_entry.php
mrbs/trunk/web/edit_entry_handler.php
mrbs/trunk/web/edit_users.php
mrbs/trunk/web/functions.inc
mrbs/trunk/web/grab_globals.inc.php
mrbs/trunk/web/help.php
mrbs/trunk/web/index.php
mrbs/trunk/web/month.php
mrbs/trunk/web/mrbs-print.css.php
mrbs/trunk/web/mrbs.css.php
mrbs/trunk/web/mrbs_auth.inc
mrbs/trunk/web/report.php
mrbs/trunk/web/search.php
mrbs/trunk/web/session_cookie.inc
mrbs/trunk/web/session_php.inc
mrbs/trunk/web/trailer.inc
mrbs/trunk/web/view_entry.php
mrbs/trunk/web/week.php
Removed Paths:
-------------
mrbs/trunk/pgsql.before_php42.inc
Modified: mrbs/trunk/checklang.php
===================================================================
--- mrbs/trunk/checklang.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/checklang.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -19,7 +19,7 @@
// the MRBS 'web' directory
$path_to_mrbs = ".";
-include "$path_to_mrbs/config.inc.php";
+require_once "$path_to_mrbs/config.inc.php";
// Checklang 2001-01-28 ljb - Check MRBS language files for completeness.
// This is a rather straightforward job. For each language file, report
Modified: mrbs/trunk/convert_db_to_utf8.php
===================================================================
--- mrbs/trunk/convert_db_to_utf8.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/convert_db_to_utf8.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -5,7 +5,7 @@
// This script converts text in the database from a particular encoding
// to UTF-8
-include "grab_globals.inc.php";
+require_once "grab_globals.inc.php";
?>
@@ -48,9 +48,9 @@
}
else
{
- include "config.inc.php";
- include "$dbsys.inc";
- include "functions.inc";
+ require_once "config.inc.php";
+ require_once "dbsys.inc";
+ require_once "functions.inc";
echo '
Starting update, this could take a while...<p>
Deleted: mrbs/trunk/pgsql.before_php42.inc
===================================================================
--- mrbs/trunk/pgsql.before_php42.inc 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/pgsql.before_php42.inc 2009-03-02 14:30:23 UTC (rev 1041)
@@ -1,239 +0,0 @@
-<?php
-// $Id$
-
-// pgsql.inc - Simple PHP database support for PostgreSQL.
-// Include this file after defining the following variables:
-// $db_host = The hostname of the database server
-// $db_login = The username to use when connecting to the database
-// $db_password = The database account password
-// $db_database = The database name.
-// Including this file connects you to the database, or exits on error.
-// This code hides an implementation difference in error reporting by the PHP
-// PostgreSQL and MySQL extensions. PostgreSQL reports an E_WARNING error
-// for some queries which MySQL does not; both properly set their own
-// error code and the PHP error raised by PostgreSQL is not needed.
-// The code here turns that off with error_reporting() calls around each
-// pg_exec call, so as not to make you change the display_errors
-// setting in your php.ini configuration file.
-
-
-// Free a results handle. You need not call this if you call sql_row or
-// sql_row_keyed until the row returns 0, since sql_row frees the results
-// handle when you finish reading the rows.
-function sql_free ($r)
-{
- pg_freeresult($r);
-}
-
-// Execute a non-SELECT SQL command (insert/update/delete).
-// Returns the number of tuples affected if OK (a number >= 0).
-// Returns -1 on error; use sql_error to get the error message.
-function sql_command ($sql)
-{
- global $db_c;
- $e = error_reporting(E_ALL & ~(E_WARNING|E_NOTICE));
- $r = pg_exec($db_c, $sql);
- error_reporting($e);
- if (! $r) return -1;
- $n = pg_cmdtuples($r);
- pg_freeresult($r);
- return $n;
-}
-
-// Execute an SQL query which should return a single non-negative number value.
-// This is a lightweight alternative to sql_query, good for use with count(*)
-// and similar queries. It returns -1 on error or if the query did not return
-// exactly one value, so error checking is somewhat limited.
-// It also returns -1 if the query returns a single NULL value, such as from
-// a MIN or MAX aggregate function applied over no rows.
-function sql_query1 ($sql)
-{
- global $db_c;
- $e = error_reporting(E_ALL & ~(E_WARNING|E_NOTICE));
- $r = pg_exec($db_c, $sql);
- error_reporting($e);
- if (! $r) return -1;
- if (pg_numrows($r) != 1 || pg_numfields($r) != 1
- || ($result = pg_result($r, 0, 0)) == "") $result = -1;
- pg_freeresult($r);
- return $result;
-}
-
-// Execute an SQL query. Returns a database-dependent result handle,
-// which should be passed back to sql_row or sql_row_keyed to get the results.
-// Returns 0 on error; use sql_error to get the error message.
-function sql_query ($sql)
-{
- global $db_c;
- $e = error_reporting(E_ALL & ~(E_WARNING|E_NOTICE));
- $r = pg_exec($db_c, $sql);
- error_reporting($e);
- return $r;
-}
-
-// Return a row from a result. The first row is 0.
-// The row is returned as an array with index 0=first column, etc.
-// When called with i >= number of rows in the result, cleans up from
-// the query and returns 0.
-// Typical usage: $i = 0; while ((a = sql_row($r, $i++))) { ... }
-function sql_row ($r, $i)
-{
- if ($i >= pg_numrows($r))
- {
- pg_freeresult($r);
- return 0;
- }
- return pg_fetch_row($r, $i);
-}
-
-// Return a row from a result as an associative array keyed by field name.
-// The first row is 0.
-// This is actually upward compatible with sql_row since the underlying
-// routing also stores the data under number indexes.
-// When called with i >= number of rows in the result, cleans up from
-// the query and returns 0.
-function sql_row_keyed ($r, $i)
-{
- if ($i >= pg_numrows($r))
- {
- pg_freeresult($r);
- return 0;
- }
- return pg_fetch_array($r, $i);
-}
-
-// Return the number of rows returned by a result handle from sql_query.
-function sql_count ($r)
-{
- return pg_numrows($r);
-}
-
-// Return the value of an autoincrement field from the last insert.
-// For PostgreSQL, this must be a SERIAL type field.
-function sql_insert_id($table, $field)
-{
- $seq_name = $table . "_" . $field . "_seq";
- return sql_query1("select last_value from $seq_name");
-}
-
-// Return the text of the last error message.
-function sql_error()
-{
- global $db_c;
- return pg_errormessage($db_c);
-}
-
-// Begin a transaction, if the database supports it. This is used to
-// improve PostgreSQL performance for multiple insert/delete/updates.
-// There is no rollback support, since MySQL doesn't support it.
-function sql_begin()
-{
- sql_command("BEGIN");
-}
-
-// Commit (end) a transaction. See sql_begin().
-function sql_commit()
-{
- sql_command("COMMIT");
-}
-
-// Acquire a mutual-exclusion lock on the named table. For portability:
-// This will not lock out SELECTs.
-// It may lock out DELETE/UPDATE/INSERT or not, depending on the
implementation.
-// It will lock out other callers of this routine with the same name argument.
-// It may timeout in 20 seconds and return 0, or may wait forever.
-// It returns 1 when the lock has been acquired.
-// Caller must release the lock with sql_mutex_unlock().
-// Caller must not have more than one mutex at any time.
-// Do not mix this with sql_begin()/sql_end() calls.
-//
-// In PostgreSQL, the EXCLUSIVE mode lock excludes all but SELECT.
-// It does not timeout, but waits forever for the lock.
-function sql_mutex_lock($name)
-{
- global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
- if (sql_command("BEGIN") < 0
- || sql_command("LOCK TABLE $name IN EXCLUSIVE MODE") < 0)
return 0;
- $sql_mutex_unlock_name = $name;
- if (empty($sql_mutex_shutdown_registered))
- {
- register_shutdown_function("sql_mutex_cleanup");
- $sql_mutex_shutdown_registered = 1;
- }
- return 1;
-}
-
-// Release a mutual-exclusion lock on the named table. See sql_mutex_lock.
-// In PostgreSQL, all locks are released by closing the transaction; there
-// is no other way.
-function sql_mutex_unlock($name)
-{
- global $sql_mutex_unlock_name;
- sql_command("COMMIT");
- $sql_mutex_unlock_name = "";
-}
-
-// Shutdown function to clean up a forgotten lock. For internal use only.
-function sql_mutex_cleanup()
-{
- global $sql_mutex_shutdown_registered, $sql_mutex_unlock_name;
- if (!empty($sql_mutex_unlock_name))
- {
- sql_command("ABORT");
- $sql_mutex_unlock_name = "";
- }
-}
-
-// Return a string identifying the database version:
-function sql_version()
-{
- $r = sql_query("select version()");
- $v = sql_row($r, 0);
- sql_free($r);
- return $v[0];
-}
-
-// Generate non-standard SQL for LIMIT clauses:
-function sql_syntax_limit($count, $offset)
-{
- return " LIMIT $count OFFSET $offset ";
-}
-
-// Generate non-standard SQL to output a TIMESTAMP as a Unix-time:
-function sql_syntax_timestamp_to_unix($fieldname)
-{
- return " DATE_PART('epoch', $fieldname) ";
-}
-
-// Generate non-standard SQL to match a string anywhere in a field's value
-// in a case insensitive manner. $s is the un-escaped/un-slashed string.
-// In PostgreSQL, we can do case insensitive regexp with ~*, but not case
-// insensitive LIKE matching.
-// Quotemeta escapes everything we need except for single quotes.
-function sql_syntax_caseless_contains($fieldname, $s)
-{
- $s = quotemeta($s);
- $s = str_replace("'", "''", $s);
- return " $fieldname ~* '$s' ";
-}
-
-// Establish a database connection.
-// On connection error, the message will be output without a proper HTML
-// header. There is no way I can see around this; if track_errors isn't on
-// there seems to be no way to supress the automatic error message output and
-// still be able to access the error text.
-$conninfo = (empty($db_host) ? "" : "host=$db_host ")
- . "dbname=$db_database user=$db_login password=$db_password";
-if (empty($db_nopersist))
- $db_c = pg_pconnect($conninfo);
-else
- $db_c = pg_connect($conninfo);
-unset($conninfo);
-
-if (!$db_c)
-{
- echo "\n<p>\n" . get_vocab("failed_connect_db") . "\n";
- exit;
-}
-
-?>
Modified: mrbs/trunk/testdata.php
===================================================================
--- mrbs/trunk/testdata.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/testdata.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -4,8 +4,8 @@
// This script initialises the database with some random data
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include "$dbsys.inc";
+require_once "config.inc.php";
+require_once "dbsys.inc";
// The sample data has an office in Tokyo. We have an array of Japanese
// Names and other names
Modified: mrbs/trunk/web/add.php
===================================================================
--- mrbs/trunk/web/add.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/add.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -3,10 +3,10 @@
// $Id$
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
// Get form variables
$day = get_form_var('day', 'int');
Modified: mrbs/trunk/web/admin.php
===================================================================
--- mrbs/trunk/web/admin.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/admin.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -3,10 +3,10 @@
// $Id$
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
// Get form variables
$day = get_form_var('day', 'int');
@@ -204,5 +204,5 @@
echo "\n</p>\n";
-include "trailer.inc"
+require_once "trailer.inc"
?>
Modified: mrbs/trunk/web/auth_ext.inc
===================================================================
--- mrbs/trunk/web/auth_ext.inc 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/auth_ext.inc 2009-03-02 14:30:23 UTC (rev 1041)
@@ -43,7 +43,7 @@
if (version_check("4.0.3") == false)
{
- include "escapeshellarg.inc";
+ require_once "escapeshellarg.inc";
}
/* authValidateUser($user, $pass)
Modified: mrbs/trunk/web/day.php
===================================================================
--- mrbs/trunk/web/day.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/day.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -2,11 +2,11 @@
// $Id$
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
-include "mincals.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
+require_once "mincals.inc";
// Get form variables
$day = get_form_var('day', 'int');
@@ -527,5 +527,5 @@
show_colour_key();
}
-include "trailer.inc";
+require_once "trailer.inc";
?>
Modified: mrbs/trunk/web/dbsys.inc
===================================================================
--- mrbs/trunk/web/dbsys.inc 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/dbsys.inc 2009-03-02 14:30:23 UTC (rev 1041)
@@ -20,7 +20,7 @@
// Include the abstraction configured to be used for the default MRBS
// database
-require_once("${dbsys}.inc");
+require_once "${dbsys}.inc";
// All the sql_* functions below apart from sql_connect() and
@@ -583,15 +583,15 @@
{
// Upgrade needed
- include_once "functions.inc";
- include_once "mrbs_auth.inc";
+ require_once "functions.inc";
+ require_once "mrbs_auth.inc";
print_header(0,0,0,0,"");
$user = getUserName();
if (isset($user) && (authGetUserLevel($user) >= 2))
{
- include "upgrade.inc";
+ require_once "upgrade.inc";
upgrade_database($current_db_schema_version, $db_schema_version);
print get_vocab("upgrade_completed").
Modified: mrbs/trunk/web/del.php
===================================================================
--- mrbs/trunk/web/del.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/del.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -2,10 +2,10 @@
// $Id$
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
// Get form variables
$day = get_form_var('day', 'int');
@@ -92,7 +92,7 @@
echo "<a href=\"admin.php\"><span id=\"del_no\">" . get_vocab("NO") .
"!</span></a>\n";
echo "</div>\n";
echo "</div>\n";
- include "trailer.inc";
+ require_once "trailer.inc";
}
}
@@ -117,7 +117,7 @@
echo get_vocab("delarea");
echo "<a href=\"admin.php\">" . get_vocab("backadmin") . "</a>";
echo "</p>\n";
- include "trailer.inc";
+ require_once "trailer.inc";
}
}
Modified: mrbs/trunk/web/del_entry.php
===================================================================
--- mrbs/trunk/web/del_entry.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/del_entry.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -2,11 +2,11 @@
// $Id$
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
-include "mrbs_sql.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
+require_once "mrbs_sql.inc";
// Get form variables
$day = get_form_var('day', 'int');
@@ -42,7 +42,7 @@
if (MAIL_ADMIN_ON_DELETE)
{
- include_once "functions_mail.inc";
+ require_once "functions_mail.inc";
// Gather all fields values for use in emails.
$mail_previous = getPreviousEntryData($id, $series);
}
Modified: mrbs/trunk/web/edit_area_room.php
===================================================================
--- mrbs/trunk/web/edit_area_room.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/edit_area_room.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -2,10 +2,10 @@
// $Id$
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
// Get form variables
$day = get_form_var('day', 'int');
@@ -57,7 +57,7 @@
<?php
if (!empty($room))
{
- include_once 'Mail/RFC822.php';
+ require_once 'Mail/RFC822.php';
(!isset($room_admin_email)) ? $room_admin_email = '': '';
$emails = explode(',', $room_admin_email);
$valid_email = TRUE;
@@ -147,7 +147,7 @@
<?php
if (!empty($area))
{
- include_once 'Mail/RFC822.php';
+ require_once 'Mail/RFC822.php';
(!isset($area_admin_email)) ? $area_admin_email = '': '';
$emails = explode(',', $area_admin_email);
$valid_email = TRUE;
@@ -217,4 +217,4 @@
<?php
}
?>
-<?php include "trailer.inc" ?>
+<?php require_once "trailer.inc" ?>
Modified: mrbs/trunk/web/edit_entry.php
===================================================================
--- mrbs/trunk/web/edit_entry.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/edit_entry.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -2,10 +2,10 @@
// $Id$
require_once('grab_globals.inc.php');
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
global $twentyfourhour_format;
@@ -800,4 +800,4 @@
</fieldset>
</form>
-<?php include "trailer.inc" ?>
+<?php require_once "trailer.inc" ?>
Modified: mrbs/trunk/web/edit_entry_handler.php
===================================================================
--- mrbs/trunk/web/edit_entry_handler.php 2009-03-02 01:29:12 UTC (rev
1040)
+++ mrbs/trunk/web/edit_entry_handler.php 2009-03-02 14:30:23 UTC (rev
1041)
@@ -2,11 +2,11 @@
// $Id$
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
-include "mrbs_sql.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
+require_once "mrbs_sql.inc";
// Get form variables
$day = get_form_var('day', 'int');
@@ -138,10 +138,9 @@
<p>
<?php echo get_vocab('must_set_description'); ?>
</p>
- </body>
-</html>
<?php
- exit;
+ // Print footer and exit
+ print_footer(TRUE);
}
if ($rep_type == 2 || $rep_type == 6)
@@ -158,15 +157,14 @@
if ($got_rep_day == 0)
{
print_header($day, $month, $year, $area, isset($room) ? $room : "");
- ?>
+?>
<h1><?php echo get_vocab('invalid_booking'); ?></h1>
<p>
<?php echo get_vocab('you_have_not_entered')."
".get_vocab("rep_rep_day"); ?>
</p>
- </body>
-</html>
<?php
- exit;
+ // Print footer and exit
+ print_footer(TRUE);
}
}
@@ -178,10 +176,9 @@
<p>
<?php echo get_vocab('you_have_not_entered')."
".get_vocab("useful_n-weekly_value"); ?>
</p>
- </body>
-</html>
<?php
- exit;
+ // Print footer and exit
+ print_footer(TRUE);
}
// Support locales where ',' is used as the decimal point
@@ -408,7 +405,7 @@
if (MAIL_ADMIN_ON_BOOKINGS or MAIL_AREA_ADMIN_ON_BOOKINGS or
MAIL_ROOM_ADMIN_ON_BOOKINGS or MAIL_BOOKER)
{
- include_once "functions_mail.inc";
+ require_once "functions_mail.inc";
// Send a mail only if this a new entry, or if this is an
// edited entry but we have to send mail on every change,
// and if mrbsCreateRepeatingEntrys is successful
@@ -465,7 +462,7 @@
if (MAIL_ADMIN_ON_BOOKINGS or MAIL_AREA_ADMIN_ON_BOOKINGS or
MAIL_ROOM_ADMIN_ON_BOOKINGS or MAIL_BOOKER)
{
- include_once "functions_mail.inc";
+ require_once "functions_mail.inc";
// Send a mail only if this a new entry, or if this is an
// edited entry but we have to send mail on every change,
// and if mrbsCreateRepeatingEntrys is successful
@@ -537,5 +534,5 @@
echo "<a href=\"" . htmlspecialchars($returl) . "\">" . get_vocab("returncal")
. "</a>\n";
echo "</p>\n";
-include "trailer.inc";
+require_once "trailer.inc";
?>
Modified: mrbs/trunk/web/edit_users.php
===================================================================
--- mrbs/trunk/web/edit_users.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/edit_users.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -39,10 +39,10 @@
// $Id$
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
// Get form variables
$day = get_form_var('day', 'int');
@@ -372,12 +372,12 @@
echo "</div>\n";
echo "</form>\n";
}
- ?>
+?>
</div>
- </body>
- </html>
- <?php
- exit();
+<?php
+
+ // Print footer and exit
+ print_footer(TRUE);
}
/*---------------------------------------------------------------------------*\
@@ -397,13 +397,14 @@
print " <p class=\"error\">" . get_vocab("passwords_not_eq") . "</p>\n";
print " <input type=\"submit\" value=\" " . get_vocab("ok") . " \">\n";
print " </fieldset>\n";
- print "</form>\n</body>\n</html>\n";
-
- exit();
+ print "</form>\n";
+
+ // Print footer and exit
+ print_footer(TRUE);
}
//
// Verify email adresses
- include_once 'Mail/RFC822.php';
+ require_once 'Mail/RFC822.php';
$email_var = get_form_var('Field_email', 'string');
if (!isset($email_var))
@@ -591,9 +592,10 @@
print " <p class=\"error\">" . sql_error() . "</p>\n";
print " <input type=\"submit\" value=\" " . get_vocab("ok") . " \">\n";
print " </fieldset>\n";
- print "</form>\n</body>\n</html>\n";
+ print "</form>\n";
- exit();
+ // Print footer and exit
+ print_footer(TRUE);
}
/* Success. Redirect to the user list, to remove the form args */
@@ -633,9 +635,10 @@
print " <p class=\"error\">" . sql_error() . "</p>\n";
print " <input type=\"submit\" value=\" " . get_vocab("ok") . " \">\n";
print " </fieldset>\n";
- print "</form>\n</body>\n</html>\n";
+ print "</form>\n";
- exit();
+ // Print footer and exit
+ print_footer(TRUE);
}
/* Success. Do not display a message. Simply fall through into the list
display. */
@@ -738,5 +741,6 @@
print "</table>\n";
} // ($initial_user_creation != 1)
-include "trailer.inc";
+require_once "trailer.inc";
+
?>
Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/functions.inc 2009-03-02 14:30:23 UTC (rev 1041)
@@ -72,7 +72,7 @@
<html>
<head>
<?php
- include "style.inc";
+ require_once "style.inc";
?>
<title><?php echo get_vocab("mrbs") ?></title>
<script type="text/javascript">
@@ -487,7 +487,7 @@
print_header(0, 0, 0, 0, "");
}
echo $message;
- include "trailer.inc";
+ require_once "trailer.inc";
exit;
}
Modified: mrbs/trunk/web/grab_globals.inc.php
===================================================================
--- mrbs/trunk/web/grab_globals.inc.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/grab_globals.inc.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -20,8 +20,13 @@
//
// $Id$
+
+//
function get_form_var($variable, $type = 'string')
{
+ // We use some functions from here
+ require_once "functions.inc";
+
if ($type == 'array')
{
$value = array();
@@ -96,6 +101,7 @@
return $value;
}
+
// -- PHP_SELF --
if (!empty($_SERVER) && isset($_SERVER['PHP_SELF']))
{
Modified: mrbs/trunk/web/help.php
===================================================================
--- mrbs/trunk/web/help.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/help.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -3,11 +3,11 @@
// $Id$
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
-include_once "functions.inc";
-include "version.inc";
+require_once "config.inc.php";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
+require_once "functions.inc";
+require_once "version.inc";
// Get form variables
$day = get_form_var('day', 'int');
@@ -52,7 +52,7 @@
. "</a> " . get_vocab("for_any_questions") . "\n";
echo "</p>\n";
-include "site_faq" . $faqfilelang . ".html";
+require_once "site_faq" . $faqfilelang . ".html";
-include "trailer.inc";
+require_once "trailer.inc";
?>
Modified: mrbs/trunk/web/index.php
===================================================================
--- mrbs/trunk/web/index.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/index.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -8,8 +8,8 @@
// be used to redirect to a particular room.
require_once "grab_globals.inc.php";
-include("config.inc.php");
-include("dbsys.inc");
+require_once "config.inc.php";
+require_once "dbsys.inc";
$day = date("d");
$month = date("m");
Modified: mrbs/trunk/web/month.php
===================================================================
--- mrbs/trunk/web/month.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/month.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -4,11 +4,11 @@
// mrbs/month.php - Month-at-a-time view
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
-include "mincals.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
+require_once "mincals.inc";
// Get form variables
$day = get_form_var('day', 'int');
@@ -199,7 +199,7 @@
if ($room <= 0)
{
echo "<h1>".get_vocab("no_rooms_for_area")."</h1>";
- include "trailer.inc";
+ require_once "trailer.inc";
exit;
}
@@ -614,5 +614,5 @@
print $before_after_links_html;
show_colour_key();
-include "trailer.inc";
+require_once "trailer.inc";
?>
Modified: mrbs/trunk/web/mrbs-print.css.php
===================================================================
--- mrbs/trunk/web/mrbs-print.css.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/mrbs-print.css.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -3,7 +3,7 @@
// $Id$
header("Content-type: text/css");
-include "config.inc.php";
+require_once "config.inc.php";
include "Themes/$theme.inc";
?>
Modified: mrbs/trunk/web/mrbs.css.php
===================================================================
--- mrbs/trunk/web/mrbs.css.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/mrbs.css.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -3,7 +3,7 @@
// $Id$
header("Content-type: text/css");
-include "config.inc.php";
+require_once "config.inc.php";
include "Themes/$theme.inc";
Modified: mrbs/trunk/web/mrbs_auth.inc
===================================================================
--- mrbs/trunk/web/mrbs_auth.inc 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/mrbs_auth.inc 2009-03-02 14:30:23 UTC (rev 1041)
@@ -2,12 +2,14 @@
// $Id$
// include the authentification wrappers
-include "auth_$auth[type].inc";
+require_once "auth_$auth[type].inc";
+
if (isset($auth['session']))
{
- include "session_$auth[session].inc";
+ require_once "session_$auth[session].inc";
}
+
/* getAuthorised($level)
*
* Check to see if the current user has a certain level of rights
@@ -81,8 +83,8 @@
<?php echo get_vocab("returnprev"); ?>
</a>
</p>
- </body>
-</html>
<?php
+ // Print footer and exit
+ print_footer(TRUE);
}
?>
Modified: mrbs/trunk/web/report.php
===================================================================
--- mrbs/trunk/web/report.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/report.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -2,10 +2,10 @@
// $Id$
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
function date_time_string($t)
@@ -687,6 +687,6 @@
}
}
-include "trailer.inc";
+require_once "trailer.inc";
?>
Modified: mrbs/trunk/web/search.php
===================================================================
--- mrbs/trunk/web/search.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/search.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -2,10 +2,10 @@
// $Id$
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
// Get form variables
$day = get_form_var('day', 'int');
@@ -62,14 +62,14 @@
</fieldset>
</form>
<?php
- include "trailer.inc";
+ require_once "trailer.inc";
exit;
}
if (!$search_str)
{
echo "<p class=\"error\">" . get_vocab("invalid_search") . "</p>";
- include "trailer.inc";
+ require_once "trailer.inc";
exit;
}
@@ -95,7 +95,7 @@
if ($total <= 0)
{
echo "<p id=\"nothing_found\">" . get_vocab("nothing_found") . "</p>\n";
- include "trailer.inc";
+ require_once "trailer.inc";
exit;
}
@@ -206,5 +206,5 @@
}
echo "</tbody>\n";
echo "</table>\n";
-include "trailer.inc";
+require_once "trailer.inc";
?>
Modified: mrbs/trunk/web/session_cookie.inc
===================================================================
--- mrbs/trunk/web/session_cookie.inc 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/session_cookie.inc 2009-03-02 14:30:23 UTC (rev 1041)
@@ -20,6 +20,9 @@
// $Id$
+// We use some functions from here
+require_once "functions.inc";
+
require_once('Blowfish.php');
$blowfish = new Crypt_Blowfish($auth['session_cookie']['secret']);
@@ -106,9 +109,9 @@
Anyway, if the browser cannot redirect automatically, the manual link
below will work. */
print_header(0, 0, 0, 0, "");
echo "<p>Please click <a
href=\"".htmlspecialchars($TargetURL)."\">here</a> if you're not redirected
automatically to the page you requested.</p>\n";
- echo "</body>\n";
- echo "</html>\n";
- exit();
+
+ // Print footer and exit
+ print_footer(TRUE);
}
/*
@@ -148,9 +151,9 @@
</div>
</fieldset>
</form>
-</body>
-</html>
<?php
+ // Print footer and exit
+ print_footer(TRUE);
}
/*
Modified: mrbs/trunk/web/session_php.inc
===================================================================
--- mrbs/trunk/web/session_php.inc 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/session_php.inc 2009-03-02 14:30:23 UTC (rev 1041)
@@ -100,9 +100,9 @@
print_header(0, 0, 0, 0, "");
echo "<br>\n";
echo "<p>Please click <a href=\"".htmlspecialchars($TargetURL)."\">here</a>
if you're not redirected automatically to the page you requested.</p>\n";
- echo "</body>\n";
- echo "</html>\n";
- exit();
+
+ // Print footer and exit
+ print_footer(TRUE);
}
/*
@@ -139,9 +139,9 @@
</div>
</fieldset>
</form>
-</body>
-</html>
<?php
+ // Print footer and exit
+ print_footer(TRUE);
}
/*
Modified: mrbs/trunk/web/trailer.inc
===================================================================
--- mrbs/trunk/web/trailer.inc 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/trailer.inc 2009-03-02 14:30:23 UTC (rev 1041)
@@ -1,4 +1,5 @@
<?php
+
// $Id$
@@ -202,7 +203,8 @@
echo "</div>\n"; // end of viewmonth
echo "</div>\n"; // end of "classic" trailer
}
+
+// Print footer
+print_footer(FALSE);
+
?>
-
-</body>
-</html>
Modified: mrbs/trunk/web/view_entry.php
===================================================================
--- mrbs/trunk/web/view_entry.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/view_entry.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -2,10 +2,10 @@
// $Id$
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
// Get form variables
$day = get_form_var('day', 'int');
@@ -387,5 +387,5 @@
</div>
<?php
-include "trailer.inc";
+require_once "trailer.inc";
?>
Modified: mrbs/trunk/web/week.php
===================================================================
--- mrbs/trunk/web/week.php 2009-03-02 01:29:12 UTC (rev 1040)
+++ mrbs/trunk/web/week.php 2009-03-02 14:30:23 UTC (rev 1041)
@@ -4,11 +4,11 @@
// mrbs/week.php - Week-at-a-time view
require_once "grab_globals.inc.php";
-include "config.inc.php";
-include_once "functions.inc";
-include "dbsys.inc";
-include_once "mrbs_auth.inc";
-include "mincals.inc";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "dbsys.inc";
+require_once "mrbs_auth.inc";
+require_once "mincals.inc";
// Get form variables
$debug_flag = get_form_var('debug_flag', 'int');
@@ -194,7 +194,7 @@
if ($room <= 0)
{
echo "<h1>".get_vocab("no_rooms_for_area")."</h1>";
- include "trailer.inc";
+ require_once "trailer.inc";
exit;
}
@@ -620,5 +620,5 @@
show_colour_key();
-include "trailer.inc";
+require_once "trailer.inc";
?>
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits