--- loncom/interface/lonpopulate.pm 2006/08/08 19:02:04 1.46 +++ loncom/interface/lonpopulate.pm 2007/03/08 01:58:45 1.49 @@ -1,5 +1,5 @@ # automated enrollment configuration handler -# $Id: lonpopulate.pm,v 1.46 2006/08/08 19:02:04 albertel Exp $ +# $Id: lonpopulate.pm,v 1.49 2007/03/08 01:58:45 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -113,30 +113,28 @@ function process(calling,numauto,nummanu } if (calling == "notify") { var totalnote = 0; - if (formName.notify[1].checked = true) { - for (var i=0; i 0) { - if (formName.notify[1].checked = true) { - if (confirm("You have indicated that you do not want notification of roster changes messages to be sent, but "+totalnote+" have been checked as recipients.\\nClick 'OK' to erase all recipients, or 'Cancel'.")) { - checker = 1; - } else { - checker = 0; - } - } - } else { - if (formName.notify[0].checked = true) { - alert("You have indicated that you want notification of roster changes messages to be sent, but you have not selected any recipients."); - checker = 0; - } - } + for (var i=0; i 0) { + if (formName.notify[1].checked == true) { + if (confirm("You have indicated that you do not want notification of roster changes messages to be sent, but "+totalnote+" have been checked as recipients.\\nClick 'OK' to erase all recipients, or 'Cancel'.")) { + checker = 1; + } else { + checker = 0; + } + } + } else { + if (formName.notify[0].checked == true) { + alert("You have indicated that you want notification of roster changes messages to be sent, but you have not selected any recipients."); + checker = 0; + } } } if (calling == "viewclass") { @@ -946,19 +944,13 @@ your changes. '); my ($result,$perm_reqd)=&Apache::lonnet::auto_photo_permission($crs,$dom); my $can_enable = 1; - my $institution = $Apache::lonnet::domaindescription{$dom}; - my $user; - if ($enrollvar{'courseowner'} =~ /^[^:]+:[^:]+$/) { - $user = $env{'user.name'}.':'.$env{'user.domain'}; - } else { - $user = $env{'user.name'}; - } + my $institution = &Apache::lonnet::domain($dom,'description'); if ($result eq 'ok') { if ($perm_reqd eq 'yes') { if (!($enrollvar{'photopermission'} eq 'yes')) { $can_enable = 0; } else { - if ($user eq $enrollvar{'courseowner'}) { + if (&user_is_courseowner($enrollvar{'courseowner'})) { $r->print(' '. @@ -991,7 +983,7 @@ your changes. '); } else { - if ($user eq $enrollvar{'courseowner'}) { + if (&user_is_courseowner($enrollvar{'courseowner'})) { $r->print(' '. @@ -2285,7 +2277,7 @@ sub photo_permission { $dom,$crs); my ($showphotos,$response); if (exists($env{'form.cancel_agreement'})) { - if ($env{'user.name'} eq $settings{'internal.courseowner'}) { + if (&user_is_courseowner($settings{'internal.courseowner'})) { my %cenv = ( 'internal.photopermission' => 'no', ); @@ -2354,8 +2346,8 @@ sub photo_permission { sub print_photo_agreement { my ($r,$realm,$dom,$crs,$action,$tasktitleref,$conditions,$courseowner)=@_; my $response; - my $institution = $Apache::lonnet::domaindescription{$dom}; - if ($env{'user.name'} eq $courseowner) { + my $institution = &Apache::lonnet::domain($dom,'description'); + if (&user_is_courseowner($courseowner)) { $response = '