if(pligg_validate()){
$encode=md5($_POST['email'] . $user->karma . $user->username. pligg_hash().$main_smarty->get_config_vars('PLIGG_Visual_Name'));
$domain = $main_smarty->get_config_vars('PLIGG_Visual_Name');
$validation = my_base_url . my_pligg_base . "/validation.php?code=$encode&uid=".urlencode($user->username)."&email=".urlencode($_POST['email']);
$str = $main_smarty->get_config_vars('PLIGG_PassEmail_verification_message');
eval('$str = "'.str_replace('"','\"',$str).'";');
$message = "$str";
if(phpnum()>=5)
require("libs/class.phpmailer5.php");
else
require("libs/class.phpmailer4.php");
$mail = new PHPMailer();
$mail->From = $main_smarty->get_config_vars('PLIGG_PassEmail_From');
$mail->FromName = $main_smarty->get_config_vars('PLIGG_PassEmail_Name');
$mail->AddAddress($_POST['email']);
$mail->AddReplyTo($main_smarty->get_config_vars('PLIGG_PassEmail_From'));
$mail->IsHTML(false);
$mail->Subject = $main_smarty->get_config_vars('PLIGG_PassEmail_Subject_verification');
$mail->Body = $message;
$mail->CharSet = 'utf-8';
#print_r($mail);
if(!$mail->Send())
return false;
$savemsg = $main_smarty->get_config_vars("PLIGG_Visual_Register_Noemail").' '.sprintf($main_smarty->get_config_vars("PLIGG_Visual_Register_ToDo"),$main_smarty->get_config_vars('PLIGG_PassEmail_From'));
}
PLIGG_PassEmail_verification_message
- это обыкновенное сообщение о регистрации в языковом файле. "Hello $username,\\r\\n\\r\\nWe\'ve sent you this email because you signed up for a new account on $domain. If you didn\'t mean to do that, you can safely ignore this message.\\r\\n\\r\\nVisit this link to activate your account:\\r\\n $validation \\r\\n\\r\\nYour Password is $password \\r\\n\\r\\nIf clicking the link doesn\'t work, copying the complete link address into your browser.\\r\\nStill having trouble? Contact us at $contactmail\\r\\n\\r\\nAfter activation of your account, you can login at $my_base_url$my_pligg_base\\r\\n\\r\\nEnjoy!\\r\\n\\r\\nThe Administrator"
if($user){
$username = $user->user_login;
$salt = substr(md5(uniqid(rand(), true)), 0, SALT_LENGTH);
$saltedlogin = generateHash($user->user_login);
$to = $user->user_email;
$subject = $main_smarty->get_config_vars("PLIGG_PassEmail_Subject");
$times= time();
$body = sprintf($main_smarty->get_config_vars("PLIGG_PassEmail_Body"),$main_smarty->get_config_vars("PLIGG_Visual_Name"));
$body .="\n \n";
$body .= $my_base_url . $my_pligg_base . '/recover.php?id=' . base64_encode($username). '&n=' . time();
$headers = 'From: ' . $main_smarty->get_config_vars("PLIGG_PassEmail_From") . "\r\n";
$headers .= "Content-type: text/html; charset=utf-8\r\n";
if(phpnum()>=5)
require("libs/class.phpmailer5.php");
else
require("libs/class.phpmailer4.php");
$mail = new PHPMailer();
$mail->From = $main_smarty->get_config_vars('PLIGG_PassEmail_From');
$mail->FromName = $main_smarty->get_config_vars('PLIGG_PassEmail_Name');
$mail->AddAddress($to);
$mail->AddReplyTo($main_smarty->get_config_vars('PLIGG_PassEmail_From'));
$mail->IsHTML(false);
$mail->Subject = $subject;
$mail->CharSet = 'utf-8';
$mail->Body = $body;
if($user){
$username = $user->user_login;
$salt = substr(md5(uniqid(rand(), true)), 0, SALT_LENGTH);
$saltedlogin = generateHash($user->user_login);
$to = $user->user_email;
$subject = $main_smarty->get_config_vars("PLIGG_PassEmail_Subject");
$times= time();
$recoverpass = my_base_url . my_pligg_base . "/recover.php?id=" .base64_encode($username). "&n=" .time();
$resetpass = "<div ......</div>"
$headers = 'From: ' . $main_smarty->get_config_vars("PLIGG_PassEmail_From") . "\r\n";
$headers .= "Content-type: text/html; charset=utf-8\r\n";
if(phpnum()>=5)
require("libs/class.phpmailer5.php");
else
require("libs/class.phpmailer4.php");
$mail = new PHPMailer();
$mail->From = $main_smarty->get_config_vars('PLIGG_PassEmail_From');
$mail->FromName = $main_smarty->get_config_vars('PLIGG_PassEmail_Name');
$mail->AddAddress($to);
$mail->AddReplyTo($main_smarty->get_config_vars('PLIGG_PassEmail_From'));
$mail->IsHTML(true);
$mail->Subject = $subject;
$mail->CharSet = 'utf-8';
$mail->Body = $resetpass;