private function saveLogs()
 {
     $line = str_repeat('--------', 8);
     $this->addLog("\n\n" . $line);
     $this->addLog(date("Y-m-d H:i:s"));
     $this->addLog("Email Sent: " . ($this->isSent ? 'OK' : 'Failed (' . $this->sendError . ')'));
     $this->addLog($this->sentMIMEMessage);
     $this->addLog($line . "\n\n");
     $logFile = Form::getEmailLogFile();
     Form::secureFile($logFile);
     file_put_contents($logFile, join("\n", $this->logs), FILE_APPEND);
     $this->logs = array();
     // clear
 }
Beispiel #2
0
    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();
    }
Beispiel #3
0
 function __construct()
 {
     $this->dataFile = Form::getFormDataFile();
 }