<?
  /* Main include info */
  ini_set('include_path',"/usr/web/sites/tuve.tv/include/");
  include("site.inc");

  /* Assign the page title */
  $data[tpl]->assign("PAGE_TITLE","");

  /* Main defines */
  $data[tpl]->define(array(index=>"index/index.html"));


  if ($data['email']) {
    $query = "SELECT password,active,firstname,lastname,email FROM users WHERE email LIKE '%$data[email]'";
    $res = mysql_query($query);
    if (mysql_num_rows($res) == 0) {
      $data['tpl']->define(array(body=>"/lostact.html"));
      $error = "Invalid E-Mail Address";
      }
    else {
      $fName = mysql_result($res,0,'firstname');
      $lName = mysql_result($res,0,'lastname');
      $pass  = mysql_result($res,0,'password');
      $email = mysql_result($res,0,'email');
      $active = mysql_result($res,0,'active');

      $data['tpl']->define(array(body=>"/lostact-sent.html"));
      $data['tpl']->assign("EMAIL",$email);
      if ($active != 1)
        $message = "$fname,<br>Please Click or goto the following link to confirm your email address <A HREF=\"http://www.tuve.tv/activate.php?active=$active&email=$email]\">http://www.tuve.tv/activate.php?active=" . $active . "&email=" . $email . "</A> After confirmation your account will be activated.<br><br>Thank you,<BR>The TUve Staff<BR>";
      else
        $message = "$fName,<br>Your Password Is: $pass<br><br>Sincerely,<br>TUVe Support";

      send_mail("$fName $lName <$email>",$message,"TUve Password Recovery / Account Activation","support@tuve.tv","TUve Support",false);
      }
    }
  else
    $data['tpl']->define(array(body=>"/lostact.html"));

  $data['tpl']->assign("ERROR",$error);


  /* Parse and print */
  $data[tpl]->parse(BODY, array("body"));
  $data[tpl]->parse(INDEX, array("index"));
  $data[tpl]->FastPrint("INDEX");
?>
