First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
require_once("include/globals.php");
|
||||
|
||||
// startLog("generic-form.php");
|
||||
|
||||
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
||||
header("Location: /");
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!array_key_exists('UserInfo', $_SESSION)) {
|
||||
$error_message = getLanguageText('ERRORMSG-INVALID-ACCESS');
|
||||
$naction = '';
|
||||
header("Location: /?action=$action&naction=$naction$headerArgs&form_message=" . urlencode($form_message) . "&error_message=" . urlencode($error_message));
|
||||
exit();
|
||||
}
|
||||
|
||||
//
|
||||
// Process all actions to list and edit records
|
||||
//
|
||||
if (array_key_exists('FormActionName', $_GET)) $FormActionName = db_escape_string($_GET['FormActionName']);
|
||||
if (!isset($FormActionName)) logExit("FormActionName not set");
|
||||
|
||||
|
||||
// Verify access is permitted
|
||||
$utype = $_SESSION['UserInfo']['type'];
|
||||
if ($utype != 'SuperUser') {
|
||||
$query = "SELECT * FROM _form_permission WHERE action_name = '$FormActionName' AND action_permission_user_type = '$utype'";
|
||||
writeLog($query);
|
||||
$results = db_query($query);
|
||||
if (db_num_rows($results) == 0) {
|
||||
$error_message = getLanguageText('ERRORMSG-ACCESS-DENIED');
|
||||
$naction = '';
|
||||
header("Location: /?action=$action&naction=$naction$headerArgs&form_message=" . urlencode($form_message) . "&error_message=" . urlencode($error_message));
|
||||
exit();
|
||||
}
|
||||
|
||||
$row = db_fetch_assoc($results);
|
||||
if ($row['action_permission_allowed'] != 'Y') {
|
||||
$error_message = getLanguageText('ERRORMSG-ACCESS-DENIED')." - N";
|
||||
$naction = '';
|
||||
header("Location: /?action=$action&naction=$naction$headerArgs&form_message=" . urlencode($form_message) . "&error_message=" . urlencode($error_message));
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Validate the form action
|
||||
$query = "SELECT * FROM _form_actions WHERE action_name = '$FormActionName'";
|
||||
writeLog($query);
|
||||
$results = db_query($query);
|
||||
|
||||
if (db_num_rows($results) == 0) {
|
||||
header("Location: /?error_message=".urlencode("Error: Invalid Code"));
|
||||
exit();
|
||||
}
|
||||
|
||||
$row = db_fetch_assoc($results);
|
||||
$templatePageTitle = $row['action_dialog_title'];
|
||||
if (strpos($templatePageTitle, 'TEXT-') === 0) $templatePageTitle = getLanguageText($templatePageTitle);
|
||||
if (strpos($templatePageTitle, 'GlobalText.') === 0) {
|
||||
$pindex = str_replace('GlobalText.','',$templatePageTitle);
|
||||
$templatePageTitle = $GlobalText[$pindex];
|
||||
}
|
||||
writeLog("templatePageTitle: $templatePageTitle");
|
||||
|
||||
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
writeLog("Here");
|
||||
|
||||
include "table-edit.php";
|
||||
|
||||
endTemplate();
|
||||
?>
|
||||
Reference in new issue
Block a user