PHP Code:
<?php
include_once("../includes/globals.php");
$body->html_head();
$ses = $body->protect($ses);
$body->html_title($title);
$body->div_open(style_header);
echo"<img src='/images/logo.png' alt='*'/><br/>";
$active = $setup->sitename_lang($ses,'lp');
$body->div_close();
$body->div_open(center);
echo "<br/>";
$body->div_close();
switch($o)
{
case 'log':
if(empty($name)){
echo "+ Name Required!<br/>";
}else if(empty($pwd)){
echo "+ Password Required!<br/>";
}
else{
$name = $body->protect($name);
$pwd = $body->protect($pwd);
$pcheck = "SELECT COUNT(*) FROM `user_sites` WHERE `sub`='".$name."' and `password`='".$pwd."' AND domain='".$subdomain."'";
$checkx = $db->Query($pcheck);
$pass = $db->FetchArray($checkx);
$check = "SELECT COUNT(*) FROM `user_sites` WHERE `sub`='".$name."' AND domain='".$subdomain."'";
$emcheck = $db->Query($check);
$capture = $db->FetchArray($emcheck);
if($capture[0]=="1"){
echo "Invalid Username/Sitename<br/>";
}
else if($pass[0]=="1")
{
echo "Please go back and check your Domain or Password or you can<br/>";
echo "<a href='/mods/request.php'>Do a password Request</a><br/>";
}
else{
$var = time();
$ses = md5($var);
$ses = substr($ses,0,-22);
$ses = base64_encode($ses);
$ses = substr($ses,0,-6);
$exptime = time() + (30 * 60);
$ses = mysql_real_escape_string($ses);
$uownerid = $body->uniqueid_nick($name,$subdomain);
$ses = "$ses$la";
$del = mysql_query("DELETE FROM user_sessions WHERE exptime < '".$var."'");
$check = DB::FetchArray(DB::Query("SELECT COUNT(*) FROM `user_sessions` WHERE `ownerid`='".$uownerid."'"));
if($check[0]==1)
{
//insert
$res2 = DB::Query("INSERT INTO `user_sessions` SET `ses`='{$ses}', `ownerid`='".$uownerid."', `exptime`='{$exptime}'") or die(mysql_error());
}else{
//UPDATE
$res3 = DB::Query("UPDATE `user_sessions` SET `ses`='{$ses}', `exptime`='{$exptime}' WHERE `ownerid`='".$uownerid."'") or die(mysql_error());
}
echo "+ Login Successfully, you will be redirected...";
echo "<a href='/editor/index.php?s=$ses'>here</a><br/>";
$body->redirect('3','../editor/index.php', $ses);
}
}
break;
default:
echo "$active[trans1]<br/>";
$la = substr("$ses", 10, 2);
$body->login_page($active[trans2],$active[trans3],$active[trans4],$la);
break;
}
$body->div_open(center);
echo "<a href='/index.php?s=$ses'>[ Home ]</a><br/>";
$body->div_close();
$body->div_open(style_footer);
$body->page_foot();
$body->div_close();
$body->html_foot();
?>
Comment