.
/**
* @package MantisBT
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
* @copyright Copyright (C) 2002 - 2014 MantisBT Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
*/
/**
* MantisBT Core API's
*/
require_once( 'core.php' );
form_security_validate( 'proj_doc_delete' );
# Check if project documentation feature is enabled.
if ( OFF == config_get( 'enable_project_documentation' ) ) {
access_denied();
}
$f_file_id = gpc_get_int( 'file_id' );
$t_project_id = file_get_field( $f_file_id, 'project_id', 'project' );
access_ensure_project_level( config_get( 'upload_project_file_threshold' ), $t_project_id );
$t_project_file_table = db_get_table( 'mantis_project_file_table' );
$query = "SELECT title FROM $t_project_file_table
WHERE id=" . db_param();
$result = db_query_bound( $query, Array( $f_file_id ) );
$t_title = db_result( $result );
# Confirm with the user
helper_ensure_confirmed( lang_get( 'confirm_file_delete_msg' ) .
'
' . lang_get( 'filename' ) . ': ' . string_display( $t_title ),
lang_get( 'file_delete_button' ) );
file_delete( $f_file_id, 'project' );
form_security_purge( 'proj_doc_delete' );
$t_redirect_url = 'proj_doc_page.php';
html_page_top( null, $t_redirect_url );
?>