[LON-CAPA-cvs] cvs: modules /gerd/irt encrypt_activity.pl

www www@source.lon-capa.org
Sat, 18 Dec 2010 21:27:06 -0000


www		Sat Dec 18 21:27:06 2010 EDT

  Modified files:              
    /modules/gerd/irt	encrypt_activity.pl 
  Log:
  Encrypt the characters that we don't want
  
  
Index: modules/gerd/irt/encrypt_activity.pl
diff -u modules/gerd/irt/encrypt_activity.pl:1.1 modules/gerd/irt/encrypt_activity.pl:1.2
--- modules/gerd/irt/encrypt_activity.pl:1.1	Sat Dec 18 21:09:41 2010
+++ modules/gerd/irt/encrypt_activity.pl	Sat Dec 18 21:27:06 2010
@@ -29,5 +29,9 @@
 
 sub encrypt {
    my ($user,$domain)=@_;
-   return '<student>'.crypt($user,42).':'.$domain.'</student>';
+   $user=crypt($user,42);
+   $user=~s/\:/CO/gs;
+   $user=~s/\</LT/gs;
+   $user=~s/\>/GT/gs;
+   return '<student>'.$user.':'.$domain.'</student>';
 }