--- loncom/build/make_domain_coordinator.pl 2008/03/03 15:25:02 1.15 +++ loncom/build/make_domain_coordinator.pl 2009/07/17 22:23:59 1.17 @@ -11,7 +11,7 @@ make_domain_coordinator.pl - Make a doma # The LearningOnline Network # make_domain_coordinator.pl - Make a domain coordinator on a system # -# $Id: make_domain_coordinator.pl,v 1.15 2008/03/03 15:25:02 www Exp $ +# $Id: make_domain_coordinator.pl,v 1.17 2009/07/17 22:23:59 droeschl Exp $ # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). # @@ -304,9 +304,20 @@ foreach (split(//,$passwd)) {if ((ord($_ if ($pbad) { die('Password must consist of standard ASCII characters'."\n"); } -open(OUT,"|passwd --stdin $username"); -print(OUT $passwd."\n"); -close(OUT); + +my $distro; +if (open(PIPE,"perl distprobe|")) { + $distro = ; + close(PIPE); +} +if ($distro =~ /^ubuntu|debian/) { + open(OUT,"|usermod -p `mkpasswd $passwd` $username"); + close(OUT); +} else { + open(OUT,"|passwd --stdin $username"); + print(OUT $passwd."\n"); + close(OUT); +} =pod @@ -426,7 +437,7 @@ print("\n$username is now a domain coord my $hostname=`hostname`; chomp($hostname); # Read in hostname. print("\n".'Once LON-CAPA is running, you should log-in and use: '."\n". 'http://'.$hostname.'/adm/createuser to further define this user.'."\n\n". - 'From the user management menu, click the link: "Add/Modify a Single User" '."\n". + 'From the user management menu, click the link: "Add/Modify a User" '."\n". 'to search for the user and to provide additional information (last name, first name etc.).'."\n"); # Output a suggested URL.