Skip to content

Commit

Permalink
Remarked all usage of helper_ensure_post() and removed its implementa…
Browse files Browse the repository at this point in the history
…tion. The remarked ones will be used as markers until replaced by security tokens.

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@5366 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed Jun 14, 2008
1 parent 7b59a2e commit dad345f
Show file tree
Hide file tree
Showing 42 changed files with 47 additions and 57 deletions.
2 changes: 1 addition & 1 deletion account_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# (none)

#============ Permissions ============
helper_ensure_post();
# helper_ensure_post();

auth_ensure_user_authenticated();

Expand Down
2 changes: 1 addition & 1 deletion account_prefs_reset.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
$f_redirect_url = gpc_get_string( 'redirect_url', 'account_prefs_page.php' );

#============ Permissions ============
helper_ensure_post();
# helper_ensure_post();

auth_ensure_user_authenticated();

Expand Down
2 changes: 1 addition & 1 deletion account_prefs_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

require_once( $t_core_path.'user_pref_api.php' );

helper_ensure_post();
# helper_ensure_post();

auth_ensure_user_authenticated();

Expand Down
4 changes: 2 additions & 2 deletions account_prof_add.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
3<?php
# Mantis - a php based bugtracking system

# Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected]
Expand Down Expand Up @@ -29,7 +29,7 @@

require_once( $t_core_path.'profile_api.php' );

helper_ensure_post();
# helper_ensure_post();

auth_ensure_user_authenticated();

Expand Down
2 changes: 1 addition & 1 deletion account_prof_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

require_once( $t_core_path.'profile_api.php' );

helper_ensure_post();
# helper_ensure_post();

auth_ensure_user_authenticated();

Expand Down
2 changes: 1 addition & 1 deletion account_sponsor_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

require_once( $t_core_path.'email_api.php' );

helper_ensure_post();
# helper_ensure_post();

auth_ensure_user_authenticated();

Expand Down
2 changes: 1 addition & 1 deletion adm_config_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

require_once( 'core.php' );

helper_ensure_post();
# helper_ensure_post();

$f_user_id = gpc_get_int( 'user_id' );
$f_project_id = gpc_get_int( 'project_id' );
Expand Down
3 changes: 2 additions & 1 deletion adm_config_set.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
require_once( 'core.php' );

$t_core_path = config_get( 'core_path' );
helper_ensure_post();

# helper_ensure_post();

$f_user_id = gpc_get_int( 'user_id' );
$f_project_id = gpc_get_int( 'project_id' );
Expand Down
3 changes: 2 additions & 1 deletion bug_assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
$t_core_path = config_get( 'core_path' );

require_once( $t_core_path.'bug_api.php' );
helper_ensure_post();

# helper_ensure_post();

$f_bug_id = gpc_get_int( 'bug_id' );
$t_bug = bug_get( $f_bug_id );
Expand Down
2 changes: 1 addition & 1 deletion bug_assign_reporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

require_once( $t_core_path.'bug_api.php' );

helper_ensure_post();
# helper_ensure_post();

$f_bug_id = gpc_get_int( 'bug_id' );

Expand Down
2 changes: 1 addition & 1 deletion bug_file_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

require_once( $t_core_path.'file_api.php' );

helper_ensure_post();
# helper_ensure_post();

$f_bug_id = gpc_get_int( 'bug_id', -1 );
$f_file = gpc_get_file( 'file', -1 );
Expand Down
2 changes: 1 addition & 1 deletion bug_file_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

require_once( $t_core_path.'file_api.php' );

helper_ensure_post();
# helper_ensure_post();

$f_file_id = gpc_get_int( 'file_id' );

Expand Down
2 changes: 1 addition & 1 deletion bug_monitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

require_once( $t_core_path.'bug_api.php' );

helper_ensure_post();
# helper_ensure_post();

$f_bug_id = gpc_get_int( 'bug_id' );
$t_bug = bug_get( $f_bug_id, true );
Expand Down
2 changes: 1 addition & 1 deletion bug_relationship_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
$t_core_path = config_get( 'core_path' );
require_once( $t_core_path . 'relationship_api.php' );

