2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
$Id: adm_login.php,v 1.4 2005/04/01 17:13:10 benjamin Exp $
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
AlternC - Web Hosting System
|
|
|
|
Copyright (C) 2002 by the AlternC Development Team.
|
|
|
|
http://alternc.org/
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
Based on:
|
|
|
|
Valentin Lacambre's web hosting softwares: http://altern.org/
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
LICENSE
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License (GPL)
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
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.
|
|
|
|
|
|
|
|
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
Original Author of file: Benjamin Sonntag
|
|
|
|
Purpose of file: Connect a super-user to another account
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
require_once("../class/config.php");
|
|
|
|
|
2011-03-04 12:29:37 +00:00
|
|
|
// If we just want to return to our previous session
|
|
|
|
$oldid=intval($_COOKIE['oldid']);
|
|
|
|
if ($oldid) {
|
2011-03-27 13:45:51 +00:00
|
|
|
setcookie('oldid','',0,'/');
|
2011-03-27 13:47:50 +00:00
|
|
|
unset($_COOKIE['oldid']);
|
2011-03-04 12:29:37 +00:00
|
|
|
|
|
|
|
$db->query("select lastip from membres where uid='$oldid';");
|
|
|
|
$db->next_record();
|
|
|
|
if ($db->f("lastip") != getenv("REMOTE_ADDR") ) {
|
|
|
|
die('Error : bad IP address');
|
|
|
|
}
|
|
|
|
|
2011-03-27 13:43:36 +00:00
|
|
|
if (!$mem->setid($oldid)) {
|
2011-03-04 12:29:37 +00:00
|
|
|
$oldid=null;
|
2011-03-27 13:43:36 +00:00
|
|
|
$error=$err->errstr();
|
2011-03-27 15:03:42 +00:00
|
|
|
include("index.php");
|
2011-03-27 13:43:36 +00:00
|
|
|
exit();
|
|
|
|
}
|
2011-03-04 12:29:37 +00:00
|
|
|
$oldid=null;
|
2011-03-27 15:03:42 +00:00
|
|
|
include_once("adm_list.php");
|
2011-03-27 13:43:36 +00:00
|
|
|
exit();
|
2011-03-04 12:29:37 +00:00
|
|
|
}
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
if (!$admin->enabled) {
|
2011-03-27 13:43:36 +00:00
|
|
|
__("This page is restricted to authorized staff");
|
|
|
|
exit();
|
2006-04-26 12:28:53 +00:00
|
|
|
}
|
|
|
|
|
2009-09-08 05:29:38 +00:00
|
|
|
$fields = array (
|
2011-03-27 13:43:36 +00:00
|
|
|
"id" => array ("request", "integer", 0),
|
|
|
|
);
|
2009-09-08 05:29:38 +00:00
|
|
|
getFields($fields);
|
2006-04-26 12:28:53 +00:00
|
|
|
|
2010-04-11 13:39:24 +00:00
|
|
|
$subadmin=variable_get("subadmin_restriction");
|
|
|
|
|
|
|
|
if ($subadmin==0 && !$admin->checkcreator($id)) {
|
2006-04-26 12:28:53 +00:00
|
|
|
__("This page is restricted to authorized staff");
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2011-03-27 13:43:36 +00:00
|
|
|
if (!$r=$admin->get($id)) {
|
|
|
|
$error=$err->errstr();
|
|
|
|
} else {
|
2011-03-27 13:45:51 +00:00
|
|
|
setcookie('oldid',$cuid,0,'/');
|
2011-03-27 13:47:50 +00:00
|
|
|
$_COOKIE['oldid']=$cuid;
|
|
|
|
|
2011-03-27 13:43:36 +00:00
|
|
|
if (!$mem->setid($id)) {
|
|
|
|
$error=$err->errstr();
|
|
|
|
include("index.php");
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
include_once("main.php");
|
|
|
|
exit();
|
2006-04-26 12:28:53 +00:00
|
|
|
}
|
|
|
|
|
2009-09-08 05:29:38 +00:00
|
|
|
include_once("head.php");
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
?>
|
|
|
|
<h3><?php __("Member login"); ?></h3>
|
|
|
|
<?php
|
2009-09-08 05:29:38 +00:00
|
|
|
|
2011-03-27 13:43:36 +00:00
|
|
|
if ($error) {
|
|
|
|
echo "<p class=\"error\">$error</p>";
|
|
|
|
include_once("foot.php");
|
|
|
|
exit();
|
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
?>
|
2009-09-08 05:29:38 +00:00
|
|
|
<?php include_once("foot.php"); ?>
|