コード例 #1
0
ファイル: login.php プロジェクト: rhertzog/lcs
    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
if (empty($PHP_SELF)) {
    $PHP_SELF = $_SERVER['PHP_SELF'];
}
if ($single_user == 'Y') {
    // No login for single-user mode
    do_redirect('index.php');
} else {
    if ($use_http_auth) {
        // There is no login page when using HTTP authorization
        do_redirect('index.php');
    } else {
コード例 #2
0
ファイル: login.php プロジェクト: rhertzog/lcs
  <error>' . translate('No login required for HTTP authentication.') . '</error>';
    } else {
        $login = getValue('login');
        $password = getValue('password');
        if (!empty($login) && !empty($password)) {
            $login = trim($login);
            if (user_valid_login($login, $password)) {
                user_load_variables($login, '');
                // Set login to expire in 365 days.
                srand((double) microtime() * 1000000);
                $salt = chr(rand(ord('A'), ord('z'))) . chr(rand(ord('A'), ord('z')));
                $encoded_login = encode_string($login . '|' . crypt($password, $salt));
                // SetCookie ( 'webcalendar_session', $encoded_login, 0, $cookie_path );
                $out .= '
  <cookieName>webcalendar_session</cookieName>
  <cookieValue>$encoded_login</cookieValue>' . ($is_admin ? '
  <admin>1</admin>' : '') . '
  <calendarName>' . generate_application_name() . '</calendarName>
  <appName>' . htmlspecialchars($PROGRAM_NAME) . '</appName>
  <appVersion>' . htmlspecialchars($PROGRAM_VERSION) . '</appVersion>
  <appDate>' . htmlspecialchars($PROGRAM_DATE) . '</appDate>';
            } else {
                $out .= '
  <error>Invalid login</error>';
            }
        }
    }
}
echo $out . '
</login>
';
コード例 #3
0
ファイル: edit_entry_handler.php プロジェクト: rhertzog/lcs
 // Only send mail if their email address is filled in.
 $do_send = get_pref_setting($participants[$i], $newevent ? 'EMAIL_EVENT_ADDED' : 'EMAIL_EVENT_UPDATED');
 $htmlmail = get_pref_setting($participants[$i], 'EMAIL_HTML');
 $t_format = get_pref_setting($participants[$i], 'TIME_FORMAT');
 $user_TIMEZONE = get_pref_setting($participants[$i], 'TIMEZONE');
 set_env('TZ', $user_TIMEZONE);
 $user_language = get_pref_setting($participants[$i], 'LANGUAGE');
 user_load_variables($participants[$i], 'temp');
 if (boss_must_be_notified($login, $participants[$i]) && !empty($tempemail) && $do_send == 'Y' && $send_user_mail && $SEND_EMAIL != 'N') {
     // We send to creator if they want it.
     if ($send_own != 'Y' && $participants[$i] == $login) {
         continue;
     }
     reset_language(empty($user_language) || $user_language == 'none' ? $LANGUAGE : $user_language);
     $fmtdate = $timetype == 'T' ? date('Ymd', $eventstart) : gmdate('Ymd', $eventstart);
     $msg = str_replace('XXX', $tempfullname, $helloStr) . "\n\n" . str_replace('XXX', $login_fullname, $newevent || empty($old_status[$participants[$i]]) ? $newAppStr : $updAppStr) . "\n" . str_replace('XXX', $name, $subjStr) . "\n\n" . str_replace('XXX', $description, $descStr) . "\n" . str_replace('XXX', date_to_str($fmtdate), $dateStr) . "\n" . ($timetype != 'T' ? '' : str_replace('XXX', display_time('', 2, $eventstart, $t_format), $timeStr) . "\n") . $extra_email_data . str_replace('XXX', generate_application_name(), $REQUIRE_APPROVALS == 'Y' ? translate('Please look on XXX to accept or reject this appointment.') : translate('Please look on XXX to view this appointment.'));
     // Add URL to event, if we can figure it out.
     if (!empty($SERVER_URL)) {
         // DON'T change & to &amp; here. Email will handle it.
         $url = $SERVER_URL . 'view_entry.php?id=' . $id . '&em=1';
         if ($htmlmail == 'Y') {
             $url = activate_urls($url);
         }
         $msg .= "\n\n" . $url;
     }
     $wantsAttach = get_pref_setting($participants[$i], 'EMAIL_ATTACH_ICS', 'N');
     $attachId = $wantsAttach == 'Y' ? $id : '';
     // Use WebCalMailer class.
     $mail->WC_Send($login_fullname, $tempemail, $tempfullname, $name, $msg, $htmlmail, $from, $attachId);
     activity_log($id, $login, $participants[$i], LOG_NOTIFICATION, '');
 }
