Files
HotLunches/FormPermission.php
2026-10-19 15:22:52 -07:00

58 lines
1.3 KiB
PHP

<?php
require_once("include/globals.php");
if (SessionActive() != 1 || ! UserLoggedIn()) {
header("Location: /");
exit();
}
//
// Process all actions to list and edit records
//
// Start the template and output buffering
startTemplate();
// Ensure that only valid user types have access to this module
$AllowedUserTypes = array('SuperUser');
if (checkPermission($AllowedUserTypes) != 1) {
$error_message = getLanguageText('ERRORMSG-ACCESS-DENIED');
include "form.messages.php";
endTemplate();
exit();
}
// Get parameters
$fanum = 0;
if (array_key_exists('formaction', $_GET)) $fanum = intval($_GET['formaction']);
if ($fanum == 0) {
logExit("Form Action Number not set");
}
$action_name = db_getVal("SELECT action_name FROM _form_actions WHERE record_num = $fanum");
if (!$action_name) logExit("Invalid Form Action Number parameter");
$TitleText = "Form Permission Management - $action_name";
$templatePageTitle = $TitleText;
//
// Setup generic table processing
//
$FormActionName = "form-permission";
$TableName = "_form_permission";
$ListTableName = "form-permission";
$SequenceFlag = 'Y';
$DialogTitle = $TitleText;
$SearchField = 'none';
$CustomData = "&action_name=$action_name";
include "table-edit.php";
endTemplate();
?>