~ubuntu-branches/ubuntu/intrepid/mantis/intrepid-updates

« back to all changes in this revision

Viewing changes to bugnote_delete.php

  • Committer: Bazaar Package Importer
  • Author(s): Bruno Rodrigues
  • Date: 2003-08-29 14:36:42 UTC
  • Revision ID: james.westby@ubuntu.com-20030829143642-bfpdoawxw1bpis88
Tags: upstream-0.17.5
ImportĀ upstreamĀ versionĀ 0.17.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
        # Mantis - a php based bugtracking system
 
3
        # Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 
4
        # This program is distributed under the terms and conditions of the GPL
 
5
        # See the README and LICENSE files for details
 
6
?>
 
7
<?php
 
8
        # Remove the bugnote and bugnote text and redirect back to
 
9
        # the viewing page
 
10
?>
 
11
<?php include( "core_API.php" ) ?>
 
12
<?php login_cookie_check() ?>
 
13
<?php
 
14
        db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );
 
15
        project_access_check( $f_id );
 
16
        check_access( REPORTER );
 
17
        check_bugnote_exists( $f_id );
 
18
 
 
19
        # grab the bugnote text id
 
20
        $query = "SELECT bugnote_text_id
 
21
                        FROM $g_mantis_bugnote_table
 
22
                        WHERE id='$f_bugnote_id'";
 
23
        $result = db_query( $query );
 
24
        $t_bugnote_text_id = db_result( $result, 0, 0 );
 
25
 
 
26
        # Remove the bugnote
 
27
        $query = "DELETE
 
28
                        FROM $g_mantis_bugnote_table
 
29
                        WHERE id='$f_bugnote_id'";
 
30
        $result = db_query( $query );
 
31
 
 
32
        # Remove the bugnote text
 
33
        $query = "DELETE
 
34
                        FROM $g_mantis_bugnote_text_table
 
35
                        WHERE id='$t_bugnote_text_id'";
 
36
        $result = db_query( $query );
 
37
 
 
38
        # Determine which view page to redirect back to.
 
39
        $t_redirect_url = get_view_redirect_url( $f_id );
 
40
        if ( $result ) {
 
41
                print_header_redirect( $t_redirect_url );
 
42
        } else {
 
43
                print_mantis_error( ERROR_GENERIC );
 
44
        }
 
45
?>
 
 
b'\\ No newline at end of file'