// * // * This program 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 3 of the License, or // * (at your option) any later version. // * // * This program 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 this program. If not, see . // * // * // * This file is the main homepage for YASS. It will accept the POST requests // * from the client, or display HTML data as needed */ if(is_dir('install')){ if(is_file('settings.php')) die('The directory \'install\' must be deleted in order to allow for the YASS server to operate.'); else header('Location: install/index.php'); }else{ if(!is_file('settings.php')) die('The configuration file is missing! YASS server is unable to operate without the configuration file.'); } require_once('settings.php'); require_once('includes/common_func.php'); if (isset($_POST['req']) && preg_match('/^[a-z]+$/', $_POST['req'])) $filename = 'includes/yassfunc/'.$_POST['req'].'.inc.php'; if (isset($filename) && file_exists($filename)){ require($filename); die; }else{ session_start(); if(!isset($_SESSION['level'])){ $_SESSION['level'] = 0; } if ((isset($_SESSION['ip']) && $_SESSION['ip'] != $_SERVER['REMOTE_ADDR']) || ($_SESSION['time']+(60*15) < time())){ session_destroy(); session_start(); $_SESSION['level'] = 0; }else{ $_SESSION['time'] = time(); } global $lang_list; global $langid; $lang_list = load_lang(); $_SESSION['langid'] = $langid = get_lang($lang_list); echo load_tpl('global_header'); echo load_tpl($_GET['act']); echo load_tpl('global_menu'); echo load_tpl('global_footer'); } ?>