public function isTOR() { // Checks whether the IP is of the TOR network. $toruser = $this->checktor($_SERVER['REMOTE_ADDR']); // Checks whether the tor field in the array is said to yes. if ($toruser['tor'] == "yes") { // Gets message to display to the user. $message = InterfaceMessage::get(InterfaceMessage::DECL_BANNED); // Displays the appropiate message to the user. echo "{$message}<strong><a href=\"https://en.wikipedia.org/wiki/Tor_%28anonymity_network%29\">TOR</a> nodes are not permitted to use this tool, due to abuse.</strong><br /></div>\n"; // Display the footer of the interface. BootstrapSkin::displayPublicFooter(); // we probably want to output ob_end_flush(); // Terminates the current script, as the user is banned. // This is done because the requesting process should be stopped. die; } }
$smarty->display("request/request-form.tpl"); } else { if ($enableEmailConfirm == 1) { $request->generateEmailConfirmationHash(); $database->transactionally(function () use($request) { $request->save(); // checksum depends on the ID, so we have to save again! $request->updateChecksum(); $request->save(); }); $request->sendConfirmationEmail(); $smarty->display("request/email-confirmation.tpl"); } else { $request->setEmailConfirm(0); // Since it can't be null $database->transactionally(function () use($request) { $request->save(); $request->updateChecksum(); $request->save(); }); $smarty->display("request/email-confirmed.tpl"); Notification::requestReceived($request); BootstrapSkin::displayPublicFooter(); } } BootstrapSkin::displayPublicFooter(); } else { $smarty->display("request/request-form.tpl"); BootstrapSkin::displayPublicFooter(); } }
/** * Summary of transactionally * @param Closure $method */ public function transactionally($method) { if (!$this->beginTransaction()) { BootstrapSkin::displayAlertBox("Error starting database transaction.", "alert-error", "Database transaction error", true, false); BootstrapSkin::displayInternalFooter(); die; } try { $method(); $this->commit(); } catch (TransactionException $ex) { $this->rollBack(); BootstrapSkin::displayAlertBox($ex->getMessage(), $ex->getAlertType(), $ex->getTitle(), true, false); // TODO: yuk. if (defined("PUBLICMODE")) { BootstrapSkin::displayPublicFooter(); } else { BootstrapSkin::displayInternalFooter(); } die; } }