[LON-CAPA-cvs] cvs: loncom /interface createaccount.pm

raeburn raeburn@source.lon-capa.org
Wed, 14 Jan 2009 13:13:59 -0000


raeburn		Wed Jan 14 13:13:59 2009 EDT

  Modified files:              
    /loncom/interface	createaccount.pm 
  Log:
  - If a user needs to create a user account to self enroll in a course, the user's domain should be the domain of the course.  
  
  
Index: loncom/interface/createaccount.pm
diff -u loncom/interface/createaccount.pm:1.26 loncom/interface/createaccount.pm:1.27
--- loncom/interface/createaccount.pm:1.26	Fri Dec  5 19:22:58 2008
+++ loncom/interface/createaccount.pm	Wed Jan 14 13:13:59 2009
@@ -3,7 +3,7 @@
 # institutional log-in ID (institutional authentication required - localauth
 #  or kerberos) or an e-mail address.
 #
-# $Id: createaccount.pm,v 1.26 2008/12/05 19:22:58 schafran Exp $
+# $Id: createaccount.pm,v 1.27 2009/01/14 13:13:59 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -58,10 +58,21 @@
     my $sso_username = $r->subprocess_env->get('REDIRECT_SSOUserUnknown');
     my $sso_domain = $r->subprocess_env->get('REDIRECT_SSOUserDomain');
 
+    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['token','courseid']);
+    &Apache::lonacc::get_posted_cgi($r);
+    &Apache::lonlocal::get_language_handle($r);
+
     if ($sso_username ne '' && $sso_domain ne '') {
         $domain = $sso_domain; 
-    } else { 
+    } else {
         $domain = &Apache::lonnet::default_login_domain();
+        if (defined($env{'form.courseid'})) {
+            if (&validate_course($env{'form.courseid'})) {
+                if ($env{'form.courseid'} =~ /^($match_domain)_($match_courseid)$/) {
+                    $domain = $1; 
+                }
+            }
+        }
     }
     my $domdesc = &Apache::lonnet::domain($domain,'description');
     my $contact_name = &mt('LON-CAPA helpdesk');
@@ -74,10 +85,6 @@
     my $include = $r->dir_config('lonIncludes');
     my $start_page;
 
-    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['token','courseid']);
-    &Apache::lonacc::get_posted_cgi($r);
-    &Apache::lonlocal::get_language_handle($r);
-
     my $handle = &Apache::lonnet::check_for_valid_session($r);
     if ($handle ne '') {
         $start_page =