Ejemplo n.º 1
0
 static function logout()
 {
     Authentication::session_start();
     session_unset();
     session_destroy();
     setcookie("Justitia", "", time() - 3600, "/");
 }
Ejemplo n.º 2
0
    function write()
    {
        Authentication::session_start();
        // we need the current user later
        $base = htmlspecialchars(Util::base_url());
        $title = htmlspecialchars($this->title());
        header('Content-Type: text/html; charset=UTF-8');
        ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title><?php 
        echo $title;
        ?>
 - <?php 
        echo $this->app_name();
        ?>
</title>
    <link rel="stylesheet" type="text/css" href="<?php 
        echo $base;
        ?>
style/style.css">
    <link rel="stylesheet" type="text/css" href="<?php 
        echo $base;
        ?>
style/jquery.autocomplete.css">
    <link rel="shortcut icon" href="<?php 
        echo $base;
        ?>
style/favicon.png">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript" src="<?php 
        echo $base;
        ?>
style/jquery.autocomplete.js"></script>
    <script type="text/javascript" src="<?php 
        echo $base;
        ?>
style/script.js"></script>
    <base href="<?php 
        echo $base;
        ?>
">
  </head>
  <body<?php 
        if ($this->is_admin_page) {
            echo ' class="admin"';
        }
        ?>
>
    <div id="header">
      <div id="appname"><?php 
        echo $this->app_name();
        ?>
, <small>Programming Judge</small></div>
      <?php 
        $this->write_user_header();
        ?>
    </div>
    <div id="tabbar">
      <?php 
        $this->write_tabbar();
        ?>
    </div>
    <div id="nav-wrap">
      <?php 
        $this->write_nav();
        ?>
    </div>
    <div id="main">
      <h1><?php 
        echo $title;
        ?>
</h1>
      <?php 
        $this->write_rejudge_all();
        ?>
      <?php 
        $this->write_body();
        ?>
    </div>
  </body>
</html>
<?php 
    }
Ejemplo n.º 3
0
 private static function start_session()
 {
     Authentication::session_start();
     if (!isset($_SESSION['usergroup'])) {
         // not set, initialize
         $_SESSION['usergroup'] = array();
     }
 }