-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathroot.php
More file actions
55 lines (50 loc) · 1.94 KB
/
Copy pathroot.php
File metadata and controls
55 lines (50 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* 2Moons
* Copyright (C) 2011 Slaver
*
* 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 <http://www.gnu.org/licenses/>.
*
* @package 2Moons
* @author Slaver <slaver7@gmail.com>
* @copyright 2009 Lucky <lucky@xgproyect.net> (XGProyecto)
* @copyright 2011 Slaver <slaver7@gmail.com> (Fork/2Moons)
* @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
* @version 1.6.1 (2011-11-19)
* @info $Id$
* @link http://code.google.com/p/2moons/
*/
define('MODE', 'LOGIN');
define('ROOT_PATH' , str_replace('\\', '/',dirname(__FILE__)).'/');
require(ROOT_PATH . 'includes/common.php');
$LANG->includeLang(array('ADMIN'));
if(isset($_REQUEST['admin_pw']))
{
$login = $GLOBALS['DATABASE']->uniquequery("SELECT `id`, `username`, `dpath`, `authlevel`, `id_planet` FROM ".USERS." WHERE `id` = '1' AND `password` = '".cryptPassword($_REQUEST['admin_pw'])."';");
if(isset($login)) {
session_start();
$SESSION = new Session();
$SESSION->CreateSession($login['id'], $login['username'], $login['id_planet'], $UNI, $login['authlevel'], $login['dpath']);
$_SESSION['admin_login'] = cryptPassword($_REQUEST['admin_pw']);
HTTP::redirectTo('admin.php');
}
}
$template = new template();
$template->assign_vars(array(
'adm_login' => $LNG['adm_login'],
'adm_password' => $LNG['adm_password'],
'adm_absenden' => $LNG['adm_absenden'],
));
$template->show('adm/LoginPage.tpl');
?>