Beispiel #1
0
 public static function addMenu($menuItemArray)
 {
     echo "<div id=\"menu\">\n<table>\n";
     // always have a logout
     Menu::addMenuItem(MENU_LOGOUT);
     for ($k = 0; $k < count($menuItemArray); $k++) {
         Menu::addMenuItem($menuItemArray[$k]);
     }
     // $k
     // always able to see self's schedule
     $author = getWorkerAuthenticated();
     $worker = getWorkerCurrent();
     $expo = getExpoCurrent($author->workerid);
     $station = getStationCurrent($author->workerid);
     if (is_null($worker)) {
         $worker = $author;
     }
     if ($author->isOrganizer() || $author->isSupervisor()) {
         #        Menu::addMenuItem(MENU_WORKER_MESSAGE);
         if (!is_null($expo)) {
             if (strpos($_SERVER['SCRIPT_URL'], "ShiftCheckInPage.php")) {
                 Menu::addMenuItem(MENU_EXPO_CHECKIN_CLIENT);
             } else {
                 if (!strpos($_SERVER['SCRIPT_URL'], "ExpoCheckInPage.php")) {
                     if (!is_null($station)) {
                         Menu::addMenuItem(MENU_CHECKIN_CLIENT);
                     } else {
                         Menu::addMenuItem(MENU_EXPO_CHECKIN_CLIENT);
                     }
                 }
             }
         }
     }
     if (!is_null($expo)) {
         if (!strpos($_SERVER['SCRIPT_URL'], Menu::$MENU_ACTION_ARRAY[MENU_VIEW_EXPOCURRENT])) {
             Menu::addMenuItem(MENU_VIEW_EXPOCURRENT);
         }
         Menu::addMenuItem(MENU_VIEW_SCHEDULE, !$expo->scheduleVisible);
     }
     Menu::addMenuItem(MENU_VIEW_WORKER);
     echo "</table>\n</div><!-- menu -->\n";
     return;
 }
<?php

// $Id: PreferenceWelcomePage.php 2418 2012-10-28 19:23:53Z ecgero $ Copyright (c) ConSked, LLC. All Rights Reserved.
include 'util/authenticate.php';
require_once 'preferences/' . PREF . 'Preferences.php';
require_once 'properties/constants.php';
require_once 'section/Menu.php';
require_once 'util/log.php';
require_once 'util/session.php';
$author = getWorkerAuthenticated();
if (isset($_REQUEST[PARAM_LIST_INDEX])) {
    $expo = getParamItem(PARAM_LIST, PARAM_LIST_INDEX);
    if (!is_null($expo)) {
        setExpoCurrent($expo);
    }
    $_SESSION[PARAM_LIST] = NULL;
}
$expo = getExpoCurrent();
?>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="31 Dec 2011 12:00:00 GMT"/>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

	<title><?php 
echo SITE_NAME;
?>
 - Shift Preference Welcome</title>
	<link href="css/site.css" rel="stylesheet" type="text/css">
<?php

// $Id: authenticateOrganizer.php 1294 2012-08-09 23:44:40Z preston $ Copyright (c) ConSked, LLC. All Rights Reserved.
require_once 'util/session.php';
require_once 'db/Worker.php';
include 'util/authenticate.php';
if (!getWorkerAuthenticated()->isOrganizer()) {
    logMessage('authorization', 'page requires Organizer');
    header('Location: WorkerLoginPage.php');
    include 'WorkerLoginPage.php';
    return;
}
Beispiel #4
0
<?php

// $Id: authenticate.php 1294 2012-08-09 23:44:40Z preston $ Copyright (c) ConSked, LLC. All Rights Reserved.
require_once 'util/session.php';
require_once 'db/Worker.php';
require_once 'db/WorkerLogin.php';
// require session login
if (!isLoggedIn()) {
    logMessage('authentication', 'worker not logged in');
    header('Location: WorkerLoginPage.php');
    include 'WorkerLoginPage.php';
    return;
}
if (WorkerLogin::isDisabled(getWorkerAuthenticated()->workerid)) {
    logMessage('authentication', 'worker is being forced to log out per disabling');
    header('Location: WorkerLoginPage.php');
    include 'WorkerLoginPage.php';
    return;
}
session_cache_limiter('nocache');
session_start();
if (!isset($_SESSION[AUTHENTICATED_TEMP]) && !isLoggedIn()) {
    logMessage('authentication', 'worker not logged in');
    header('Location: WorkerLoginPage.php');
    include 'WorkerLoginPage.php';
    return;
}
require_once 'db/Worker.php';
require_once 'db/WorkerLogin.php';
require_once 'util/log.php';
require_once 'swwat/gizmos/parse.php';
$password = swwat_parse_string(html_entity_decode($_POST[PARAM_PASSWORD]), true);
if (is_null($password)) {
    header('Location: WorkerLoginChangePage.php');
    include 'WorkerLoginChangePage.php';
    return;
}
// else
$worker = isset($_SESSION[AUTHENTICATED_TEMP]) ? $_SESSION[AUTHENTICATED_TEMP] : getWorkerAuthenticated();
WorkerLogin::password_change($worker->workerid, $password);
$worker = getWorkerAuthenticated();
$password = NULL;
if ($worker->isOrganizer()) {
    header('Location: SiteAdminPage.php');
    include 'SiteAdminPage.php';
} else {
    header('Location: WorkerViewPage.php');
    include 'WorkerViewPage.php';
}
return;
<?php

// $Id: authenticateSupervisor.php 2264 2012-09-26 15:31:49Z preston $ Copyright (c) ConSked, LLC. All Rights Reserved.
require_once 'util/session.php';
require_once 'db/Worker.php';
include 'util/authenticate.php';
if (getWorkerAuthenticated()->isCrewMember()) {
    logMessage('authorization', 'page requires Supervisor');
    header('Location: WorkerLoginPage.php');
    include 'WorkerLoginPage.php';
    return;
}
Beispiel #7
0
<?php

/* $Id: LinkExpoWorker.php 1970 2012-09-14 20:59:57Z preston $ Copyright (c) ConSked, LLC. All Rights Reserved. */
require_once 'db/Expo.php';
require_once 'db/Worker.php';
require_once 'util/session.php';
$titleLinkExpoWorker = !is_null(getExpoCurrent()) ? getExpoCurrent()->titleString() : "";
if (getWorkerAuthenticated()->isOrganizer() || getWorkerAuthenticated()->isSupervisor()) {
    $title = "<a href='ExpoViewPage.php'>" . $titleLinkExpoWorker . "</a>";
}
?>
<div id="LinkExpo">
   <table>
      <?php 
if (!is_null(getExpoCurrent())) {
    ?>
      <tr>
         <td><h5 style="margin:0">Expo</h5></td>
         <td class="fieldLink"><?php 
    echo $titleLinkExpoWorker;
    ?>
</a></td>
      </tr>
      <?php 
}
if (!is_null(getWorkerCurrent())) {
    ?>
      <tr>
         <td><h5 style="margin:0">Staff</h5></td>
         <td class="fieldLink"><a href="WorkerViewPage.php"><?php 
    echo getWorkerCurrent()->nameString();
Beispiel #8
0
// $Id: WorkerEditAction.php 914 2012-07-14 13:26:32Z preston $ Copyright (c) ConSked, LLC. All Rights Reserved.
include 'util/authenticate.php';
require_once 'properties/constants.php';
require_once 'db/Worker.php';
require_once 'util/log.php';
require_once 'util/session.php';
require_once 'util/SMSEnum.php';
require_once 'swwat/gizmos/parse.php';
$worker = getWorkerCurrent();
if (isset($_POST[PARAM_SAVE])) {
    $worker->firstName = swwat_parse_string(html_entity_decode($_POST[PARAM_FIRSTNAME]), true);
    $worker->middleName = swwat_parse_string(html_entity_decode($_POST[PARAM_MIDDLENAME]), true);
    $worker->lastName = swwat_parse_string(html_entity_decode($_POST[PARAM_LASTNAME]), true);
    $worker->email = swwat_parse_string(html_entity_decode($_POST[PARAM_EMAIL]), true);
    $worker->phone = swwat_parse_phone(html_entity_decode($_POST[PARAM_PHONE]), true);
    $sms = swwat_parse_enum(html_entity_decode($_POST[PARAM_SMS_SERVICE]), SMSEnum::$SMS_ARRAY, true);
    if (0 == strcmp(SMSEnum::$NONE, $sms)) {
        $sms = NULL;
    }
    $worker->smsemail = is_null($worker->phone) || is_null($sms) ? NULL : $worker->phone . "@" . $sms;
    $worker = $worker->update();
    if ($worker->workerid == getWorkerAuthenticated()->workerid) {
        $_SESSION[AUTHENTICATED] = $worker;
        // unusual; but I believe the only place required to do so
    } else {
        setWorkerCurrent($worker);
    }
}
// in all cases
header('Location: WorkerViewPage.php');
include 'WorkerViewPage.php';