コード例 #1
0
 function getApps()
 {
     global $area, $db;
     echo "<option value='NULL'>None</option>";
     $dev = isSuperuser();
     $external = $dev;
     try {
         $appQuery = $db->prepare("SELECT * FROM `app` WHERE `appId` IN (SELECT `appId` FROM `link` WHERE `area` = :area GROUP BY `appId`) ORDER BY `appName`");
         $appQuery->execute(array(':area' => $area));
     } catch (PDOException $e) {
         exit("error in query");
     }
     while ($row = $appQuery->fetch(PDO::FETCH_ASSOC)) {
         if ($dev || $external && intval($row['internal'])) {
             echo "<option value='{$row['appId']}'>{$row['appName']}</option>";
         }
     }
 }
コード例 #2
0
require_once '../includes/includeme.php';
function printWeekDayOptions()
{
    echo <<<WEEKDAYOPTIONS
\t<option>Pick a Day</option>
\t<option value="0">Saturday</option>
\t<option value="1">Sunday</option>
\t<option value="2">Monday</option>
\t<option value="3">Tuesday</option>
\t<option value="4">Wednesday</option>
\t<option value="5">Thursday</option>
\t<option value="6">Friday</option>
WEEKDAYOPTIONS;
}
// Ensure that only people with the development permission can access the app.
if (isSuperuser()) {
    ?>

<link rel="stylesheet" type="text/css" href="./index.css" />

<h1 id="editorTitle">Area Creaditor</h1>
<div id="instructions">
	<p>
		This app is used in order to create a new Area on the website or make changes to an existing area.
		Click to fill out a form and select those apps and permissions you would like to include in the area.
		After successfully creating the new area it might be good to head over to the Area Admin page and select which employees you would like to have access to the area.
	</p>
	<p>
		If you single click an area it will "select" the area and you will be able to modify which apps are used in the selected area by scrolling down to the "Area App Selector" section of this page.
	</p>
</div>
コード例 #3
0
<?php

require '../includes/includeme.php';
/*
This application is designed to give users access to different areas of the website 
ie. Ops, SD, COS, etc.
It will allow the granting and revoking of access to areas of the website beyond their default area.
A user cannot be removed from their default area.
*/
$permission = isSuperuser();
if (!$permission) {
    echo "<h2>You do not have permission to view this page.</h2>";
    require '../includes/includeAtEnd.php';
    return;
}
function pullAreasToSelect()
{
    global $area, $db;
    $selected = "";
    try {
        $areaQuery = $db->prepare("SELECT ID,longName FROM employeeAreas");
        $areaQuery->execute();
    } catch (PDOException $e) {
        exit("error in query");
    }
    while ($cur = $areaQuery->fetch(PDO::FETCH_ASSOC)) {
        if ($cur['ID'] == $area) {
            $selected = "selected";
        } else {
            $selected = "";
        }
コード例 #4
0
function pullSubMenus()
{
    global $area, $env, $netID, $db;
    echo "<ul>";
    //quicklinks
    if ($area != null) {
        echo "<li><a href=\"#\">Quick links</a>";
        echo "<div class=\"sub links\">";
        try {
            $stmt = $db->prepare("SELECT * FROM quicklinks WHERE netId=:netId");
            $stmt->execute(array(":netId" => $netID));
        } catch (\PDOException $e) {
        }
        while ($quicklink = $stmt->fetch()) {
            echo "<a target='_blank' href='" . $quicklink->url . "'>" . $quicklink->name . "</a>";
        }
        echo "<a href='/quicklinks/index'><strong>Edit Quick links</strong></a>";
        echo "</div>";
        echo "</li>";
    }
    // area
    $areas = getAreas();
    if (count($areas) > 1) {
        echo "<li><a href=\"#\">Area</a>";
        echo "<div class=\"sub links\">";
        for ($i = 0; $i < count($areas); $i++) {
            echo "<a href=\"\" onclick=\"document.cookie='area=" . $areas[$i] . "; path=/';\">";
            if ($area == $areas[$i]) {
                echo "* ";
            }
            echo getAreaNameById($areas[$i]) . "</a>";
        }
        echo "</div>";
        echo "</li>";
    }
    // environment
    if (isSuperuser()) {
        echo "<li><a href=\"#\">Environment</a>";
        echo "<div class=\"sub links\">";
        echo "<a href=\"\" onclick=\"document.cookie='environment=0; path=/';\">";
        if ($env == 0) {
            echo "* ";
        }
        echo "Development</a>";
        echo "<a href=\"\" onclick=\"document.cookie='environment=1; path=/';\">";
        if ($env == 1) {
            echo "* ";
        }
        echo "Stage</a>";
        echo "<a href=\"\" onclick=\"document.cookie='environment=2; path=/';\">";
        if ($env == 2) {
            echo "* ";
        }
        echo "Production</a>";
        echo "</div>";
        echo "</li>";
        echo "<li>\n\t\t\t\t<a href=\"#\">Development Tools</a>\n\t\t\t\t<div class=\"sub links\">\n\t\t\t\t\t<a href=\"/resources/index\">Resources</a>\n\t\t\t\t\t<a href=\"/notifications/types\">Notification Types</a>\n\t\t\t\t\t<a href=\"/tools/addLink\">Add link</a>\n\t\t\t\t\t<a href=\"/tools/editLink\">Edit link</a>\n\t\t\t\t\t<a href=\"/areaCreator\">Area Creator</a>\n\t\t\t\t\t<a href=\"/areaAdmin\">Area Admin</a>\n\t\t\t\t\t<a href=\"/areaCreator/apps.php\">App Editor</a>\n\t\t\t\t\t<a href=\"/areaCreator/permissions.php\">Old Permission Editor</a>\n\t\t\t\t\t<a href=\"/areaCreator/appPermissions.php\">Old App Permission Editor</a>\n\t\t\t\t\t<a href=\"/heimdall\">Heimdall</a>\n\t\t\t\t</div>\n\t\t\t</li>";
    }
    if (count($areas) > 1) {
        // Notifications
        echo "<li><a id='notificationsDropdownHeader' href='#'>Notifications</a>";
        echo "<div id='notificationsDropdown' class='sub links'>";
        echo "</div>";
        echo "</li>";
    }
    echo "</ul>";
}
コード例 #5
0
<?php

require_once '../includes/includeme.php';
if (!isSuperuser()) {
    echo '<h1 style="text-align:center;margin-top:20%;">You do not have permission to see this page</h1><p style="text-align:center;"> If you should have access to this page, please talk to your manager</p>';
    require '../includes/includeAtEnd.php';
    exit;
}
?>

<link rel='stylesheet' type='text/css' href='index.css'>
<script src='index.js' type='text/javascript'></script>

<h1>Welcome to Heimdall</h1>

<div id='searchBar' name='searchBar'>
	<input type='text' id='textFilter' name='textFilter' placeholder='Search...'>
</div>

<div class='addApplication'>
	<span class='ui-icon ui-icon-circle-plus'></span>
	<span>Add an application</span>
</div>

<div id='applications' name='applications'>

</div>

<div id='addApplicationForm'>
	<p>Please enter in the following information:</p>
	<label for='appLongName'>Long Name:</label>
コード例 #6
0
function recursiveCall($parentIndex)
{
    echo "<ul class='sortList'>";
    foreach ($parentIndex as $index) {
        if (linkHasChild($index['index']) && linkIsVisible($index['index'])) {
            //print link header with appropriate edit options
            echo "<li style='list-style-type: none;'>";
            echo "<input type='text' style='width:20px; display:none;' id='" . $index['index'] . "' name='order[" . $index['index'] . "]' value='" . $index['sortOrder'] . "' />";
            echo '<div style="display: inline;" ' . (isSuperuser() ? 'class="trigger"' : 'class="trigger"') . ' index="' . $index['index'] . '" id="title' . $index['index'] . '" internal="' . $index['internal'] . '" onclick="togglediv(\'children' . $index['index'] . '\')"><b>' . $index['name'] . '</b>';
            echo '</div>';
            $content = "<span class='popup' id='span" . $index['index'] . "' style='display:none;margin-left:10px; '>";
            $content .= '<input type="button" value="Edit" onclick="javascript:newwindow(\'./editLink.php?id=' . $index['index'] . '&internal=' . $index['internal'] . '\')">';
            $content2 = '<input type="button" value="Delete" onclick="deleteLink(' . $index['index'] . ')">';
            $content2 .= "</span>";
            if (isSuperuser()) {
                echo $content . $content2;
            } else {
                $content .= "</span>";
                echo $content;
            }
            echo '<br/><br/>';
            echo '<div id="children' . $index['index'] . '" style="display:none;">';
            $nextLevel = linkPullChildren($index['index']);
            recursiveCall($nextLevel);
            echo '</div>';
            echo "</li>";
        } else {
            if (linkIsVisible($index['index'])) {
                echo '<li style="list-style-type: none;">';
                echo "<input type='text' style='width:20px;display:none;' id='" . $index['index'] . "' name='order[" . $index['index'] . "]' value='" . $index['sortOrder'] . "' />";
                echo "<span " . (isSuperuser() ? 'class="trigger"' : 'class="trigger"') . " id='" . $index['index'] . "span' index='" . $index['index'] . "'>" . $index['name'];
                echo "</span>";
                $content = "<span class='popup' id='span" . $index['index'] . "' style='display:none;margin-left:10px;'>";
                $content .= '<input type="button" value="Edit" onclick="javascript:newwindow(\'./editLink.php?id=' . $index['index'] . '\')">';
                $content2 = '<input type="button" value="Delete" onclick="deleteLink(' . $index['index'] . ')">';
                $content2 .= "</span>";
                if (isSuperuser()) {
                    echo $content . $content2;
                } else {
                    $content .= "</span>";
                    echo $content;
                }
                echo '<br/><br/>';
                echo '</li>';
            }
        }
    }
    echo "<ul>";
}