--- loncom/lond 2009/10/09 12:36:10 1.410.2.2 +++ loncom/lond 2009/02/10 11:31:26 1.411 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.410.2.2 2009/10/09 12:36:10 raeburn Exp $ +# $Id: lond,v 1.411 2009/02/10 11:31:26 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -59,7 +59,7 @@ my $DEBUG = 0; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.410.2.2 $'; #' stupid emacs +my $VERSION='$Revision: 1.411 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -562,8 +562,13 @@ sub InstallFile { # # ConfigFileFromSelector: converts a configuration file selector -# (one of host or domain at this point) into a -# configuration file pathname. +# into a configuration file pathname. +# It's probably no longer necessary to preserve +# special handling of hosts or domain as those +# files have been superceded by dns_hosts, dns_domain. +# The default action is just to prepend the directory +# and append .tab +# # # Parameters: # selector - Configuration file selector. @@ -580,7 +585,7 @@ sub ConfigFileFromSelector { } elsif ($selector eq "domain") { $tablefile = $tabledir."domain.tab"; } else { - return undef; + $tablefile = $tabledir.$selector.'.tab'; } return $tablefile; @@ -1781,9 +1786,8 @@ sub change_password_handler { # npass - New password. # context - Context in which this was called # (preferences or reset_by_email). - # lonhost - HostID of server where request originated - my ($udom,$uname,$upass,$npass,$context,$lonhost)=split(/:/,$tail); + my ($udom,$uname,$upass,$npass,$context)=split(/:/,$tail); $upass=&unescape($upass); $npass=&unescape($npass); @@ -1792,13 +1796,9 @@ sub change_password_handler { # First require that the user can be authenticated with their # old password unless context was 'reset_by_email': - my ($validated,$failure); + my $validated; if ($context eq 'reset_by_email') { - if ($lonhost eq '') { - $failure = 'invalid_client'; - } else { - $validated = 1; - } + $validated = 1; } else { $validated = &validate_user($udom, $uname, $upass); } @@ -1812,11 +1812,8 @@ sub change_password_handler { $salt=substr($salt,6,2); my $ncpass=crypt($npass,$salt); if(&rewrite_password_file($udom, $uname, "internal:$ncpass")) { - my $msg="Result of password change for $uname: pwchange_success"; - if ($lonhost) { - $msg .= " - request originated from: $lonhost"; - } - &logthis($msg); + &logthis("Result of password change for " + ."$uname: pwchange_success"); &Reply($client, "ok\n", $userinput); } else { &logthis("Unable to open $uname passwd " @@ -1837,10 +1834,7 @@ sub change_password_handler { } } else { - if ($failure eq '') { - $failure = 'non_authorized'; - } - &Failure( $client, "$failure\n", $userinput); + &Failure( $client, "non_authorized\n", $userinput); } return 1; @@ -4320,12 +4314,12 @@ sub dump_domainroles_handler { my ($start,$end) = split(/:/,&unescape($value)); my ($trole,$uname,$udom,$runame,$rudom,$rsec) = split(/:/,&unescape($key)); unless ($startfilter eq '.' || !defined($startfilter)) { - if ((defined($start)) && ($start >= $startfilter)) { + if ($start >= $startfilter) { $match = 0; } } unless ($endfilter eq '.' || !defined($endfilter)) { - if ((defined($end)) && ($end <= $endfilter)) { + if ($end <= $endfilter) { $match = 0; } }