Restrict export of specific media to anonymous users

Restrict export of specific media to anonymous users


To restrict export of some media to anonymous users you will need to modify one jsp file and add a new text file.

  • Make a new text file and call it lunaExportRestrictedFiles.txt. Open it up and add media links you'd like to restrict export on. 

 

  • Open the file in you favorite text editor.

         Got to line 44 and paste in.

<!-- restrict export change -->
      <c:import var="restrictedFiles" url="file:///home/YourUser/LunaImaging/lunaExportRestrictedFiles.txt" />
      <!-- end change -->

  • Next got to line 53 and paste in. 
<!-- restrict export change -->
        <c:if test="${!fn:contains(restrictedFiles , media.id )}">
        <!-- end change -->
        <c:if test="${not empty buyLinkBaseUrl && not empty buyLinkQueryString }">
          <c:choose>
           <c:when test="${media.maxWidth / media.maxHeight < .38 || media.maxHeight / media.maxWidth < .38}" >
                <c:set var="buyBaseUrl_" value="${fn:replace(buyLinkBaseUrl,'002-default.html','002-defaultnss.html')}" />
          </c:when>
          <c:otherwise>
                <c:set var="buyBaseUrl_" value="${buyLinkBaseUrl}" />
          </c:otherwise>
          </c:choose>
          <a id="BuyButton" target=_blank onClick="recordEvent(<c:out value="${analyticsEnabled}"/>,'Buy Button','<c:out value="${buyBaseUrl_}${buyLinkQueryString}" />');" 
                href="<c:out value="${buyBaseUrl_}${buyLinkQueryString}" />"><fmt:message key="link.buy" /></a>

  • Now to finish it off go to line 86 and paste this in.
 <!-- restrict export change -->
        </c:if>
        <!-- end change -->

  • Once complete, save out your jsp file and stop your LUNA 7 tomcat sever and delete the Tomcat localhost folder located at ~/LunaImaging/7.x/LUNA/tomcat/work/Catalina. Then restart Tomcat sever.