2 /* Copyright (C) 2009 Winch Gate Property Limited
4 * This file is part of ryzom_api.
5 * ryzom_api is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * ryzom_api is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with ryzom_api. If not, see <http://www.gnu.org/licenses/>.
22 function my_session_start()
24 if (isset($_COOKIE['PHPSESSID'])) {
25 $sessid = $_COOKIE['PHPSESSID'];
26 } else if (isset($_GET['PHPSESSID'])) {
27 $sessid = $_GET['PHPSESSID'];
33 if (!preg_match('/^[a-z0-9]{32}$/', $sessid)) {
44 if (!defined('ON_IPHONE')) {
45 if(isset($_SERVER['HTTP_USER_AGENT']))
46 define('ON_IPHONE', strpos($_SERVER['HTTP_USER_AGENT'], 'Ryzom'));
48 define('ON_IPHONE', false);
51 require_once("common/config.php");
53 $includes = array('auth', 'utils', 'user', 'time');
55 foreach ($includes as $include) {
56 if (RYAPI_MODE
== 'server') {
57 require_once('server/config.php');
58 require_once("server/$include.php");
60 require_once('client/config.php');
61 require_once("client/$include.php");
64 require_once("common/$include.php");
67 require_once("common/db_lib.php");
68 require_once("common/db_defs.php");
69 require_once("common/render.php");