| 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 | * @package WiFiDogAuthServer |
|---|
| 38 | * @author Benoit Grégoire <benoitg@coeus.ca> |
|---|
| 39 | * @copyright 2004-2006 Benoit Grégoire, Technologies Coeus inc. |
|---|
| 40 | * @version Subversion $Id$ |
|---|
| 41 | * @link http://www.wifidog.org/ |
|---|
| 42 | */ |
|---|
| 43 | |
|---|
| 44 | /** |
|---|
| 45 | * Load required files |
|---|
| 46 | */ |
|---|
| 47 | require_once('classes/Locale.php'); |
|---|
| 48 | |
|---|
| 49 | if (!empty ($_REQUEST['wifidog_language'])) { |
|---|
| 50 | $session = Session::getObject(); |
|---|
| 51 | //echo "Setting to $_REQUEST[wifidog_language]<br/>"; |
|---|
| 52 | $AVAIL_LOCALE_ARRAY = LocaleList::getAvailableLanguageArray(); |
|---|
| 53 | /* Try to guess the lang */ |
|---|
| 54 | if (!empty($AVAIL_LOCALE_ARRAY[$_REQUEST['wifidog_language']])) { |
|---|
| 55 | $session->set(SESS_LANGUAGE_VAR, $_REQUEST['wifidog_language']); |
|---|
| 56 | } |
|---|
| 57 | else { |
|---|
| 58 | throw new Exception(htmlspecialchars($_REQUEST['wifidog_language'])." is not a valid locale"); |
|---|
| 59 | } |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | $locale = Locale::getCurrentLocale(); |
|---|
| 63 | Locale::setCurrentLocale($locale); |
|---|
| 64 | $locale_id = $locale->getId(); |
|---|
| 65 | |
|---|
| 66 | if (isset ($smarty)) { |
|---|
| 67 | $smarty->assign("lang_id", $locale_id); |
|---|
| 68 | } |
|---|
| 69 | |
|---|
| 70 | /* |
|---|
| 71 | * Local variables: |
|---|
| 72 | * tab-width: 4 |
|---|
| 73 | * c-basic-offset: 4 |
|---|
| 74 | * c-hanging-comment-ender-p: nil |
|---|
| 75 | * End: |
|---|
| 76 | */ |
|---|
| 77 | |
|---|
| 78 | ?> |
|---|