/**
  * Constructor to initialize the Main Controller
  */
 public function __construct()
 {
     if (!self::$session_exists) {
         self::$session_exists = 1;
         session_start();
     }
     $this->smarty = new SmartyHackademic();
     $this->app_session = new Session();
     if ($this->isLoggedIn()) {
         $this->addToView('is_logged_in', true);
         $this->addToView('logged_in_user', $this->getLoggedInUser());
     }
     if ($this->isAdmin()) {
         $this->addToView('user_type', true);
     }
     $menu = FrontendMenuController::go();
     $this->addToView('main_menu', $menu);
     $challenge_menu = ChallengeMenuController::go();
     $this->addToView('challenge_menu', $challenge_menu);
     if ($this->isLoggedIn()) {
         $usermenu = UserMenuController::go();
         $this->addToView('user_menu', $usermenu);
     }
 }
Esempio n. 2
0
 *
 * The page for calling the Hackademic challenges in the frontend.
 * 
 * Copyright (c) 2012 OWASP
 *
 * LICENSE:
 *
 * This file is part of Hackademic CMS (https://www.owasp.org/index.php/OWASP_Hackademic_Challenges_Project).
 *
 * Hackademic CMS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any
 * later version.
 *
 * Hackademic CMS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with Hackademic CMS.  If not, see
 * <http://www.gnu.org/licenses/>.
 *
 *
 * @author Pragya Gupta <pragya18nsit[at]gmail[dot]com>
 * @author Konstantinos Papapanagiotou <conpap[at]gmail[dot]com>
 * @license http://www.gnu.org/licenses/gpl.html
 * @copyright 2012 OWASP
 *
 */
require_once "../init.php";
require_once HACKADEMIC_PATH . "controller/class.ChallengeMenuController.php";
$controller = new ChallengeMenuController();
echo $controller->go();