[ Index ] |
|
Code source de WebCalendar 1.0.5 |
1 <?php 2 /* $Id: layers_toggle.php,v 1.17.2.1 2005/12/02 21:45:15 cknudsen Exp $ */ 3 include_once 'includes/init.php'; 4 load_user_layers (); 5 6 7 $status = getValue ( 'status', '(on|off)', true ); 8 9 10 if ( $allow_view_other != 'Y' ) { 11 print_header (); 12 etranslate("You are not authorized"); 13 print_trailer (); 14 exit; 15 } 16 17 $updating_public = false; 18 if ( $is_admin && ! empty ( $public ) && $public_access == "Y" ) { 19 $updating_public = true; 20 $layer_user = "__public__"; 21 $url = 'layers.php?public=1'; 22 } else { 23 $layer_user = $login; 24 $url = 'layers.php'; 25 } 26 27 $sql = "DELETE FROM webcal_user_pref WHERE cal_login = '$layer_user' " . 28 "AND cal_setting = 'LAYERS_STATUS'"; 29 dbi_query ( $sql ); 30 31 $value = ( $status == "off" ? "N" : "Y" ); 32 33 $sql = "INSERT INTO webcal_user_pref " . 34 "( cal_login, cal_setting, cal_value ) VALUES " . 35 "( '$layer_user', 'LAYERS_STATUS', '$value' )"; 36 if ( ! dbi_query ( $sql ) ) { 37 $error = "Unable to update preference: " . dbi_error () . 38 "<br /><br /><span style=\"font-weight:bold;\">SQL:</span> $sql"; 39 break; 40 } 41 42 if ( empty ( $error ) ) { 43 do_redirect ( $url ); 44 } 45 46 print_header(); 47 ?> 48 49 <h2><?php etranslate("Error")?></h2> 50 51 <?php etranslate("The following error occurred")?>: 52 <blockquote> 53 <?php echo $error; ?> 54 </blockquote> 55 56 <?php print_trailer(); ?> 57 58 </body> 59 </html>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Nov 30 19:09:19 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |