Files
Testing/lostusername.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

71 lines
1.5 KiB
PHP

<?php
/* $Id: lostpass.php 133 2009-03-22 20:16:35Z john $ */
$page = "lostusername";
include "header.php";
$task = ( isset($_POST['task']) ? $_POST['task'] : ( isset($_GET['task']) ? $_GET['task'] : NULL ) );
// SET ERROR VARS
$is_error = 0;
$submitted = 0;
if($task == "send_email")
{
$query=$database->database_query("SELECT * FROM se_users WHERE user_email='".$_POST["email"]."'");
$submitted = 1;
if($database->database_num_rows($query)>0&&$_POST["agree"]==1){
$row=$database->database_fetch_array($query);
$lostpassword_code = randomcode(15);
$lostpassword_time = time();
$a=1;
$subject="BateWorld - Lost Username";
$mailtext="Hello ".$new_user->user_displayname.",
Your username is ".$new_user->user_info['user_username']."
Best Regards,
The Guys at BateWorld";
if(send_generic($row["user_email"], $setting['setting_email_fromemail'], $subject, $mailtext, " ", " "))
{
$cache_object = SECache::getInstance();
if( is_object($cache_object) )
{
$cache_object->remove('site_user_settings_'.$new_user->user_info['user_id']);
}
}
else
{
$is_error = 748;
}
}
}
// SET GLOBAL PAGE TITLE
$global_page_title[0] = 33;
$global_page_description[0] = 34;
$smarty->assign('pagetitle', "Lost Password");
$smarty->assign('pagedescription', "Did you lose your password for your BateWorld account? Reset it.");
// ASSIGN VARIABLES AND INCLUDE FOOTER
$smarty->assign('is_error', $is_error);
$smarty->assign('submitted', $submitted);
include "footer.php";
?>