File: /var/www/web37/htdocs/topsex/admin/index.php
<?php
############################################
### Top-XL - Admin index.php #######
############################################
/// 1. You are NOT entiteld to rent, lease, transfer, reproduce or distribute this Software.
/// 2. You are entiteld to adapt, and modify the Software to your need.
/// 3. You can use this Script on all of YOUR Domains.
/// 4. Any modification or removal to the links in the footer and member area shall terminate this license immediately .
/// 5. The Script has been tested on different Servers and found free of any notable errors by the author. The Author shall not in any case be liable for any special, incidental indirect or other similar damages arising from the use of this Script.
/// 6. Author: Simon Zehender - Contact: https://www.paddelberg.de
////////////////////////////////////////////
/// Topsite Version ////////////////////////
////////////////////////////////////////////
$v = "1.26 Free";
////////////////////////////////////////////
////////////////////////////////////////////
@ini_set ('error_reporting', 0);
@error_reporting (0);
@ini_set ('default_charset', 'utf-8');
header ('Content-Type: text/html; charset=utf-8');
$scriptpath=$_SERVER['DOCUMENT_ROOT'];
include("../inc/sql.php");
include("../inc/vars.php");
include("functions.php");
$langget=get_lang($config['stanlang']);
include("../lang/members-".get_lang_file($langget,$config['stanlang'],$config['langs'],$config['langdetect']).".php");
$do = !empty ($_GET["do"]) ? safety ($_GET["do"]) : '';
//////////////////////////
//// Login
//////////////////////////
if ($do == "login")
{
$user = !empty ($_POST["user"]) ? safety ($_POST["user"]) : '';
$pass = !empty ($_POST["pass"]) ? safety ($_POST["pass"]) : '';
$remember = !empty ($_POST["remember"]) ? safety ($_POST["remember"]) : '';
$pass = md5 ($pass);
$db -> query ("SELECT * FROM ".$topxl_admin_table." WHERE user = '".$user."'");
$row4 = $db -> fetch ();
if (!empty ($user) && $row4['user'] == $user and !empty ($pass) && $row4['pass'] == $pass)
{
if ($remember == "yes")
{
$remember = 1;
setcookie("xxxtopa", $user.':'.$pass.':'.$remember, 2147468399, $config['acookiepath']);
}
else
{
$remember = 0;
setcookie("xxxtopa", $user.':'.$pass.':'.$remember, '0' , $config['acookiepath']);
}
header ("location: index.php?do=main");
}
else
{header ("location: index.php");}
exit ();
}
////////////////////////////////////
////////// berechtigung überprüfen
////////////////////////////////////
$keks = !empty ($_COOKIE["xxxtopa"]) ? $_COOKIE["xxxtopa"] : '';
/// wenn ein Keks vorhanden ist
if ($keks)
{
$keksinhalt = explode(":", $keks);
$db -> query ("SELECT * FROM ".$topxl_admin_table." WHERE user = '".safety ($keksinhalt[0])."'");
$row = $db -> fetch ();
if (!empty ($row['user']) && $row['user'] == $keksinhalt[0] && $row['pass'] == $keksinhalt[1])
{
if (empty ($do))
{$do = "main";}
}
else
{
echo "What are you doing?";
exit;
}
}
/// wenn kein Keks vorhanden ist
else
{
if (!file_exists("../html/".$config['design']."/admin/login.html"))
{
echo "The template file html/".$config['design']."/admin/login.html does not exist.";
exit;
}
$fp1 = fopen("../html/".$config['design']."/admin/login.html","r"); // Datei öffnen
$zeile = fread ($fp1, filesize ("../html/".$config['design']."/admin/login.html"));
echo $zeile;
fclose($fp1);
exit;
}
$file="../html/".$config['design']."/admin/main.html";
//////////////////////////////////////
///// Main section
//////////////////////////////////////
if ($do == "main")
{include("main.php");}
//////////////////////////////////////
///// Configuration
//////////////////////////////////////
if ($do == "config")
{include("config.php");}
//////////////////////////////////////
///// user overwiev
//////////////////////////////////////
if ($do == "user" or $do == "userchange")
{include("accounts.php");}
//////////////////////////////////////
///// Edit User
//////////////////////////////////////
if ($do == "editaccount")
{include("editaccount.php");}
//////////////////////////////////////
///// Active User
//////////////////////////////////////
if ($do == "active" or $do == "changeactive" or $do == "inactive" or $do == "changeinactive")
{include("active.php");}
//////////////////////////////////////
///// Validate User
//////////////////////////////////////
if ($do == "validate")
{include("validate.php");}
//////////////////////////////////////
///// Newsletter
//////////////////////////////////////
if ($do == "newsletter")
{include("newsletter.php");}
//////////////////////////////////////
///// Stats
//////////////////////////////////////
if ($do == "stats")
{include("stats.php");}
//////////////////////////////////////
///// Delete User
//////////////////////////////////////
if ($do == "delete")
{include("delete.php");}
//////////////////////////////////////
///// Search User
//////////////////////////////////////
if ($do == "search")
{include("search.php");}
//////////////////////////////////////
///// Reset list
//////////////////////////////////////
if ($do == "reset")
{include("reset.php");}
//////////////////////////////////////
///// Logout
//////////////////////////////////////
if ($do == "logout")
{
$checkckkeks = $_COOKIE["xxxtopa"];
$checkkeksinhalt = explode(":", $checkckkeks);
$remember = $checkkeksinhalt[2];
setcookie ("xxxtopa", $user.":".$pass.":".$remember, time()-7200, $config['acookiepath']);
header ("Location: index.php");
exit;
}
?>