2006-01-09 05:22:02 +03:00
|
|
|
#!/usr/bin/perl -w
|
1998-08-29 03:50:39 +04:00
|
|
|
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
1999-11-02 02:33:56 +03:00
|
|
|
# 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.
|
|
|
|
#
|
1998-08-29 03:50:39 +04:00
|
|
|
# The Original Code is the Despot Account Administration System.
|
1999-11-02 02:33:56 +03:00
|
|
|
#
|
1998-08-29 03:50:39 +04:00
|
|
|
# The Initial Developer of the Original Code is Netscape Communications
|
1999-11-02 02:33:56 +03:00
|
|
|
# Corporation. Portions created by Netscape are
|
|
|
|
# Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
# Rights Reserved.
|
|
|
|
#
|
1998-08-29 03:50:39 +04:00
|
|
|
# Contributor(s): Terry Weissman <terry@mozilla.org>
|
|
|
|
|
|
|
|
|
|
|
|
# This goes through the database, and sends whiny mail to anyone who has not
|
|
|
|
# changed their password.
|
|
|
|
|
|
|
|
$sourcedir = $0;
|
|
|
|
$sourcedir =~ s:/[^/]*$::; # Remove last word, and slash before it.
|
|
|
|
if ($sourcedir eq "") {
|
|
|
|
$sourcedir = ".";
|
|
|
|
}
|
|
|
|
|
|
|
|
chdir $sourcedir || die "Couldn't chdir to $sourcedir";
|
|
|
|
|
|
|
|
|
2006-01-08 09:50:21 +03:00
|
|
|
use DBI;
|
1998-08-29 03:50:39 +04:00
|
|
|
require 'utils.pl';
|
|
|
|
|
2006-01-08 09:50:21 +03:00
|
|
|
use vars qw( $db_host $db_name $db_user $db_pass );
|
|
|
|
do "config.pl" || die "Couldn't load config file";
|
|
|
|
my $dsn = "DBI:mysql:host=$db_host;database=$db_name";
|
|
|
|
$::db = DBI->connect($dsn, $db_user, $db_pass)
|
1998-08-29 03:50:39 +04:00
|
|
|
|| die "Can't connect to database server";
|
|
|
|
|
2006-01-08 09:50:21 +03:00
|
|
|
$query = $::db->prepare("SELECT email, neednewpassword FROM users");
|
|
|
|
$query->execute();
|
1998-08-29 03:50:39 +04:00
|
|
|
|
|
|
|
$changedsomething = 0;
|
|
|
|
|
2006-01-08 09:50:21 +03:00
|
|
|
while (@row = $query->fetchrow_array()) {
|
1998-08-29 03:50:39 +04:00
|
|
|
($email,$neednew) = @row;
|
|
|
|
if ($neednew eq "Yes") {
|
|
|
|
print "$email\n";
|
|
|
|
open(MAIL, "| /bin/mail $email");
|
|
|
|
print MAIL "Subject: [despot] Your mozilla.org account needs to have its password changed.";
|
|
|
|
print MAIL q{
|
|
|
|
(This message has been automatically generated.)
|
|
|
|
|
|
|
|
You have a mozilla.org account, which is used to access various things at
|
|
|
|
mozilla.org. Currently, your account has been disabled, and will stay
|
|
|
|
disabled until you change your password.
|
|
|
|
|
|
|
|
To change your password, please visit
|
2000-02-03 02:07:20 +03:00
|
|
|
http://despot.mozilla.org/despot.cgi.
|
1998-08-29 03:50:39 +04:00
|
|
|
If you can't get that to work, send mail to staff@mozilla.org. If it's
|
|
|
|
an emergency, try paging terry at page-terry@netscape.com.
|
|
|
|
|
|
|
|
Unless you take some action, you will probably get this very same email
|
|
|
|
every day.
|
|
|
|
};
|
|
|
|
|
|
|
|
close MAIL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($changedsomething) {
|
|
|
|
system("./syncit.pl");
|
|
|
|
}
|