Index: print_all_bug_options_update.php
===================================================================
--- print_all_bug_options_update.php (revision 5116)
+++ print_all_bug_options_update.php (working copy)
@@ -20,15 +20,16 @@
# --------------------------------------------------------
# $Id$
# --------------------------------------------------------
-?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- stop here!
if( OFF == config_get( 'lost_password_feature' ) ||
OFF == config_get( 'send_reset_password' ) ||
Index: manage_plugin_uninstall.php
===================================================================
--- manage_plugin_uninstall.php (revision 5116)
+++ manage_plugin_uninstall.php (working copy)
@@ -24,6 +24,8 @@
define( 'PLUGINS_DISABLED', true );
require_once( 'core.php' );
+helper_ensure_post();
+
auth_reauthenticate();
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );
Index: manage_proj_custom_field_add_existing.php
===================================================================
--- manage_proj_custom_field_add_existing.php (revision 5116)
+++ manage_proj_custom_field_add_existing.php (working copy)
@@ -27,6 +27,8 @@
require_once( $t_core_path.'custom_field_api.php' );
+ helper_ensure_post();
+
auth_reauthenticate();
$f_field_id = gpc_get_int( 'field_id' );
Index: bug_assign_reporter.php
===================================================================
--- bug_assign_reporter.php (revision 5116)
+++ bug_assign_reporter.php (working copy)
@@ -2,7 +2,7 @@
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
-# Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net
+# Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
# Mantis is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,18 +20,17 @@
# --------------------------------------------------------
# $Id$
# --------------------------------------------------------
-?>
-
-
-
-
-
-
-
-
-
-.
+/**
+* check if database support exists
+*
+* @param string database type
+* @return bool
+*/
function check_database_support($p_db_type) {
$t_support = false;
switch ($p_db_type) {
@@ -44,6 +50,12 @@
return $t_support;
}
+ /**
+ * check if php meets minimum version
+ *
+ * @param string version information
+ * @return bool
+ */
function check_php_version( $p_version ) {
if ($p_version == PHP_MIN_VERSION) {
return true;
@@ -58,4 +70,58 @@
return false;
}
}
- }
\ No newline at end of file
+ }
+
+ /**
+ * print result in the proper colour
+ *
+ * @param bool pass/fail input
+ * @param bool true if failure is fatal
+ * @param string text message added to failures
+ * @return bool
+ */
+ function print_test_result( $p_result, $p_hard_fail=true, $p_message='' ) {
+ global $g_failed;
+ echo '
BAD';
+ } else {
+ echo 'bgcolor="pink">POSSIBLE PROBLEM';
+ }
+ if ( '' != $p_message ) {
+ echo ' ' . $p_message;
+ }
+ }
+
+ if ( GOOD == $p_result ) {
+ echo 'bgcolor="green">GOOD';
+ }
+ echo ' | ';
+ }
+
+ /**
+ * print test row
+ *
+ * @param string test title text
+ * @param bool pass/fail input
+ * @param bool true if failure is fatal
+ * @param string text message added to failures
+ * @return bool
+ */
+ function print_test( $p_test_description, $p_result, $p_hard_fail=true, $p_message='' ) {
+
+ echo "\n| $p_test_description | ";
+ print_test_result( $p_result, $p_hard_fail, $p_message );
+ echo "
\n";
+ }
+
+ # --------
+ # create an SQLArray to insert data
+ function InsertData( $p_table, $p_data ) {
+ $query = "INSERT INTO " . $p_table . $p_data;
+ return Array( $query );
+ }
+
+
Index: admin/install.php
===================================================================
--- admin/install.php (revision 5116)
+++ admin/install.php (working copy)
@@ -37,45 +37,6 @@
$g_failed = false;
$g_database_upgrade = false;
- # -------
- # print test result
- function print_test_result( $p_result, $p_hard_fail=true, $p_message='' ) {
- global $g_failed;
- echo 'BAD';
- } else {
- echo 'bgcolor="pink">POSSIBLE PROBLEM';
- }
- if ( '' != $p_message ) {
- echo ' ' . $p_message;
- }
- }
-
- if ( GOOD == $p_result ) {
- echo 'bgcolor="green">GOOD';
- }
- echo ' | ';
- }
-
- # -------
- # print test header and result
- function print_test( $p_test_description, $p_result, $p_hard_fail=true, $p_message='' ) {
-
- echo "\n| $p_test_description | ";
- print_test_result( $p_result, $p_hard_fail, $p_message );
- echo "
\n";
- }
-
- # --------
- # create an SQLArray to insert data
- function InsertData( $p_table, $p_data ) {
- $query = "INSERT INTO " . $p_table . $p_data;
- return Array( $query );
- }
-
# install_state
# 0 = no checks done
# 1 = server ok, get database information
Index: signup.php
===================================================================
--- signup.php (revision 5116)
+++ signup.php (working copy)
@@ -28,6 +28,8 @@
require_once( $t_core_path.'email_api.php' );
require_once( $t_core_path . 'disposable' . DIRECTORY_SEPARATOR . 'disposable.php' );
+ helper_ensure_post();
+
$f_username = strip_tags( gpc_get_string( 'username' ) );
$f_email = strip_tags( gpc_get_string( 'email' ) );
$f_captcha = gpc_get_string( 'captcha', '' );
Index: bug_actiongroup_ext.php
===================================================================
--- bug_actiongroup_ext.php (revision 5116)
+++ bug_actiongroup_ext.php (working copy)
@@ -2,7 +2,7 @@
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
-# Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net
+# Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
# Mantis is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,6 +28,8 @@
require_once( $t_core_path . 'bug_api.php' );
require_once( $t_core_path . 'bug_group_action_api.php' );
+ helper_ensure_post();
+
auth_ensure_user_authenticated();
helper_begin_long_process();
Index: bug_monitor.php
===================================================================
--- bug_monitor.php (revision 5116)
+++ bug_monitor.php (working copy)
@@ -2,7 +2,7 @@
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
-# Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net
+# Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
# Mantis is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,18 +20,17 @@
# --------------------------------------------------------
# $Id$
# --------------------------------------------------------
-?>
-
-
-
-
-
-
-
-
-
-
-
-
-IsConnected();
}
+ $g_db->LogSQL();
if ( $t_result ) {
# For MySQL, the charset for the connection needs to be specified.
Index: core/helper_api.php
===================================================================
--- core/helper_api.php (revision 5116)
+++ core/helper_api.php (working copy)
@@ -502,4 +502,16 @@
return (int)$t_min;
}
+
+ #
+ #-------------------------------------------------
+ # check access method is POST, return if true, else call error handler
+ function helper_ensure_post()
+ {
+ if ( isset( $_SERVER['REQUEST_METHOD'] ) && ( $_SERVER['REQUEST_METHOD'] != 'POST' ) ) {
+ trigger_error( ERROR_INVALID_REQUEST_METHOD, ERROR );
+ }
+
+ }
+
?>
Index: core/relationship_graph_api.php
===================================================================
--- core/relationship_graph_api.php (revision 5116)
+++ core/relationship_graph_api.php (working copy)
@@ -250,7 +250,8 @@
} else {
$t_graph_orientation = 'vertical';
}
-
+ $t_graph_attributes['fontpath'] = $t_graph_fontpath;
+
$t_graph = new Digraph( $t_id_string, $t_graph_attributes, $t_dot_tool );
$t_graph->set_default_node_attr( array (
Index: core/constant_inc.php
===================================================================
--- core/constant_inc.php (revision 5116)
+++ core/constant_inc.php (working copy)
@@ -194,6 +194,7 @@
define( 'ERROR_FTP_CONNECT_ERROR', 16 );
define( 'ERROR_HANDLER_ACCESS_TOO_LOW', 17 );
define( 'ERROR_PAGE_REDIRECTION', 18 );
+ define( 'ERROR_INVALID_REQUEST_METHOD', 19 );
# ERROR_CONFIG_*
define( 'ERROR_CONFIG_OPT_NOT_FOUND', 100 );
Index: manage_config_revert.php
===================================================================
--- manage_config_revert.php (revision 5116)
+++ manage_config_revert.php (working copy)
@@ -25,6 +25,8 @@
$t_core_path = config_get( 'core_path' );
+ helper_ensure_post();
+
auth_reauthenticate();
$f_project_id = gpc_get_int( 'project', 0 );
Index: bug_report.php
===================================================================
--- bug_report.php (revision 5116)
+++ bug_report.php (working copy)
@@ -2,7 +2,7 @@
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
-# Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net
+# Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
# Mantis is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -32,6 +32,8 @@
require_once( $t_core_path.'bug_api.php' );
require_once( $t_core_path.'custom_field_api.php' );
+ helper_ensure_post();
+
access_ensure_project_level( config_get('report_bug_threshold' ) );
$t_bug_data = new BugData;
Index: bug_update.php
===================================================================
--- bug_update.php (revision 5116)
+++ bug_update.php (working copy)
@@ -20,11 +20,9 @@
# --------------------------------------------------------
# $Id$
# --------------------------------------------------------
-?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-