コード例 #4
0
ファイル: view_entry.php プロジェクト: rhertzog/lcs
// If we have no event status yet, it must have been deleted.
if (empty($event_status) && !$is_admin || !$can_view && empty($rss_view)) {
    echo print_not_auth(33, true) . print_trailer();
    exit;
}
// We can bypass $can_view if coming from RSS
if (!$can_view && empty($rss_view)) {
    echo print_not_auth(8, true) . print_trailer();
    exit;
}
// save date so the trailer links are for the same time period
$thisyear = intval($orig_date / 10000);
$thismonth = $orig_date / 100 % 100;
$thisday = $orig_date % 100;
// $subject is used for mailto URLs.
$subject = generate_application_name() . ': ' . $name;
// Remove the '"' character since it causes some mailers to barf
$subject = str_replace(' "', '', $subject);
$subject = htmlspecialchars($subject);
$event_repeats = false;
// Build info string for repeating events and end date.
$res = dbi_execute('SELECT cal_type FROM webcal_entry_repeats
  WHERE cal_id = ?', array($id));
$rep_str = '';
if ($res) {
    if ($tmprow = dbi_fetch_row($res)) {
        $event_repeats = true;
    }
    dbi_free_result($res);
}
/* calculate end time */
コード例 #5
0
        $events = read_events($username, $startDate, $endDate, $cat_id);
    }
    // Pre-load tasks for quicker access */
    if (empty($DISPLAY_TASKS_IN_GRID) || $DISPLAY_TASKS_IN_GRID == 'Y' || $showTasks) {
        /* Pre-load tasks for quicker access */
        $tasks = read_tasks($username, $endDate, $cat_id);
    }
}
// Determine if this script is being called directly, or via an include.
if (empty($PHP_SELF) && !empty($_SERVER) && !empty($_SERVER['PHP_SELF'])) {
    $PHP_SELF = $_SERVER['PHP_SELF'];
}
// If called directly print  header stuff.
if (!empty($PHP_SELF) && preg_match($name_of_this_file, $PHP_SELF)) {
    // Print header without custom header and no style sheet.
    echo send_doctype(generate_application_name());
    ?>
<!-- This style sheet is here mostly to make it easier for others
     to customize the appearance of the page.
     In the not too distant future, the admin UI will allow configuration
     of the stylesheet elements on this page.
-->
<style type="text/css">
body {
  background-color: #ffffff;
}
dt {
  font-family: arial,helvetica;
  font-weight: bold;
  font-size: 12px;
  color: #000000;
コード例 #6
0
function print_header($includes = '', $HeadX = '', $BodyX = '', $disableCustom = false, $disableStyle = false, $disableRSS = false, $disableAJAX = false, $disableUTIL = false)
{
    global $BGCOLOR, $browser, $charset, $CUSTOM_HEADER, $CUSTOM_SCRIPT, $DISABLE_POPUPS, $DISPLAY_TASKS, $DISPLAY_WEEKENDS, $FONTS, $friendly, $LANGUAGE, $login, $MENU_ENABLED, $MENU_THEME, $OTHERMONTHBG, $POPUP_FG, $REQUEST_URI, $self, $TABLECELLFG, $TEXTCOLOR, $THBG, $THFG, $TODAYCELLBG, $WEEKENDBG, $SCRIPT, $PUBLIC_ACCESS_FULLNAME, $PUBLIC_ACCESS, $is_admin;
    $lang = $ret = '';
    // Remember this view if the file is a view_x.php script.
    if (!strstr($REQUEST_URI, 'view_entry')) {
        remember_this_view(true);
    }
    // Check the CSS version for cache clearing if needed.
    if (!$disableStyle) {
        if (isset($_COOKIE['webcalendar_csscache'])) {
            $webcalendar_csscache = $_COOKIE['webcalendar_csscache'];
        } else {
            $webcalendar_csscache = 1;
            SetCookie('webcalendar_csscache', $webcalendar_csscache);
        }
    }
    // Menu control.
    if (!empty($friendly) || $disableCustom) {
        $MENU_ENABLED = 'N';
    }
    $appStr = generate_application_name(true);
    $ret .= send_doctype($appStr);
    $ret .= !$disableAJAX ? '
    <script type="text/javascript" src="includes/js/prototype.js"></script>' : '';
    // Includes needed for the top menu.
    if ($MENU_ENABLED == 'Y') {
        $MENU_THEME = !empty($MENU_THEME) && $MENU_THEME != 'none' ? $MENU_THEME : 'default';
        $menu_theme = $SCRIPT == 'admin.php' && !empty($GLOBALS['sys_MENU_THEME']) ? $GLOBALS['sys_MENU_THEME'] : $MENU_THEME;
        $ret .= '
    <script type="text/javascript" src="includes/menu/JSCookMenu.js"></script>
    <script type="text/javascript" src="includes/menu/themes/' . $menu_theme . '/theme.js"></script>';
    }
    $ret .= !$disableUTIL ? '
    <script type="text/javascript" src="includes/js/util.js"></script>' : '';
    // Any other includes?
    if (is_array($includes)) {
        foreach ($includes as $inc) {
            if (substr($inc, 0, 13) == 'js/popups.php' && !empty($DISABLE_POPUPS) && $DISABLE_POPUPS == 'Y') {
                // Don't load popups.php javascript if DISABLE_POPUPS.
            } else {
                $ret .= '
    <script type="text/javascript" src="js_cacher.php?inc=' . $inc . '"></script>';
            }
        }
    }
    // Do we need anything else inside the header tag?
    if ($HeadX) {
        $ret .= '
    ' . $HeadX;
    }
    // Include the CSS needed for the top menu and themes.
    if ($MENU_ENABLED == 'Y') {
        include_once 'includes/menu/index.php';
        $ret .= '
    <link rel="stylesheet" type="text/css" href="includes/menu/themes/' . $menu_theme . '/theme.css" />';
    }
    // Add RSS feed for unapproved events if approvals are required
    if ($GLOBALS['REQUIRE_APPROVALS'] == 'Y' && $login != '__public__' && $is_admin) {
        // Prh .. fix theme change for auth_http which does not set webcal*login
        //        variables.
        //
        //        Pass the logged in user id as login=<whatever> on the URL
        //        Add css_cache=<cookie setting> to change the URL signature
        //        to force a fetch from the server rather than from the
        //        browser cache when the style changes.
        // Note: we could do all the queries to add the RSS feed for every user
        // the current user has permissions to approve for, but I'm thinking
        // that's too many db requests to repeat on every page.
        $ret .= '<link rel="alternate" type="application/rss+xml" title="' . $appStr . ' - Unapproved Events - ' . $login . '" href="rss_unapproved.php"/>';
        if ($is_admin && $PUBLIC_ACCESS == 'Y') {
            $ret .= '<link rel="alternate" type="application/rss+xml" title="' . $appStr . ' - Unapproved Events - ' . translate($PUBLIC_ACCESS_FULLNAME) . '" href="rss_unapproved.php?user=public"/>';
        }
    }
    if ($is_admin) {
        $ret .= '<link rel="alternate" type="application/rss+xml" title="' . $appStr . ' - ' . translate('Activity Log') . '" href="rss_activity_log.php"/>';
    }
    // If loading admin.php, we will not use an exrternal file because we need to
    // override the global colors and this is impossible if loading external file.
    // We will still increment the webcalendar_csscache cookie though.
    echo $ret . ($disableStyle ? '' : '
    <link rel="stylesheet" type="text/css" href="css_cacher.php?login='******'webcal_tmp_login']) ? $login : $_SESSION['webcal_tmp_login']) . '&amp;css_cache=' . $webcalendar_csscache . '" />') . ($CUSTOM_SCRIPT == 'Y' && !$disableCustom ? load_template($login, 'S') : '') . (empty($friendly) ? '' : '
    <link rel="stylesheet" type="text/css"' . (empty($friendly) ? ' media="print"' : '') . ' href="includes/print_styles.css" />') . (!empty($GLOBALS['RSS_ENABLED']) && $GLOBALS['RSS_ENABLED'] == 'Y' && $login == '__public__' || !empty($GLOBALS['USER_RSS_ENABLED']) && $GLOBALS['USER_RSS_ENABLED'] == 'Y' && !$disableRSS ? '
    <link rel="alternate" type="application/rss+xml" title="' . $appStr . ' [RSS 2.0]" href="rss.php' . ($login != '__public__' ? '?user='******'') . '" />' : '') . '
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />' . ($MENU_ENABLED == 'Y' ? $menuScript : '') . '
  </head>
  <body' . (translate('direction') == 'rtl' ? ' dir="rtl"' : '') . ' id="' . preg_replace('/(_|.php)/', '', substr($self, strrpos($self, '/') + 1)) . '"' . (empty($BodyX) ? '' : " {$BodyX}") . '>' . "\n" . ($MENU_ENABLED == 'Y' && $menuConfig['Above Custom Header'] ? $menuHtml : '') . ($CUSTOM_HEADER == 'Y' && !$disableCustom ? load_template($login, 'H') : '') . ($MENU_ENABLED == 'Y' && !$menuConfig['Above Custom Header'] ? $menuHtml : '');
    // TODO convert this to return value.
}