[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface selfenroll.pm

raeburn raeburn at source.lon-capa.org
Tue Dec 14 07:53:12 EST 2021


raeburn		Tue Dec 14 12:53:12 2021 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	selfenroll.pm 
  Log:
  - For 2.11
    Backport 1.36
  
  
Index: loncom/interface/selfenroll.pm
diff -u loncom/interface/selfenroll.pm:1.27.2.7 loncom/interface/selfenroll.pm:1.27.2.8
--- loncom/interface/selfenroll.pm:1.27.2.7	Sun Jun 20 16:23:21 2021
+++ loncom/interface/selfenroll.pm	Tue Dec 14 12:53:12 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Allow users to self-enroll in a course
 #
-# $Id: selfenroll.pm,v 1.27.2.7 2021/06/20 16:23:21 raeburn Exp $
+# $Id: selfenroll.pm,v 1.27.2.8 2021/12/14 12:53:12 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -456,7 +456,7 @@
         }
         if ($selfenroll_approval) {
             my $outcome = 
-                &store_selfenroll_request($udom,$uname,$usec,$cdom,$cnum,
+                &store_selfenroll_request($r,$udom,$uname,$usec,$cdom,$cnum,
                                           $selfenroll_notifylist,$owner,
                                           $selfenroll_approval,$crstype,$lonhost,$handle);
             $r->print($outcome);
@@ -536,7 +536,7 @@
 }
 
 sub store_selfenroll_request {
-    my ($udom,$uname,$usec,$cdom,$cnum,$selfenroll_notifylist,$owner,
+    my ($r,$udom,$uname,$usec,$cdom,$cnum,$selfenroll_notifylist,$owner,
         $selfenroll_approval,$crstype,$lonhost,$handle) = @_;
     my $namespace = 'selfenrollrequests';
     my $output;
@@ -552,7 +552,7 @@
         }
         if ($status eq 'pending') {
             my $token = $info{$cdom.'_'.$cnum}{'token'};
-            my ($statusupdate,$pendingform) = &pending_selfenrollment_form($cdom,$cnum,$crstype,$token,$lonhost);
+            my ($statusupdate,$pendingform) = &pending_selfenrollment_form($r,$cdom,$cnum,$crstype,$token,$lonhost);
             if ($statusupdate eq 'pending') {
                 $output .= $pendingform;
             }
@@ -590,7 +590,7 @@
             }
             $output = &mt('Your request for self-enrollment has been recorded.').'<br />';
             if ($status eq 'pending') {
-                my ($statusupdate,$pendingform) = &pending_selfenrollment_form($cdom,$cnum,$crstype,$token,$lonhost);
+                my ($statusupdate,$pendingform) = &pending_selfenrollment_form($r,$cdom,$cnum,$crstype,$token,$lonhost);
                 if ($statusupdate eq 'request') {
                     $status = $statusupdate;
                 } else {
@@ -631,7 +631,7 @@
 }
 
 sub pending_selfenrollment_form {
-    my ($cdom,$cnum,$crstype,$token,$lonhost) = @_;
+    my ($r,$cdom,$cnum,$crstype,$token,$lonhost) = @_;
     my ($status,$output);
     my $coursetype = &Apache::lonuserutils::get_extended_type($cdom,$cnum,$crstype);
     my %postvalues = (
@@ -668,6 +668,8 @@
                 my $hostname = &Apache::lonnet::hostname($lonhost);
                 my $protocol = $Apache::lonnet::protocol{$lonhost};
                 $protocol = 'http' if ($protocol ne 'https');
+                my $alias = &Apache::lonnet::use_proxy_alias($r,$lonhost);
+                $hostname = $alias if ($alias ne '');
                 my $enroller = $protocol.'://'.$hostname.'/cgi-bin/enrollqueued.pl';
                 $output .= '<input type="hidden" name="enroller" value="'.$enroller.'" />'."\n".
                            '<input type="hidden" name="token" value="'.$token.'" />'."\n".




More information about the LON-CAPA-cvs mailing list