[aur-dev] [PATCH 1/2] Be friendly to newly registered users
Use "Welcome to the Arch User Repository" instead of "AUR Password Reset" as subject for the initial password reset email. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/html/passreset.php | 3 ++- web/lib/acctfuncs.inc.php | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/web/html/passreset.php b/web/html/passreset.php index 6fade6b..9541021 100644 --- a/web/html/passreset.php +++ b/web/html/passreset.php @@ -41,11 +41,12 @@ if (isset($_GET['resetkey'], $_POST['email'], $_POST['password'], $_POST['confir if (empty($email)) { $error = __('Missing a required field.'); } else { + $subject = 'AUR Password Reset'; $body = __('A password reset request was submitted for the account '. 'associated with your e-mail address. If you wish to reset '. 'your password follow the link below, otherwise ignore '. 'this message and nothing will happen.'). - send_resetkey($email, $body); + send_resetkey($email, $subject, $body); header('Location: ' . get_uri('/passreset/') . '?step=confirm'); exit(); diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index 312f11b..6ac34a0 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -221,6 +221,7 @@ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="", "<strong>", htmlspecialchars($U,ENT_QUOTES), "</strong>"); print "<p>\n"; if ($send_resetkey) { + $subject = 'Welcome to the Arch User Repository'; $body = __('Welcome to %s! In order ' . 'to set an initial password ' . 'for your new account, ' . @@ -230,7 +231,7 @@ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="", 'pasting it into your ' . 'browser.', $AUR_LOCATION); - send_resetkey($email, $body); + send_resetkey($email, $subject, $body); print __("A password reset key has been sent to your e-mail address."); } else { print __("Click on the Login link above to use your account."); @@ -632,11 +633,12 @@ function create_resetkey($resetkey, $uid) { * Send a reset key to a specific e-mail address * * @param string $email E-mail address of the user resetting their password + * @param string $subject Subject of the email * @param string $body Body of the email * * @return void */ -function send_resetkey($email, $body) { +function send_resetkey($email, $subject, $body) { global $AUR_LOCATION; $uid = uid_from_email($email); @@ -658,7 +660,7 @@ function send_resetkey($email, $body) { "From: aur-notify@archlinux.org\r\n" . "X-Mailer: PHP\r\n" . "X-MimeOLE: Produced By AUR"; - @mail($email, 'AUR Password Reset', $body, $headers); + @mail($email, $subject, $body, $headers); } } -- 1.9.3
Consistently use the following headers in notification emails: Reply-to: noreply@aur.archlinux.org From: notify@aur.achlinux.org Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/lib/acctfuncs.inc.php | 4 ++-- web/lib/pkgbasefuncs.inc.php | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index 6ac34a0..5b907dc 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -656,8 +656,8 @@ function send_resetkey($email, $subject, $body) { "resetkey={$resetkey}"; $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/plain; charset=UTF-8\r\n"; - "Reply-to: nobody@archlinux.org\r\n" . - "From: aur-notify@archlinux.org\r\n" . + "Reply-to: noreply@aur.archlinux.org\r\n" . + "From: notify@aur.achlinux.org\r\n" . "X-Mailer: PHP\r\n" . "X-MimeOLE: Produced By AUR"; @mail($email, $subject, $body, $headers); diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php index 34ff302..9f80ef2 100644 --- a/web/lib/pkgbasefuncs.inc.php +++ b/web/lib/pkgbasefuncs.inc.php @@ -137,8 +137,8 @@ function pkgbase_add_comment($base_id, $uid, $comment) { $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/plain; charset=UTF-8\r\n" . "Bcc: $bcc\r\n" . - "Reply-to: nobody@archlinux.org\r\n" . - "From: aur-notify@archlinux.org\r\n" . + "Reply-to: noreply@aur.archlinux.org\r\n" . + "From: notify@aur.archlinux.org\r\n" . "In-Reply-To: $thread_id\r\n" . "References: $thread_id\r\n" . "X-Mailer: AUR"; @@ -385,8 +385,8 @@ function pkgbase_flag($atype, $base_ids) { $body = wordwrap($body, 70); $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/plain; charset=UTF-8\r\n" . - "Reply-to: nobody@archlinux.org\r\n" . - "From: aur-notify@archlinux.org\r\n" . + "Reply-to: noreply@aur.archlinux.org\r\n" . + "From: notify@aur.archlinux.org\r\n" . "X-Mailer: PHP\r\n" . "X-MimeOLE: Produced By AUR"; @mail($row['Email'], "AUR Out-of-date Notification for ".$row['Name'], $body, $headers); @@ -497,8 +497,8 @@ function pkgbase_delete ($atype, $base_ids, $merge_base_id) { $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/plain; charset=UTF-8\r\n" . "Bcc: $bcc\r\n" . - "Reply-to: nobody@archlinux.org\r\n" . - "From: aur-notify@archlinux.org\r\n" . + "Reply-to: noreply@aur.archlinux.org\r\n" . + "From: notify@aur.archlinux.org\r\n" . "X-Mailer: AUR"; @mail('undisclosed-recipients: ;', "AUR Package deleted: " . $pkgbase_name, $body, $headers); } -- 1.9.3
participants (1)
-
Lukas Fleischer