2 include_once $gfplugins.'webcalendar/www/includes/init.php';
6 $status = getValue ( 'status', '(on|off)', true );
9 if ( $allow_view_other != 'Y' ) {
11 etranslate("You are not authorized");
16 $updating_public = false;
17 if ( $is_admin && ! empty ( $public ) && $public_access == "Y" ) {
18 $updating_public = true;
19 $layer_user = "__public__";
20 $url = 'layers.php?public=1';
26 $sql = "DELETE FROM webcal_user_pref WHERE cal_login = '$layer_user' " .
27 "AND cal_setting = 'LAYERS_STATUS'";
30 $value = ( $status == "off" ? "N" : "Y" );
32 $sql = "INSERT INTO webcal_user_pref " .
33 "( cal_login, cal_setting, cal_value ) VALUES " .
34 "( '$layer_user', 'LAYERS_STATUS', '$value' )";
35 if ( ! dbi_query ( $sql ) ) {
36 $error = "Unable to update preference: " . dbi_error () .
37 "<br /><br /><span style=\"font-weight:bold;\">SQL:</span> $sql";
41 if ( empty ( $error ) ) {
48 <h2><?php etranslate("Error")?></h2>
50 <?php etranslate("The following error occurred")?>:
55 <?php print_trailer(); ?>