Exemple #1
0
 public function forceLogout($uid)
 {
     $user = User::getById($uid, gGetDb());
     if ($user->getForceLogout() == "1") {
         $_SESSION = array();
         if (isset($_COOKIE[session_name()])) {
             setcookie(session_name(), '', time() - 42000, '/');
         }
         session_destroy();
         BootstrapSkin::displayInternalHeader();
         echo "You have been forcibly logged out, probably due to being renamed. Please log back in.";
         BootstrapSkin::displayAlertBox("You have been forcibly logged out, probably due to being renamed. Please log back in.", "alert-error", "Logged out", true, false);
         $user->setForceLogout(0);
         $user->save();
         BootstrapSkin::displayInternalFooter();
         die;
     }
 }
Exemple #2
0
 /**
  * Shows the statistics page.
  */
 public function Show()
 {
     // Get the needed objects.
     // fetch and show page header
     global $dontUseWikiDb;
     BootstrapSkin::displayInternalHeader();
     if ($this->requiresWikiDatabase() && $dontUseWikiDb == 1) {
         // wiki database unavailable, don't show stats page
         BootstrapSkin::displayAlertBox("This statistics page is currently unavailable.", "alert-error", "Database unavailable", true, false);
         BootstrapSkin::displayInternalFooter();
         die;
     }
     // wiki database available OR stats page doesn't need wiki database
     // check protection level
     if ($this->isProtected()) {
         if (User::getCurrent()->isCommunityUser()) {
             showlogin();
             BootstrapSkin::displayInternalFooter();
             die;
         }
         $session = new session();
         $session->checksecurity();
     }
     // not protected or access allowed
     echo '<div class="page-header"><h1>' . $this->getPageTitle() . '</h1></div>';
     if ($this->requiresSimpleHtmlEnvironment()) {
         echo '<div class="row-fluid"><div class="span12">';
         BootstrapSkin::pushTagStack("</div>");
         BootstrapSkin::pushTagStack("</div>");
     }
     echo $this->execute();
     // Display the footer of the interface.
     BootstrapSkin::displayInternalFooter();
 }
Exemple #3
0
 /**
  * Shows the statistics page.
  */
 public function Show()
 {
     // Get the needed objects.
     // fetch and show page header
     global $dontUseWikiDb, $session;
     BootstrapSkin::displayInternalHeader();
     if ($this->requiresWikiDatabase() && $dontUseWikiDb == 1) {
         // wiki database unavailable, don't show stats page
         BootstrapSkin::displayAlertBox("This statistics page is currently unavailable.", "alert-error", "Database unavailable", true, false);
         BootstrapSkin::displayInternalFooter();
         die;
     }
     // wiki database available OR stats page doesn't need wiki database
     // check protection level
     if ($this->isProtected()) {
         // protected, check accesslevel.
         $sessionuser = isset($_SESSION['user']) ? $_SESSION['user'] : "";
         if (!($session->hasright($sessionuser, "Admin") || $session->hasright($sessionuser, "User"))) {
             // not authed
             showlogin();
             BootstrapSkin::displayInternalFooter();
             die;
         }
     }
     // not protected or access allowed
     echo '<div class="page-header"><h1>' . $this->getPageTitle() . '</h1></div>';
     if ($this->requiresSimpleHtmlEnvironment()) {
         echo '<div class="row-fluid"><div class="span12">';
         BootstrapSkin::pushTagStack("</div>");
         BootstrapSkin::pushTagStack("</div>");
     }
     echo $this->execute();
     // Display the footer of the interface.
     BootstrapSkin::displayInternalFooter();
 }
Exemple #4
0
// Get all the classes.
require_once 'functions.php';
require_once 'includes/PdoDatabase.php';
require_once 'includes/SmartyInit.php';
// Check to see if the database is unavailable.
// Uses the false variable as its the internal interface.
if (Offline::isOffline()) {
    echo Offline::getOfflineMessage(false);
    die;
}
if (isset($_SESSION['user'])) {
    $sessionuser = $_SESSION['user'];
} else {
    $sessionuser = "";
}
BootstrapSkin::displayInternalHeader();
// protect against logged out users
if (User::getCurrent()->isCommunityUser()) {
    showlogin();
    BootstrapSkin::displayInternalFooter();
    die;
}
///////////////// Page code
$smarty->display("search/header.tpl");
BootstrapSkin::pushTagStack("</div>");
// span12
BootstrapSkin::pushTagStack("</div>");
// row
if (isset($_GET['term']) && isset($_GET['type'])) {
    $term = $_GET['term'];
    if ($term == "" || $term == "%") {