[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> print_all_bug_options_update.php (source)

   1  <?php
   2  # Mantis - a php based bugtracking system
   3  
   4  # Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
   5  # Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
   6  
   7  # Mantis is free software: you can redistribute it and/or modify
   8  # it under the terms of the GNU General Public License as published by
   9  # the Free Software Foundation, either version 2 of the License, or
  10  # (at your option) any later version.
  11  #
  12  # Mantis is distributed in the hope that it will be useful,
  13  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15  # GNU General Public License for more details.
  16  #
  17  # You should have received a copy of the GNU General Public License
  18  # along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
  19  
  20      # --------------------------------------------------------
  21      # $Id: print_all_bug_options_update.php,v 1.16.22.1 2007-10-13 22:34:14 giallu Exp $
  22      # --------------------------------------------------------
  23  ?>
  24  <?php
  25      # Updates printing prefs then redirect to print_all_bug_page_page.php
  26  ?>
  27  <?php require_once ( 'core.php' ) ?>
  28  <?php require ( 'print_all_bug_options_inc.php' ) ?>
  29  
  30  <?php auth_ensure_user_authenticated() ?>
  31  <?php
  32      $f_user_id        = gpc_get_int( 'user_id' );
  33      $f_redirect_url    = gpc_get_string( 'redirect_url' );
  34  
  35      # the check for the protected state is already done in the form, there is
  36      # no need to duplicate it here.
  37  
  38      # get the fields list
  39      $t_field_name_arr = get_field_names();
  40      $field_name_count = count($t_field_name_arr);
  41  
  42      # check the checkboxes
  43      for ($i=0 ; $i <$field_name_count ; $i++) {
  44          $t_name='print_'.strtolower(str_replace(' ','_',$t_field_name_arr[$i]));
  45          $t_flag = gpc_get( $t_name, null );
  46  
  47          if ( $t_flag === null ) {
  48              $t_prefs_arr[$i] = 0;
  49          }
  50          else {
  51              $t_prefs_arr[$i] = 1;
  52          }
  53      }
  54  
  55      # get user id
  56      $t_user_id = $f_user_id;
  57  
  58      $c_export = implode('',$t_prefs_arr);
  59  
  60      # update preferences
  61      $t_user_print_pref_table = config_get( 'mantis_user_print_pref_table' );
  62      $query = "UPDATE $t_user_print_pref_table
  63              SET print_pref='$c_export'
  64              WHERE user_id='$t_user_id'";
  65  
  66      $result = db_query( $query );
  67  
  68      html_page_top1();
  69      html_meta_redirect( $f_redirect_url );
  70      html_page_top2();
  71      PRINT '<br /><div align="center">';
  72  
  73      if ( $result ) {
  74          print lang_get( 'operation_successful' );
  75      } else {
  76          print error_string( ERROR_GENERIC );
  77      }
  78  
  79      PRINT '<br />';
  80      print_bracket_link( $f_redirect_url, lang_get( 'proceed' ) );
  81      PRINT '<br /></div>';
  82      html_page_bottom1( __FILE__ );
  83  ?>


Généré le : Thu Nov 29 09:42:17 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics