@@ -242,9 +243,9 @@
0;
@@ -273,11 +274,11 @@
$salt = substr(bin2hex(get_random_bytes(125)), 0, 250);
$pwd_hash = encrypt_password($password, $salt, true);
- db_query($link, "INSERT INTO ttrss_users
+ db_query( "INSERT INTO ttrss_users
(login,pwd_hash,access_level,last_login, email, created, salt)
VALUES ('$login', '$pwd_hash', 0, null, '$email', NOW(), '$salt')");
- $result = db_query($link, "SELECT id FROM ttrss_users WHERE
+ $result = db_query( "SELECT id FROM ttrss_users WHERE
login = '$login' AND pwd_hash = '$pwd_hash'");
if (db_num_rows($result) != 1) {
@@ -289,7 +290,7 @@
$new_uid = db_fetch_result($result, 0, "id");
- initialize_user($link, $new_uid);
+ initialize_user( $new_uid);
$reg_text = "Hi!\n".
"\n".
@@ -306,32 +307,12 @@
"\n".
"If that wasn't you, just ignore this message. Thanks.";
- $mail = new PHPMailer();
-
- $mail->PluginDir = "lib/phpmailer/";
- $mail->SetLanguage("en", "lib/phpmailer/language/");
-
- $mail->CharSet = "UTF-8";
-
- $mail->From = SMTP_FROM_ADDRESS;
- $mail->FromName = SMTP_FROM_NAME;
- $mail->AddAddress($email);
-
- if (SMTP_HOST) {
- $mail->Host = SMTP_HOST;
- $mail->Mailer = "smtp";
- $mail->Username = SMTP_LOGIN;
- $mail->Password = SMTP_PASSWORD;
- }
-
- // $mail->IsHTML(true);
- $mail->Subject = "Registration information for Tiny Tiny RSS";
- $mail->Body = $reg_text;
- // $mail->AltBody = $digest_text;
+ $mailer = new Mailer();
+ $rc = $mailer->mail(["to_address" => $email,
+ "subject" => "Registration information for Tiny Tiny RSS",
+ "message" => $reg_text]);
- $rc = $mail->Send();
-
- if (!$rc) print_error($mail->ErrorInfo);
+ if (!$rc) print_error($mailer->error());
$reg_text = "Hi!\n".
"\n".
@@ -340,30 +321,12 @@
"Login: $login\n".
"Email: $email\n";
- $mail = new PHPMailer();
-
- $mail->PluginDir = "lib/phpmailer/";
- $mail->SetLanguage("en", "lib/phpmailer/language/");
-
- $mail->CharSet = "UTF-8";
+ $mailer = new Mailer();
+ $rc = $mailer->mail(["to_address" => REG_NOTIFY_ADDRESS,
+ "subject" => "Registration notice for Tiny Tiny RSS",
+ "message" => $reg_text]);
- $mail->From = SMTP_FROM_ADDRESS;
- $mail->FromName = SMTP_FROM_NAME;
- $mail->AddAddress(REG_NOTIFY_ADDRESS);
-
- if (SMTP_HOST) {
- $mail->Host = SMTP_HOST;
- $mail->Mailer = "smtp";
- $mail->Username = SMTP_LOGIN;
- $mail->Password = SMTP_PASSWORD;
- }
-
- // $mail->IsHTML(true);
- $mail->Subject = "Registration notice for Tiny Tiny RSS";
- $mail->Body = $reg_text;
- // $mail->AltBody = $digest_text;
-
- $rc = $mail->Send();
+ if (!$rc) print_error($mailer->error());
print_notice(__("Account created successfully."));
@@ -395,6 +358,7 @@
+
+
-
|