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

raeburn raeburn at source.lon-capa.org
Tue May 1 12:09:26 EDT 2012


raeburn		Tue May  1 16:09:26 2012 EDT

  Modified files:              (Branch: loncapaMITrelate_1)
    /loncom/interface	createaccount.pm selfenroll.pm 
  Log:
  - Customization for MITrelate.
    - Different sections assigned to existing users and new users who sign-up 
      for Summer course, so demographic survey is only shown to new users.
  
  
Index: loncom/interface/createaccount.pm
diff -u loncom/interface/createaccount.pm:1.40.2.5.2.16 loncom/interface/createaccount.pm:1.40.2.5.2.17
--- loncom/interface/createaccount.pm:1.40.2.5.2.16	Tue May  1 14:20:10 2012
+++ loncom/interface/createaccount.pm	Tue May  1 16:09:26 2012
@@ -3,7 +3,7 @@
 # institutional log-in ID (institutional authentication required - localauth
 #  or kerberos) or an e-mail address.
 #
-# $Id: createaccount.pm,v 1.40.2.5.2.16 2012/05/01 14:20:10 raeburn Exp $
+# $Id: createaccount.pm,v 1.40.2.5.2.17 2012/05/01 16:09:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -697,7 +697,7 @@
                     }
                     my %form = &start_session($r,$data{'username'},$domain, 
                                               $lonhost,$data{'courseid'},
-                                              $token);
+                                              $token,'new');
                     $nostart = 1;
                     $noend = 1;
                 } else {
@@ -724,7 +724,7 @@
 }
 
 sub start_session {
-    my ($r,$username,$domain,$lonhost,$courseid,$token) = @_;
+    my ($r,$username,$domain,$lonhost,$courseid,$token,$usertype) = @_;
     my %form = (
                 uname => $username,
                 udom  => $domain,
@@ -735,6 +735,9 @@
         if ($courseid ne '') {
             $form{'courseid'} = $courseid;
             $firsturl = '/adm/selfenroll?courseid='.$courseid;
+            if ($usertype) {
+                $firsturl .= '&usertype='.$usertype;
+            }
         }
     }
     if ($r->dir_config('lonBalancer') eq 'yes') {
@@ -1144,7 +1147,7 @@
         if ($result eq 'ok') {
             my $delete = &Apache::lonnet::tmpdel($env{'form.authtoken'});
             $output = &mt('A LON-CAPA account has been created for username: [_1] in domain: [_2].',$username,$domain);
-            my %form = &start_session($r,$username,$domain,$lonhost,$courseid);
+            my %form = &start_session($r,$username,$domain,$lonhost,$courseid,undef,'new');
             my $nostart = 1;
             return ('ok',$output,$nostart);
         } else {
Index: loncom/interface/selfenroll.pm
diff -u loncom/interface/selfenroll.pm:1.25 loncom/interface/selfenroll.pm:1.25.6.1
--- loncom/interface/selfenroll.pm:1.25	Sat Jan 16 16:13:42 2010
+++ loncom/interface/selfenroll.pm	Tue May  1 16:09:26 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Allow users to self-enroll in a course
 #
-# $Id: selfenroll.pm,v 1.25 2010/01/16 16:13:42 raeburn Exp $
+# $Id: selfenroll.pm,v 1.25.6.1 2012/05/01 16:09:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -52,7 +52,7 @@
     }
     &Apache::lonacc::get_posted_cgi($r);
     &Apache::lonlocal::get_language_handle($r);
-    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['courseid']);
+    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['courseid','usertype']);
     my $js = &Apache::createaccount::catreturn_js();
     my ($coursechk,$courseid) = &validate_course_id($env{'form.courseid'});
     if ($coursechk ne 'ok') {
@@ -442,6 +442,9 @@
         if ($selfenroll_section eq 'none') {
             $usec = '';
         }
+        unless (($usec ne '') && ($env{'form.usertype'} eq 'new')) {
+            $usec = 'sp12';
+        }
         if ($selfenroll_registered) {
             my ($registered,$instsec,$message) = &check_registered($cdom,$cnum);
             $usec = $instsec;




More information about the LON-CAPA-cvs mailing list