manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kish...@apache.org
Subject svn commit: r1689968 [6/14] - in /manifoldcf/branches/CONNECTORS-1196: ./ connectors/elasticsearch/ connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ connectors/solr/connector/src/main/native2ascii/org/apache/manifoldcf/...
Date Wed, 08 Jul 2015 22:01:09 GMT
Modified: manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/edittransformation.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/edittransformation.jsp?rev=1689968&r1=1689967&r2=1689968&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/edittransformation.jsp (original)
+++ manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/edittransformation.jsp Wed Jul  8 22:01:08 2015
@@ -23,16 +23,27 @@
 %>
 
 <%
-    // The contract of this edit page is as follows.  It is either called directly, in which case it is expected to be creating
-    // a connection or beginning the process of editing an existing connection, or it is called via redirection from execute.jsp, in which case
-    // the connection object being edited will be placed in the thread context under the name "ConnectionObject".
-    try
-    {
+// The contract of this edit page is as follows.  It is either called directly, in which case it is expected to be creating
+// a connection or beginning the process of editing an existing connection, or it is called via redirection from execute.jsp, in which case
+// the connection object being edited will be placed in the thread context under the name "ConnectionObject".
+try
+{
+  // Check if authorized
+  if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_EDIT_CONNECTIONS))
+  {
+    variableContext.setParameter("target","listtransformations.jsp");
+%>
+    <jsp:forward page="unauthorized.jsp"/>
+<%
+  }
+
   // Get the connection manager handle
   ITransformationConnectionManager connMgr = TransformationConnectionManagerFactory.make(threadContext);
   // Also get the list of available connectors
   ITransformationConnectorManager connectorManager = TransformationConnectorManagerFactory.make(threadContext);
 
+  IResultSet set = connectorManager.getConnectors();
+
   // Figure out what the current tab name is.
   String tabName = variableContext.getParameter("tabname");
   if (tabName == null || tabName.length() == 0)
@@ -101,115 +112,115 @@
   <script type="text/javascript">
   <!--
 
-  // Use this method to repost the form and pick a new tab
-  function SelectTab(newtab)
+// Use this method to repost the form and pick a new tab
+function SelectTab(newtab)
+{
+  if (checkForm())
   {
-    if (checkForm())
-    {
-      document.editconnection.tabname.value = newtab;
-      document.editconnection.submit();
-    }
+    document.editconnection.tabname.value = newtab;
+    document.editconnection.submit();
   }
+}
 
-  // Use this method to repost the form,
-  // and set the anchor request.
-  function postFormSetAnchor(anchorValue)
+// Use this method to repost the form,
+// and set the anchor request.
+function postFormSetAnchor(anchorValue)
+{
+  if (checkForm())
   {
-    if (checkForm())
-    {
-      if (anchorValue != "")
-        document.editconnection.action = document.editconnection.action + "#" + anchorValue;
-      document.editconnection.submit();
-    }
+    if (anchorValue != "")
+      document.editconnection.action = document.editconnection.action + "#" + anchorValue;
+    document.editconnection.submit();
   }
+}
 
-  // Use this method to repost the form
-  function postForm()
+// Use this method to repost the form
+function postForm()
+{
+  if (checkForm())
   {
-    if (checkForm())
-    {
-      document.editconnection.submit();
-    }
+    document.editconnection.submit();
   }
+}
 
-  function Save()
+function Save()
+{
+  if (checkForm())
   {
-    if (checkForm())
-    {
-      // Can't submit until all required fields have been set.
-      // Some of these don't live on the current tab, so don't set
-      // focus.
+    // Can't submit until all required fields have been set.
+    // Some of these don't live on the current tab, so don't set
+    // focus.
 
-      // Check our part of the form, for save
-      if (editconnection.connname.value == "")
-      {
-        alert("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"edittransformation.ConnectionMustHaveAName")%>");
-        SelectTab("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"edittransformation.Name")%>");
-        document.editconnection.connname.focus();
+    // Check our part of the form, for save
+    if (editconnection.connname.value == "")
+    {
+      alert("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"edittransformation.ConnectionMustHaveAName")%>");
+      SelectTab("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"edittransformation.Name")%>");
+      document.editconnection.connname.focus();
+      return;
+    }
+    if (window.checkConfigForSave)
+    {
+      if (!checkConfigForSave())
         return;
-      }
-      if (window.checkConfigForSave)
-      {
-        if (!checkConfigForSave())
-          return;
-      }
-      document.editconnection.op.value="Save";
-      document.editconnection.submit();
     }
-  }
-
-  function Continue()
-  {
-    document.editconnection.op.value="Continue";
-    postForm();
-  }
-
-  function Cancel()
-  {
-    document.editconnection.op.value="Cancel";
+    document.editconnection.op.value="Save";
     document.editconnection.submit();
   }
+}
 
-  function checkForm()
+function Continue()
+{
+  document.editconnection.op.value="Continue";
+  postForm();
+}
+
+function Cancel()
+{
+  document.editconnection.op.value="Cancel";
+  document.editconnection.submit();
+}
+
+function checkForm()
+{
+  if (!checkConnectionCount())
+    return false;
+  if (window.checkConfig)
+    return checkConfig();
+  return true;
+}
+
+function checkConnectionCount()
+{
+  if (!isInteger(editconnection.maxconnections.value))
+  {
+    alert("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"edittransformation.TheMaximumNumberOfConnectionsMustBeAValidInteger")%>");
+    editconnection.maxconnections.focus();
+    return false;
+  }
+  return true;
+}
+
+function isRegularExpression(value)
+{
+  try
   {
-    if (!checkConnectionCount())
-      return false;
-    if (window.checkConfig)
-      return checkConfig();
+    var foo = "teststring";
+    foo.search(value.replace(/\(\?i\)/,""));
     return true;
   }
-
-  function checkConnectionCount()
+  catch (e)
   {
-    if (!isInteger(editconnection.maxconnections.value))
-    {
-      alert("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"edittransformation.TheMaximumNumberOfConnectionsMustBeAValidInteger")%>");
-      editconnection.maxconnections.focus();
-      return false;
-    }
-    return true;
+    return false;
   }
 
-  function isRegularExpression(value)
-  {
-    try
-    {
-      var foo = "teststring";
-                        foo.search(value.replace(/\(\?i\)/,""));
-      return true;
-    }
-    catch (e)
-    {
-      return false;
-    }
+}
 
-  }
-
-  function isInteger(value)
-  {
-    var anum=/(^\d+$)/;
-    return anum.test(value);
-  }
+function isInteger(value)
+{
+  var anum=/(^\d+$)/;
+  return anum.test(value);
+}
 
   //-->
   </script>
@@ -221,76 +232,76 @@
 
 <body class="standardbody">
 
-    <table class="page">
-      <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
-      <tr><td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
-       <td class="darkwindow">
+  <table class="page">
+    <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
+    <tr>
+      <td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
+      <td class="darkwindow">
 <%
   // Get connector list; need this to decide what to do
-  IResultSet set = connectorManager.getConnectors();
   if (set.getRowCount() == 0)
   {
 %>
-  <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.EditTransformationConnection2")%></p>
-  <table class="displaytable"><tr><td class="message"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.NoTransformationConnectorsRegistered")%></td></tr></table>
+        <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.EditTransformationConnection2")%></p>
+        <table class="displaytable"><tr><td class="message"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.NoTransformationConnectorsRegistered")%></td></tr></table>
 <%
   }
   else
   {
 %>
 
-  <form class="standardform" name="editconnection" action="execute.jsp" method="POST" enctype="multipart/form-data">
-      <input type="hidden" name="op" value="Continue"/>
-      <input type="hidden" name="type" value="transformation"/>
-      <input type="hidden" name="tabname" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(tabName)%>'/>
-      <input type="hidden" name="isnewconnection" value='<%=(isNew?"true":"false")%>'/>
-      <table class="tabtable">
-        <tr class="tabspacerrow">
-    <td class="spacertab" colspan="<%=tabsArray.size()%>"></td>
-    <td class="remaindertab" rowspan="3">
+        <form class="standardform" name="editconnection" action="execute.jsp" method="POST" enctype="multipart/form-data">
+          <input type="hidden" name="op" value="Continue"/>
+          <input type="hidden" name="type" value="transformation"/>
+          <input type="hidden" name="tabname" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(tabName)%>'/>
+          <input type="hidden" name="isnewconnection" value='<%=(isNew?"true":"false")%>'/>
+          <table class="tabtable">
+            <tr class="tabspacerrow">
+              <td class="spacertab" colspan="<%=tabsArray.size()%>"></td>
+              <td class="remaindertab" rowspan="3">
 <%
     if (description.length() > 0)
     {
 %>
-        <nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.EditTransformationConnection")%> '<%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%>'</nobr>
+                <nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.EditTransformationConnection")%> '<%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%>'</nobr>
 <%
     }
     else
     {
 %>
 
-              <nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.EditATransformationConnection")%></nobr>
+                <nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.EditATransformationConnection")%></nobr>
 <%
     }
 %>
-    </td>
-        </tr>
-        <tr class="tabsequencerow">
-    <td class="blanksequencetab" colspan="<%=tabsArray.size()%>"></td>
-        </tr>
-        <tr class="tabrow">
+              </td>
+            </tr>
+            <tr class="tabsequencerow">
+              <td class="blanksequencetab" colspan="<%=tabsArray.size()%>"></td>
+            </tr>
+            <tr class="tabrow">
 <%
     int tabNum = 0;
     while (tabNum < tabsArray.size())
     {
-    String tab = (String)tabsArray.get(tabNum++);
-    if (tab.equals(tabName))
-    {
+      String tab = (String)tabsArray.get(tabNum++);
+      if (tab.equals(tabName))
+      {
 %>
-          <td class="activetab"><nobr><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(tab)%></nobr></td>
+              <td class="activetab"><nobr><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(tab)%></nobr></td>
 <%
-    }
-    else
-    {
+      }
+      else
+      {
 %>
-          <td class="passivetab"><nobr><a href="javascript:void(0);" alt='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(tab)+" "+Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.tab")%>' onclick='<%="javascript:SelectTab(\""+tab+"\");return false;"%>'><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(tab)%></a></nobr></td>
+              <td class="passivetab"><nobr><a href="javascript:void(0);" alt='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(tab)+" "+Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.tab")%>' onclick='<%="javascript:SelectTab(\""+tab+"\");return false;"%>'><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(tab)%></a></nobr></td>
 <%
-    }
+      }
     }
 %>
-        </tr>
-        <tr class="tabbodyrow">
-    <td class="tabbody" colspan='<%=Integer.toString(tabsArray.size()+1)%>'>
+            </tr>
+            <tr class="tabbodyrow">
+              <td class="tabbody" colspan='<%=Integer.toString(tabsArray.size()+1)%>'>
 <%
 
 
@@ -298,42 +309,45 @@
     if (tabName.equals(Messages.getString(pageContext.getRequest().getLocale(),"edittransformation.Name")))
     {
 %>
-        <table class="displaytable">
-      <tr><td class="separator" colspan="5"><hr/></td></tr>
-      <tr>
-        <td class="description"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.NameColon")%></nobr></td><td class="value" colspan="4">
+                <table class="displaytable">
+                  <tr><td class="separator" colspan="5"><hr/></td></tr>
+                  <tr>
+                    <td class="description"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.NameColon")%></nobr></td><td class="value" colspan="4">
 <%
       // If the connection doesn't exist yet, we are allowed to change the name.
       if (connection == null || connectionName.length() < 1)
       {
 %>
-          <input type="text" size="32" name="connname" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(connectionName)%>'/>
+                      <input type="text" size="32" name="connname" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(connectionName)%>'/>
 <%
       }
       else
       {
 %>
-          <%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectionName)%>
-          <input type="hidden" name="connname" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(connectionName)%>'/>
+                      <%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectionName)%>
+                      <input type="hidden" name="connname" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(connectionName)%>'/>
 <%
       }
 %>
-        </td>
-      </tr>
-      <tr>
-        <td class="description"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.DescriptionColon")%></nobr></td><td class="value" colspan="4">
-          <input type="text" size="50" name="description" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(description)%>'/>
-        </td>
-      </tr>
-        </table>
+                    </td>
+                  </tr>
+                  <tr>
+                    <td class="description">
+                      <nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.DescriptionColon")%></nobr>
+                    </td>
+                    <td class="value" colspan="4">
+                      <input type="text" size="50" name="description" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(description)%>'/>
+                    </td>
+                  </tr>
+                </table>
 <%
     }
     else
     {
-    // Hiddens for the Name tab
+      // Hiddens for the Name tab
 %>
-        <input type="hidden" name="connname" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(connectionName)%>'/>
-        <input type="hidden" name="description" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(description)%>'/>
+                <input type="hidden" name="connname" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(connectionName)%>'/>
+                <input type="hidden" name="description" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(description)%>'/>
 <%
     }
 
@@ -342,61 +356,62 @@
     if (tabName.equals(Messages.getString(pageContext.getRequest().getLocale(),"edittransformation.Type")))
     {
 %>
-        <table class="displaytable">
-      <tr><td class="separator" colspan="5"><hr/></td></tr>
-      <tr>
-        <td class="description"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.ConnectionTypeColon")%></nobr></td><td class="value" colspan="4">
+                <table class="displaytable">
+                  <tr><td class="separator" colspan="5"><hr/></td></tr>
+                  <tr>
+                    <td class="description"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.ConnectionTypeColon")%></nobr></td><td class="value" colspan="4">
 <%
       if (className.length() > 0)
       {
-    String value = connectorManager.getDescription(className);
-    if (value == null)
-    {
+        String value = connectorManager.getDescription(className);
+        if (value == null)
+        {
 %>
-          <nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.UNREGISTERED")%> <%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(className)%></nobr>
+                      <nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.UNREGISTERED")%> <%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(className)%></nobr>
 <%
-    }
-    else
-    {
+        }
+        else
+        {
 %>
-          <%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(value)%>
+                      <%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(value)%>
 <%
-    }
+        }
 %>
-          <input type="hidden" name="classname" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(className)%>'/>
+                      <input type="hidden" name="classname" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(className)%>'/>
 <%
       }
       else
       {
-    int i = 0;
+        int i = 0;
 %>
-          <select name="classname" size="1">
+                      <select name="classname" size="1">
 <%
-    while (i < set.getRowCount())
-    {
-      IResultRow row = set.getRow(i++);
-      String thisClassName = row.getValue("classname").toString();
-      String thisDescription = row.getValue("description").toString();
+        while (i < set.getRowCount())
+        {
+          IResultRow row = set.getRow(i++);
+          String thisClassName = row.getValue("classname").toString();
+          String thisDescription = row.getValue("description").toString();
 %>
-            <option value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(thisClassName)%>'
-              <%=className.equals(thisClassName)?"selected=\"selected\"":""%>><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(thisDescription)%></option>
+                        <option value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(thisClassName)%>'
+                      <%=className.equals(thisClassName)?"selected=\"selected\"":""%>><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(thisDescription)%>
+                        </option>
 <%
-    }
+        }
 %>
-          </select>
+                      </select>
 <%
       }
 %>
-        </td>
-      </tr>
-        </table>
+                    </td>
+                  </tr>
+                </table>
 <%
     }
     else
     {
-    // Hiddens for the "Type" tab
+      // Hiddens for the "Type" tab
 %>
-        <input type="hidden" name="classname" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(className)%>'/>
+                <input type="hidden" name="classname" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(className)%>'/>
 <%
     }
 
@@ -405,77 +420,81 @@
     if (tabName.equals(Messages.getString(pageContext.getRequest().getLocale(),"edittransformation.Throttling")))
     {
 %>
-        <table class="displaytable">
-      <tr><td class="separator" colspan="2"><hr/></td></tr>
-      <tr>
-        <td class="description"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.MaxConnectionsColon")%></nobr></td>
-        <td class="value"><input type="text" size="6" name="maxconnections" value='<%=Integer.toString(maxConnections)%>'/></td>
-      </tr>
-        </table>
+                <table class="displaytable">
+                  <tr><td class="separator" colspan="2"><hr/></td></tr>
+                  <tr>
+                    <td class="description"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"edittransformation.MaxConnectionsColon")%></nobr></td>
+                    <td class="value"><input type="text" size="6" name="maxconnections" value='<%=Integer.toString(maxConnections)%>'/></td>
+                  </tr>
+                </table>
 <%
     }
     else
     {
-    // Hiddens for "Throttling" tab
+      // Hiddens for "Throttling" tab
 %>
-        <input type="hidden" name="maxconnections" value='<%=Integer.toString(maxConnections)%>'/>
+                <input type="hidden" name="maxconnections" value='<%=Integer.toString(maxConnections)%>'/>
 <%
     }
 
     if (className.length() > 0)
-    TransformationConnectorFactory.outputConfigurationBody(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters,tabName);
+      TransformationConnectorFactory.outputConfigurationBody(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters,tabName);
 
 %>
-        <table class="displaytable">
-      <tr><td class="separator" colspan="4"><hr/></td></tr>
-      <tr><td class="message" colspan="4"><nobr>
+                <table class="displaytable">
+                  <tr><td class="separator" colspan="4"><hr/></td></tr>
+                  <tr>
+                    <td class="message" colspan="4">
+                      <nobr>
 <%
     if (className.length() > 0)
     {
 %>
-          <input type="button" value="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.Save")%>" onClick="javascript:Save()" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.SaveThisTransformationConnection")%>"/>
+                        <input type="button" value="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.Save")%>" onClick="javascript:Save()" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.SaveThisTransformationConnection")%>"/>
 <%
     }
     else
     {
-    if (tabName.equals(Messages.getString(pageContext.getRequest().getLocale(),"edittransformation.Type")))
-    {
+      if (tabName.equals(Messages.getString(pageContext.getRequest().getLocale(),"edittransformation.Type")))
+      {
 %>
-          <input type="button" value="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.Continue")%>" onClick="javascript:Continue()" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.ContinueToNextPage")%>"/>
+                        <input type="button" value="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.Continue")%>" onClick="javascript:Continue()" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.ContinueToNextPage")%>"/>
 <%
-    }
+      }
     }
 %>
-          &nbsp;<input type="button" value="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.Cancel")%>" onClick="javascript:Cancel()" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.CancelTransformationConnectionEditing")%>"/></nobr></td>
-      </tr>
-        </table>
-    </td>
-        </tr>
-      </table>
-  </form>
+                        <input type="button" value="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.Cancel")%>" onClick="javascript:Cancel()" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"edittransformation.CancelTransformationConnectionEditing")%>"/>
+                      </nobr>
+                    </td>
+                  </tr>
+                </table>
+              </td>
+            </tr>
+          </table>
+        </form>
 
 <%
   }
 %>
 
-       </td>
-      </tr>
-    </table>
+      </td>
+    </tr>
+  </table>
 
 </body>
 
 </html>
 
 <%
-    }
-    catch (ManifoldCFException e)
-    {
+}
+catch (ManifoldCFException e)
+{
   e.printStackTrace();
   variableContext.setParameter("text",e.getMessage());
   variableContext.setParameter("target","listtransformations.jsp");
 %>
   <jsp:forward page="error.jsp"/>
 <%
-    }
+}
 %>
 

Modified: manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/execute.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/execute.jsp?rev=1689968&r1=1689967&r2=1689968&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/execute.jsp (original)
+++ manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/execute.jsp Wed Jul  8 22:01:08 2015
@@ -165,6 +165,14 @@
           }
           else if (op.equals("Save"))
           {
+            // Check if authorized
+            if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_EDIT_CONNECTIONS))
+            {
+              variableContext.setParameter("target","listconnections.jsp");
+%>
+                  <jsp:forward page="unauthorized.jsp"/>
+<%
+            }
             connManager.save(connection);
             variableContext.setParameter("connname",connectionName);
 %>
@@ -280,11 +288,20 @@
           {
             threadContext.save("GroupObject",group);
 %>
-            <jsp:forward page="editgroup.jsp"/>
+              <jsp:forward page="editgroup.jsp"/>
 <%
           }
           else if (op.equals("Save"))
           {
+            // Check if authorized
+            if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_EDIT_CONNECTIONS))
+            {
+              variableContext.setParameter("target","listgroups.jsp");
+%>
+                  <jsp:forward page="unauthorized.jsp"/>
+<%
+            }
+
             authGroupManager.save(group);
             variableContext.setParameter("groupname",groupName);
 %>
@@ -415,6 +432,15 @@
           }
           else if (op.equals("Save"))
           {
+            // Check if authorized
+            if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_EDIT_CONNECTIONS))
+            {
+              variableContext.setParameter("target","listauthorities.jsp");
+%>
+                  <jsp:forward page="unauthorized.jsp"/>
+<%
+            }
+
             authConnManager.save(connection);
             variableContext.setParameter("connname",connectionName);
 %>
@@ -538,6 +564,15 @@
           }
           else if (op.equals("Save"))
           {
+            // Check if authorized
+            if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_EDIT_CONNECTIONS))
+            {
+              variableContext.setParameter("target","listmappers.jsp");
+%>
+                  <jsp:forward page="unauthorized.jsp"/>
+<%
+            }
+
             mappingConnManager.save(connection);
             variableContext.setParameter("connname",connectionName);
 %>
@@ -653,6 +688,15 @@
           }
           else if (op.equals("Save"))
           {
+            // Check if authorized
+            if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_EDIT_CONNECTIONS))
+            {
+              variableContext.setParameter("target","listoutputs.jsp");
+%>
+                  <jsp:forward page="unauthorized.jsp"/>
+<%
+            }
+
             outputManager.save(connection);
             variableContext.setParameter("connname",connectionName);
 %>
@@ -812,6 +856,15 @@
           }
           else if (op.equals("Save"))
           {
+            // Check if authorized
+            if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_EDIT_CONNECTIONS))
+            {
+              variableContext.setParameter("target","listtransformations.jsp");
+%>
+                  <jsp:forward page="unauthorized.jsp"/>
+<%
+            }
+
             transformationManager.save(connection);
             variableContext.setParameter("connname",connectionName);
 %>
@@ -927,6 +980,15 @@
           }
           else if (op.equals("Save"))
           {
+            // Check if authorized
+            if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_EDIT_CONNECTIONS))
+            {
+              variableContext.setParameter("target","listnotifications.jsp");
+%>
+                  <jsp:forward page="unauthorized.jsp"/>
+<%
+            }
+
             notificationManager.save(connection);
             variableContext.setParameter("connname",connectionName);
 %>
@@ -1470,6 +1532,15 @@
           }
           else if (op.equals("Save"))
           {
+            // Check if authorized
+            if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_EDIT_JOBS))
+            {
+              variableContext.setParameter("target","listjobs.jsp");
+%>
+                  <jsp:forward page="unauthorized.jsp"/>
+<%
+            }
+
             manager.save(job);
             // Reset the job schedule. We may want to make this explicit at some point; having
             // this happen all the time seems wrong.

Modified: manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listauthorities.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listauthorities.jsp?rev=1689968&r1=1689967&r2=1689968&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listauthorities.jsp (original)
+++ manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listauthorities.jsp Wed Jul  8 22:01:08 2015
@@ -22,6 +22,23 @@
 */
 %>
 
+<%
+try
+{
+  // Check if authorized
+  if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_VIEW_CONNECTIONS))
+  {
+    variableContext.setParameter("target","index.jsp");
+%>
+    <jsp:forward page="unauthorized.jsp"/>
+<%
+  }
+  // Get the authority connection manager handle
+  IAuthorityConnectionManager manager = AuthorityConnectionManagerFactory.make(threadContext);
+  IAuthorityConnectorManager connectorManager = AuthorityConnectorManagerFactory.make(threadContext);
+  IAuthorityConnection[] connections = manager.getAllConnections();
+%>
+
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html>
 <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
@@ -38,49 +55,42 @@
   <script type="text/javascript">
   <!--
 
-  function Delete(connectionName)
+function Delete(connectionName)
+{
+  if (confirm("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"listauthorities.DeleteAuthority")%> '"+connectionName+"'?"))
   {
-    if (confirm("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"listauthorities.DeleteAuthority")%> '"+connectionName+"'?"))
-    {
-      document.listconnections.op.value="Delete";
-      document.listconnections.connname.value=connectionName;
-      document.listconnections.submit();
-    }
+    document.listconnections.op.value="Delete";
+    document.listconnections.connname.value=connectionName;
+    document.listconnections.submit();
   }
+}
 
   //-->
-  </script>
+</script>
 
 </head>
 
 <body class="standardbody">
 
-    <table class="page">
-      <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
-      <tr><td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
-       <td class="window">
-  <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.ListOfAuthorityConnections")%></p>
-  <form class="standardform" name="listconnections" action="execute.jsp" method="POST">
-    <input type="hidden" name="op" value="Continue"/>
-    <input type="hidden" name="type" value="authority"/>
-    <input type="hidden" name="connname" value=""/>
-
-<%
-    try
-    {
-  // Get the authority connection manager handle
-  IAuthorityConnectionManager manager = AuthorityConnectionManagerFactory.make(threadContext);
-  IAuthorityConnectorManager connectorManager = AuthorityConnectorManagerFactory.make(threadContext);
-  IAuthorityConnection[] connections = manager.getAllConnections();
-%>
-    <table class="datatable">
-      <tr>
-        <td class="separator" colspan="5"><hr/></td>
-      </tr>
-      <tr class="headerrow">
-        <td class="columnheader"></td><td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Name")%></td><td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Description")%></td><td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.AuthorityType")%></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Max")%></td>
-      </tr>
+  <table class="page">
+    <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
+    <tr><td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
+      <td class="window">
+        <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.ListOfAuthorityConnections")%></p>
+        <form class="standardform" name="listconnections" action="execute.jsp" method="POST">
+          <input type="hidden" name="op" value="Continue"/>
+          <input type="hidden" name="type" value="authority"/>
+          <input type="hidden" name="connname" value=""/>
+
+          <table class="datatable">
+            <tr>
+              <td class="separator" colspan="5"><hr/></td>
+            </tr>
+            <tr class="headerrow">
+              <td class="columnheader"></td>
+              <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Name")%></td><td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Description")%></td><td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.AuthorityType")%></td>
+              <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Max")%></td>
+            </tr>
 <%
   int i = 0;
   while (i < connections.length)
@@ -98,44 +108,44 @@
       connectorName = className + "(uninstalled)";
 
 %>
-    <tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
-      <td class="columncell">
-        <nobr>
-          <a href='<%="viewauthority.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%="View "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.View")%></a>
-          <a href='<%="editauthority.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listauthorities.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Edit")%></a>
-          <a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listauthorities.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Delete")%></a>
-        </nobr>
-      </td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(name)%></td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%></td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectorName)%></td>
-      <td class="columncell"><%=Integer.toString(maxCount)%></td>
-    </tr>
+            <tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
+              <td class="columncell">
+                <nobr>
+                  <a href='<%="viewauthority.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%="View "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.View")%></a>
+                  <a href='<%="editauthority.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listauthorities.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Edit")%></a>
+                  <a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listauthorities.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Delete")%></a>
+                </nobr>
+              </td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(name)%></td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%></td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectorName)%></td>
+              <td class="columncell"><%=Integer.toString(maxCount)%></td>
+            </tr>
 <%
   }
 %>
-      <tr>
-        <td class="separator" colspan="5"><hr/></td>
-      </tr>
-      <tr><td class="message" colspan="5"><a href="editauthority.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listauthorities.AddNewConnection")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.AddaNewConnection")%></a></td></tr>
-    </table>
+            <tr>
+              <td class="separator" colspan="5"><hr/></td>
+            </tr>
+            <tr><td class="message" colspan="5"><a href="editauthority.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listauthorities.AddNewConnection")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.AddaNewConnection")%></a></td></tr>
+          </table>
 
 <%
-    }
-    catch (ManifoldCFException e)
-    {
+}
+catch (ManifoldCFException e)
+{
   e.printStackTrace();
   variableContext.setParameter("text",e.getMessage());
   variableContext.setParameter("target","index.jsp");
 %>
   <jsp:forward page="error.jsp"/>
 <%
-    }
+}
 %>
