Tim Norton - 2007-04-26 12:19:39
I think I found an error where if you set var $auto_activation = false; then the validation email sent to yhe user is actually the admin email.
I believe this is an error in the send_mail function
if (!$this->auto_activation) {
$subject = "New user request...";
$body = "New user registration on ".date("Y-m-d").":\r\n\r\nClick here to enter the admin page:\r\n\r\n"."http://".$_SERVER['HTTP_HOST'].$this->admin_page."?login_id=".$this->id;
} else {
$subject = $this->messages(28);
$body = $this->messages($num);
}
I corrected this by remming out the following and then creating a new function
//if (!$this->auto_activation) {
//$subject = "New user request...";
//$body = "New user registration on ".date("Y-m-d").":\r\n\r\nClick here to enter the admin page:\r\n\r\n"."http://".$_SERVER['HTTP_HOST'].$this->admin_page."?login_id=".$this->id;
//} else {
$subject = $this->messages(28);
$body = $this->messages($num);
//}
\
NEW FUNCTION **************************************8
function send_mailAdmin($mail_address, $num = 29) {
$header = "From: \"".$this->webmaster_name."\" <".$this->webmaster_mail.">\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Mailer: Olaf's mail script version 1.11\r\n";
$header .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
$header .= "Content-Transfer-Encoding: 7bit\r\n";
$subject = "New user request...";
$body = "New user registration on ".date("Y-m-d").":\r\n\r\nClick here to enter the admin page:\r\n\r\n"."http://".$_SERVER['HTTP_HOST'].$this->admin_page."?login_id=".$this->id;
if (mail($mail_address, $subject, $body, $header)) {
return true;
} else {
return false;
}
}
AND ADDED TO activate_account*********************************************************
if ($this->auto_activation) {
$upd_sql = sprintf("UPDATE %s SET active = 'y' WHERE id = %s AND pw = '%s'", $this->table_name, $key_id, $activate_key);
if (mysql_query($upd_sql)) {
if ($this->send_confirmation($key_id)) {
$this->the_msg = $this->messages(18);
} else {
$this->the_msg = $this->messages(14);
}
} else {
$this->the_msg = $this->messages(19);
}
} else {
***************
if ($this->send_mailAdmin($this->admin_mail, 0, true)) {
$this->the_msg = $this->messages(36);
***************
} else {
$this->the_msg = $this->messages(14);
}
}
} else {
$this->the_msg = $this->messages(20);
}
Any comments on my evaluation?
\\
Tim