⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configstepthree.jsp

📁 一个完整的网络订餐系统
💻 JSP
字号:
<%--
 - $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/admin/configstepthree.jsp,v 1.6 2005/02/15 19:30:22 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.6 $
 - $Date: 2005/02/15 19:30:22 $
 -
 - ====================================================================
 -
 - Copyright (C) 2002-2005 by MyVietnam.net
 -
 - This program is free software; you can redistribute it and/or
 - modify it under the terms of the GNU General Public License
 - as published by the Free Software Foundation; either version 2
 - of the License, or any later version.
 -
 - All copyright notices regarding mvnForum MUST remain intact
 - in the scripts and in the outputted HTML.
 - The "powered by" text/logo with a link back to
 - http://www.mvnForum.com and http://www.MyVietnam.net in the
 - footer of the pages MUST remain visible when the pages
 - are viewed on the internet or intranet.
 -
 - This program is distributed in the hope that it will be useful,
 - but WITHOUT ANY WARRANTY; without even the implied warranty of
 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 - GNU General Public License for more details.
 -
 - You should have received a copy of the GNU General Public License
 - along with this program; if not, write to the Free Software
 - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 -
 - Support can be obtained from support forums at:
 - http://www.mvnForum.com/mvnforum/index
 -
 - Correspondence and Marketing Questions can be sent to:
 - info@MyVietnam.net
 -
 - @author: Minh Nguyen  minhnn@MyVietnam.net
 - @author: Mai  Nguyen  mai.nh@MyVietnam.net
 --%>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="java.io.File" %>
<%@ page import="java.util.Locale" %>
<%@ page import="net.myvietnam.mvncore.util.*" %>
<%@ page import="net.myvietnam.mvncore.configuration.DOM4JConfiguration" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<fmt:bundle basename="mvnForum_i18n">
<html>
<head>
  <title><fmt:message key="mvnforum.common.forum.title_name"/> - Config mvnForum - Step 3</title>
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
<link href="<%=onlineUser.getCssPath()%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%@ include file="inc_js_checkvalid_myvietnamlib.jsp"%>

<script type="text/javascript">
function SubmitForm() {
  if (ValidateForm() == true ) {
    document.submitform.submitbutton.disabled = true;
    document.submitform.submit();
  }
}

function ValidateForm() {
  if (document.submitform.use_datasource.options[document.submitform.use_datasource.selectedIndex].value == "false") {
    if (isBlank(document.submitform.database_type, "database_type")) return false;
    if (isBlank(document.submitform.driver_class_name, "driver_class_name")) return false;
    if (isBlank(document.submitform.database_url, "database_url")) return false;
    if (isBlank(document.submitform.database_user, "database_user")) return false;
    if (!isUnsignedInteger(document.submitform.max_connection, "max_connection")) return false;
    if (!isUnsignedInteger(document.submitform.max_time_to_wait, "max_time_to_wait")) return false;
    if (!isUnsignedInteger(document.submitform.minutes_between_refresh, "minutes_between_refresh")) return false;
  } else {
    if (isBlank(document.submitform.datasource_name, "datasource_name")) return false;
  }

  if (isBlank(document.submitform.mail_server, "mail_server")) return false;
  if (isBlank(document.submitform.default_mail_from, "default_mail_from")) return false;
  if (!isEmail(document.submitform.default_mail_from, "default_mail_from")) return false;
  if (!isUnsignedInteger(document.submitform.port, "port")) return false;

  if (isBlank(document.submitform.server_path, "server_path")) return false;
  if (isBlank(document.submitform.server_hour_offset, "server_hour_offset")) return false;
  //if (!isUnsignedInteger(document.submitform.server_hour_offset, "server_hour_offset")) return false;
  return true;
}
function OnChangeUseDatasource() {
  if (document.submitform.use_datasource.options[document.submitform.use_datasource.selectedIndex].value == "false") {
    document.getElementById("id_database_type").style.display = '';
    document.getElementById("id_driver_class_name").style.display = '';
    document.getElementById("id_database_url").style.display = '';
    document.getElementById("id_database_user").style.display = '';
    document.getElementById("id_database_password").style.display = '';
    document.getElementById("id_max_connection").style.display = '';
    document.getElementById("id_max_time_to_wait").style.display = '';
    document.getElementById("id_minutes_between_refresh").style.display = '';
    document.getElementById("id_datasource_name").style.display = 'none';
  } else {
    document.getElementById("id_database_type").style.display = 'none';
    document.getElementById("id_driver_class_name").style.display = 'none';
    document.getElementById("id_database_url").style.display = 'none';
    document.getElementById("id_database_user").style.display = 'none';
    document.getElementById("id_database_password").style.display = 'none';
    document.getElementById("id_max_connection").style.display = 'none';
    document.getElementById("id_max_time_to_wait").style.display = 'none';
    document.getElementById("id_minutes_between_refresh").style.display = 'none';
    document.getElementById("id_datasource_name").style.display = '';
  }
}
</script>