-      </form>
-       </td>
-      </tr>
-    </table>
+        </form>
+      </td>
+    </tr>
+  </table>
 
 </body>
 

Modified: manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listconnections.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listconnections.jsp?rev=1689968&r1=1689967&r2=1689968&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listconnections.jsp (original)
+++ manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listconnections.jsp Wed Jul  8 22:01:08 2015
@@ -22,6 +22,23 @@
 */
 %>
 
+<%
+try
+{
+  // Check if authorized
+  if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_VIEW_CONNECTIONS))
+  {
+    variableContext.setParameter("target","index.jsp");
+%>
+    <jsp:forward page="unauthorized.jsp"/>
+<%
+  }
+  // Get the job manager handle
+  IRepositoryConnectionManager manager = RepositoryConnectionManagerFactory.make(threadContext);
+  IConnectorManager connectorManager = ConnectorManagerFactory.make(threadContext);
+  IRepositoryConnection[] connections = manager.getAllConnections();
+%>
+
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html>
 <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
@@ -37,15 +54,15 @@
   <script type="text/javascript">
   <!--
 
-  function Delete(connectionName)
+function Delete(connectionName)
+{
+  if (confirm("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"listconnections.DeleteConnection")%> '"+connectionName+"'?"))
   {
-    if (confirm("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"listconnections.DeleteConnection")%> '"+connectionName+"'?"))
-    {
-      document.listconnections.op.value="Delete";
-      document.listconnections.connname.value=connectionName;
-      document.listconnections.submit();
-    }
+    document.listconnections.op.value="Delete";
+    document.listconnections.connname.value=connectionName;
+    document.listconnections.submit();
   }
+}
 
   //-->
   </script>
@@ -54,36 +71,29 @@
 
 <body class="standardbody">
 
-    <table class="page">
-      <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
-      <tr><td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
-       <td class="window">
-  <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.ListOfRepositoryConnections")%></p>
-  <form class="standardform" name="listconnections" action="execute.jsp" method="POST">
-    <input type="hidden" name="op" value="Continue"/>
-    <input type="hidden" name="type" value="connection"/>
-    <input type="hidden" name="connname" value=""/>
-
-<%
-    try
-    {
-  // Get the job manager handle
-  IRepositoryConnectionManager manager = RepositoryConnectionManagerFactory.make(threadContext);
-  IConnectorManager connectorManager = ConnectorManagerFactory.make(threadContext);
-  IRepositoryConnection[] connections = manager.getAllConnections();
-%>
-    <table class="datatable">
-      <tr>
-        <td class="separator" colspan="6"><hr/></td>
-      </tr>
-      <tr class="headerrow">
-        <td class="columnheader"></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Name")%></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Description")%></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.ConnectionType")%></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.AuthorityGroup")%></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Max")%></td>
-      </tr>
+  <table class="page">
+    <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
+    <tr>
+      <td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
+      <td class="window">
+        <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.ListOfRepositoryConnections")%></p>
+          <form class="standardform" name="listconnections" action="execute.jsp" method="POST">
+            <input type="hidden" name="op" value="Continue"/>
+            <input type="hidden" name="type" value="connection"/>
+            <input type="hidden" name="connname" value=""/>
+
+            <table class="datatable">
+              <tr>
+                <td class="separator" colspan="6"><hr/></td>
+              </tr>
+              <tr class="headerrow">
+                <td class="columnheader"></td>
+                <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Name")%></td>
+                <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Description")%></td>
+                <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.ConnectionType")%></td>
+                <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.AuthorityGroup")%></td>
+                <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Max")%></td>
+              </tr>
 <%
   int i = 0;
   while (i < connections.length)
@@ -102,50 +112,47 @@
     int maxCount = connection.getMaxConnections();
 
 %>
-    <tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
-      <td class="columncell">
-        <nobr>
-          <a href='<%="viewconnection.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.View")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.View")%></a>
-          <a href='<%="editconnection.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Edit")%></a>
-          <a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Delete")%></a>
-        </nobr>
-      </td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(name)%></td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%></td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectorName)%></td>
-      <td class="columncell"><%=((authorityName==null)?Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.GlobalAuthority"):org.apache.manifoldcf.ui.util.Encoder.bodyEscape(authorityName))%></td>
-      <td class="columncell"><%=Integer.toString(maxCount)%></td>
-    </tr>
+              <tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
+                <td class="columncell">
+                  <nobr>
+                    <a href='<%="viewconnection.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.View")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.View")%></a>
+                    <a href='<%="editconnection.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Edit")%></a>
+                    <a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Delete")%></a>
+                  </nobr>
+                </td>
+                <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(name)%></td>
+                <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%></td>
+                <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectorName)%></td>
+                <td class="columncell"><%=((authorityName==null)?Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.GlobalAuthority"):org.apache.manifoldcf.ui.util.Encoder.bodyEscape(authorityName))%></td>
+                <td class="columncell"><%=Integer.toString(maxCount)%></td>
+              </tr>
 <%
   }
 %>
-      <tr>
-        <td class="separator" colspan="6"><hr/></td>
-      </tr>
-      <tr><td class="message" colspan="6"><a href="editconnection.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.AddAConnection")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.AddNewConnection")%></a></td></tr>
-    </table>
+              <tr>
+                <td class="separator" colspan="6"><hr/></td>
+              </tr>
+              <tr><td class="message" colspan="6"><a href="editconnection.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.AddAConnection")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.AddNewConnection")%></a></td></tr>
+            </table>
 
 <%
-    }
-    catch (ManifoldCFException e)
-    {
+}
+catch (ManifoldCFException e)
+{
   e.printStackTrace();
   variableContext.setParameter("text",e.getMessage());
   variableContext.setParameter("target","index.jsp");
 %>
   <jsp:forward page="error.jsp"/>
 <%
-    }
+}
 %>
-      </form>
-       </td>
-      </tr>
-    </table>
+        </form>
+      </td>
+    </tr>
+  </table>
 
 </body>
 
 </html>
 
-<%
-
-%>

Modified: manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listgroups.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listgroups.jsp?rev=1689968&r1=1689967&r2=1689968&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listgroups.jsp (original)
+++ manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listgroups.jsp Wed Jul  8 22:01:08 2015
@@ -22,6 +22,22 @@
 */
 %>
 
+<%
+try
+{
+  // Check if authorized
+  if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_VIEW_CONNECTIONS))
+  {
+    variableContext.setParameter("target","index.jsp");
+%>
+    <jsp:forward page="unauthorized.jsp"/>
+<%
+  }
+  // Get the authority group manager handle
+  IAuthorityGroupManager manager = AuthorityGroupManagerFactory.make(threadContext);
+  IAuthorityGroup[] groups = manager.getAllGroups();
+%>
+
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html>
 <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
@@ -38,15 +54,15 @@
   <script type="text/javascript">
   <!--
 
-  function Delete(groupName)
+function Delete(groupName)
+{
+  if (confirm("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"listgroups.DeleteAuthorityGroup")%> '"+groupName+"'?"))
   {
-    if (confirm("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"listgroups.DeleteAuthorityGroup")%> '"+groupName+"'?"))
-    {
-      document.listgroups.op.value="Delete";
-      document.listgroups.groupname.value=groupName;
-      document.listgroups.submit();
-    }
+    document.listgroups.op.value="Delete";
+    document.listgroups.groupname.value=groupName;
+    document.listgroups.submit();
   }
+}
 
   //-->
   </script>
@@ -55,32 +71,25 @@
 
 <body class="standardbody">
 
-    <table class="page">
-      <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
-      <tr><td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
-       <td class="window">
-  <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.ListOfAuthorityGroups")%></p>
-  <form class="standardform" name="listgroups" action="execute.jsp" method="POST">
-    <input type="hidden" name="op" value="Continue"/>
-    <input type="hidden" name="type" value="group"/>
-    <input type="hidden" name="groupname" value=""/>
-
-<%
-    try
-    {
-  // Get the authority group manager handle
-  IAuthorityGroupManager manager = AuthorityGroupManagerFactory.make(threadContext);
-  IAuthorityGroup[] groups = manager.getAllGroups();
-%>
-    <table class="datatable">
-      <tr>
-        <td class="separator" colspan="5"><hr/></td>
-      </tr>
-      <tr class="headerrow">
-        <td class="columnheader"></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.Name")%></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.Description")%></td>
-      </tr>
+  <table class="page">
+    <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
+    <tr><td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
+      <td class="window">
+        <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.ListOfAuthorityGroups")%></p>
+        <form class="standardform" name="listgroups" action="execute.jsp" method="POST">
+          <input type="hidden" name="op" value="Continue"/>
+          <input type="hidden" name="type" value="group"/>
+          <input type="hidden" name="groupname" value=""/>
+
+          <table class="datatable">
+            <tr>
+              <td class="separator" colspan="5"><hr/></td>
+            </tr>
+            <tr class="headerrow">
+              <td class="columnheader"></td>
+              <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.Name")%></td>
+              <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.Description")%></td>
+            </tr>
 <%
   int i = 0;
   while (i < groups.length)
@@ -93,42 +102,42 @@
       description = "";
 
 %>
-    <tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
-      <td class="columncell">
-        <nobr>
-          <a href='<%="viewgroup.jsp?groupname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.View")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.View")%></a>
-          <a href='<%="editgroup.jsp?groupname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.Edit")%></a>
-          <a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.Delete")%></a>
-        </nobr>
-      </td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(name)%></td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%></td>
-    </tr>
+            <tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
+              <td class="columncell">
+                <nobr>
+                  <a href='<%="viewgroup.jsp?groupname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.View")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.View")%></a>
+                  <a href='<%="editgroup.jsp?groupname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.Edit")%></a>
+                  <a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.Delete")%></a>
+                </nobr>
+              </td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(name)%></td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%></td>
+            </tr>
 <%
   }
 %>
-      <tr>
-        <td class="separator" colspan="5"><hr/></td>
-      </tr>
-      <tr><td class="message" colspan="5"><a href="editgroup.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.AddNewGroup")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.AddaNewGroup")%></a></td></tr>
-    </table>
+            <tr>
+              <td class="separator" colspan="5"><hr/></td>
+            </tr>
+            <tr><td class="message" colspan="5"><a href="editgroup.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.AddNewGroup")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.AddaNewGroup")%></a></td></tr>
+          </table>
 
 <%
-    }
-    catch (ManifoldCFException e)
-    {
+}
+  catch (ManifoldCFException e)
+{
   e.printStackTrace();
   variableContext.setParameter("text",e.getMessage());
   variableContext.setParameter("target","index.jsp");
 %>
   <jsp:forward page="error.jsp"/>
 <%
-    }
+}
 %>
-      </form>
-       </td>
-      </tr>
-    </table>
+        </form>
+      </td>
+    </tr>
+  </table>
 
 </body>
 

Modified: manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listjobs.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listjobs.jsp?rev=1689968&r1=1689967&r2=1689968&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listjobs.jsp (original)
+++ manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listjobs.jsp Wed Jul  8 22:01:08 2015
@@ -22,6 +22,22 @@
 */
 %>
 
+<%
+try
+{
+  // Check if authorized
+  if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_VIEW_JOBS))
+  {
+    variableContext.setParameter("target","index.jsp");
+%>
+    <jsp:forward page="unauthorized.jsp"/>
+<%
+  }
+  // Get the job manager handle
+  IJobManager manager = JobManagerFactory.make(threadContext);
+  IJobDescription[] jobs = manager.getAllJobs();
+%>
+
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html>
 <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
@@ -37,15 +53,15 @@
   <script type="text/javascript">
   <!--
 
-  function Delete(jobID)
+function Delete(jobID)
+{
+  if (confirm("Warning: Deleting this job will remove all\nassociated documents from the index.\nDo you want to proceed?"))
   {
-    if (confirm("Warning: Deleting this job will remove all\nassociated documents from the index.\nDo you want to proceed?"))
-    {
-      document.listjobs.op.value="Delete";
-      document.listjobs.jobid.value=jobID;
-      document.listjobs.submit();
-    }
+    document.listjobs.op.value="Delete";
+    document.listjobs.jobid.value=jobID;
+    document.listjobs.submit();
   }
+}
 
   //-->
   </script>
@@ -55,34 +71,28 @@
 
 <body class="standardbody">
 
-    <table class="page">
-      <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
-      <tr><td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
-       <td class="window">
-  <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.JobList")%></p>
-  <form class="standardform" name="listjobs" action="execute.jsp" method="POST">
-    <input type="hidden" name="op" value="Continue"/>
-    <input type="hidden" name="type" value="job"/>
-    <input type="hidden" name="jobid" value=""/>
-
-<%
-    try
-    {
-  // Get the job manager handle
-  IJobManager manager = JobManagerFactory.make(threadContext);
-  IJobDescription[] jobs = manager.getAllJobs();
-%>
-    <table class="datatable">
-      <tr>
-        <td class="separator" colspan="5"><hr/></td>
-      </tr>
-      <tr class="headerrow">
-        <td class="columnheader"></td>
-        <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.Name")%></nobr></td>
-        <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.OutputConnection")%></nobr></td>
-        <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.RepositoryConnection")%></nobr></td>
-        <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.ScheduleType")%></nobr></td>
-      </tr>
+  <table class="page">
+    <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
+    <tr>
+      <td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
+      <td class="window">
+        <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.JobList")%></p>
+        <form class="standardform" name="listjobs" action="execute.jsp" method="POST">
+          <input type="hidden" name="op" value="Continue"/>
+          <input type="hidden" name="type" value="job"/>
+          <input type="hidden" name="jobid" value=""/>
+
+          <table class="datatable">
+            <tr>
+              <td class="separator" colspan="5"><hr/></td>
+            </tr>
+            <tr class="headerrow">
+              <td class="columnheader"></td>
+              <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.Name")%></nobr></td>
+              <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.OutputConnection")%></nobr></td>
+              <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.RepositoryConnection")%></nobr></td>
+              <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.ScheduleType")%></nobr></td>
+            </tr>
 <%
   for (int i = 0; i < jobs.length; i++)
   {
@@ -113,45 +123,45 @@
     }
 
 %>
-    <tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
-        <td class="columncell">
-      <nobr>
-        <a href='<%="viewjob.jsp?jobid="+jd.getID()%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listjobs.Viewjob")+" "+jd.getID()%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.View")%></a>
-        <a href='<%="editjob.jsp?jobid="+jd.getID()%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listjobs.Editjob")+" "+jd.getID()%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.Edit")%></a>
-        <a href='<%="javascript:Delete(\""+jd.getID()+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listjobs.DeleteJob")+" "+jd.getID()%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.Delete")%></a>
-        <a href='<%="editjob.jsp?origjobid="+jd.getID()%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listjobs.CopyJob")+" "+jd.getID()%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.Copy")%></a>
-      </nobr>
-        </td>
-        <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(jd.getDescription())%></td>
-        <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(outputConnectionNames)%></td>
-        <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(jd.getConnectionName())%></td>
-        <td class="columncell"><%=jobType%></td>
-    </tr>
+            <tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
+              <td class="columncell">
+                <nobr>
+                  <a href='<%="viewjob.jsp?jobid="+jd.getID()%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listjobs.Viewjob")+" "+jd.getID()%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.View")%></a>
+                  <a href='<%="editjob.jsp?jobid="+jd.getID()%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listjobs.Editjob")+" "+jd.getID()%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.Edit")%></a>
+                  <a href='<%="javascript:Delete(\""+jd.getID()+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listjobs.DeleteJob")+" "+jd.getID()%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.Delete")%></a>
+                  <a href='<%="editjob.jsp?origjobid="+jd.getID()%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listjobs.CopyJob")+" "+jd.getID()%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.Copy")%></a>
+                </nobr>
+              </td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(jd.getDescription())%></td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(outputConnectionNames)%></td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(jd.getConnectionName())%></td>
+              <td class="columncell"><%=jobType%></td>
+            </tr>
 <%
   }
 %>
