📄 manage_config.asp
字号:
<%
'****************************************************
' Jetiben CMS Power by Jetiben.com
' Email: jetiben@hotmail.com
' Web: http://www.jetiben.com/
'****************************************************
ncontrol = "select,lock,delete"
Const nsearch = "username,id"
Function admin_manage_popedom(ByVal ppdstr)
Dim option_uncheckbox, option_checkbox
option_uncheckbox = itake("global.tpl_config.option_uncheckbox", "tpl")
option_checkbox = itake("global.tpl_config.option_checkbox", "tpl")
Dim html_kong, html_br
html_kong = itake("global.tpl_config.html_kong", "tpl")
html_br = itake("global.tpl_config.html_br", "tpl")
Dim tmpappary
tmpappary = get_application(adms_appstr)
If IsArray(tmpappary) Then
Dim tmpary
tmpary = get_newary2(tmpappary, ":description", 1)
If IsArray(tmpary) Then
Dim tmpi, tmpub, tmpstr, tmpara, tmparb
tmpub = UBound(tmpary)
For tmpi = 0 To tmpub
tmpara = get_lrstr(tmpary(tmpi, 0), ":", "left")
tmparb = tmpary(tmpi, 1)
If cinstr(ppdstr, tmpara, ",") Then
tmpstr = tmpstr & replace_template(option_checkbox, "{$explain}" & spa & "{$value}", "popedom" & spa & tmpara) & tmparb & html_kong
Else
tmpstr = tmpstr & replace_template(option_uncheckbox, "{$explain}" & spa & "{$value}", "popedom" & spa & tmpara) & tmparb & html_kong
End If
If (tmpi + 1) mod 5 = 0 Then tmpstr = tmpstr & html_br
Next
admin_manage_popedom = tmpstr
Else
admin_manage_popedom = itake("manage.admin_addappnull", "lng")
End If
Else
admin_manage_popedom = itake("manage.admin_addappnull", "lng")
End If
End Function
Function manage_navigation()
Dim tmpstr
tmpstr = ireplace("manage.navigation", "tpl")
manage_navigation = tmpstr
End Function
Function admin_get_popedom(ByVal psuper, ByVal ppopedom)
If get_num(psuper, 0) = 1 Then
admin_get_popedom = "-1"
Else
admin_get_popedom = format_checkbox(ppopedom)
End If
End Function
Sub jtb_cms_admin_manage_list()
Dim search_field, search_keyword
search_field = get_safecode(request.querystring("field"))
search_keyword = get_safecode(request.querystring("keyword"))
Dim tmpstr, tmpastr
tmpstr = ireplace("manage.list", "tpl")
tmpastr = ctemplate(tmpstr, "{$recurrence_ida}")
Dim tmprstr, tmptstr
sqlstr = "select * from " & ndatabase & " where " & nidfield & ">0"
If search_field = "username" Then sqlstr = sqlstr & " and " & cfname("name") & " like '%" & search_keyword & "%'"
If search_field = "id" Then sqlstr = sqlstr & " and " & nidfield & "=" & get_num(search_keyword, 0)
sqlstr = sqlstr & " order by " & nidfield & " desc"
Dim jcutpage, jcuti
Set jcutpage = New jtb_cutpage
jcutpage.perpage = npagesize
jcutpage.sqlstr = sqlstr
jcutpage.cutpage
Set rs = jcutpage.pagers
Dim font_disabled, postfix_good
postfix_good = ireplace("global.tpl_config.postfix_good", "tpl")
font_disabled = itake("global.tpl_config.font_disabled", "tpl")
Dim tmpusername
For jcuti = 1 To npagesize
If Not rs.EOF Then
tmpusername = get_str(rs(cfname("name")))
If rs("jtb_alock") = 1 Then tmpusername = Replace(font_disabled, "{$explain}", tmpusername)
If rs("jtb_apopedom") = "-1" Then tmpusername = tmpusername & postfix_good
tmptstr = Replace(tmpastr, "{$username}", tmpusername)
tmptstr = Replace(tmptstr, "{$usernamestr}", get_str(rs(cfname("name"))))
tmptstr = Replace(tmptstr, "{$lasttime}", get_str(rs(cfname("lasttime"))))
tmptstr = Replace(tmptstr, "{$lastip}", get_str(rs(cfname("lastip"))))
tmptstr = Replace(tmptstr, "{$id}", rs(nidfield))
rs.movenext
tmprstr = tmprstr & tmptstr
End If
Next
tmpstr = Replace(tmpstr, "{$cpagestr}", jcutpage.pagestr)
Set rs = Nothing
Set jcutpage = Nothing
tmpstr = Replace(tmpstr, jtbc_cinfo, tmprstr)
response.write tmpstr
End Sub
Sub jtb_cms_admin_manage_add()
Dim tmpstr
tmpstr = ireplace("manage.add", "tpl")
response.write tmpstr
End Sub
Sub jtb_cms_admin_manage_edit()
Dim tid, tbackurl
tid = get_num(request.querystring("id"), 0)
tbackurl = get_safecode(request.querystring("backurl"))
Set rs = server.CreateObject("adodb.recordset")
sqlstr = "select * from " & ndatabase & " where " & nidfield & "=" & tid
rs.open sqlstr, conn, 1, 1
If Not rs.EOF Then
Dim tmpstr, tmppopedom, tmpsuper
If rs(cfname("popedom")) = "-1" Then
tmpsuper = 1
tmppopedom = ""
Else
tmpsuper = 0
tmppopedom = get_str(rs(cfname("popedom")))
End If
tmpstr = itake("manage.edit", "tpl")
tmpstr = Replace(tmpstr, "{$id}", rs(nidfield))
tmpstr = Replace(tmpstr, "{$username}", get_str(rs(cfname("name"))))
tmpstr = Replace(tmpstr, "{$super}", tmpsuper)
tmpstr = Replace(tmpstr, "{$popedom}", tmppopedom)
tmpstr = Replace(tmpstr, "{$lock}", get_str(rs(cfname("lock"))))
tmpstr = creplace(tmpstr)
response.write tmpstr
Else
Call jtb_cms_admin_msg(itake("global.lng_public.not_exist", "lng"), tbackurl, 0)
End If
rs.Close
Set rs = Nothing
End Sub
Sub jtb_cms_admin_manage_adddisp()
Dim tmpusername, tbackurl
tmpusername = get_safecode(request.Form("username"))
tbackurl = get_safecode(request.querystring("backurl"))
If check_null(tmpusername) Then Call client_alert(Replace(itake("global.lng_public.insert_empty", "lng"), "[]", "[" & itake("global.lng_config.username", "lng") & "]"), -1)
Set rs = server.CreateObject("adodb.recordset")
sqlstr = "select * from " & ndatabase & " where " & cfname("name") & "='" & tmpusername & "'"
rs.open sqlstr, conn, 1, 3
If rs.EOF Then
rs.addnew
rs(cfname("name")) = tmpusername
rs(cfname("pword")) = md5(request.Form("password"), 2)
rs(cfname("popedom")) = left_intercept(admin_get_popedom(request.Form("super"), request.Form("popedom")), 250)
rs(cfname("lock")) = get_num(request.Form("lock"), 0)
rs(cfname("lasttime")) = Now()
rs(cfname("lastip")) = nuserip
rs.Update
Call jtb_cms_admin_msg(itake("global.lng_public.add_succeed", "lng"), tbackurl, 1)
Else
Call jtb_cms_admin_msg(itake("global.lng_public.add_failed", "lng"), tbackurl, 1)
End If
rs.Close
Set rs = Nothing
End Sub
Sub jtb_cms_admin_manage_editdisp()
Dim tbackurl, tid
tbackurl = get_safecode(request.querystring("backurl"))
tid = get_num(request.querystring("id"), 0)
Set rs = server.CreateObject("adodb.recordset")
sqlstr = "select * from " & ndatabase & " where " & nidfield & "=" & tid
rs.open sqlstr, conn, 1, 3
If Not rs.EOF Then
If Not check_null(request.Form("password")) Then rs(cfname("pword")) = md5(request.Form("password"), 2)
rs(cfname("popedom")) = left_intercept(admin_get_popedom(request.Form("super"), request.Form("popedom")), 250)
rs(cfname("lock")) = get_num(request.Form("lock"), 0)
rs.Update
Call jtb_cms_admin_msg(itake("global.lng_public.edit_succeed", "lng"), tbackurl, 1)
Else
Call jtb_cms_admin_msg(itake("global.lng_public.edit_failed", "lng"), tbackurl, 1)
End If
rs.Close
Set rs = Nothing
End Sub
Sub jtb_cms_admin_manage_action()
Select Case request.querystring("action")
Case "add"
Call jtb_cms_admin_manage_adddisp
Case "edit"
Call jtb_cms_admin_manage_editdisp
Case "delete"
Call jtb_cms_admin_deletedisp
Case "control"
Call jtb_cms_admin_controldisp
End Select
End Sub
Call jtb_cms_admin_manage_action
Sub jtb_cms_admin_manage()
Select Case request.querystring("type")
Case "add"
Call jtb_cms_admin_manage_add
Case "edit"
Call jtb_cms_admin_manage_edit
Case Else
Call jtb_cms_admin_manage_list
End Select
End Sub
'****************************************************
' Jetiben CMS Power by Jetiben.com
' Email: jetiben@hotmail.com
' Web: http://www.jetiben.com/
'****************************************************
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -