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

raeburn raeburn@source.lon-capa.org
Sun, 22 Aug 2010 19:28:28 -0000


raeburn		Sun Aug 22 19:28:28 2010 EDT

  Modified files:              
    /loncom	lond 
    /loncom/interface	createaccount.pm 
  Log:
  - Change the way tokens are named. 
  
  
Index: loncom/lond
diff -u loncom/lond:1.453 loncom/lond:1.454
--- loncom/lond:1.453	Sun Aug 22 03:44:12 2010
+++ loncom/lond	Sun Aug 22 19:28:26 2010
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.453 2010/08/22 03:44:12 raeburn Exp $
+# $Id: lond,v 1.454 2010/08/22 19:28:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -58,7 +58,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.453 $'; #' stupid emacs
+my $VERSION='$Revision: 1.454 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -4678,7 +4678,7 @@
     }
     my ($id,$store);
     $tmpsnum++;
-    if ($context eq 'resetpw') {
+    if (($context eq 'resetpw') || ($context eq 'createaccount')) {
         $id = &md5_hex(&md5_hex(time.{}.rand().$$));
     } else {
         $id = $$.'_'.$clientip.'_'.$tmpsnum;
Index: loncom/interface/createaccount.pm
diff -u loncom/interface/createaccount.pm:1.40 loncom/interface/createaccount.pm:1.41
--- loncom/interface/createaccount.pm:1.40	Mon Aug 16 14:23:50 2010
+++ loncom/interface/createaccount.pm	Sun Aug 22 19:28:28 2010
@@ -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 2010/08/16 14:23:50 raeburn Exp $
+# $Id: createaccount.pm,v 1.41 2010/08/22 19:28:28 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -459,7 +459,7 @@
                                             );
     my ($lkey,$ukey) = &Apache::lonpreferences::des_keys();
     my ($lextkey,$uextkey) = &getkeys($lkey,$ukey);
-    my $logtoken=Apache::lonnet::reply('tmpput:'.$ukey.$lkey.'&createaccount',
+    my $logtoken=Apache::lonnet::reply('tmpput:'.$ukey.$lkey.'&createaccount:createaccount',
                                        $lonhost);
     $output = &serverform($logtoken,$lonhost,undef,$courseid,$context);
     my $unameform = '<input type="text" name="uname" size="20" value="" />';
@@ -597,7 +597,7 @@
                 'domain'     => $domain,
                 'username'   => $email,
                 'courseid'   => $courseid);
-    my $token = &Apache::lonnet::tmpput(\%info,$server);
+    my $token = &Apache::lonnet::tmpput(\%info,$server,'createaccount');
     if ($token !~ /^error/ && $token ne 'no_such_host') {
         my $esc_token = &escape($token);
         my $showtime = localtime(time);
@@ -721,7 +721,7 @@
         $output .= &javascript_setforms($now)."\n".&javascript_checkpass($now);
         my ($lkey,$ukey) = &Apache::lonpreferences::des_keys();
         my ($lextkey,$uextkey) = &getkeys($lkey,$ukey);
-        my $logtoken=Apache::lonnet::reply('tmpput:'.$ukey.$lkey.'&createaccount',
+        my $logtoken=Apache::lonnet::reply('tmpput:'.$ukey.$lkey.'&createaccount:createaccount',
                                            $lonhost);
         my $formtag = '<form name="server" method="post" target="_top" action="/adm/createaccount">';
         my ($datatable,$rowcount) =
@@ -962,7 +962,7 @@
                     'time'       => $now,
                     'domain'     => $domain,
                     'username'   => $username);
-        my $authtoken = &Apache::lonnet::tmpput(\%info,$lonhost);
+        my $authtoken = &Apache::lonnet::tmpput(\%info,$lonhost,'createaccount');
         if ($authtoken !~ /^error/ && $authtoken ne 'no_such_host') {
             $output .= '<input type="hidden" name="authtoken" value="'.&HTML::Entities::encode($authtoken,'&<>"').'" />';
         } else {