-      <tr>
-        <td class="separator" colspan="5"><hr/></td>
-      </tr>
-    <tr><td class="message" colspan="5"><a href="editjob.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listjobs.Addajob")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.AddaNewJob")%></a></td></tr>
-    </table>
+            <tr>
+              <td class="separator" colspan="5"><hr/></td>
+            </tr>
+            <tr><td class="message" colspan="5"><a href="editjob.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listjobs.Addajob")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listjobs.AddaNewJob")%></a></td></tr>
+          </table>
 
 <%
-    }
-    catch (ManifoldCFException e)
-    {
+}
+catch (ManifoldCFException e)
+{
   e.printStackTrace();
   variableContext.setParameter("text",e.getMessage());
   variableContext.setParameter("target","index.jsp");
 %>
   <jsp:forward page="error.jsp"/>
 <%
-    }
+}
 %>
-      </form>
-       </td>
-      </tr>
-    </table>
+        </form>
+      </td>
+    </tr>
+  </table>
 
 </body>
 

Modified: manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listmappers.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listmappers.jsp?rev=1689968&r1=1689967&r2=1689968&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listmappers.jsp (original)
+++ manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listmappers.jsp Wed Jul  8 22:01:08 2015
@@ -22,6 +22,23 @@
 */
 %>
 
+<%
+try
+{
+  // Check if authorized
+  if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_VIEW_CONNECTIONS))
+  {
+    variableContext.setParameter("target","index.jsp");
+%>
+    <jsp:forward page="unauthorized.jsp"/>
+<%
+  }
+  // Get the mapping connection manager handle
+  IMappingConnectionManager manager = MappingConnectionManagerFactory.make(threadContext);
+  IMappingConnectorManager connectorManager = MappingConnectorManagerFactory.make(threadContext);
+  IMappingConnection[] connections = manager.getAllConnections();
+%>
+
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html>
 <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
@@ -38,15 +55,15 @@
   <script type="text/javascript">
   <!--
 
-  function Delete(connectionName)
+function Delete(connectionName)
+{
+  if (confirm("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"listmappers.DeleteMapper")%> '"+connectionName+"'?"))
   {
-    if (confirm("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"listmappers.DeleteMapper")%> '"+connectionName+"'?"))
-    {
-      document.listconnections.op.value="Delete";
-      document.listconnections.connname.value=connectionName;
-      document.listconnections.submit();
-    }
+    document.listconnections.op.value="Delete";
+    document.listconnections.connname.value=connectionName;
+    document.listconnections.submit();
   }
+}
 
   //-->
   </script>
@@ -55,35 +72,28 @@
 
 <body class="standardbody">
 
-    <table class="page">
-      <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
-      <tr><td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
-       <td class="window">
-  <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.ListOfMappingConnections")%></p>
-  <form class="standardform" name="listconnections" action="execute.jsp" method="POST">
-    <input type="hidden" name="op" value="Continue"/>
-    <input type="hidden" name="type" value="mapper"/>
-    <input type="hidden" name="connname" value=""/>
-
-<%
-    try
-    {
-  // Get the mapping connection manager handle
-  IMappingConnectionManager manager = MappingConnectionManagerFactory.make(threadContext);
-  IMappingConnectorManager connectorManager = MappingConnectorManagerFactory.make(threadContext);
-  IMappingConnection[] connections = manager.getAllConnections();
-%>
-    <table class="datatable">
-      <tr>
-        <td class="separator" colspan="5"><hr/></td>
-      </tr>
-      <tr class="headerrow">
-        <td class="columnheader"></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Name")%></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Description")%></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.MapperType")%></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Max")%></td>
-      </tr>
+  <table class="page">
+    <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
+    <tr>
+      <td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
+      <td class="window">
+        <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.ListOfMappingConnections")%></p>
+        <form class="standardform" name="listconnections" action="execute.jsp" method="POST">
+          <input type="hidden" name="op" value="Continue"/>
+          <input type="hidden" name="type" value="mapper"/>
+          <input type="hidden" name="connname" value=""/>
+
+          <table class="datatable">
+            <tr>
+              <td class="separator" colspan="5"><hr/></td>
+            </tr>
+            <tr class="headerrow">
+              <td class="columnheader"></td>
+              <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Name")%></td>
+              <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Description")%></td>
+              <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.MapperType")%></td>
+              <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Max")%></td>
+            </tr>
 <%
   int i = 0;
   while (i < connections.length)
@@ -101,45 +111,44 @@
       connectorName = className + Messages.getString(pageContext.getRequest().getLocale(),"listmappers.uninstalled");
 
 %>
-    <tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
-      <td class="columncell">
-        <nobr>
-          <a href='<%="viewmapper.jsp?connname="+URLEncoder.encode(name)%>' alt='<%="View "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.View")%></a>
-          <a href='<%="editmapper.jsp?connname="+URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listmappers.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Edit")%></a>
-          <a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listmappers.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Delete")%></a>
-        </nobr>
-      </td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(name)%></td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%></td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectorName)%></td>
-      <td class="columncell"><%=Integer.toString(maxCount)%></td>
-    </tr>
+            <tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
+              <td class="columncell">
+                <nobr>
+                  <a href='<%="viewmapper.jsp?connname="+URLEncoder.encode(name)%>' alt='<%="View "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.View")%></a>
+                  <a href='<%="editmapper.jsp?connname="+URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listmappers.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Edit")%></a>
+                  <a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listmappers.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Delete")%></a>
+                </nobr>
+              </td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(name)%></td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%></td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectorName)%></td>
+              <td class="columncell"><%=Integer.toString(maxCount)%></td>
+            </tr>
 <%
   }
 %>
