Merge branch '164-crash-on-patching-and-possibly-right-after-login' into 'main/atys...
[ryzomcore.git] / nelns / admin / public_html / authenticate.php
blobff84b02361f18fc8fcf91742d939cf5c51b9117a
1 <?php
2 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
3 // Copyright (C) 2010 Winch Gate Property Limited
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Affero General Public License as
7 // published by the Free Software Foundation, either version 3 of the
8 // License, or (at your option) any later version.
9 //
10 // This program 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 Affero General Public License for more details.
15 // You should have received a copy of the GNU Affero General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 session_start();
19 include('foo.php');
20 $publicAccess = true;
21 // set cookies for filters
22 if (isset($admfilter_shard) && !isset($filter_shard)) $filter_shard = $admfilter_shard;
23 else if (isset($filter_shard) && $filter_shard=="") setCookie("admfilter_shard");
24 else if (isset($filter_shard)) setCookie("admfilter_shard", $filter_shard, time()+3600*24*15);
26 if (isset($admfilter_server) && !isset($filter_server)) $filter_server = $admfilter_server;
27 else if (isset($filter_server) && $filter_server=="") setCookie("admfilter_server");
28 else if (isset($filter_server)) setCookie("admfilter_server", $filter_server, time()+3600*24*15);
30 if (isset($admfilter_service) && !isset($filter_service)) $filter_service = $admfilter_service;
31 else if (isset($filter_service) && $filter_service=="") setCookie("admfilter_service");
32 else if (isset($filter_service)) setCookie("admfilter_service", $filter_service, time()+3600*24*15);
34 if (isset($admfilter_entity) && !isset($filter_entity)) $filter_entity = $admfilter_entity;
35 else if (isset($filter_entity) && $filter_entity=="") setCookie("admfilter_entity");
36 else if (isset($filter_entity)) setCookie("admfilter_entity", $filter_entity, time()+3600*24*15);
39 include('sql_connection.php');
40 include('session_auth.php');
41 include('login_form.php');
42 include('html_headers.php');
44 $result = defaultConnectToDatabase();
45 if ($result)
46 die($result);
49 if(!auth($error))
51 LoginForm();
52 die();
55 $IsNevrax = (strtolower($group) == 'nevraxgroup');
57 if ((!isset($publicAccess) || $publicAccess == false) && $admlogin != "root" && (!$allowNevrax || !$IsNevrax))
59 htmlProlog($_SERVER['PHP_SELF'], "Acces not granted");
60 echo "You are not allowed to go to this page.<br>\n";
61 echo "<a href='index.php'>Index page</a>\n";
62 htmlEpilog();
63 die;
66 include('init.php');
68 // print "POST VARS: "; print_r($HTTP_POST_VARS); print "<br><br>";
69 // print "GET VARS: "; print_r($HTTP_GET_VARS); print "<br><br>";
70 // print "COOKIE VARS "; print_r($HTTP_COOKIE_VARS); print "<br><br>";
71 // print "SESSION VARS "; print_r($_SESSION); print "<br><br>";