예제 #1
0
 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;
     }
 }
예제 #2
0
 /**
  * Summary of displayInternalHeader
  */
 public static function displayInternalHeader()
 {
     // userid
     // username
     // sitenotice
     global $smarty, $session;
     $userid = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0;
     $user = isset($_SESSION['user']) ? $_SESSION['user'] : "";
     $sitenotice = InterfaceMessage::get(InterfaceMessage::SITENOTICE);
     $smarty->assign("userid", $userid);
     $smarty->assign("username", $user);
     $smarty->assign("sitenotice", $sitenotice);
     $smarty->assign("alerts", SessionAlert::retrieve());
     $smarty->display("header-internal.tpl");
     if ($userid != 0) {
         User::getCurrent()->touchLastLogin();
         $session->forceLogout($_SESSION['userID']);
     }
 }
예제 #3
0
파일: acc.php 프로젝트: FastLizard4/waca
     $smarty->assign("message", $message);
     $smarty->assign("readonly", true);
     $smarty->display("message-management/editform.tpl");
     BootstrapSkin::displayInternalFooter();
     die;
 }
 if (isset($_GET['edit'])) {
     if (!(User::getCurrent()->isAdmin() || User::getCurrent()->isCheckuser())) {
         BootstrapSkin::displayAccessDenied();
         BootstrapSkin::displayInternalFooter();
         die;
     }
     $database = gGetDb();
     $database->transactionally(function () use($database) {
         global $smarty;
         $message = InterfaceMessage::getById($_GET['edit'], $database);
         if ($message == false) {
             throw new TransactionException("Unable to find specified message", "Error");
         }
         if (isset($_GET['submit'])) {
             $message->setContent($_POST['mailtext']);
             $message->setDescription($_POST['maildesc']);
             $message->save();
             Logger::interfaceMessageEdited(gGetDb(), $message);
             $smarty->assign("message", $message);
             $smarty->display("message-management/alert-editsuccess.tpl");
             Notification::interfaceMessageEdited($message);
             BootstrapSkin::displayInternalFooter();
             return;
         }
         $smarty->assign("message", $message);
예제 #4
0
 /**
  * Summary of interfaceMessageEdited
  * @param InterfaceMessage $message
  */
 public static function interfaceMessageEdited(InterfaceMessage $message)
 {
     self::send("Message {$message->getDescription()} ({$message->getId()}) edited by " . User::getCurrent()->getUsername());
 }