<?php

/********************************************************/
/* NSN Banner Ads                                       */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright © 2000-2005 by NukeScripts Network         */
/********************************************************/

$login = baclear_text($login);
$pass = baclear_text($pass);
$referer = $_SERVER['HTTP_REFERER'];
if($referer == "") { $referer = $nukeurl; }
$setinfo = $db->sql_fetchrow($db->sql_query("SELECT `passwd`, `cid` FROM `".TABLE_NSNBA_CLIENTS."` WHERE `login`='$login'"));
if(($db->sql_numrows($result)==1) AND ($setinfo[cid] != 0) AND ($setinfo[passwd] != "")) {
  $dbpass=$setinfo[passwd];
  $new_pass = md5($pass);
  if($dbpass != $new_pass) {
    redirect_url("modules.php?name=$module_name&amp;stop=1");
    return;
  }
  $datekey = date("F j");
  $rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
  $code = substr($rcode, 2, 8);
  if(extension_loaded("gd") AND $code != $gfx_check AND ($ba_config['usegfxcheck'] == 2 OR $ba_config['usegfxcheck'] == 3)) {
    redirect_url("modules.php?name=$module_name&amp;stop=1");
    die();
  } else {
    $setcid = $setinfo['cid'];
    BACookie($setcid, $login, $new_pass);
    redirect_url("$referer");
  }
} else {
  redirect_url("modules.php?name=$module_name&amp;stop=1");
}

?>