View file wapirate/A1/logine.php

File size: 5.65Kb
<?php





include("core.php");

include("config.php");





header("Content-type: text/html; charset=ISO-8859-1");

echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";

echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";

echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";



	echo "<head>";



	echo "<title>$stitle</title>";

	echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"../themes/blue_medium.css\" />";

echo "

<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />

<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>

<meta name=\"description\" content=\"wapirate :)\"> 

<meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\">

";

	echo "</head>";



	echo "<body>";

connectdb();

$bcon = connectdb();

if (!$bcon)

{

    echo "<div><br/>Doh!<br/></div>";

    echo "<p align=\"center\">";

    echo "<img src=\"images/exit.gif\" alt=\"*\"/><br/>";

    echo "ERROR! cannot connect to database<br/><br/>";

    echo "This error usually happens when backing up the database, please be patient, The site will be up as soon as possible<br/><br/>";

	echo "You can temporary use our other <a href=\"http://wapirate.madpage.com/chat/index.php\">chatroom</a> while wapirate is offline<br/>";

    echo "<b>THANK YOU VERY MUCH</b>";

    echo "</p>";

    echo "<div>wapirate.net</div>";

    exit();

}

$uid = $_GET["loguid"];

$pwd = $_GET["logpwd"];

$uip = getip();

$ip = $_GET["ip"];

if($ip<1){

    echo "<div><br/>Security Check!<br/></div>";

    echo "<p align=\"center\">";

    echo "<b>Please Wait...</b>";

    echo "<img src=\"/check.php\" alt=\"*\"/><br/>";

echo "<meta http-equiv=\"refresh\" content=\"10; url=http://wapirate.net/a/login.php?loguid=$uid&amp;password=$pwd&amp;in=$uip\"/>"



    echo "</p>";

    echo "<div>wapirate.net</div>";

    exit();

}



$tolog = false;

    echo "<div><br/>Login!<br/></div>";

  echo "<p align=\"center\">";

 echo "<img src=\"/images/logo.gif\" alt=\"Wapirate\"/><br/>";

 $brws = $_SERVER['HTTP_USER_AGENT'];

$uip = getip();

$idiot = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_idiots WHERE browser='".$brws."'"));

$idiotip = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_idiotsip WHERE ipadd='".$uip."'"));

if($idiot[0]>0){

echo "<img src=\"images/notok.gif\" alt=\"X\"/>ERROR! cannot connect to database<br/><br/>";

}else if($idiotip[0]>0){

echo "<img src=\"images/notok.gif\" alt=\"X\"/>ERROR! cannot connect to database<br/><br/>";

}else{

 

  

  $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."'"));

  if($uinf[0]==0)

  {

    //Check for user ID

    echo "<img src=\"images/notok.gif\" alt=\"X\"/>UserID doesn't exist<br/><br/>";

  }else{

    //check for pwd

    $epwd = md5($pwd);

    $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."'"));

    if($uinf[0]==0)

    {

      echo "<img src=\"images/notok.gif\" alt=\"X\"/>Incorrect Password<br/><br/>";

$brws = $_SERVER['HTTP_USER_AGENT'];

$ope = $_SERVER['HTTP_X_OPERAMINI_PHONE'];

$uip = getip();

$ubr = "$brws $ope $uip";

mysql_query("INSERT INTO ibwf_mlog SET action='Pass Cracks', details='<b>".$ubr."</b> Tried Cracking <b>".$uid."</b> with pass <b>".$pwd."</b>', actdt='".time()."'");

    }else{

      $tm = time();

      $xtm = $tm + (getsxtm()*60);

      $did = $uid.$tm;

      $res = mysql_query("INSERT INTO ibwf_ses SET id='".md5($did)."', uid='".getuid_nick($uid)."', expiretm='".$xtm."'");

      

      if($res)

      {

        $tolog=true;

        echo "Logged in successfully as $uid<br/>";

echo "***<br/>";

        $idn = getuid_nick($uid);

 $theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$idn."'"));

if($theme[0]==""){

mysql_query("UPDATE ibwf_users SET theme='blue_medium.css' WHERE id='".$idn."'");

$theme = "blue_medium.css";

}       

            $lact = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$idn."'"));

             mysql_query("UPDATE ibwf_users SET lastvst='".$lact[0]."', ppass='".$pwd."' WHERE id='".$idn."'");

      }else{

        //is user already logged in?

        $logedin = mysql_fetch_array(mysql_query("SELECT (*) FROM ibwf_ses WHERE uid='".$getuid_nick($uid)."'"));

        if($logedin[0]>0)

        {

          //yip, so let's just update the expiration time

          $xtm = time() + (getsxtm()*60);

          $res = mysql_query("UPDATE ibwf_ses SET expiretm='".$xtm."' WHERE uid='".getuid_nick($uid)."'");

          

          if($res)

          {

            $tolog=true;

            echo "Logged in successfully as $uid<br/>";

echo "***<br/>";

            



           

            

          }else{

            echo "<img src=\"images/point.gif\" alt=\"!\"/>Can't login at this time, please again try later!<br/>"; //no chance this could happen unless there's error in mysql connection

            

          }

          

        }

        

      }

      //can add text ere//

    }

  }

  

  if($tolog)

{

  $sid = md5($did);

  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";

    echo "<a href=\"index.php?action=main&amp;sid=$sid\">ENTER WAPIRATE</a><br/><br/>";

echo "Dont forget to tell everyone you know about us...";

}else{

echo "<a href=\"index.php\"><img src=\"images/home.gif\" alt=\"*\"/>";

echo "Home</a>";

}}

echo "</p>";

echo "<div>wapirate.net</div>"; 



	echo "</body>";

	echo "</html>";

?>