} else { echo '<!--U-->false'; exit; } } } if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn']) { if (isset($_GET['delete'])) { if (file_exists($_GET['delete'])) { unlink($_GET['delete']); exit; } } elseif (isset($_GET['oldName'])) { if (file_exists($_GET['oldName'])) { //echo '<!--MSG-->Attempting rename'; rename($_GET['oldName'], fileSafe($_GET['newName'])); //echo '<!--MSG-->Renamed "'.$_GET['oldName'].'" to "'.fileSafe($_GET['newName']).'".'; exit; } } elseif (isset($_GET['imageProp'])) { $f = $_GET['imageProp']; if (file_exists($f)) { $s = getimagesize($f); echo '<!--P--><table class="imageProp" align="left" cellpadding="2" cellspacing="0" border="0"> <tr><th colspan="2">Image Properties</th></tr> <tr><td class="imagePropTitle">Image Title:</td><td id="imageTitle">' . substr($f, 0, strrpos($f, '.')) . '</td></tr> <tr><td class="imagePropTitle">Image Size:</td><td id="imageSize">' . (string) round(filesize($f) / 1024, 2) . 'kb</td></tr> <tr><td class="imagePropTitle">Image Dimensions:</td><td id="imageDim">' . $s[0] . ' x ' . $s[1] . '</td></tr> <tr><td class="imagePropTitle">Last Modified:</td><td id="imageMod">' . date("F j, Y, g:i a", filemtime($f)) . '</td></tr> <tr><td class="imagePropTitle">Creation Date:</td><td id="imageCrate">' . date("F j, Y, g:i a", filectime($f)) . '</td></tr> </table>';
$files = json_decode("{\"{$file}\":1}"); $prefix = ''; } else { $files = json_decode(Get_Values('json')); $prefix = 'Scan_'; } foreach ($files as $file => $val) { $file = fileSafe($prefix . $file); include "res/inc/view.php"; } echo '<script type="text/javascript">disableIcons();</script>'; Footer(''); } else { if ($PAGE == "Edit") { InsertHeader("Edit Image"); $file = fileSafe(Get_Values('file')); if ($file != null) { if (substr($file, -3) == "txt") { include "res/inc/edit-text.php"; } else { if (Get_Values('edit') != null) { if (file_exists("scans/file/Scan_{$file}")) { $langs = findLangs(); if (!validNum(array($WIDTH, $HEIGHT, $X_1, $Y_1, $BRIGHT, $CONTRAST, $SCALE, $ROTATE)) || $FILETYPE !== "txt" && $FILETYPE !== "png" && $FILETYPE !== "tiff" && $FILETYPE !== "jpg" || !in_array($LANG, $langs)) { Print_Message("No, you can not do that", "Input data is invalid and most likely an attempt to run malicious code on the server <i>denied</i>", 'center'); Footer(''); quit(); } $tmpFileRaw = "/tmp/Scan_{$file}"; $fileRaw = "scans/file/Scan_{$file}"; if (!@copy($fileRaw, $tmpFileRaw)) {