<?php

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

$pagetitle = ": "._BA_TITLE." - "._BA_UPDTCLNT;
if(is_baclient($baclient)) {
  $chng_name = baclear_text($chng_name);
  $chng_email = baclear_text($chng_email);
  $new_pass1 = baclear_text($new_pass1);
  $new_pass2 = baclear_text($new_pass2);
  incoh();
  title(_BA_UPDTCLNT);
  $new_pass1 = trim ("$new_pass1");
  $new_pass2 = trim ("$new_pass2");
  BAMenu();
  echo "<br />\n";
  Max_OpenTable();
  if(($new_pass1 != $new_pass2) AND ($new_pass1 != "" AND $new_pass2 != "")) {
    echo "<center><b>"._BA_ERR_NOMATCH."</b></center>\n";
  } elseif($new_pass1 > "") {
    $new_pass = md5($new_pass1);
    if(!get_magic_quotes_runtime()) {
      $chng_name = addslashes($chng_name);
      $chng_email = addslashes($chng_email);
    }
    $sql = "UPDATE `".TABLE_NSNBA_CLIENTS."` SET `name`='$chng_name', `email`='$chng_email', `passwd`='$new_pass' WHERE `cid`='$bacookie[0]'";
    if ( !($result = $db->sql_query($sql)) )
{ query_die(GENERAL_ERROR, 'Could not obtain _nsnba_clients', '', __LINE__, __FILE__, $sql);}
    $info = base64_encode("$cid:$login:$new_pass");
    setcookie("client","$info",time()+3024000);
    echo "<center><b>"._BA_ACCPASUPD."</b></center>\n";
  } else {
    if(!get_magic_quotes_runtime()) {
      $chng_name = addslashes($chng_name);
      $chng_email = addslashes($chng_email);
    }
    $sql1 = "UPDATE `".TABLE_NSNBA_CLIENTS."` SET `name`='$chng_name', `email`='$chng_email' WHERE `cid`='$bacookie[0]'";
    if ( !($result1 = $db->sql_query($sql1)) )
{ query_die(GENERAL_ERROR, 'Could not obtain _nsnba_clients', '', __LINE__, __FILE__, $sql1);}
    echo "<center><b>"._BA_ACCUPD."</b></center>\n";
  }
  Max_CloseTable();
  incof();
} else {
  redirect_url("modules.php?name=$module_name");
}

?>