helper_ensure_post();
# helper_ensure_post();

$f_rel_type = gpc_get_int( 'rel_type' );
$f_src_bug_id = gpc_get_int( 'src_bug_id' );
Expand Down
2 changes: 1 addition & 1 deletion bug_relationship_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
$t_core_path = config_get( 'core_path' );
require_once( $t_core_path . 'relationship_api.php' );

helper_ensure_post();
# helper_ensure_post();

$f_rel_id = gpc_get_int( 'rel_id' );
$f_bug_id = gpc_get_int( 'bug_id' );
Expand Down
2 changes: 1 addition & 1 deletion bug_reminder.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
require_once( $t_core_path.'email_api.php' );
require_once( $t_core_path.'bugnote_api.php' );

helper_ensure_post();
# helper_ensure_post();

$f_bug_id = gpc_get_int( 'bug_id' );
$f_to = gpc_get_int_array( 'to' );
Expand Down
4 changes: 2 additions & 2 deletions bug_report.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
3<?php
# Mantis - a php based bugtracking system

# Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected]
Expand Down Expand Up @@ -32,7 +32,7 @@
require_once( $t_core_path.'bug_api.php' );
require_once( $t_core_path.'custom_field_api.php' );

helper_ensure_post();
# helper_ensure_post();

access_ensure_project_level( config_get('report_bug_threshold' ) );

Expand Down
2 changes: 1 addition & 1 deletion bug_set_sponsorship.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

require_once( $t_core_path . 'sponsorship_api.php' );

helper_ensure_post();
# helper_ensure_post();

if ( config_get( 'enable_sponsorship' ) == OFF ) {
trigger_error( ERROR_SPONSORSHIP_NOT_ENABLED, ERROR );
Expand Down
2 changes: 1 addition & 1 deletion bugnote_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
require_once( $t_core_path.'bug_api.php' );
require_once( $t_core_path.'bugnote_api.php' );

helper_ensure_post();
# helper_ensure_post();

$f_bug_id = gpc_get_int( 'bug_id' );
$f_private = gpc_get_bool( 'private' );
Expand Down
2 changes: 1 addition & 1 deletion bugnote_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
require_once( $t_core_path.'bugnote_api.php' );
require_once( $t_core_path.'current_user_api.php' );

helper_ensure_post();
# helper_ensure_post();

$f_bugnote_id = gpc_get_int( 'bugnote_id' );

Expand Down
4 changes: 2 additions & 2 deletions bugnote_set_view_state.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
require_once( $t_core_path.'bug_api.php' );
require_once( $t_core_path.'bugnote_api.php' );

helper_ensure_post();
# helper_ensure_post();

$f_bugnote_id = gpc_get_int( 'bugnote_id' );
$f_private = gpc_get_bool( 'private' );

Expand Down
2 changes: 1 addition & 1 deletion bugnote_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
require_once( $t_core_path.'bugnote_api.php' );
require_once( $t_core_path.'current_user_api.php' );

helper_ensure_post();
# helper_ensure_post();

$f_bugnote_id = gpc_get_int( 'bugnote_id' );
$f_bugnote_text = gpc_get_string( 'bugnote_text', '' );
Expand Down
14 changes: 1 addition & 13 deletions core/helper_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,17 +504,5 @@ function helper_duration_to_minutes( $p_hhmm ) {
}

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'] ) && ( strtoupper( $_SERVER['REQUEST_METHOD'] ) != 'POST' ) ) {
trigger_error( ERROR_INVALID_REQUEST_METHOD, ERROR );
}

}

?>
?>
2 changes: 1 addition & 1 deletion lost_pwd.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

require_once( 'core.php' );

helper_ensure_post();
# helper_ensure_post();

