summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2021-05-29 01:23:22 +0200
committerDominique Martinet <asmadeus@codewreck.org>2021-05-29 02:13:19 +0200
commit581865e05b23a5cc20eb9bf1ad155d4114c14b42 (patch)
treeeff46952d957a871ecf56795f671b4bc2e1eb001
parentcfe1f01bea60817fdbd4e18b6f811945014ad1c5 (diff)
downstream changes
-rw-r--r--includes/class_email.php37
-rw-r--r--register.php6
2 files changed, 40 insertions, 3 deletions
diff --git a/includes/class_email.php b/includes/class_email.php
index 685c194..5c8c4cc 100644
--- a/includes/class_email.php
+++ b/includes/class_email.php
@@ -192,7 +192,6 @@ class EMail
* mail() the email
*
* @return bool
- */
function send()
{
global $phpEx, $phpbb_root_path;
@@ -220,5 +219,41 @@ class EMail
return true;
}
+ */
+ function send()
+ {
+ global $phpEx, $phpbb_root_path;
+
+ if ( $this->address == null )
+ {
+ message_die('No email address set');
+ }
+
+ if ( !$this->parse_email() )
+ {
+ return false;
+ }
+
+ // Add date and encoding type
+ $universal_extra = "MIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . gmdate('D, d M Y H:i:s', time()) . " UT\n";
+ $this->extra_headers = $universal_extra . $this->extra_headers;
+
+// $result = @mail($this->address, $this->subject, $this->msg, $this->extra_headers);
+ require_once "Mail.php";
+ $host = "localhost";
+ $port = "25";
+ $email_from = "Ancient Dominion DKP <eq@rebelhq.org>";
+ $email_address = "eq@rebelhq.org";
+
+ $headers = array ('From' => $email_from, 'To' => $this->address, 'Subject' => $this->subject, 'Reply-To' => $email_address);
+ $smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => false));
+ $mail = $smtp->send($this->address, $headers, $this->msg);
+
+ if (PEAR::isError($mail)) {
+ message_die('Failed sending email');
+ }
+
+ return true;
+ }
}
?> \ No newline at end of file
diff --git a/register.php b/register.php
index 84e189c..ff5a867 100644
--- a/register.php
+++ b/register.php
@@ -14,7 +14,7 @@
define('EQDKP_INC', true);
$eqdkp_root_path = './';
include_once($eqdkp_root_path . 'common.php');
-
+error_reporting(E_ALL);
class Register extends EQdkp_Admin
{
var $server_url = '';
@@ -139,7 +139,7 @@ class Register extends EQdkp_Admin
$key_len = ($key_len > 6) ? $key_len : 6;
$user_key = substr($user_key, 0, $key_len);
- $user_active = 0;
+ $user_active = '0';
if ($user->data['user_id'] != ANONYMOUS)
{
@@ -169,11 +169,13 @@ class Register extends EQdkp_Admin
'user_lastvisit' => $this->time)
);
$sql = 'INSERT INTO ' . USERS_TABLE . $query;
+// echo $db->query($sql);
if ( !($db->query($sql)) )
{
message_die('Could not add user information', '', __FILE__, __LINE__, $sql);
}
+
$user_id = $db->insert_id();
// Insert their permissions into the table