<%@ include file="header.jsp"%>
<br/>
<%
  String strPathName = FileUtil.getServletClassesPath();
  String configFilename = strPathName + "mvncore.xml";
  DOM4JConfiguration conf = new DOM4JConfiguration(new File(configFilename));
%>

<table width="95%" align="center">
  <tr class="nav">
    <td><img src="<%=contextPath%>/mvnplugin/mvnforum/images/nav.gif"></td>
    <td width="100%" nowrap>
    <a class="nav" href="<%=indexUrl%>"><fmt:message key="mvnforum.common.nav.index"/></a>&nbsp;&raquo;&nbsp;
    <a class="nav" href="index">Admin CP</a>&nbsp;&raquo;&nbsp;
    <a class="nav" href="configindex">Config mvnForum</a>&nbsp;&raquo;&nbsp;
    Config mvnForum - Step 3
    </td>
  </tr>
</table>
<br/>

<form action="configstepthreeprocess" method="post" name="submitform">
<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="theader">
    <td colspan="2">Configuration Step 3 - Database Configuration</td>
  </tr>
  <tr class="trow1">
    <td>use_datasource <span class="requiredfield">*</span></td>
    <td>
    <select name="use_datasource" onChange="javascript:OnChangeUseDatasource();">
<%  String use_datasource = conf.getString("dboptions.use_datasource", "");
    String[] arr = {"true", "false"};
    for (int i = 0; i < arr.length; i++) {
      if (arr[i].equals(use_datasource)) { %>
      <option value=<%=arr[i]%> selected><%=arr[i]%></option>
    <%} else { %>
      <option value=<%=arr[i]%>><%=arr[i]%></option>
    <%}
    } %>
    </select>
    </td>
  </tr>
  <tr class="trow2" id="id_database_type" style="display: none;">
    <td>database_type <span class="requiredfield">*</span></td>
    <td>
    <select name="database_type">
      <% String database_type = conf.getString("dboptions.database_type", "");%>
      <option value=0 <%= (database_type.equals("0")) ? "selected" : "" %>>Default (Auto detect)</option>
      <option value=2 <%= (database_type.equals("2")) ? "selected" : "" %>>Database/Driver doesn't support scrollable Resultset</option>
    </select>
    </td>
  </tr>
  <tr class="trow1" id="id_driver_class_name" style="display: none;">
    <td>driver_class_name <span class="requiredfield">*</span></td>
    <td><input type="text" size="60" name="driver_class_name" value="<%=conf.getString("dboptions.driver_class_name", "")%>"></td>
  </tr>
  <tr class="trow2" id="id_database_url" style="display: none;">
    <td>database_url <span class="requiredfield">*</span></td>
    <td><input type="text" size="60" name="database_url" value="<%=conf.getString("dboptions.database_url", "")%>"></td>
  </tr>
  <tr class="trow1" id="id_database_user" style="display: none;">
    <td>database_user <span class="requiredfield">*</span></td>
    <td><input type="text" size="60" name="database_user" value="<%=conf.getString("dboptions.database_user", "")%>"></td>
  </tr>
  <tr class="trow2" id="id_database_password" style="display: none;">
    <td>database_password</td>
    <td><input type="password" size="60" name="database_password" value="<%=conf.getString("dboptions.database_password", "")%>"></td>
  </tr>
  <tr class="trow1" id="id_max_connection" style="display: none;">
    <td>max_connection <span class="requiredfield">*</span></td>
    <td><input type="text" size="60" name="max_connection" value="<%=conf.getString("dboptions.max_connection", "")%>"></td>
  </tr>
  <tr class="trow2" id="id_max_time_to_wait" style="display: none;">
    <td>max_time_to_wait <span class="requiredfield">*</span></td>
    <td><input type="text" size="60" name="max_time_to_wait" value="<%=conf.getString("dboptions.max_time_to_wait", "")%>"></td>
  </tr>
  <tr class="trow1" id="id_minutes_between_refresh" style="display: none;">
    <td>minutes_between_refresh <span class="requiredfield">*</span></td>
    <td><input type="text" size="60" name="minutes_between_refresh" value="<%=conf.getString("dboptions.minutes_between_refresh", "")%>"></td>
  </tr>
  <tr class="trow2" id="id_datasource_name" style="display: none;">
    <td>datasource_name</td>
    <td><input type="text" size="60" name="datasource_name" value="<%=conf.getString("dboptions.datasource_name", "")%>"></td>
  </tr>

  <tr class="theader">
    <td colspan="2">Configuration Step 3 - Mail Options</td>
  </tr>
  <tr class="trow1">
    <td>mail_server <span class="requiredfield">*</span></td>
    <td><input type="text" size="60" name="mail_server" value="<%=conf.getString("mailoptions.mail_server", "")%>"></td>
  </tr>
  <tr class="trow2">
    <td>default_mail_from <span class="requiredfield">*</span></td>
    <td><input type="text" size="60" name="default_mail_from" value="<%=conf.getString("mailoptions.default_mail_from", "")%>"></td>
  </tr>
  <tr class="trow1">
    <td>username</td>
    <td><input type="text" size="60" name="username" value="<%=conf.getString("mailoptions.username", "")%>"></td>
  </tr>
  <tr class="trow2">
    <td>password</td>
    <td><input type="password" size="60" name="password" value="<%=conf.getString("mailoptions.password", "")%>"></td>
  </tr>
  <tr class="trow1">
    <td>port <span class="requiredfield">*</span></td>
    <td><input type="text" size="60" name="port" value="<%=conf.getString("mailoptions.port", "25")%>"></td>
  </tr>

  <tr class="theader">
    <td colspan="2">Configuration Step 3 - Parameter Options</td>
  </tr>
  <tr class="trow1">
    <td>context_path</td>
    <td>
    <input type="text" size="60" name="context_path" value="<%=conf.getString("paramoptions.context_path", "")%>"><br/>
    Auto detect: <b><%= request.getContextPath() %></b>
    </td>
  </tr>
  <tr class="trow2">
    <td>server_path <span class="requiredfield">*</span></td>
    <td>
    <input type="text" size="60" name="server_path" value="<%=conf.getString("paramoptions.server_path", "")%>"><br/>
    Auto detect (method 1): <b><%= ParamUtil.getServer(request) %></b><br/>
    Auto detect (method 2): <b><%= ParamUtil.getServer2(request) %></b>
    </td>
  </tr>

  <tr class="theader">
    <td colspan="2">Configuration Step 3 - Date options</td>
  </tr>
  <tr class="trow1">
    <td>server_hour_offset <span class="requiredfield">*</span></td>
    <td>
    <input type="text" size="60" name="server_hour_offset" value="<%=conf.getString("dateoptions.server_hour_offset", "0")%>">
    <br/>Auto detect: <b><%= java.util.TimeZone.getDefault().getRawOffset() / DateUtil.HOUR %></b>
    </td>
  </tr>


  <tr class="theader">
    <td colspan="2">Configuration Step 3 - User Agent Options</td>
  </tr>
  <tr class="trow1">
    <td>blocked_user_agent</td>
    <td>
    <input type="text" size="60" name="blocked_user_agent" value="<%=conf.getString("useragentoptions.blocked_user_agent", "")%>">
    </td>
  </tr>

  <tr class="theader">
    <td colspan="2">Configuration Step 3 - IP Options</td>
  </tr>
  <tr class="trow1">
    <td>blocked_ip</td>
    <td>
    <input type="text" size="60" name="blocked_ip" value="<%=conf.getString("ipoptions.blocked_ip", "")%>">
    </td>
  </tr>

  <tr class="theader">
    <td colspan="2">Configuration Step 3 - Core Options</td>
  </tr>
  <tr class="trow1">
    <td>enable_link_nofollow <span class="requiredfield">*</span></td>
    <td>
    <select name="enable_link_nofollow">
<%  String enable_link_nofollow = conf.getString("mvncoreconfig.enable_link_nofollow", "");%>
      <option value="true" <%if ( "true".equals(enable_link_nofollow) ) { %> selected <% } %> >true</option>
      <option value="false" <%if ( "false".equals(enable_link_nofollow) ) { %> selected <% } %>>false</option>
    </select>
    </td>
  </tr>

  <tr class="theader">
    <td colspan="2">Configuration Step 3 - Interceptor Options</td>
  </tr>
  <tr class="trow1">
    <td>mailinterceptor_implementation</td>
    <td>
    <input type="text" size="60" name="mailinterceptor_implementation" value="<%=conf.getString("interceptor.mailinterceptor_implementation", "")%>">
    </td>
  </tr>
  <tr class="trow2">
    <td>contentinterceptor_implementation</td>
    <td>
    <input type="text" size="60" name="contentinterceptor_implementation" value="<%=conf.getString("interceptor.contentinterceptor_implementation", "")%>">
    </td>
  </tr>
  <tr class="trow1">
    <td>loginidinterceptor_implementation</td>
    <td>
    <input type="text" size="60" name="loginidinterceptor_implementation" value="<%=conf.getString("interceptor.loginidinterceptor_implementation", "")%>">
    </td>
  </tr>

  <tr class="trowfinal">
    <td colspan="2" align="center">
      <input type="button" name="submitbutton" value="Update Configuration" onclick="javascript:SubmitForm();" class="mainoption">
      <input type="button" value="Cancel" class="liteoption" onclick="javascript:gotoPage('configindex');">
    </td>
  </tr>
</table>
</form>
<br/>
<script language="JavaScript" type="text/javascript">
<!--
    OnChangeUseDatasource();
//-->
</script>

</fmt:bundle>
<%@ include file="footer.jsp"%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -