array_unshift($grouplist, $public); } $groups = ''; for ($i = 0, $cnt = count($grouplist); $i < $cnt; $i++) { $l = $grouplist[$i]['cal_login']; $f = $grouplist[$i]['cal_fullname']; // don't display current $user in group list if (!empty($user) && $user == $l) { continue; } // Use the preferred view if it is day/week/month/year.php. Try not to // use a user-created view because it might not display the proper user's // events. (Fallback to month.php if this is true.) Of course, if this // user cannot view any of the standard D/W/M/Y pages, that will force us // to use the view. $xurl = get_preferred_view('', 'user='******'view_')) { if (access_can_access_function(ACCESS_MONTH)) { $xurl = 'month.php?user='******'week.php?user='******'day.php?user='******'s cal. } $groups .= ($i > 0 && $groups != '' ? ", \n" : '') . '<a title="' . "{$f}\" href=\"{$xurl}\">{$f}" . '</a>'; } if (!empty($groups)) { $tret .= '<br /><span class="prefix">' . translate('Manage calendar of') . ':</span> ' . $groups; }
// 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, ""); } } $ret = getValue("ret"); if (!empty($ret) && $ret == "list") { $url = "list_unapproved.php"; if (!empty($user)) { $url .= "?user={$user}"; } } else { $url = get_preferred_view("", empty($user) ? "" : "user={$user}"); } if (empty($error)) { do_redirect($url); exit; } print_header(); ?> <h2><?php etranslate("Error"); ?> </h2> <blockquote> <?php echo $error;
$grouplist = user_get_boss_list($login); if (!empty($admincals[0])) { $grouplist = array_merge($admincals, $grouplist); } if ($is_admin && $public_access == 'Y') { $public = array("cal_login" => "__public__", "cal_fullname" => translate("Public Access")); array_unshift($grouplist, $public); } $groups = ""; for ($i = 0; $i < count($grouplist); $i++) { $l = $grouplist[$i]['cal_login']; $f = $grouplist[$i]['cal_fullname']; // Use the preferred view if it is day/week/month/year.php. Do // not use a user-created view because it might not display the // proper user's events. (Fallback to month.php if this is true.) $xurl = get_preferred_view("", "user={$l}"); if (strstr($xurl, "view_")) { $xurl = "month.php?user={$l}"; } if ($i > 0) { $groups .= ", "; } $groups .= "<a title=\"{$f}\" href=\"{$xurl}\">{$f}</a>"; } if (!empty($groups)) { /* echo "<br/><span class=\"prefix\">"; etranslate ( "Manage calendar of" ); echo ":</span> " . $groups; */ }
if ($event_owner == $login || user_is_assistant($login, $event_owner)) { $can_delete = true; } } dbi_free_result($res); } } if (empty($error) && !$can_delete) { $error = print_not_auth(6); } if (empty($error) && $can_delete) { if (!dbi_execute('DELETE FROM webcal_blob WHERE cal_blob_id = ?', array($blid))) { $error = db_error(); } else { if ($event_id > 0) { $removeStr = translate('Removed'); if ($type == 'A') { activity_log($event_id, $login, $login, LOG_ATTACHMENT, $removeStr . ': ' . $name); } elseif ($type == 'C') { activity_log($event_id, $login, $login, LOG_COMMENT, $removeStr); } } if ($event_id > 0) { do_redirect('view_entry.php?id=' . $event_id); } do_redirect(get_preferred_view()); } } // Some kind of error... print_header(); echo print_error($error) . print_trailer();
function send_to_preferred_view($indate = '', $args = '') { do_redirect(get_preferred_view($indate, $args)); }
<?php /* $Id: index.php,v 1.16.2.2 2007/08/06 02:28:30 cknudsen Exp $ */ include_once 'includes/init.php'; // If not yet logged in, you will be redirected to login.php before // we get to this point (by init.php included above). if (!empty($STARTVIEW)) { $page = get_preferred_view(); if (access_can_view_page($page)) { send_to_preferred_view(); } else { // User's preferences need to be updated to their preferred view. if (access_can_access_function(ACCESS_PREFERENCES)) { do_redirect('pref.php'); } // User does not have access to preferences... // So, we need to pick another page. if (access_can_access_function(ACCESS_WEEK)) { do_redirect('week.php'); } elseif (access_can_access_function(ACCESS_MONTH)) { do_redirect('month.php'); } elseif (access_can_access_function(ACCESS_DAY)) { do_redirect('day.php'); } elseif (access_can_access_function(ACCESS_YEAR)) { do_redirect('year.php'); } // At this point, this user cannot view the preferred view in their // preferences (and they cannot update their preferences), and they cannot // view any of the standard day/week/month/year pages. All that's left is a // custom view that is either created by them or a global view. if (count($views) > 0) {
/** * Sends a redirect to the user's preferred view. * * The user's preferred view is stored in the $STARTVIEW global variable. This * is loaded from the user preferences (or system settings if there are no user * prefererences.) * * @param string $indate Date to pass to preferred view in YYYYMMDD format * @param string $args Arguments to include in the URL (such as "user=joe") */ function send_to_preferred_view($indate = "", $args = "") { $url = get_preferred_view($indate, $args); do_redirect($url); }
WHERE cal_id = ? AND cal_login = ?', array('D', $id, $del_user)); activity_log($id, $login, $login, $log_reject, ''); } } } } $ret = getValue('ret'); $return_view = get_last_view(); if (!empty($ret)) { if ($ret == 'listall') { $url = 'list_unapproved.php'; } else { if ($ret == 'list') { $url = 'list_unapproved.php' . (empty($user) ? '' : '?user='******'', empty($user) ? '' : 'user='******'TZ', $TIMEZONE); if (empty($error) && empty($mailerError)) { do_redirect($url); exit; } // Process errors. $mail->MailError($mailerError, $error);