[LON-CAPA-cvs] cvs: loncom /auth checkauthen.pm /homework chemresponse.pm /html/res/adm/pages/reactionresponse reaction_editor.html doc/loncapafiles loncapafiles.lpml removenolongerused.piml

raeburn raeburn at source.lon-capa.org
Mon Sep 21 10:25:03 EDT 2015


raeburn		Mon Sep 21 14:25:03 2015 EDT

  Modified files:              
    /doc/loncapafiles	removenolongerused.piml loncapafiles.lpml 
    /loncom/html/res/adm/pages/reactionresponse	reaction_editor.html 
    /loncom/homework	chemresponse.pm 
    /loncom/auth	checkauthen.pm 
  Log:
  - Bug 6800
    - Move HTML files used for pop-up window in reactionresponse to 
      /adm/reactionresponse directory to support public access.
    - Replace use of &EXT('query.') with javascript to retrieve values for
      reaction, field and id from query string, and replace call to &xmlparse()
      with HTML entity to provide rightarrow. 
  
  
Index: doc/loncapafiles/removenolongerused.piml
diff -u doc/loncapafiles/removenolongerused.piml:1.11 doc/loncapafiles/removenolongerused.piml:1.12
--- doc/loncapafiles/removenolongerused.piml:1.11	Fri Jun 20 21:21:44 2014
+++ doc/loncapafiles/removenolongerused.piml	Mon Sep 21 14:24:34 2015
@@ -34,7 +34,8 @@
 my %dirs = (
               'londocroot' => ['adm/lonLCDfont',
                                   'htmlarea',
-                                  'res/adm/pages/bookmarkmenu'],
+                                  'res/adm/pages/bookmarkmenu',
+                                  'res/adm/pages/reactionresponse'],
            );
 
 my %multis = (
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.922 doc/loncapafiles/loncapafiles.lpml:1.923
--- doc/loncapafiles/loncapafiles.lpml:1.922	Tue Jul  7 20:10:09 2015
+++ doc/loncapafiles/loncapafiles.lpml	Mon Sep 21 14:24:34 2015
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.922 2015/07/07 20:10:09 musolffc Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.923 2015/09/21 14:24:34 raeburn Exp $ -->
 
 <!--
 
@@ -619,6 +619,12 @@
 </directory>
 <directory dist='default'>
   <protectionlevel>modest_delete</protectionlevel>
+  <targetdir dist='default'>home/httpd/html/adm/reactionresponse</targetdir>
+  <categoryname>server readonly</categoryname>
+  <description>HTML files for reactionresponse items</description>
+</directory>
+<directory dist='default'>
+  <protectionlevel>modest_delete</protectionlevel>
   <targetdir dist='default'>home/httpd/html/adm/quicksearch</targetdir>
   <categoryname>server readonly</categoryname>
   <description>Author space quick search</description>
@@ -912,12 +918,6 @@
 </directory>
 <directory dist='default'>
   <protectionlevel>modest_delete</protectionlevel>
-  <targetdir dist='default'>home/httpd/html/res/adm/pages/reactionresponse</targetdir>
-  <categoryname>server readonly</categoryname>
-  <description>web user interface resources</description>
-</directory>
-<directory dist='default'>
-  <protectionlevel>modest_delete</protectionlevel>
   <targetdir dist='default'>home/httpd/html/adm/lonDomLogos</targetdir>
   <categoryname>server readonly</categoryname>
   <description>Logos for LON-CAPA domains</description>
@@ -8298,7 +8298,7 @@
 <fileglob>
 <glob>*.*</glob>
 <sourcedir>loncom/html/res/adm/pages/reactionresponse/</sourcedir>
-<targetdir dist='default'>home/httpd/html/res/adm/pages/reactionresponse/</targetdir>
+<targetdir dist='default'>home/httpd/html/adm/reactionresponse/</targetdir>
 <categoryname>interface file</categoryname>
 <description>
 Associated file for answering reactionresponse style questions
Index: loncom/html/res/adm/pages/reactionresponse/reaction_editor.html
diff -u loncom/html/res/adm/pages/reactionresponse/reaction_editor.html:1.15 loncom/html/res/adm/pages/reactionresponse/reaction_editor.html:1.16
--- loncom/html/res/adm/pages/reactionresponse/reaction_editor.html:1.15	Mon Sep 21 14:08:57 2015
+++ loncom/html/res/adm/pages/reactionresponse/reaction_editor.html	Mon Sep 21 14:24:44 2015
@@ -1,7 +1,7 @@
 <!-- Chemical reaction editor developed by Guy Ashkenazi, guy at fh.huji.ac.il-->
 
 <!--
- $Id: reaction_editor.html,v 1.15 2015/09/21 14:08:57 raeburn Exp $
+ $Id: reaction_editor.html,v 1.16 2015/09/21 14:24:44 raeburn Exp $
 
  Copyright Michigan State University Board of Trustees
 
@@ -29,7 +29,7 @@
 <html>
 <head>
 <script type="text/javascript" language="Javascript">
-var rightarrow;
+var rightarrow = '→';
 var id;
 var reaction;
 var field
@@ -228,6 +228,20 @@
 }
 
 function setup() {
+  var query = window.location.search.substring(1);
+  var vars = query.split("&");
+  for (var i=0;i<vars.length;i++) {
+      var pair = vars[i].split("=");
+      if (pair[0] == 'reaction' ) {
+          reaction = decodeURIComponent(pair[1]);
+      }
+      if (pair[0] == 'field') {
+          field = decodeURIComponent(pair[1]);
+      }
+      if (pair[0] == 'id') {
+          id = decodeURIComponent(pair[1]);
+      }
+  }
   document.form.text.value=reaction;
   parent.viewer.document.writeln('<center><br />'+to_html(document.form.text.value)+'</center>');
   parent.viewer.document.close();
@@ -239,15 +253,6 @@
 </head>
 
 <body bgcolor="#ffffff" onLoad = "javascript:setup();">
-<display>
-return '<script type="text/javascript" language="Javascript">
-          var rightarrow=\''.&xmlparse('<m display="tth">$\rightarrow$</m>').'\';
-	  var reaction=\''.&EXT('query.reaction').'\';
-	  var field=\''.&EXT('query.field').'\';
-	  var id=\''.&EXT('query.id').'\';
-        </script>';
-</display>
-
 <center>
 <hr />
 <form name="form">
Index: loncom/homework/chemresponse.pm
diff -u loncom/homework/chemresponse.pm:1.97 loncom/homework/chemresponse.pm:1.98
--- loncom/homework/chemresponse.pm:1.97	Mon Mar  9 16:30:46 2015
+++ loncom/homework/chemresponse.pm	Mon Sep 21 14:24:54 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # chemical equation style response
 #
-# $Id: chemresponse.pm,v 1.97 2015/03/09 16:30:46 raeburn Exp $
+# $Id: chemresponse.pm,v 1.98 2015/09/21 14:24:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -654,7 +654,7 @@
     function create_reaction_window_${id}_${field} () {
 	editor=window.open('','','width=500,height=270,scrollbars=no,resizable=yes');
 	editor.$docopen;
-	editor.document.writeln('$start_page <frame src="/res/adm/pages/reactionresponse/reaction_viewer.html?inhibitmenu=yes" name="viewer" scrolling="no" />  <frame src="/res/adm/pages/reactionresponse/reaction_editor.html?inhibitmenu=yes&reaction=$reaction_es&id=$id_es&field=$field_es" name="editor" scrolling="no" /> $end_page');
+	editor.document.writeln('$start_page <frame src="/adm/reactionresponse/reaction_viewer.html?inhibitmenu=yes" name="viewer" scrolling="no" />  <frame src="/adm/reactionresponse/reaction_editor.html?inhibitmenu=yes&reaction=$reaction_es&id=$id_es&field=$field_es" name="editor" scrolling="no" /> $end_page');
 	editor.document.close();
     }
 // -->
Index: loncom/auth/checkauthen.pm
diff -u loncom/auth/checkauthen.pm:1.18 loncom/auth/checkauthen.pm:1.19
--- loncom/auth/checkauthen.pm:1.18	Fri Sep 18 11:43:05 2015
+++ loncom/auth/checkauthen.pm	Mon Sep 21 14:25:03 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # checks for a cookie to authenticate a user
 #
-# $Id: checkauthen.pm,v 1.18 2015/09/18 11:43:05 raeburn Exp $
+# $Id: checkauthen.pm,v 1.19 2015/09/21 14:25:03 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -50,13 +50,6 @@
         return OK;
     }
 
-    if ($r->uri() =~ m{^/res/adm/pages/reactionresponse/[^/]+\.html$}) {
-        if ($r->user() eq '') {
-            $r->user('public:public');
-        }
-        return OK;
-    }
-
     if ($r->auth_type() ne 'LONCAPA') {
 	return DECLINED;
     }




More information about the LON-CAPA-cvs mailing list