Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
9ff5677e
Commit
9ff5677e
authored
Mar 16, 2002
by
gerv%gerv.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 126789 - templatise token.cgi. r=bbaetz, mattyt.
parent
300e2cb3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
61 deletions
+83
-61
change-password.html.tmpl
template/default/admin/change-password.html.tmpl
+54
-0
token.cgi
token.cgi
+29
-61
No files found.
template/default/admin/change-password.html.tmpl
0 → 100644
View file @
9ff5677e
[%# 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): Gervase Markham <gerv@gerv.net>
#%]
[% INCLUDE global/header %]
<p>
To change your password, enter a new password twice:
</p>
<form method="post" action="token.cgi">
<input type="hidden" name="t" value="[% token %]" />
<input type="hidden" name="a" value="chgpw" />
<table>
<tr>
<th align="right">New Password:</th>
<td>
<input type="password" name="password" size="16" maxlength="16" />
</td>
</tr>
<tr>
<th align="right">New Password Again:</th>
<td>
<input type="password" name="matchpassword" size="16" maxlength="16" />
</td>
</tr>
<tr>
<th align="right"> </th>
<td>
<input type="submit" value="Submit" />
</td>
</tr>
</table>
</form>
[% INCLUDE global/footer %]
token.cgi
View file @
9ff5677e
...
...
@@ -30,6 +30,8 @@ use strict;
use
lib
qw(.)
;
use
vars
qw($template $vars)
;
# Include the Bugzilla CGI and general utility library.
require
"CGI.pl"
;
...
...
@@ -144,72 +146,42 @@ exit;
################################################################################
sub
requestChangePassword
{
Token::
IssuePasswordToken
(
$::FORM
{
'loginname'
});
# Return HTTP response headers.
print
"Content-Type: text/html\n\n"
;
$vars
->
{
'title'
}
=
"Request to Change Password"
;
$vars
->
{
'message'
}
=
"A token for changing your password has been
emailed to you. Follow the instructions in
that email to change your password."
;
PutHeader
(
"Request to Change Password"
);
print
qq|
<p>
A token for changing your password has been emailed to you.
Follow the instructions in that email to change your password.
</p>
|
;
PutFooter
();
print
"Content-Type: text/html\n\n"
;
$template
->
process
(
"global/message.html.tmpl"
,
$vars
)
||
DisplayError
(
"Template process failed: "
.
$template
->
error
())
&&
exit
;
}
sub
confirmChangePassword
{
# Return HTTP response headers.
$vars
->
{
'title'
}
=
"Change Password"
;
$vars
->
{
'token'
}
=
$::token
;
print
"Content-Type: text/html\n\n"
;
PutHeader
(
"Change Password"
);
print
qq|
<p>
To change your password, enter a new password twice:
</p>
<form method="post" action="token.cgi">
<input type="hidden" name="t" value="$::token">
<input type="hidden" name="a" value="chgpw">
<table>
<tr>
<th align="right">New Password:</th>
<td><input type="password" name="password" size="16" maxlength="16"></td>
</tr>
<tr>
<th align="right">New Password Again:</th>
<td><input type="password" name="matchpassword" size="16" maxlength="16"></td>
</tr>
<tr>
<th align="right"> </th>
<td><input type="submit" value="Submit"></td>
</tr>
</table>
</form>
|
;
PutFooter
();
$template
->
process
(
"admin/change-password.html.tmpl"
,
$vars
)
||
DisplayError
(
"Template process failed: "
.
$template
->
error
())
&&
exit
;
}
sub
cancelChangePassword
{
sub
cancelChangePassword
{
Token::
Cancel
(
$::token
,
"user requested cancellation"
);
# Return HTTP response headers.
print
"Content-Type: text/html\n\n
"
;
$vars
->
{
'title'
}
=
"Cancel Request to Change Password"
;
$vars
->
{
'message'
}
=
"Your request has been cancelled.
"
;
PutHeader
(
"Cancel Request to Change Password"
);
print
qq|
<p>
Your request has been cancelled.
</p>
|
;
PutFooter
();
print
"Content-Type: text/html\n\n"
;
$template
->
process
(
"global/message.html.tmpl"
,
$vars
)
||
DisplayError
(
"Template process failed: "
.
$template
->
error
())
&&
exit
;
}
sub
changePassword
{
# Quote the password and token for inclusion into SQL statements.
my
$cryptedpassword
=
Crypt
(
$::FORM
{
'password'
});
my
$quotedpassword
=
SqlQuote
(
$cryptedpassword
);
...
...
@@ -229,17 +201,13 @@ sub changePassword {
InvalidateLogins
(
$userid
);
# Return HTTP response headers.
print
"Content-Type: text/html\n\n
"
;
$vars
->
{
'title'
}
=
"Password Changed"
;
$vars
->
{
'message'
}
=
"Your password has been changed.
"
;
# Let the user know their password has been changed.
PutHeader
(
"Password Changed"
);
print
qq|
<p>
Your password has been changed.
</p>
|
;
PutFooter
();
print
"Content-Type: text/html\n\n"
;
$template
->
process
(
"global/message.html.tmpl"
,
$vars
)
||
DisplayError
(
"Template process failed: "
.
$template
->
error
())
&&
exit
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment