1 |
<?php |
<?php |
2 |
if (!$STDNWPSTYLE_INCLUDED) |
require_once("style/std/stdwpstyle.inc"); |
3 |
{ |
//---------------------------------------------------------------------------------------------------- |
4 |
include("stdnwpstyle.inc"); |
//Copyright (c) 2003, 2018 David T. Ashley. |
5 |
$STDNWPSTYLE_INCLUDED=1; |
// |
6 |
} |
//Permission is hereby granted, free of charge, to any person obtaining a copy |
7 |
?> |
//of this software and associated documentation files (the "Software"), to deal |
8 |
<?php |
//in the Software without restriction, including without limitation the rights |
9 |
//******************************************************************************** |
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
10 |
//Copyright (C) 2003 David T. Ashley |
//copies of the Software, and to permit persons to whom the Software is |
11 |
//******************************************************************************** |
//furnished to do so, subject to the following conditions: |
12 |
//This program or source file is free software; you can redistribute it and/or |
// |
13 |
//modify it under the terms of the GNU General Public License as published by |
//The above copyright notice and this permission notice shall be included in all |
14 |
//the Free Software Foundation; either version 2 of the License, or (at your |
//copies or substantial portions of the Software. |
15 |
//option) any later version. |
// |
16 |
// |
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 |
//This program or source file is distributed in the hope that it will |
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 |
//be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
19 |
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
20 |
//GNU General Public License for more details. |
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
21 |
// |
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
22 |
//You may have received a copy of the GNU General Public License |
//SOFTWARE. |
23 |
//along with this program; if not, write to the Free Software |
//---------------------------------------------------------------------------------------------------- |
|
//Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
//******************************************************************************** |
|
24 |
// |
// |
25 |
function do_header(&$style) |
function do_header(&$style) |
26 |
{ |
{ |
27 |
$style->header_title("HTPASSWD-Style Hashed Password Generator", |
$style->static_page_header_title_std("HTPASSWD-Style Hashed Password Generator", |
28 |
"<i>htpasswd</i>-Style Hashed Password Generator", |
"<i>htpasswd</i>-Style Hashed Password Generator", |
29 |
""); |
""); |
30 |
echo "<p align=\"center\"><b><font size=\"3\">(This cgi-bin form generates password hashes which are \n"; |
echo "<p align=\"center\"><b><font size=\"3\">(This cgi-bin form generates password hashes which are \n"; |
34 |
echo "randomly selected two-character salt. To use this password hash generator, \n"; |
echo "randomly selected two-character salt. To use this password hash generator, \n"; |
35 |
echo "you must normally paste the output into an <i>Apache</i> directory access file or into \n"; |
echo "you must normally paste the output into an <i>Apache</i> directory access file or into \n"; |
36 |
echo "the <i>CVSROOT/passwd</i> file of a <i>CVS</i> repository.)</font></b></p>\n"; |
echo "the <i>CVSROOT/passwd</i> file of a <i>CVS</i> repository.)</font></b></p>\n"; |
37 |
$style->hrule_std(); |
$style->static_page_hrule_std(); |
38 |
echo "<p align=\"center\"><font size=\"3\" color=\"#FF0000\"><b>WARNING:</b> The username and "; |
echo "<p align=\"center\"><font size=\"3\" color=\"#FF0000\"><b>WARNING:</b> The username and "; |
39 |
echo "password you choose are "; |
echo "password you choose are "; |
40 |
echo "transmitted over the network to the server unencrypted and can be intercepted. "; |
echo "transmitted over the network to the server unencrypted and can be intercepted. "; |
41 |
echo "Use this utility "; |
echo "Use this utility "; |
42 |
echo "at your own risk.</font></p>\n"; |
echo "at your own risk.</font></p>\n"; |
43 |
$style->hrule_std(); |
$style->static_page_hrule_std(); |
44 |
} |
} |
45 |
|
|
46 |
function do_footer(&$style) |
function do_footer(&$style) |
47 |
{ |
{ |
48 |
$style->footer_std(); |
$style->static_page_footer_std(); |
49 |
} |
} |
50 |
|
|
51 |
function do_form($Buttontext) |
function do_form($Buttontext) |
52 |
{ |
{ |
53 |
echo "<form method=post action=\"htpasswd_gen.php\" width=\"100%\">\n"; |
echo "<form method=post action=\"index.php\" width=\"100%\">\n"; |
54 |
echo "<table align=\"center\">\n"; |
echo "<table align=\"center\">\n"; |
55 |
echo "<tr>\n"; |
echo "<tr>\n"; |
56 |
echo " <td width=\"10%\">\n"; |
echo " <td width=\"10%\">\n"; |
92 |
//Main script begins here. |
//Main script begins here. |
93 |
// |
// |
94 |
// |
// |
95 |
$style = new Stdnwpstyle; |
$style = new StdWpStyle; |
96 |
//Assign the current style in force. Also, starts the CPU |
//Assign the current style in force. Also, starts the CPU |
97 |
//usage clock. |
//usage clock. |
98 |
|
|
99 |
//Do the header unconditionally. The header is always used on this page. |
//Do the header unconditionally. The header is always used on this page. |
100 |
do_header($style); |
do_header($style); |
101 |
// |
// |
102 |
|
if (isset($_POST['Username'])) |
103 |
|
$Username = $_POST['Username']; |
104 |
|
// |
105 |
|
if (isset($_POST['Password'])) |
106 |
|
$Password = $_POST['Password']; |
107 |
|
|
108 |
//Load up a few variables based on what username and password values were supplied. |
//Load up a few variables based on what username and password values were supplied. |
109 |
if (isset($Username) && isset($Password)) |
if (isset($Username) && isset($Password)) |
110 |
{ |
{ |
173 |
{ |
{ |
174 |
//The password is suspicious. Must flag it. |
//The password is suspicious. Must flag it. |
175 |
do_err_msg("The <i>Password</i> you supplied is not valid. Passwords must contain at least two characters and may consist only of lower-case and upper-case letters and digits and the \"/\" and \".\" characters. Please try again."); |
do_err_msg("The <i>Password</i> you supplied is not valid. Passwords must contain at least two characters and may consist only of lower-case and upper-case letters and digits and the \"/\" and \".\" characters. Please try again."); |
176 |
$style->hrule_std(); |
$style->static_page_hrule_std(); |
177 |
do_form("Click To Generate Hashed Password"); |
do_form("Click To Generate Hashed Password"); |
178 |
} |
} |
179 |
else |
else |
191 |
echo "character or other punctuation appears as the last character(s) of the hash above, \n"; |
echo "character or other punctuation appears as the last character(s) of the hash above, \n"; |
192 |
echo "it <i>is</i> part of the hash and \n"; |
echo "it <i>is</i> part of the hash and \n"; |
193 |
echo "must be included when copying and pasting.</p>\n"; |
echo "must be included when copying and pasting.</p>\n"; |
194 |
$style->hrule_std(); |
$style->static_page_hrule_std(); |
195 |
do_form("Click To Generate Another Hashed Password"); |
do_form("Click To Generate Another Hashed Password"); |
196 |
} |
} |
197 |
|
|