Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
*/
if ($dss_userId == 0) {
    header("Location: /index.php");
    exit;
}
/* Keep track of the char the user is viewing. */
if (trim($_REQUEST["char"]) != "") {
    superstore_save("workgroup_list", $dss_sessionCookie, "char", $_REQUEST["char"]);
}
$char = superstore_fetch("workgroup_list", $dss_sessionCookie, "char");
require "resources/header.php";
?>
				<h2>Workgroups</h2>
				<?php 
displayMessages($_REQUEST["infoMessage"], $_REQUEST["errorMessage"], $required);
if ($dss_accessLevel > 0) {
    ?>
				<a href="workgroup_edit.php"><img src="/resources/add.png" border="0" alt="Add new workgroup" title="Add new workgroup"></a>
<?php 
    $char = displayAlphaBar("workgroup", "name", "", $char, $dss_displayListSize);
} else {
    $char = displayAlphaBar("workgroup a, workgroupUser b", "a.name", "WHERE b.userId={$dss_userId} AND b.workgroupId=a.id", $char, $dss_displayListSize);
}
?>
				<table class="listing">
}
if (trim($_REQUEST["workgroupId"]) != "") {
    $dss_currentWorkgroup = $_REQUEST["workgroupId"];
    db_query("UPDATE session SET currentWorkgroup=" . escapeValue($dss_currentWorkgroup) . " WHERE id=" . escapeQuote($dss_sessionCookie));
}
$workgroupResult = db_fetch(db_query("SELECT name FROM workgroup WHERE id={$dss_currentWorkgroup}"));
/* Keep track of the char & page number the user is viewing. */
if (trim($_REQUEST["char"]) != "") {
    superstore_save("{$dss_currentWorkgroup}", $dss_sessionCookie, "char", $_REQUEST["char"]);
    superstore_save("{$dss_currentWorkgroup}", $dss_sessionCookie, "currentPage", 0);
}
if (trim($_REQUEST["currentPage"]) != "") {
    superstore_save("{$dss_currentWorkgroup}", $dss_sessionCookie, "currentPage", $_REQUEST["currentPage"]);
}
$char = superstore_fetch("{$dss_currentWorkgroup}", $dss_sessionCookie, "char");
$currentPage = escapeValue(superstore_fetch("{$dss_currentWorkgroup}", $dss_sessionCookie, "currentPage"));
require "resources/header.php";
?>
				<h2>Projects for <?php 
echo $workgroupResult["name"];
?>
</h2>
				<?php 
displayMessages($_REQUEST["infoMessage"], $_REQUEST["errorMessage"], $required);
if ($dss_numWorkgroups > 1 || $dss_accessLevel > 0) {
    ?>
				<a href="workgroup_list.php"><img src="/resources/cancel.png" border="0" alt="Return to workgroup list" title="Return to workgroup list"></a>
<?php 
}
?>
				<a href="project_add.php"><img src="/resources/add.png" border="0" alt="Add new project" title="Add new project"></a>
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
*/
if ($dss_userId == 0 || $dss_accessLevel < 2) {
    header("Location: /index.php");
    exit;
}
/* Keep track of the char the user is viewing. */
if (trim($_REQUEST["char"]) != "") {
    superstore_save("user_list.php", $dss_sessionCookie, "char", $_REQUEST["char"]);
}
$char = superstore_fetch("user_list.php", $dss_sessionCookie, "char");
require "resources/header.php";
?>
				<h2>Users</h2>
				<?php 
displayMessages($_REQUEST["infoMessage"], $_REQUEST["errorMessage"], $required);
?>
				<a href="admin.php"><img src="/resources/cancel.png" border="0" alt="Return to admin tools" title="Return to admin tools"></a>
				<a href="user_edit.php"><img src="/resources/add.png" border="0" alt="Add new user" title="Add new user"></a>
				<?php 
$char = displayAlphaBar("user", "lastName", "", $char, $dss_displayListSize);
?>
				<table class="listing">
					<tr><th>Name</th><th>Access Level</th><th>Last Login</th></tr>
<?php 
$where = "";
    if ($_POST["resetButton"] != "") {
        superstore_save("SEARCH", $dss_sessionCookie, $thisField, '');
        superstore_save("SEARCH", $dss_sessionCookie, $thisCondition, '');
        superstore_save("SEARCH", $dss_sessionCookie, $thisValue, '');
        superstore_save("SEARCH", $dss_sessionCookie, "currentPage", 0);
        $currentPage = 0;
    } elseif ($_POST["searchButton"] != "") {
        superstore_save("SEARCH", $dss_sessionCookie, $thisField, $_POST[$thisField]);
        superstore_save("SEARCH", $dss_sessionCookie, $thisCondition, $_POST[$thisCondition]);
        superstore_save("SEARCH", $dss_sessionCookie, $thisValue, $_POST[$thisValue]);
        superstore_save("SEARCH", $dss_sessionCookie, "currentPage", 0);
        $currentPage = 0;
    }
    $fieldArray[$i] = superstore_fetch("SEARCH", $dss_sessionCookie, $thisField);
    $conditionArray[$i] = superstore_fetch("SEARCH", $dss_sessionCookie, $thisCondition);
    $valueArray[$i] = superstore_fetch("SEARCH", $dss_sessionCookie, $thisValue);
}
$dss_onLoad = "document.main.value0.focus()";
require "resources/header.php";
?>
				<h2>Search</h2>
				<form action="search.php" method="post" name="main">
<?php 
for ($i = 0; $i < 5; $i++) {
    ?>
					<div id="row<?php 
    echo $i;
    ?>
" style="<?php 
    if ($i > 0 && $valueArray[$i] == '') {
        echo 'display:none';
            db_query("UPDATE item SET checksumCorrect=1,checksumChecked=" . date("U") . " WHERE id=" . $itemResult["id"]);
            $checksumLastChecked = date("U");
            $checksumStatus = 1;
        } else {
            $checksumStatus = 0;
        }
    } else {
        $checksumStatus = 1;
    }
} else {
    $checksumStatus = 0;
}
/* Find the previous and next items and provide links to them. */
$previousLinkId = 0;
$nextLinkId = 0;
$char = superstore_fetch("{$dss_currentWorkgroup}.{$dss_currentProject}", $dss_sessionCookie, "char");
if (trim($char) == "") {
    $char = "all";
}
$where = "WHERE projectId={$dss_currentProject}";
if ($char == "#") {
    $where .= " AND left(title,1)>='0' AND left(title,1)<='9'";
} elseif ($char != "all") {
    $where .= " AND left(title,1)='{$char}'";
}
$linkQuery = db_query("SELECT id FROM item {$where} ORDER BY title");
$found = 0;
while ($linkResult = db_fetch($linkQuery)) {
    if ($linkResult["id"] == $itemId) {
        $found = 1;
    }
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
*/
if ($dss_userId == 0 || $dss_accessLevel < 2) {
    header("Location: /index.php");
    exit;
}
/* Keep track of the char the user is viewing. */
if (trim($_REQUEST["char"]) != "") {
    superstore_save("filetype_list.php", $dss_sessionCookie, "char", $_REQUEST["char"]);
}
$char = superstore_fetch("filetype_list.php", $dss_sessionCookie, "char");
require "resources/header.php";
?>
				<h2>Acceptable Filetypes</h2>
				<?php 
displayMessages($_REQUEST["infoMessage"], $_REQUEST["errorMessage"], $required);
?>
				<a href="admin.php"><img src="/resources/cancel.png" border="0" alt="Return to admin tools" title="Return to admin tools"></a>
				<a href="filetype_edit.php"><img src="/resources/add.png" border="0" alt="Add new filetype" title="Add new filetype"></a>
				<?php 
$char = displayAlphaBar("filetype", "extension", "", $char, $dss_displayListSize);
?>
				<table class="listing">
					<tr><th>Extension</th><th>MIME Type</th></tr>
<?php 
$where = "";
}
if (trim($_REQUEST["submit_button"]) != "") {
    superstore_save("report_audit_list", $dss_sessionCookie, "action", $_REQUEST["action"]);
    superstore_save("report_audit_list", $dss_sessionCookie, "actionByUserId", $_REQUEST["actionByUserId"]);
    superstore_save("report_audit_list", $dss_sessionCookie, "workgroupName", $_REQUEST["workgroupName"]);
    superstore_save("report_audit_list", $dss_sessionCookie, "projectName", $_REQUEST["projectName"]);
} elseif (trim($_REQUEST["reset_button"]) != "") {
    superstore_save("report_audit_list", $dss_sessionCookie, "action", "");
    superstore_save("report_audit_list", $dss_sessionCookie, "actionByUserId", "");
    superstore_save("report_audit_list", $dss_sessionCookie, "workgroupName", "");
    superstore_save("report_audit_list", $dss_sessionCookie, "projectName", "");
}
$action = superstore_fetch("report_audit_list", $dss_sessionCookie, "action");
$actionByUserId = superstore_fetch("report_audit_list", $dss_sessionCookie, "actionByUserId");
$workgroupName = superstore_fetch("report_audit_list", $dss_sessionCookie, "workgroupName");
$projectName = superstore_fetch("report_audit_list", $dss_sessionCookie, "projectName");
require "resources/header.php";
?>
				<h2>Audit Log Review</h2>
				<a href="report_list.php"><img src="/resources/cancel.png" border="0" alt="Return to the report list" title="Return to the report list"></a>
				<form action="report_audit_list.php" method="post" style="padding: 10px 0 10px 0">
					Limit to
					<select name="action">
						<option value="">Any</option>
<?php 
$query = db_query("SELECT action FROM auditlog GROUP BY action ORDER BY action");
while ($result = db_fetch($query)) {
    ?>
						<option value="<?php 
    echo $result["action"];
    ?>