version 1.19, 2011/04/27 20:42:58
|
version 1.20, 2011/11/17 14:29:51
|
Line 96 use Term::ReadKey;
|
Line 96 use Term::ReadKey;
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use DBI; |
use DBI; |
|
use strict; |
|
|
=pod |
=pod |
|
|
Line 122 coordinator.
|
Line 123 coordinator.
|
|
|
=cut |
=cut |
|
|
my ($username,$domain)=(@ARGV); |
|
my $lang = &Apache::lonlocal::choose_language(); |
my $lang = &Apache::lonlocal::choose_language(); |
&Apache::lonlocal::get_language_handle(undef,$lang); |
&Apache::lonlocal::get_language_handle(undef,$lang); |
print"\n"; |
print"\n"; |
Line 191 unless (($go_on eq '') || ($go_on =~ /^\
|
Line 191 unless (($go_on eq '') || ($go_on =~ /^\
|
} |
} |
print "\n"; |
print "\n"; |
|
|
my ($got_passwd,$firstpass,$secondpass); |
my ($got_passwd,$firstpass,$secondpass,$passwd); |
my $maxtries = 10; |
my $maxtries = 10; |
my $trial = 0; |
my $trial = 0; |
while ((!$got_passwd) && ($trial < $maxtries)) { |
while ((!$got_passwd) && ($trial < $maxtries)) { |
Line 199 while ((!$got_passwd) && ($trial < $maxt
|
Line 199 while ((!$got_passwd) && ($trial < $maxt
|
if (length($firstpass) < 6) { |
if (length($firstpass) < 6) { |
print(&mt('Password too short.')."\n". |
print(&mt('Password too short.')."\n". |
&mt('Please choose a password with at least six characters.')."\n". |
&mt('Please choose a password with at least six characters.')."\n". |
i &mt('Please try again.')."\n"); |
&mt('Please try again.')."\n"); |
} elsif (length($firstpass) > 30) { |
} elsif (length($firstpass) > 30) { |
print(&mt('Password too long.')."\n". |
print(&mt('Password too long.')."\n". |
&mt('Please choose a password with no more than thirty characters.')."\n". |
&mt('Please choose a password with no more than thirty characters.')."\n". |
i &mt('Please try again.')."\n"); |
&mt('Please try again.')."\n"); |
} else { |
} else { |
my $pbad=0; |
my $pbad=0; |
foreach (split(//,$passwd)) {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}} |
foreach (split(//,$passwd)) {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}} |
Line 352 if (-d "/home/$username") {
|
Line 352 if (-d "/home/$username") {
|
|
|
# Process password (taint-check, then pass to the UNIX passwd command). |
# Process password (taint-check, then pass to the UNIX passwd command). |
$username =~ s/\W//g; # an extra filter, just to be sure |
$username =~ s/\W//g; # an extra filter, just to be sure |
$pbad = 0; |
my $pbad = 0; |
foreach (split(//,$passwd)) {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}} |
foreach (split(//,$passwd)) {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}} |
if ($pbad) { |
if ($pbad) { |
print(&mt('Password must consist of standard ASCII characters.'). |
print(&mt('Password must consist of standard ASCII characters.'). |