getMessage(); printf("%s
\n", htmlspecialchars($e->getMessage())); $status = -1; } flock($f, LOCK_UN); fclose($f); if ($status != 0) { printf("

htpasswd failed (status = %d)



\n", $status); printf("# %s
\n", $cmd); } else { printf("

Password updated successfully


\n"); printf("

You will now need to log in again,
\n"); printf("even within the same browser session.


\n"); } foreach ($output as $line) { printf("%s
\n", htmlspecialchars($line)); } } else { $errors[] = "New passwords do not match."; } } else { $errors[] = "Current password does not match."; } } else { $errors[] = "Wrong user."; } if (count($errors) > 0) { $body = $errors; array_unshift($body, sprintf("Failed password update for %s", $user), ""); mail("webmaster@tucsonfolkfest.org", "Failed password update attempt", implode("\r\n", $body), "From: webmaster@tucsonfolkfest.org\r\n"); printf("

\n"); foreach ($errors as $e) { printf("%s
\n", htmlspecialchars($e)); } printf("

Please try again.

\n"); } else if (preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i", $user)) { $body[] = "Your password for tucsonfolkfest.org has been changed."; $body[] = ""; $body[] = "If you did NOT do this, please reply to this email immediately."; mail($user, "Password updated", implode("\r\n", $body), "From: webmaster@tucsonfolkfest.org\r\n"); } ?>
Staff user name: />
Current password:
 
New password:
Type it again: