cvs: php-bugs-web / bug-pwd-finder.php
| From: | Derick Rethans | Date: | Tue, 01 Oct 2002 14:02:50 +0000 |
| Subject: | cvs: php-bugs-web / bug-pwd-finder.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-12883@lists.php.net to get a copy of this message | ||
derick Tue Oct 1 10:02:50 2002 EDT
Modified files:
/php-bugs-web bug-pwd-finder.php
Log:
- Do not send password is it's empty
Index: php-bugs-web/bug-pwd-finder.php
diff -u php-bugs-web/bug-pwd-finder.php:1.2 php-bugs-web/bug-pwd-finder.php:1.3
--- php-bugs-web/bug-pwd-finder.php:1.2 Sun Apr 21 13:58:03 2002
+++ php-bugs-web/bug-pwd-finder.php Tue Oct 1 10:02:49 2002
@@ -5,38 +5,42 @@
if ($bug_id) {
- mysql_pconnect ("localhost","nobody","")
- or die("Unable to connect to SQL server. Please try again later.");
+ mysql_pconnect ("localhost","nobody","")
+ or die("Unable to connect to SQL server. Please try again later.");
- mysql_select_db ("php3");
+ mysql_select_db ("php3");
- // Clean up the bug id
- $bug_id = ereg_replace ("[^0-9]+", "", $bug_id);
+ // Clean up the bug id
+ $bug_id = ereg_replace ("[^0-9]+", "", $bug_id);
- if ($bug_id != "") {
+ if ($bug_id != "") {
- // Try to find the email and the password
- $query = "SELECT email, passwd FROM bugdb WHERE id = $bug_id";
-
- // Run the query
- $result = mysql_query ($query)
- or die ("Sorry. No information could be found for bug report #$bug_id");
- } else {
- $msg = "The provided #$bug_id bug id is invalid.";
- }
-
- if (mysql_num_rows($result) != 1) {
- $msg = "No password found for #$bug_id bug report, sorry.";
- } else {
- list ($email, $passwd) = mysql_fetch_row ($result);
- $passwd = stripslashes ($passwd);
-
- mail ($email, "Password for bug report #$bug_id", "The password for bug report
#$bug_id is $passwd.", "From: noreply@php.net")
- or die ("Sorry. Mail could not be sent at this time. Please try again later.");
-
- $msg = "The password for bug report #$bug_id has been sent to $email.";
- }
+ // Try to find the email and the password
+ $query = "SELECT email, passwd FROM bugdb WHERE id = $bug_id";
+ // Run the query
+ $result = mysql_query ($query)
+ or die ("Sorry. No information could be found for bug report #$bug_id");
+ } else {
+ $msg = "The provided #$bug_id bug id is invalid.";
+ }
+
+ if (mysql_num_rows($result) != 1) {
+ $msg = "No password found for #$bug_id bug report, sorry.";
+ } else {
+ list ($email, $passwd) = mysql_fetch_row ($result);
+
+ if (empty($password) {
+ $msg = "No password found for #$bug_id bug report, sorry.";
+ } else {
+ $passwd = stripslashes ($passwd);
+
+ mail ($email, "Password for bug report #$bug_id", "The password for bug report
#$bug_id is $passwd.", "From: noreply@php.net")
+ or die ("Sorry. Mail could not be sent at this time. Please try again later.");
+
+ $msg = "The password for bug report #$bug_id has been sent to $email.";
+ }
+ }
}
commonHeader("Bug Report Password Finder");