コード例 #1
0
ファイル: publish.php プロジェクト: rhertzog/lcs
}
if ($user == 'public') {
    $user = '******';
}
load_global_settings();
$WebCalendar->setLanguage();
if (empty($PUBLISH_ENABLED) || $PUBLISH_ENABLED != 'Y') {
    header('Content-Type: text/plain');
    echo print_not_auth(20);
    exit;
}
$errorStr = translate('Error');
$nouser = translate('No user specified');
// Make sure they specified a username.
if (empty($user)) {
    echo send_doctype($errorStr);
    echo <<<EOT
  </head>
  <body>
    <h2>{$errorStr}</h2>
    {$nouser}.
  </body>
</html>
EOT;
    exit;
}
// Load user preferences (to get the USER_PUBLISH_ENABLED and
// DISPLAY_UNAPPROVED setting for this user).
$login = $user;
load_user_preferences();
if (empty($USER_PUBLISH_ENABLED) || $USER_PUBLISH_ENABLED != 'Y') {
コード例 #2
0
ファイル: login.php プロジェクト: rhertzog/lcs
        } else {
            // No login info... just present empty login page
            //$error = "Start";
        }
        // delete current user
        SetCookie('webcalendar_session', '', 0, $cookie_path);
        // In older versions the cookie path had no trailing slash and NS 4.78
        // thinks "path/" and "path" are different, so the line above does not
        // delete the "old" cookie. This prohibits the login. So we delete the
        // cookie with the trailing slash removed
        if (substr($cookie_path, -1) == '/') {
            SetCookie('webcalendar_session', '', 0, substr($cookie_path, 0, -1));
        }
    }
}
echo send_doctype($appStr);
if (!$logout) {
    ?>
<script type="text/javascript">
// error check login/password
function valid_form ( form ) {
  if ( form.login.value.length == 0 || form.password.value.length == 0 ) {
    alert ( '<?php 
    etranslate('You must enter a login and password.', true);
    ?>
' );
    return false;
  }
  return true;
}
function myOnLoad () {
コード例 #3
0
function send_http_login()
{
    global $lang_file;
    if (strlen($lang_file)) {
        $not_authorized = print_not_auth();
        $title = translate('Title');
        $unauthorized = translate('Unauthorized');
    } else {
        $not_authorized = 'You are not authorized.';
        $title = 'WebCalendar';
        $unauthorized = 'Unauthorized';
    }
    header('WWW-Authenticate: Basic realm="' . "{$title}\"");
    header('HTTP/1.0 401 Unauthorized');
    echo send_doctype($unauthorized) . '
  </head>
  <body>
    <h2>' . $title . '</h2>
    ' . $not_authorized . '
  </body>
</html>';
    exit;
}
コード例 #4
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;
コード例 #5
0
ファイル: login-app.php プロジェクト: rhertzog/lcs
    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 ) {
          alert ( \'' . translate('You must enter a login and password.', true) . '\' );
          return false;
        }
        return true;
      }

      function myOnLoad () {
        document.login_form.login.focus ();' . (empty($login) ? '' : '
        document.login_form.login.select ();') . (empty($error) ? '' : '
        alert ( \'' . $error . '\' );') . '
コード例 #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.
}