throw new EasySCP_Exception(tr("Captcha fontfile not found!")); } // remove old unique keys removeOldKeys($cfg->LOSTPASSWORD_TIMEOUT); if (isset($_SESSION['user_theme'])) { $theme_color = $_SESSION['user_theme']; } else { $theme_color = $cfg->USER_INITIAL_THEME; } $tpl = EasySCP_TemplateEngine::getInstance(); $tpl->assign(array('TR_PAGE_TITLE' => tr('EasySCP - Virtual Hosting Control System'), 'TR_WEBMAIL_SSL_LINK' => 'webmail', 'TR_FTP_SSL_LINK' => 'ftp', 'TR_PMA_SSL_LINK' => 'pma')); // Key request has been triggered if (isset($_GET['key']) && !empty($_GET['key'])) { check_input($_GET['key']); $template = 'lostpassword_message.tpl'; if (sendpassword($_GET['key'])) { $tpl->assign(array('TR_MESSAGE' => tr('Your new password has been sent.'), 'TR_LINK' => '<a href="index.php" class="button">' . tr('Login') . '</a>')); } else { $tpl->assign(array('TR_MESSAGE' => tr('New password could not be sent.'), 'TR_LINK' => '<a href="index.php" class="button">' . tr('Login') . '</a>')); } } elseif (isset($_POST['uname'])) { check_ipaddr(getipaddr(), 'captcha'); $template = 'lostpassword_message.tpl'; if (!empty($_POST['uname']) && isset($_SESSION['image']) && isset($_POST['capcode'])) { check_input(trim($_POST['uname'])); check_input($_POST['capcode']); if ($_SESSION['image'] == $_POST['capcode'] && requestpassword($_POST['uname'])) { $tpl->assign(array('TR_MESSAGE' => tr('Your password request has been initiated. You will receive an email with instructions to complete the process. This reset request will expire in %s minutes.', $cfg->LOSTPASSWORD_TIMEOUT), 'TR_LINK' => '<a href="index.php" class="button">' . tr('Back') . '</a>')); } else { $tpl->assign(array('TR_MESSAGE' => tr('User or security code was incorrect!'), 'TR_LINK' => '<a href="lostpassword.php" class="button">' . tr('Retry') . '</a>')); }
<?php include_once 'functions.php'; require $this->template_path . 'config.php'; if (isset($_POST["btnGet"])) { $result = sendpassword($_POST['emails']); ?> <div style="color:red;"> <?php echo $result; ?> </div> <?php } ?> <form action="" enctype="multipart/form-data" name="myForm" id="myForm" method="post"> <section class="forgot"> <table> <tr> <td>Please enter your email so that we can send you an email for you to reset your password:</td> </tr> <tr> <td><div class="value">Email</div> <input type="text" id="emails" name="emails" class="text"/> <script type="text/javascript"> var emails = new LiveValidation('emails'); emails.add(Validate.Presence) emails.add(Validate.Email ) </script> </td> </tr> <tr>