From 0c15f124e89c88b60d68386c385d3455fd061bec Mon Sep 17 00:00:00 2001
From: "justdave%syndicomm.com"
Date: Mon, 1 Apr 2002 03:49:06 +0000
Subject: [PATCH] Fix for bug 23067: Allow the user to change their email
address through the preferences. Sends out tokens in email to both addresses
which have to be confirmed by the new address, and can be cancelled by the
old one. Entering your password on the preferences page is required to
initiate the process. Patch by John Vandenberg r= myk,
justdave
---
.../template/default/prefs/account.tmpl | 46 ++++++++++++++++++-
.../template/default/prefs/userprefs.tmpl | 10 +++-
.../default/token/confirmemail.html.tmpl | 43 +++++++++++++++++
.../default/token/emailchangenew.txt.tmpl | 35 ++++++++++++++
.../default/token/emailchangeold.txt.tmpl | 34 ++++++++++++++
.../default/token/tokencancel.txt.tmpl | 38 +++++++++++++++
6 files changed, 202 insertions(+), 4 deletions(-)
create mode 100644 webtools/bugzilla/template/default/token/confirmemail.html.tmpl
create mode 100644 webtools/bugzilla/template/default/token/emailchangenew.txt.tmpl
create mode 100644 webtools/bugzilla/template/default/token/emailchangeold.txt.tmpl
create mode 100644 webtools/bugzilla/template/default/token/tokencancel.txt.tmpl
diff --git a/webtools/bugzilla/template/default/prefs/account.tmpl b/webtools/bugzilla/template/default/prefs/account.tmpl
index 486aba0828a..e436d07a598 100644
--- a/webtools/bugzilla/template/default/prefs/account.tmpl
+++ b/webtools/bugzilla/template/default/prefs/account.tmpl
@@ -21,17 +21,27 @@
[%# INTERFACE:
# realname: string. The user's real name, if any.
# login: string. The user's Bugzilla login email address.
+ # login_change_date: string. The date the email change will be complete. (optional)
+ # new_login_name: string. The user's new Bugzilla login whilst not confirmed. (optional)
#%]
diff --git a/webtools/bugzilla/template/default/prefs/userprefs.tmpl b/webtools/bugzilla/template/default/prefs/userprefs.tmpl
index 136dcda07eb..91bb4f02735 100644
--- a/webtools/bugzilla/template/default/prefs/userprefs.tmpl
+++ b/webtools/bugzilla/template/default/prefs/userprefs.tmpl
@@ -29,8 +29,9 @@
# and its interface must be fulfilled.
# current_tab: A direct reference to one of the hashes in the tabs list.
# This tab will be displayed.
- # changes_saved: boolean. True if the CGI processed form data before
- # displaying anything.
+ # changes_saved: boolean/string. True if the CGI processed form data before
+ # displaying anything, and can contain an optional custom
+ # message if required (which Perl still evaluates as True).
#%]
[% INCLUDE global/header
@@ -75,6 +76,11 @@
[% current_tab.description FILTER lower %] have been saved.
+ [% IF changes_saved != 1 %]
+
+ [% changes_saved %]
+
+ [% END %]
[% END %]
[% current_tab.description %]
diff --git a/webtools/bugzilla/template/default/token/confirmemail.html.tmpl b/webtools/bugzilla/template/default/token/confirmemail.html.tmpl
new file mode 100644
index 00000000000..848828e6085
--- /dev/null
+++ b/webtools/bugzilla/template/default/token/confirmemail.html.tmpl
@@ -0,0 +1,43 @@
+[%# The contents of this file are subject to the Mozilla Public
+ # License Version 1.1 (the "License"); you may not use this file
+ # except in compliance with the License. You may obtain a copy of
+ # the License at http://www.mozilla.org/MPL/
+ #
+ # Software distributed under the License is distributed on an "AS
+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ # implied. See the License for the specific language governing
+ # rights and limitations under the License.
+ #
+ # The Original Code is the Bugzilla Bug Tracking System.
+ #
+ # The Initial Developer of the Original Code is Netscape Communications
+ # Corporation. Portions created by Netscape are
+ # Copyright (C) 1998 Netscape Communications Corporation. All
+ # Rights Reserved.
+ #
+ # Contributor(s): John Vandenberg
+ #%]
+
+[% INCLUDE global/header %]
+
+
+
+ To change your email address, please enter the old email address:
+
+
+
+
+[% INCLUDE global/footer %]
diff --git a/webtools/bugzilla/template/default/token/emailchangenew.txt.tmpl b/webtools/bugzilla/template/default/token/emailchangenew.txt.tmpl
new file mode 100644
index 00000000000..36bf02bf86a
--- /dev/null
+++ b/webtools/bugzilla/template/default/token/emailchangenew.txt.tmpl
@@ -0,0 +1,35 @@
+[%# The contents of this file are subject to the Mozilla Public
+ # License Version 1.1 (the "License"); you may not use this file
+ # except in compliance with the License. You may obtain a copy of
+ # the License at http://www.mozilla.org/MPL/
+ #
+ # Software distributed under the License is distributed on an "AS
+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ # implied. See the License for the specific language governing
+ # rights and limitations under the License.
+ #
+ # The Original Code is the Bugzilla Bug Tracking System.
+ #
+ # The Initial Developer of the Original Code is Netscape Communications
+ # Corporation. Portions created by Netscape are
+ # Copyright (C) 1998 Netscape Communications Corporation. All
+ # Rights Reserved.
+ #
+ # Contributor(s): John Vandenberg
+ #%]
+From: bugzilla-admin-daemon
+To: [% emailaddress %]
+Subject: Bugzilla Change Email Address Request
+
+Bugzilla has received a request to change the email address
+for the [% oldemailaddress %] account to your address.
+
+To confirm the change, visit the following link:
+
+[% Param('urlbase') %]token.cgi?a=cfmem&t=[% token %]
+
+If you are not the person who made this request, or you wish to cancel
+this request, visit the following link:
+
+[% Param('urlbase') %]token.cgi?a=cxlem&t=[% token %]
+
diff --git a/webtools/bugzilla/template/default/token/emailchangeold.txt.tmpl b/webtools/bugzilla/template/default/token/emailchangeold.txt.tmpl
new file mode 100644
index 00000000000..ce7ccd08cdd
--- /dev/null
+++ b/webtools/bugzilla/template/default/token/emailchangeold.txt.tmpl
@@ -0,0 +1,34 @@
+[%# The contents of this file are subject to the Mozilla Public
+ # License Version 1.1 (the "License"); you may not use this file
+ # except in compliance with the License. You may obtain a copy of
+ # the License at http://www.mozilla.org/MPL/
+ #
+ # Software distributed under the License is distributed on an "AS
+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ # implied. See the License for the specific language governing
+ # rights and limitations under the License.
+ #
+ # The Original Code is the Bugzilla Bug Tracking System.
+ #
+ # The Initial Developer of the Original Code is Netscape Communications
+ # Corporation. Portions created by Netscape are
+ # Copyright (C) 1998 Netscape Communications Corporation. All
+ # Rights Reserved.
+ #
+ # Contributor(s): John Vandenberg
+ #%]
+From: bugzilla-admin-daemon
+To: [% emailaddress %]
+Subject: Bugzilla Change Email Address Request
+Importance: High
+X-MSMail-Priority: High
+X-Priority: 1
+
+Bugzilla has received a request to change the email address
+for your account to [% newemailaddress %].
+
+If you are not the person who made this request, or you wish to cancel
+this request, visit the following link:
+
+[% Param('urlbase') %]token.cgi?a=cxlem&t=[% token %]
+
diff --git a/webtools/bugzilla/template/default/token/tokencancel.txt.tmpl b/webtools/bugzilla/template/default/token/tokencancel.txt.tmpl
new file mode 100644
index 00000000000..bcab8c38865
--- /dev/null
+++ b/webtools/bugzilla/template/default/token/tokencancel.txt.tmpl
@@ -0,0 +1,38 @@
+[%# The contents of this file are subject to the Mozilla Public
+ # License Version 1.1 (the "License"); you may not use this file
+ # except in compliance with the License. You may obtain a copy of
+ # the License at http://www.mozilla.org/MPL/
+ #
+ # Software distributed under the License is distributed on an "AS
+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ # implied. See the License for the specific language governing
+ # rights and limitations under the License.
+ #
+ # The Original Code is the Bugzilla Bug Tracking System.
+ #
+ # The Initial Developer of the Original Code is Netscape Communications
+ # Corporation. Portions created by Netscape are
+ # Copyright (C) 1998 Netscape Communications Corporation. All
+ # Rights Reserved.
+ #
+ # Contributor(s): John Vandenberg
+ #%]
+From: bugzilla-admin-daemon
+To: [% emailaddress %]
+Subject: [% tokentype %] token cancelled
+
+A token was cancelled from [% remoteaddress %].
+If you did not request this, it could be either an honest
+mistake or the result of a malicious hack attempt.
+
+Take a look at the information below and forward this email
+to [% maintainer %] if you suspect foul play.
+
+ Token: [% token %]
+ Token Type: [% tokentype %]
+ User: [% emailaddress %]
+ Issue Date: [% issuedate %]
+ Event Data: [% eventdata %]
+Cancelled Because: [% cancelaction %]
+
+