$mbrid = trim($_POST["mbrid"]); $mbrQ = new MemberQuery(); $mbr = $mbrQ->get($mbrid); $postVars = $_POST; $pageErrors = array(); function checkerror($field, $err) { global $mbrid, $postVars, $pageErrors; if (!$err) { return; } $pageErrors[$field] = $err->toStr(); $_SESSION["postVars"] = $postVars; $_SESSION["pageErrors"] = $pageErrors; header("Location: ../circ/mbr_view.php?mbrid=" . U($mbrid)); exit; } $circQ = new CircQuery(); if (isset($_POST['date_from']) && isset($_POST['dueDate']) && $_POST['date_from'] == 'override') { list($dueDate, $err) = Date::read_e($_POST['dueDate']); checkerror('dueDate', $err); $_SESSION['due_date_override'] = $_POST['dueDate']; $err = $circQ->checkout_due_e($mbr->getBarcodeNmbr(), $barcode, $dueDate); checkerror('barcodeNmbr', $err); } else { $err = $circQ->checkout_e($mbr->getBarcodeNmbr(), $barcode); checkerror('barcodeNmbr', $err); } unset($_SESSION["postVars"]); unset($_SESSION["pageErrors"]); header("Location: ../circ/mbr_view.php?mbrid=" . U($mbrid));
} echo "OK\n"; echo "Saving it... "; if ($dom->save($ac['srcdir'] . '/version.xml')) { echo "OK\n"; } else { echo "FAIL!\n"; } } globbetyglob("{$ac['basedir']}/scripts", 'make_scripts_executable'); $redir = $ac['quiet'] == 'yes' ? ' > ' . (is_windows() ? 'nul' : '/dev/null') : ''; quietechorun("\"{$ac['PHP']}\" -q \"{$ac['basedir']}/scripts/file-entities.php\"{$redir}"); checking("for if we should generate a simplified file"); if ($ac["GENERATE"] != "no") { if (!file_exists($ac["GENERATE"])) { checkerror("Can't find {$ac["GENERATE"]}"); } $tmp = realpath($ac["GENERATE"]); $ac["GENERATE"] = str_replace($ac["ROOTDIR"] . $ac["LANGDIR"], "", $tmp); $str = "\n<!ENTITY developer.include.file SYSTEM 'file:///{$ac["GENERATE"]}'>"; file_put_contents("{$ac["basedir"]}/entities/file-entities.ent", $str, FILE_APPEND); $ac["INPUT_FILENAME"] = "developer.template.xml"; $ac["FORCE_DOM_SAVE"] = "yes"; } checkvalue($ac["GENERATE"]); checking('whether to save an invalid .manual.xml'); checkvalue($ac['FORCE_DOM_SAVE']); echo "Loading and parsing {$ac["INPUT_FILENAME"]}... "; flush(); $dom = new DOMDocument(); // realpath() is important: omitting it causes severe performance degradation
checkerror(6); } } else { if ($_REQUEST['action'] == "exists") { $path = getpath(); if (file_exists($path)) { //yes } else { checkerror(6); } } else { if ($_REQUEST['action'] == "md5") { $path = getpath(); if (file_exists($path)) { echo substr(shell_exec('md5sum ' . $path), 0, 32); } else { checkerror(6); } } else { http_response_code(500); echo 'unknown method'; } } } } } } } ?>