--- loncom/interface/loncreatecourse.pm 2007/07/02 03:36:28 1.103 +++ loncom/interface/loncreatecourse.pm 2007/08/23 21:54:40 1.104 @@ -1,7 +1,7 @@ # The LearningOnline Network # Create a course # -# $Id: loncreatecourse.pm,v 1.103 2007/07/02 03:36:28 raeburn Exp $ +# $Id: loncreatecourse.pm,v 1.104 2007/08/23 21:54:40 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -669,25 +669,31 @@ sub create_course { 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').'

'); - } - if ($env{'form.setkeys'}) { - $r->print( - '

'.&mt('Manage Access Keys').'

'); - } -# Flush the course logs so reverse user roles immediately updated - &Apache::lonnet::flushcourselogs(); - $r->print('

'.&mt('Roles will be active at next login').'.

'. - '

'. + 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').'

'); + } + if ($env{'form.setkeys'}) { + $r->print( + '

'.&mt('Manage Access Keys').'

'); + } + # Flush the course logs so reverse user roles immediately updated + &Apache::lonnet::flushcourselogs(); + $r->print('

'.&mt('Roles will be active at next login').'.

'); + } + $r->print('

'. &mt('Create Another [_1]',$crstype).'

'. &Apache::loncommon::end_page()); }