# lost password feature disabled or reset password via email disabled -> stop here!
if( OFF == config_get( 'lost_password_feature' ) ||
Expand Down
2 changes: 1 addition & 1 deletion manage_columns_copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
require_once( $t_core_path . 'gpc_api.php' );
require_once( $t_core_path . 'helper_api.php' );

helper_ensure_post();
# helper_ensure_post();

auth_reauthenticate();

Expand Down
2 changes: 1 addition & 1 deletion manage_config_columns_reset.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

require_once( $t_core_path . 'config_api.php' );

helper_ensure_post();
# helper_ensure_post();

auth_ensure_user_authenticated();
auth_reauthenticate();
Expand Down
2 changes: 1 addition & 1 deletion manage_config_columns_set.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
require_once( $t_core_path . 'columns_api.php' );
require_once( $t_core_path . 'gpc_api.php' );

helper_ensure_post();
# helper_ensure_post();

# @@@ access_ensure_project_level( config_get( 'manage_project_threshold' ) );

Expand Down
2 changes: 1 addition & 1 deletion manage_config_work_threshold_set.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$t_core_path = config_get( 'core_path' );
require_once( $t_core_path.'email_api.php' );

helper_ensure_post();
# helper_ensure_post();

auth_reauthenticate();

Expand Down
2 changes: 1 addition & 1 deletion manage_config_workflow_set.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$t_core_path = config_get( 'core_path' );
require_once( $t_core_path.'email_api.php' );

helper_ensure_post();
# helper_ensure_post();

auth_reauthenticate();

Expand Down
2 changes: 1 addition & 1 deletion manage_plugin_install.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
define( 'PLUGINS_DISABLED', true );
require_once( 'core.php' );

helper_ensure_post();
# helper_ensure_post();

auth_reauthenticate();
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );
Expand Down
2 changes: 1 addition & 1 deletion manage_plugin_uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
define( 'PLUGINS_DISABLED', true );
require_once( 'core.php' );

helper_ensure_post();
# helper_ensure_post();

auth_reauthenticate();
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );
Expand Down
2 changes: 1 addition & 1 deletion manage_plugin_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
define( 'PLUGINS_DISABLED', true );
require_once( 'core.php' );

helper_ensure_post();
# helper_ensure_post();

auth_reauthenticate();
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );
Expand Down
2 changes: 1 addition & 1 deletion manage_plugin_upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
define( 'PLUGINS_DISABLED', true );
require_once( 'core.php' );

helper_ensure_post();
# helper_ensure_post();

auth_reauthenticate();
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );
Expand Down
2 changes: 1 addition & 1 deletion manage_user_proj_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

require_once( 'core.php' );

helper_ensure_post();
# helper_ensure_post();

auth_reauthenticate();

Expand Down
2 changes: 1 addition & 1 deletion manage_user_prune.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

require_once( 'core.php' );

helper_ensure_post();
# helper_ensure_post();

auth_reauthenticate();

Expand Down
2 changes: 1 addition & 1 deletion print_all_bug_options_reset.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
require_once( $t_core_path.'current_user_api.php' );
require( 'print_all_bug_options_inc.php' );

helper_ensure_post();
# helper_ensure_post();

auth_ensure_user_authenticated();

Expand Down
2 changes: 1 addition & 1 deletion print_all_bug_options_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
require_once( 'core.php' );
require( 'print_all_bug_options_inc.php' );

helper_ensure_post();
# helper_ensure_post();

auth_ensure_user_authenticated();

Expand Down
2 changes: 1 addition & 1 deletion proj_doc_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

require_once( $t_core_path.'file_api.php' );

helper_ensure_post();
# helper_ensure_post();

# Check if project documentation feature is enabled.
if ( OFF == config_get( 'enable_project_documentation' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion proj_doc_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

require_once( 'core.php' );

helper_ensure_post();
# helper_ensure_post();

# Check if project documentation feature is enabled.
if ( OFF == config_get( 'enable_project_documentation' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion proj_doc_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

require_once( $t_core_path.'file_api.php' );

helper_ensure_post();
# helper_ensure_post();

# Check if project documentation feature is enabled.
if ( OFF == config_get( 'enable_project_documentation' ) ||
Expand Down
2 changes: 1 addition & 1 deletion query_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
require_once( $t_core_path.'string_api.php' );
require_once( $t_core_path.'date_api.php' );

helper_ensure_post();
# helper_ensure_post();

auth_ensure_user_authenticated();
compress_enable();
Expand Down
Loading

0 comments on commit dad345f

Please sign in to comment.