private static function forgotPassword() { self::header('Request Password'); ?> <style type="text/css"> #forgot { max-width: 450px; padding: 15px; margin: 0 auto; } #forgot input[type=text]{ font-size: 150%; } .submit{ text-align: center; } .submit .btn{ width: 85%; } .submit a{ display: block; margin: 10px; } </style> <!-- ----------------------------------------------- --> <div class="container fmg-form"> <form name="forgot" id="forgot" action='admin.php?method=forgotPassword' method='post' enctype='multipart/form-data'> <?php $to = Form::getToEmail(); $email = strtolower($_POST['email']); if (!empty($to) && !empty($email) && strtolower($to) == $email) { self::emailPassword(); echo "Password has been sent to {$email}."; echo "<p><a href='admin.php'>Sign In Here</a></p>"; } else { ?> <div class="form-group email"> <label class="control-label" for="email">Enter Email (<?php echo self::getEmailHint($to); ?> ):</label> <input type="text" class="form-control input-lg" id="email" name="email" value="<?php echo htmlspecialchars($_POST['email']); ?> " /> <p>The password will be sent to this email address.</p> </div> <div class="form-group submit"> <input class="btn btn-primary btn-lg" type="submit" value="Verify"> <?php if (self::isPost()) { ?> <p class="error bg-warning" style="padding:8px;margin-top:10px;">Failed to verify your email.</p> <?php } ?> </div> <?php } ?> </form> </div> <!-- ----------------------------------------------- --> <?php self::footer(); }
public function validateForm($post = array()) { if (!Form::isValidated()) { Form::validate($post); } $this->From = Form::getFromEmail(); $this->FromName = Form::getFromName(); $this->Subject = Form::getMailSubject(); $this->Body = Form::getMailBody(); $email = $this->config['email']; $this->TO = Form::getToEmail(); $this->CC = empty($email['cc']) ? '' : $email['cc']; $this->BCC = empty($email['bcc']) ? '' : $email['bcc']; }