[LON-CAPA-cvs] cvs: nsdl /nsdlloncapaorg lonlogin.pm signon.pl

www lon-capa-cvs@mail.lon-capa.org
Fri, 29 Aug 2003 14:50:13 -0000


www		Fri Aug 29 10:50:13 2003 EDT

  Modified files:              
    /nsdl/nsdlloncapaorg	lonlogin.pm signon.pl 
  Log:
  Go directly to desired resource from email.
  
  
Index: nsdl/nsdlloncapaorg/lonlogin.pm
diff -u nsdl/nsdlloncapaorg/lonlogin.pm:1.3 nsdl/nsdlloncapaorg/lonlogin.pm:1.4
--- nsdl/nsdlloncapaorg/lonlogin.pm:1.3	Fri Aug 29 10:10:40 2003
+++ nsdl/nsdlloncapaorg/lonlogin.pm	Fri Aug 29 10:50:13 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
-# Login Screen
+# Login Screen NSDL version
 #
-# $Id: lonlogin.pm,v 1.3 2003/08/29 14:10:40 www Exp $
+# $Id: lonlogin.pm,v 1.4 2003/08/29 14:50:13 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -101,6 +101,7 @@
     my $otherserver='http://'.$ENV{'SERVER_NAME'};
     my $firsturl=
     ($ENV{'request.firsturl'}?$ENV{'request.firsturl'}:$ENV{'form.firsturl'});
+    my $escfirsturl=&Apache::lonnet::escape($firsturl);
 # ---------------------------------------- Are we access server and overloaded?
     if (($role eq 'access') &&
 	(($userloadpercent>100.0)||($loadpercent>100.0))) {
@@ -273,7 +274,7 @@
   <tr>
 
    <!-- Row 1 Columns 2-4 -->
-   <td width="100%" colspan=4 bgcolor="$sidebg"><h1><font color="$pgbg">Welcome to the LON-CAPA NSDL Gateway</font></h1><a href="/cgi-bin/signon.pl"><h3><font color="$pgbg">Sign up for a Guest Login</font></h3></a></td>
+   <td width="100%" colspan=4 bgcolor="$sidebg"><h1><font color="$pgbg">Welcome to the LON-CAPA NSDL Gateway</font></h1><a href="/cgi-bin/signon.pl?$escfirsturl"><h3><font color="$pgbg">Sign up for a Guest Login</font></h3></a></td>
   </tr>
 
   <!-- The gray bar that starts the two table frames -->
Index: nsdl/nsdlloncapaorg/signon.pl
diff -u nsdl/nsdlloncapaorg/signon.pl:1.2 nsdl/nsdlloncapaorg/signon.pl:1.3
--- nsdl/nsdlloncapaorg/signon.pl:1.2	Mon Jul 28 11:03:29 2003
+++ nsdl/nsdlloncapaorg/signon.pl	Fri Aug 29 10:50:13 2003
@@ -25,6 +25,9 @@
 my %libserv=();
 my %hostip=();
 
+my $firsturl=&unescape($ENV{'QUERY_STRING'});
+unless ($firsturl=~/^\//) { $firsturl='/'.$firsturl; }
+
     my %formfields=('afirst' => 'First Name',
                     'blast'  => 'Last Name',
                     'ctitle' => 'Title',
@@ -276,11 +279,12 @@
 
 sub sendemail {
     my $upass=shift;
-   open(MAILOUT,"|mail '$form{'gemail'}' -c '$admemail' -s 'Your LON-CAPA Demo Access Info'");
+   open(MAILOUT,"|mail '$form{'gemail'}' -c '$admemail' -s 'Your LON-CAPA Guest Access Info'");
    print MAILOUT "Welcome to LON-CAPA!\n\n";
    print MAILOUT "Somebody at $ENV{'REMOTE_ADDR'}, probably you, signed up\n";
-   print MAILOUT "for an NSDL guest login to\n\n  http://$demoserver/\n\n";
+   print MAILOUT "for an NSDL guest login to\n\n  http://$demoserver$firsturl?username=$form{'huser'}\n\n";
    print MAILOUT "  Username: $form{'huser'}\n  Password: $upass\n\n";
+   print MAILOUT "\n\nThe guest access will remain valid for 100 days, and can be used for future access to NSDL resources within LON-CAPA\n\n";
    print MAILOUT "Additional information provided was:\n\n";
    foreach (sort keys %formfields) {
       print MAILOUT '  '.$formfields{$_}.': '.$form{$_}."\n";