public function action_lostPass() { $data = AccountData::getAccountData($this->post['email_user']); if ($data) { $crypt = new Mcrypt(); $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; $email_body = "<p style='font-size: 12px; font-family: Tahoma;'>Dear User, <br>" . "<br> User email:<b> " . $this->post['email_user'] . "</b> " . "<br> Password:<b> " . trim($crypt->decrypt($data['pass'])) . "</b><br>\n <p style='font-size: 10px; font-family: Tahoma; color: #0B72B5;'>This email was generated automatically, do not reply to.</p>"; mail($post['email_user'], 'Forgot password to the DRUtES application.', $email_body, $headers); $this->msg = 'Temporary password has been sent to email.'; return []; } else { $this->msg = 'The email address does not exist.'; return []; } }
function getSMTPInfo($active = true) { $info = array(); if (!$active || $active && $this->isSMTPEnabled()) { $info = array('host' => $this->ht['smtp_host'], 'port' => $this->ht['smtp_port'], 'auth' => $this->ht['smtp_auth'], 'username' => $this->ht['userid'], 'password' => Mcrypt::decrypt($this->ht['userpass'], SECRET_SALT)); } return $info; }
/** * Converts an encoded hash to the original value * @param string $hash * @param string $key * @return string Decrypted string */ public static function decode_hash($hash, $key = NULL) { if ($key === NULL) { $key = self::$key; } return Mcrypt::decrypt($hash, NULL, NULL, $key); }
function getSMTPInfo() { $info = array('host' => $this->ht['smtp_host'], 'port' => $this->ht['smtp_port'], 'auth' => (bool) $this->ht['smtp_auth'], 'username' => $this->ht['userid'], 'password' => Mcrypt::decrypt($this->ht['userpass'], SECRET_SALT)); return $info; }