-      <tr>
-        <td class="separator" colspan="5"><hr/></td>
-      </tr>
-      <tr><td class="message" colspan="5"><a href="editmapper.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listmappers.AddNewConnection")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.AddaNewConnection")%></a></td></tr>
-    </table>
+            <tr>
+              <td class="separator" colspan="5"><hr/></td>
+            </tr>
+            <tr><td class="message" colspan="5"><a href="editmapper.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listmappers.AddNewConnection")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.AddaNewConnection")%></a></td></tr>
+          </table>
 
 <%
-    }
-    catch (ManifoldCFException e)
-    {
+}
+catch (ManifoldCFException e)
+{
   e.printStackTrace();
   variableContext.setParameter("text",e.getMessage());
   variableContext.setParameter("target","index.jsp");
 %>
   <jsp:forward page="error.jsp"/>
 <%
-    }
+}
 %>
-      </form>
-       </td>
-      </tr>
-    </table>
-
+        </form>
+      </td>
+    </tr>
+  </table>
 </body>
 
 </html>

Modified: manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listnotifications.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listnotifications.jsp?rev=1689968&r1=1689967&r2=1689968&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listnotifications.jsp (original)
+++ manifoldcf/branches/CONNECTORS-1196/framework/crawler-ui/src/main/webapp/listnotifications.jsp Wed Jul  8 22:01:08 2015
@@ -22,6 +22,23 @@
 */
 %>
 
+<%
+try
+{
+  // Check if authorized
+  if (!adminprofile.checkAllowed(threadContext,IAuthorizer.CAPABILITY_VIEW_CONNECTIONS))
+  {
+    variableContext.setParameter("target","index.jsp");
+%>
+    <jsp:forward page="unauthorized.jsp"/>
+<%
+  }
+  // Get the notification connection manager handle
+  INotificationConnectionManager manager = NotificationConnectionManagerFactory.make(threadContext);
+  INotificationConnectorManager connectorManager = NotificationConnectorManagerFactory.make(threadContext);
+  INotificationConnection[] connections = manager.getAllConnections();
+%>
+
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html>
 <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
@@ -37,15 +54,15 @@
   <script type="text/javascript">
   <!--
 
-  function Delete(connectionName)
+function Delete(connectionName)
+{
+  if (confirm("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"listnotifications.DeleteNotificationConnection")%> '"+connectionName+"'?"))
   {
-    if (confirm("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"listnotifications.DeleteNotificationConnection")%> '"+connectionName+"'?"))
-    {
-      document.listconnections.op.value="Delete";
-      document.listconnections.connname.value=connectionName;
-      document.listconnections.submit();
-    }
+    document.listconnections.op.value="Delete";
+    document.listconnections.connname.value=connectionName;
+    document.listconnections.submit();
   }
+}
 
   //-->
   </script>
@@ -54,35 +71,28 @@
 
 <body class="standardbody">
 
-    <table class="page">
-      <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
-      <tr><td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
-       <td class="window">
-  <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.ListOfNotificationConnections")%></p>
-  <form class="standardform" name="listconnections" action="execute.jsp" method="POST">
-    <input type="hidden" name="op" value="Continue"/>
-    <input type="hidden" name="type" value="transformation"/>
-    <input type="hidden" name="connname" value=""/>
-
-<%
-    try
-    {
-  // Get the notification connection manager handle
-  INotificationConnectionManager manager = NotificationConnectionManagerFactory.make(threadContext);
-  INotificationConnectorManager connectorManager = NotificationConnectorManagerFactory.make(threadContext);
-  INotificationConnection[] connections = manager.getAllConnections();
-%>
-    <table class="datatable">
-      <tr>
-        <td class="separator" colspan="5"><hr/></td>
-      </tr>
-      <tr class="headerrow">
-        <td class="columnheader"></td>
-        <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.Name")%></nobr></td>
-        <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.Description")%></nobr></td>
-        <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.ConnectionType")%></nobr></td>
-        <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.Max")%></td>
-      </tr>
+  <table class="page">
+    <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
+    <tr>
+      <td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
+      <td class="window">
+        <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.ListOfNotificationConnections")%></p>
+        <form class="standardform" name="listconnections" action="execute.jsp" method="POST">
+          <input type="hidden" name="op" value="Continue"/>
+          <input type="hidden" name="type" value="transformation"/>
+          <input type="hidden" name="connname" value=""/>
+
+          <table class="datatable">
+            <tr>
+              <td class="separator" colspan="5"><hr/></td>
+            </tr>
+            <tr class="headerrow">
+              <td class="columnheader"></td>
+              <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.Name")%></nobr></td>
+              <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.Description")%></nobr></td>
+              <td class="columnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.ConnectionType")%></nobr></td>
+              <td class="columnheader"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.Max")%></td>
+            </tr>
 <%
   int i = 0;
   while (i < connections.length)
@@ -100,44 +110,44 @@
     int maxCount = connection.getMaxConnections();
 
 %>
-    <tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
-      <td class="columncell">
-        <nobr>
-          <a href='<%="viewnotification.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listnotifications.View")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.View")%></a>
-          <a href='<%="editnotification.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listnotifications.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.Edit")%></a>
-          <a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listnotifications.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.Delete")%></a>
-        </nobr>
-      </td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(name)%></td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%></td>
-      <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectorName)%></td>
-      <td class="columncell"><%=Integer.toString(maxCount)%></td>
-    </tr>
+            <tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
+              <td class="columncell">
+                <nobr>
+                  <a href='<%="viewnotification.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listnotifications.View")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.View")%></a>
+                  <a href='<%="editnotification.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listnotifications.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.Edit")%></a>
+                  <a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listnotifications.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.Delete")%></a>
+                </nobr>
+              </td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(name)%></td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%></td>
+              <td class="columncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectorName)%></td>
+              <td class="columncell"><%=Integer.toString(maxCount)%></td>
+            </tr>
 <%
   }
 %>
-      <tr>
-        <td class="separator" colspan="5"><hr/></td>
-      </tr>
-      <tr><td class="message" colspan="5"><a href="editnotification.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listnotifications.AddANotificationConnection")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.AddaNewNotificationConnection")%></a></td></tr>
-    </table>
+            <tr>
+              <td class="separator" colspan="5"><hr/></td>
+            </tr>
+            <tr><td class="message" colspan="5"><a href="editnotification.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listnotifications.AddANotificationConnection")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listnotifications.AddaNewNotificationConnection")%></a></td></tr>
+          </table>
 
 <%
-    }
-    catch (ManifoldCFException e)
-    {
+}
+catch (ManifoldCFException e)
+{
   e.printStackTrace();
   variableContext.setParameter("text",e.getMessage());
   variableContext.setParameter("target","index.jsp");
 %>
   <jsp:forward page="error.jsp"/>
 <%
-    }
+}
 %>
-      </form>
-       </td>
-      </tr>
-    </table>
+        </form>
+      </td>
+    </tr>
+  </table>
 
 </body>
 



Mime
View raw message