[LON-CAPA-cvs] cvs: loncom(version_2_5_X) /interface loncreatecourse.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Fri, 24 Aug 2007 07:21:43 -0000
albertel Fri Aug 24 03:21:43 2007 EDT
Modified files: (Branch: version_2_5_X)
/loncom/interface loncreatecourse.pm
Log:
- backport 1.104
Index: loncom/interface/loncreatecourse.pm
diff -u loncom/interface/loncreatecourse.pm:1.103.2.1 loncom/interface/loncreatecourse.pm:1.103.2.2
--- loncom/interface/loncreatecourse.pm:1.103.2.1 Thu Aug 2 15:52:30 2007
+++ loncom/interface/loncreatecourse.pm Fri Aug 24 03:21:43 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Create a course
#
-# $Id: loncreatecourse.pm,v 1.103.2.1 2007/08/02 19:52:30 albertel Exp $
+# $Id: loncreatecourse.pm,v 1.103.2.2 2007/08/24 07:21:43 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -670,25 +670,31 @@
return;
}
my ($courseid,$crsudom,$crsunum);
- $r->print(&Apache::loncommon::construct_course($args,\$logmsg,\$courseid,\$crsudom,\$crsunum,$env{'user.domain'},$env{'user.name'}));
-
-#
-# Make the requested user a course coordinator or group coordinator
-#
- if (($ccdomain) && ($ccuname)) {
- $r->print(&mt('Assigning role of [_1] Coordinator to [_2] at [_3]: ',
- $crstype,$ccuname,$ccdomain).
- &Apache::lonnet::assignrole($ccdomain,$ccuname,$courseid,
- 'cc').'<p>');
- }
- if ($env{'form.setkeys'}) {
- $r->print(
- '<p><a href="/adm/managekeys?cid='.$crsudom.'_'.$crsunum.'">'.&mt('Manage Access Keys').'</a></p>');
- }
-# Flush the course logs so reverse user roles immediately updated
- &Apache::lonnet::flushcourselogs();
- $r->print('<p>'.&mt('Roles will be active at next login').'.</p>'.
- '<p><a href="/adm/createcourse?phase='.lc($crstype).'one">'.
+ my ($success,$output) =
+ &Apache::loncommon::construct_course($args,\$logmsg,\$courseid,
+ \$crsudom,\$crsunum,
+ $env{'user.domain'},
+ $env{'user.name'});
+ $r->print($output);
+ if ($success) {
+ #
+ # Make the requested user a course coordinator or group coordinator
+ #
+ if (($ccdomain) && ($ccuname)) {
+ $r->print(&mt('Assigning role of [_1] Coordinator to [_2] at [_3]: ',
+ $crstype,$ccuname,$ccdomain).
+ &Apache::lonnet::assignrole($ccdomain,$ccuname,$courseid,
+ 'cc').'<p>');
+ }
+ if ($env{'form.setkeys'}) {
+ $r->print(
+ '<p><a href="/adm/managekeys?cid='.$crsudom.'_'.$crsunum.'">'.&mt('Manage Access Keys').'</a></p>');
+ }
+ # Flush the course logs so reverse user roles immediately updated
+ &Apache::lonnet::flushcourselogs();
+ $r->print('<p>'.&mt('Roles will be active at next login').'.</p>');
+ }
+ $r->print('<p><a href="/adm/createcourse?phase='.lc($crstype).'one">'.
&mt('Create Another [_1]',$crstype).'</a></p>'.
&Apache::loncommon::end_page());
}