--- loncom/Attic/lcuseradd 2002/04/27 13:10:47 1.20 +++ loncom/Attic/lcuseradd 2002/09/16 13:27:40 1.22 @@ -18,7 +18,7 @@ # o LonCapa will add it if/when the user is granted an Author # role. # -# $Id: lcuseradd,v 1.20 2002/04/27 13:10:47 foxr Exp $ +# $Id: lcuseradd,v 1.22 2002/09/16 13:27:40 foxr Exp $ ### ############################################################################### @@ -162,10 +162,14 @@ else { } my ($username,$password1,$password2)=@input; +print "Username = ".$username unless $noprint; $username=~/^(\w+)$/; +print "Username after substitution - ".$username unless $noprint; my $safeusername=$1; +print "Safe username = $safeusername" unless $noprint; + if (($username ne $safeusername) or ($safeusername!~/^[A-Za-z]/)) { - print "Error. The user name specified has invalid characters.\n" + print "Error. The user name specified $username $safeusername has invalid characters.\n" unless $noprint; unlink('/tmp/lock_lcpasswd'); exit 9; @@ -244,33 +248,33 @@ if ($?) { # ------------------------------ Make final modifications to the user directory # -- Add a public_html file with a stand-in index.html file -# system('/bin/chmod','-R','0660',"/home/$safeusername"); -#system('/bin/chmod','0710',"/home/$safeusername"); -#mkdir "/home/$safeusername/public_html",0755; -#system('/bin/chmod','02770',"/home/$safeusername/public_html"); -#open OUT,">/home/$safeusername/public_html/index.html"; -#print OUT< -# -#$safeusername -# -# -#

$safeusername

-#

-#Learning Online Network -#

-#

-#This area provides for: -#

-# -# -# -#END -#close OUT; + system('/bin/chmod','-R','0660',"/home/$safeusername"); +system('/bin/chmod','0710',"/home/$safeusername"); +mkdir "/home/$safeusername/public_html",0755; +system('/bin/chmod','02770',"/home/$safeusername/public_html"); +open OUT,">/home/$safeusername/public_html/index.html"; +print OUT< + +$safeusername + + +

$safeusername

+

+Learning Online Network +

+

+This area provides for: +

+ + + +END +close OUT; system('/bin/chown','-R',"$safeusername:$safeusername","/home/$safeusername");