load_user_preferences('guest'); $WebCalendar->setLanguage(); $cookie_path = str_replace('login.php', '', $PHP_SELF); //echo "Cookie path: $cookie_path\n"; // Look for action=logout $logout = false; $action = getGetValue('action'); if (!empty($action) && $action == 'logout') { $logout = true; $return_path = ''; SetCookie('webcalendar_login', '', 0, $cookie_path); SetCookie('webcalendar_last_view', '', 0, $cookie_path); } else { if (empty($return_path)) { // see if a return path was set $return_path = get_last_view(false); } } if (!empty($return_path)) { $return_path = clean_whitespace($return_path); $url = $return_path; } else { $url = 'index.php'; } // If Application Name is set to Title then get translation // If not, use the Admin defined Application Name $appStr = generate_application_name(); $login = getPostValue('login'); $password = getPostValue('password'); $remember = getPostValue('remember'); // calculate path for cookie
} // Now, mark event as deleted for all users. dbi_query("UPDATE webcal_entry_user SET cal_status = 'D' " . "WHERE cal_id = {$id}"); } } else { // Not the owner of the event and are not the admin. // Just delete the event from this user's calendar. // We could just set the status to 'D' instead of deleting. // (but we would need to make some changes to edit_entry_handler.php // to accomodate this). dbi_query("DELETE FROM webcal_entry_user " . "WHERE cal_id = {$id} AND cal_login = '******'"); activity_log($id, $login, $login, $LOG_REJECT, ""); } } if (strlen(get_last_view())) { $url = get_last_view(); } else { $redir = ""; if ($thisdate != "") { $redir = "?date={$thisdate}"; } if ($user != "") { if ($redir != "") { $redir .= "&"; } $redir .= "user={$user}"; } $url = "{$STARTVIEW}.php" . $redir; } if (empty($error)) { if ($is_assistant) {
// Don't send HTML to external adresses. // Always attach iCalendar file to external users $mail->WC_Send($login_fullname, $ext_emails[$i], $ext_names[$i], $name, $msg, 'N', $from, $id); } } } } } //end external mail } //end empty error // If we were editing this event, then go back to the last view (day, month, week). // If this is a new event, // then go to the preferred view for the date range where this event was added. if (empty($error) && empty($mailerError)) { $return_view = get_last_view(); if (!empty($return_view)) { do_redirect($return_view); } else { $xdate = sprintf("%04d%02d%02d", $year, $month, $day); $user_args = empty($user) ? '' : 'user='******' <h2>' . translate('Scheduling Conflict') . '</h2> ' . translate('Your suggested time of') . ' <span class="bold">';
</FONT></TD> </FORM> </TR> </TABLE> <BR> <B><?php etranslate("Go to"); ?> :</B> <?php $can_add = $readonly == "N" || $is_admin == "Y"; if ($public_access == "Y" && $public_access_can_add != "Y" && $login == "__public__") { $can_add = false; } if (strlen(get_last_view())) { $mycal = get_last_view(); } else { $mycal = "{$STARTVIEW}.php"; } if ($single_user != "Y") { if (!empty($user) && $user != $login) { echo "<A CLASS=\"navlinks\" HREF=\"{$mycal}\"><B>" . translate("Back to My Calendar") . "</B></A>"; } else { echo "<A CLASS=\"navlinks\" HREF=\"{$mycal}\"><B>" . translate("My Calendar") . "</B></A>"; } if (!$use_http_auth) { if (empty($login_return_path)) { $login_url = "login.php"; } else { $login_url = "login.php?return_path={$login_return_path}"; }
$days = ($rpt_sun ? 'y' : 'n') . ($rpt_mon ? 'y' : 'n') . ($rpt_tue ? 'y' : 'n') . ($rpt_wed ? 'y' : 'n') . ($rpt_thu ? 'y' : 'n') . ($rpt_fri ? 'y' : 'n') . ($rpt_sat ? 'y' : 'n'); } else { $days = "nnnnnnn"; } $sql = "INSERT INTO webcal_entry_repeats ( cal_id, " . "cal_type, cal_end, cal_days, cal_frequency ) VALUES " . "( {$id}, '{$rpt_type}', {$end}, '{$days}', {$freq} )"; dbi_query($sql); $msg .= "<span style=\"font-weight:bold;\">SQL:</span> {$sql}<br />\n<br />"; } } } #print $msg; exit; // If we were editing this event, then go back to the last view (week, day, // month). If this is a new event, then go to the preferred view for // the date range that this event was added to. if (empty($error)) { $last_view = get_last_view(); if (strlen($last_view) && !$newevent) { $url = $last_view; } else { $url = sprintf("%s.php?date=%04d%02d%02d", $STARTVIEW, $year, $month, $day); } if ($is_assistant || $is_nonuser_admin) { $url = $url . (strpos($url, "?") === false ? "?" : "&") . "user={$user}"; } do_redirect($_SESSION['referer']); $_SESSION['referer'] = ''; } print_header(); if (strlen($conflicts)) { ?> <h2><?php
$value = $status == "off" ? "N" : "Y"; $sql = "INSERT INTO webcal_user_pref " . "( cal_login, cal_setting, cal_value ) VALUES " . "( '{$layer_user}', 'LAYERS_STATUS', '{$value}' )"; if (!dbi_query($sql)) { $error = "Unable to update preference: " . dbi_error() . "<P><B>SQL:</B> {$sql}"; break; } if (empty($error)) { // Go back to where we where if we can figure it out. if (strlen($ret)) { do_redirect($ret); } else { if (strlen($HTTP_REFERER)) { do_redirect($HTTP_REFERER); } else { if (strlen(get_last_view())) { do_redirect(get_last_view()); } else { do_redirect("{$STARTVIEW}.php"); } } } } ?> <HTML> <HEAD><TITLE><?php etranslate($application_name); ?> </TITLE> <?php include "includes/styles.php"; ?>
$WebCalendar->initializeSecondPhase(); load_global_settings(); load_user_preferences('guest'); $WebCalendar->setLanguage(); // Look for action=logout. $action = getGetValue('action'); $logout = false; if (!empty($action) && $action == 'logout') { $logout = true; $return_path = ''; SetCookie('webcalendar_last_view', '', 0); SetCookie('webcalendar_login', '', 0); } else { if (empty($return_path)) { // See if a return path was set. $return_path = get_last_view(); if (!empty($return_path)) { SetCookie('webcalendar_last_view', '', 0); } } } $appStr = generate_application_name(); // Set return page. $login_return_path = $SERVER_URL . $return_path; ob_start(); echo send_doctype($appStr) . (!$logout ? ' <script type="text/javascript"> // Error check login/password. function valid_form ( form ) { if ( form.login.value.length == 0 || form.password.value.length == 0 ) {