[LON-CAPA-cvs] cvs: loncom /automation batchcreatecourse.pm /interface loncommon.pm loncreatecourse.pm loncreateuser.pm londropadd.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Sat, 03 Mar 2007 01:40:39 -0000
albertel Fri Mar 2 20:40:39 2007 EDT
Modified files:
/loncom/interface loncommon.pm loncreatecourse.pm londropadd.pm
loncreateuser.pm
/loncom/automation batchcreatecourse.pm
Log:
- switch to lonnet for get the library server for a domain
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.512 loncom/interface/loncommon.pm:1.513
--- loncom/interface/loncommon.pm:1.512 Fri Mar 2 20:33:20 2007
+++ loncom/interface/loncommon.pm Fri Mar 2 20:40:28 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.512 2007/03/03 01:33:20 albertel Exp $
+# $Id: loncommon.pm,v 1.513 2007/03/03 01:40:28 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1451,23 +1451,6 @@
=pod
-=item * get_library_servers($domain)
-
-Returns a hash which contains keys like '103l3' and values like
-'kirk.lite.msu.edu'. All of the keys will be for machines in the
-given $domain.
-
-=cut
-
-#-------------------------------------------
-sub get_library_servers {
- return &Apache::lonnet::get_servers($_[0],'library');
-}
-
-#-------------------------------------------
-
-=pod
-
=item * home_server_option_list($domain)
returns a string which contains an <option> list to be used in a
@@ -1478,7 +1461,7 @@
#-------------------------------------------
sub home_server_option_list {
my $domain = shift;
- my %servers = &get_library_servers($domain);
+ my %servers = &Apache::lonnet::get_servers($domain,'library');
my $result = '';
foreach my $hostid (sort(keys(%servers))) {
$result.=
Index: loncom/interface/loncreatecourse.pm
diff -u loncom/interface/loncreatecourse.pm:1.100 loncom/interface/loncreatecourse.pm:1.101
--- loncom/interface/loncreatecourse.pm:1.100 Wed Jan 10 16:37:50 2007
+++ loncom/interface/loncreatecourse.pm Fri Mar 2 20:40:28 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Create a course
#
-# $Id: loncreatecourse.pm,v 1.100 2007/01/10 21:37:50 www Exp $
+# $Id: loncreatecourse.pm,v 1.101 2007/03/03 01:40:28 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -49,7 +49,7 @@
$crstype = 'Course';
}
my $defdom=$env{'request.role.domain'};
- my %host_servers = &Apache::loncommon::get_library_servers($defdom);
+ my %host_servers = &Apache::lonnet::get_servers($defdom,'library');
my $course_home = '<select name="course_home" size="1">'."\n";
foreach my $server (sort(keys(%host_servers))) {
$course_home .= qq{<option value="$server"};
@@ -662,8 +662,8 @@
return;
}
# Check the proposed home server for the course
- my %host_servers = &Apache::loncommon::get_library_servers
- ($env{'request.role.domain'});
+ my %host_servers =
+ &Apache::lonnet::get_servers($env{'request.role.domain'},'library');
if (! exists($host_servers{$env{'form.course_home'}})) {
$r->print(&mt('Invalid home server for course').': '.
$env{'form.course_home'}.&Apache::loncommon::end_page());
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.156 loncom/interface/londropadd.pm:1.157
--- loncom/interface/londropadd.pm:1.156 Fri Mar 2 20:33:21 2007
+++ loncom/interface/londropadd.pm Fri Mar 2 20:40:28 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to drop and add students in courses
#
-# $Id: londropadd.pm,v 1.156 2007/03/03 01:33:21 albertel Exp $
+# $Id: londropadd.pm,v 1.157 2007/03/03 01:40:28 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -117,7 +117,7 @@
$select_menus{$dom}->{'default'}= 'default';
$select_menus{$dom}->{'select2'}->{'default'} = 'default';
# Now build up the other items in the second menu
- my %servers = &Apache::loncommon::get_library_servers($dom);
+ my %servers = &Apache::lonnet::get_servers($dom,'library');
foreach my $server (keys(%servers)) {
$select_menus{$dom}->{'select2'}->{$server}
= "$server $servers{$server}";
@@ -766,7 +766,7 @@
if (lc($desiredhost) eq 'default') {
$desiredhost = undef;
} else {
- my %home_servers =&Apache::loncommon::get_library_servers($domain);
+ my %home_servers =&Apache::lonnet::get_servers($domain,'library');
if (! exists($home_servers{$desiredhost})) {
$r->print('<font color="#ff0000">'.&mt('Error').':</font>'.
&mt('Invalid home server specified'));
@@ -997,7 +997,7 @@
#
# Set up domain selection form
my $homeserver_form = '';
- my %servers = &Apache::loncommon::get_library_servers($domain);
+ my %servers = &Apache::lonnet::get_servers($domain,'library');
$homeserver_form = '<select name="lcserver" size="1">'."\n".
'<option value="default" selected>default</option>'."\n";
while (my ($servername,$serverdescription) = each (%servers)) {
@@ -2171,7 +2171,7 @@
if (lc($desiredhost) eq 'default') {
$desiredhost = undef;
} else {
- my %home_servers = &Apache::loncommon::get_library_servers($domain);
+ my %home_servers = &Apache::lonnet::get_servers($domain,'library');
if (! exists($home_servers{$desiredhost})) {
$r->print('<font color="#ff0000">'.&mt('Error').'</font>'.
&mt('Invalid home server specified'));
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.146 loncom/interface/loncreateuser.pm:1.147
--- loncom/interface/loncreateuser.pm:1.146 Fri Mar 2 20:33:21 2007
+++ loncom/interface/loncreateuser.pm Fri Mar 2 20:40:28 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.146 2007/03/03 01:33:21 albertel Exp $
+# $Id: loncreateuser.pm,v 1.147 2007/03/03 01:40:28 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1064,8 +1064,8 @@
if (lc($desiredhost) eq 'default') {
$desiredhost = undef;
} else {
- my %home_servers = &Apache::loncommon::get_library_servers
- ($env{'form.ccdomain'});
+ my %home_servers =
+ &Apache::lonnet::get_servers($env{'form.ccdomain'},'library');
if (! exists($home_servers{$desiredhost})) {
$r->print($error.&mt('Invalid home server specified'));
return;
Index: loncom/automation/batchcreatecourse.pm
diff -u loncom/automation/batchcreatecourse.pm:1.19 loncom/automation/batchcreatecourse.pm:1.20
--- loncom/automation/batchcreatecourse.pm:1.19 Wed Dec 20 17:35:35 2006
+++ loncom/automation/batchcreatecourse.pm Fri Mar 2 20:40:38 2007
@@ -1,5 +1,5 @@
#
-# $Id: batchcreatecourse.pm,v 1.19 2006/12/20 22:35:35 albertel Exp $
+# $Id: batchcreatecourse.pm,v 1.20 2007/03/03 01:40:38 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -489,7 +489,7 @@
firstres => $firstres
};
- my %host_servers = &Apache::loncommon::get_library_servers($cdom);
+ my %host_servers = &Apache::lonnet::get_servers($cdom,'library');
if (! exists($host_servers{$$details{$num}{'coursehome'}})) {
$$logmsg .= &mt('Invalid home server for course').': '.$$details{$num}{'coursehome'};
return;