if (!isset($_POST['priority']) || !isset($_POST['type'])) { echo "Invalid Post Data"; return; } $sysId = ''; $passy = ''; if (isset($_POST['sysId'])) { $sysId = $_POST['sysId']; } if (isset($_SESSION['servNowPass'])) { $passy = passDecrypt(urldecode($_SESSION['servNowPass'])); } $ticketEntry = ''; $type = $_POST['type']; if ($type == 'New') { newEntry($_POST); $ticketEntry = "Sent an Executive Notification regarding this issue: <br/><br/>NEW:" . $_POST['desc']; } else { if ($type == 'Update') { updateEntry($_POST); $ticketEntry = "Sent an Executive Notification regarding this issue: <br/><br/>" . $_POST['update']; } else { if ($type == 'Resolve') { resolved($_POST); $ticketEntry = "Sent an Executive Notification with the resolution: <br/><br/>" . $_POST['update']; } else { if ($type == 'New/Resolve') { newResolved($_POST); $ticketEntry = "Sent a New/Resolve Executive Notification with the resolution: <br/><br/>" . $_POST['update']; } else { if ($type == "Re-open") {
while ($row = @mysqli_fetch_assoc($result)) { echo "\t" . $row['gps_type_id'] . ": " . $row['gps_type_name'] . "<br>\n"; } echo "<br>\n"; echo "<b>GPS Paths:</b><br>\n"; $typeSql = "select gps_path_id, gps_path_name from gps_path order by gps_path_id"; $result = mysqli_query($con, $typeSql); while ($row = @mysqli_fetch_assoc($result)) { echo "\t" . $row['gps_path_id'] . ": " . $row['gps_path_name'] . "<br>\n"; } echo "<br>\n"; echo "<b>Marker Status:</b><br>\n"; echo "\t*: Default\n<br>"; echo "\tH: Hidden\n<br>"; echo "\tP: Path Only\n<br>"; echo "<br>\n"; } if (isset($_GET['key']) && $_GET['key'] == phpGPS_Settings::$_secretKey) { if (isset($_GET["newEntry"]) && $_GET["newEntry"] == "Y") { echo "New Entry<br /><br />\n"; newEntry($con); } else { if (isset($_GET["help"])) { showHelp($con); } else { echo "Invalid Option"; } } } else { echo "Invalid Key!"; }
} } $admin_req = isset($_REQUEST['perform']) ? strtolower($_REQUEST['perform']) : null; $login_status = getLoginState($get); if ($login_status["status"] !== true) { $login_status["error"] = "Invalid user"; $login_status["human_error"] = "You're not logged in as a valid user to edit this. Please log in and try again."; returnAjax($login_status); } switch ($admin_req) { # Stuff case "save": returnAjax(saveEntry($_REQUEST)); break; case "new": returnAjax(newEntry($_REQUEST)); break; case "delete": returnAjax(deleteEntry($_REQUEST)); break; default: returnAjax(getLoginState($_REQUEST, true)); } function saveEntry($get) { /*** * Save a new taxon entry ***/ $data64 = $get["data"]; $enc = strtr($data64, '-_', '+/'); $enc = chunk_split(preg_replace('!\\015\\012|\\015|\\012!', '', $enc));
<?php $out = array(); require 'header.php'; if (isGET('draft') && isAdmin() && isValidEntry('drafts', GET('draft'))) { $draft = GET('draft'); if (check('title') && check('content') && check('id')) { $post = newEntry(cleanMagic($_POST['id'])); $postEntry['title'] = clean(cleanMagic($_POST['title'])); $postEntry['content'] = cleanMagic($_POST['content']); $postEntry['locked'] = $_POST['locked'] === 'yes'; $addedTags = $_POST['tags'] ? $_POST['tags'] : array(); $postEntry['tags'] = $addedTags; saveEntry('posts', $post, $postEntry); foreach ($addedTags as $tag) { $tagEntry = readEntry('tags', $tag); $tagEntry['posts'][$post] = $post; saveEntry('tags', $tag, $tagEntry); } deleteEntry('drafts', $draft); redirect('view.php?post=' . $post); } else { $draftEntry = readEntry('drafts', $draft); $tagOptions = array(); foreach (listEntry('tags') as $tag) { $tagEntry = readEntry('tags', $tag); $tagOptions[$tag] = $tagEntry['name']; } $out['title'] = $lang['publishPost'] . ': ' . $draftEntry['title']; $out['content'] .= '<form action="./publish.php?draft=' . $draft . '" method="post"> <p>' . text('title', $draftEntry['title']) . '</p>
saveEntry('links', newEntry(), $linkEntry); home(); } else { $out['title'] = $lang['addLink']; $out['content'] .= '<form action="./add.php?link" method="post"> <p>' . text('name') . '</p> <p>' . text('url') . '</p> <p>' . submitAdmin($lang['confirm']) . '</p> </form>'; } } else { if (isGET('tag') && isAdmin()) { if (check('name')) { $tagEntry['name'] = clean(cleanMagic($_POST['name'])); $tagEntry['posts'] = array(); saveEntry('tags', newEntry(), $tagEntry); home(); } else { $out['title'] = $lang['addTag']; $out['content'] .= '<form action="./add.php?tag" method="post"> <p>' . text('name') . '</p> <p>' . submitAdmin($lang['confirm']) . '</p> </form>'; } } else { home(); } } } } require 'templates/page.php';