root/wifidogadmin/wifidog/index.php
| Revision 479, 4.0 kB (checked in by insultant, 8 months ago) |
|---|
| Line | |
|---|---|
| 1 | <?php |
| 2 | |
| 3 | /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
| 4 | |
| 5 | // +-------------------------------------------------------------------+ |
| 6 | // | WiFiDog Authentication Server | |
| 7 | // | ============================= | |
| 8 | // | | |
| 9 | // | The WiFiDog Authentication Server is part of the WiFiDog captive | |
| 10 | // | portal suite. | |
| 11 | // +-------------------------------------------------------------------+ |
| 12 | // | PHP version 5 required. | |
| 13 | // +-------------------------------------------------------------------+ |
| 14 | // | Homepage: http://www.wifidog.org/ | |
| 15 | // | Source Forge: http://sourceforge.net/projects/wifidog/ | |
| 16 | // +-------------------------------------------------------------------+ |
| 17 | // | This program is free software; you can redistribute it and/or | |
| 18 | // | modify it under the terms of the GNU General Public License as | |
| 19 | // | published by the Free Software Foundation; either version 2 of | |
| 20 | // | the License, or (at your option) any later version. | |
| 21 | // | | |
| 22 | // | This program is distributed in the hope that it will be useful, | |
| 23 | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 24 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 25 | // | GNU General Public License for more details. | |
| 26 | // | | |
| 27 | // | You should have received a copy of the GNU General Public License | |
| 28 | // | along with this program; if not, contact: | |
| 29 | // | | |
| 30 | // | Free Software Foundation Voice: +1-617-542-5942 | |
| 31 | // | 59 Temple Place - Suite 330 Fax: +1-617-542-2652 | |
| 32 | // | Boston, MA 02111-1307, USA gnu@gnu.org | |
| 33 | // | | |
| 34 | // +-------------------------------------------------------------------+ |
| 35 | |
| 36 | /** |
| 37 | * WiFiDog Authentication Server home page |
| 38 | * |
| 39 | * @package WiFiDogAuthServer |
| 40 | * @author Benoit Grégoire <bock@step.polymtl.ca> |
| 41 | * @author Max Horváth <max.horvath@freenet.de> |
| 42 | * @copyright 2004-2006 Benoit Grégoire, Technologies Coeus inc. |
| 43 | * @copyright 2006 Max Horváth, Horvath Web Consulting |
| 44 | * @version Subversion $Id: index.php 1253 2007-07-16 05:11:27Z benoitg $ |
| 45 | * @link http://www.wifidog.org/ |
| 46 | */ |
| 47 | |
| 48 | /** |
| 49 | * Don't change the first require_once() as we didn't add WiFiDogs installation |
| 50 | * path to the global include_path variable of PHP, yet! |
| 51 | */ |
| 52 | require_once(dirname(__FILE__) . '/include/common.php'); |
| 53 | |
| 54 | require_once('classes/MainUI.php'); |
| 55 | require_once('classes/Network.php'); |
| 56 | require_once('classes/Node.php'); |
| 57 | require_once('classes/User.php'); |
| 58 | |
| 59 | $smarty = SmartyWifidog::getObject(); |
| 60 | |
| 61 | // Init ALL smarty values |
| 62 | $smarty->assign('googleMapsEnabled', false); |
| 63 | |
| 64 | // Get information about network |
| 65 | $network = Network::getCurrentNetwork(); |
| 66 | |
| 67 | /* |
| 68 | * Main content |
| 69 | */ |
| 70 | // Set section of Smarty template |
| 71 | $smarty->assign('sectionMAINCONTENT', true); |
| 72 | |
| 73 | // Set Google maps information |
| 74 | $smarty->assign('googleMapsEnabled', defined('GMAPS_HOTSPOTS_MAP_ENABLED') && GMAPS_HOTSPOTS_MAP_ENABLED); |
| 75 | |
| 76 | $net = Network::getCurrentNetwork(); |
| 77 | $smarty->assign('networkNumValidUsers', $net ? $net->getNumValidUsers() : 0); |
| 78 | |
| 79 | // Compile HTML code |
| 80 | $html_body = $smarty->fetch("templates/sites/index.tpl"); |
| 81 | |
| 82 | $currentNode = Node::getCurrentRealNode(); |
| 83 | if($currentNode){ |
| 84 | header("Location: ".BASE_URL_PATH."portal/?node_id=".$currentNode->getId()); |
| 85 | exit(); |
| 86 | } |
| 87 | /* |
| 88 | * Render output |
| 89 | */ |
| 90 | $ui = MainUI::getObject(); |
| 91 | $ui->addContent('main_area_top', $html_body); |
| 92 | $ui->display(); |
| 93 | |
| 94 | /* |
| 95 | * Local variables: |
| 96 | * tab-width: 4 |
| 97 | * c-basic-offset: 4 |
| 98 | * c-hanging-comment-ender-p: nil |
| 99 | * End: |
| 100 | */ |
| 101 | |
| 102 | ?> |
Note: See TracBrowser for help on using the browser.
