/
manage_proj_update.php
48 lines (43 loc) · 1.35 KB
/
manage_proj_update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2002 Mantis Team - mantisbt-dev@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
?>
<?php include( 'core_API.php' ) ?>
<?php login_cookie_check() ?>
<?php
check_access( MANAGER );
if ( !isset( $f_enabled ) ) {
$c_enabled = 0;
} else {
$c_enabled = 1;
}
# Make sure file path has trailing slash
if ( $f_file_path && $f_file_path[strlen($f_file_path)-1] != '/' ) {
$f_file_path = $f_file_path.'/';
}
$c_name = string_prepare_textarea( $f_name );
$c_description = string_prepare_textarea( $f_description );
$c_status = (integer)$f_status;
$c_view_state = (integer)$f_view_state;
$c_project_id = (integer)$f_project_id;
$c_file_path = addslashes($f_file_path);
# Update entry
$query = "UPDATE $g_mantis_project_table
SET name='$c_name',
status='$c_status',
enabled='$c_enabled',
view_state='$c_view_state',
file_path='$c_file_path',
description='$c_description'
WHERE id='$c_project_id'";
$result = db_query( $query );
$t_redirect_url = 'manage_proj_menu_page.php';
if ( $result ) {
print_header_redirect( $t_redirect_url );
} else {
print_mantis_error( ERROR_GENERIC );
}
?>