Subversion Repositories DevTools

Rev

Rev 2362 | Rev 3611 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2362 Rev 2382
Line 124... Line 124...
124
Else
124
Else
125
    gDataSourceName = "DefaultDb"
125
    gDataSourceName = "DefaultDb"
126
End If
126
End If
127
 
127
 
128
' Can only Edit on the Test / Development System not on the Live System
128
' Can only Edit on the Test / Development System not on the Live System
129
If (IsEmpty(Application("LiveSystem"))) AND (Session("login") <> 0) Then
129
If (IsEmpty(Application("LiveSystem"))) Then
130
        gHideLogin = false
130
    gHideLogin = false
-
 
131
    If (Session("login") <> 0) Then
131
        gHideWikiFooter = false
132
            gHideWikiFooter = false
132
        gEnableEdit = true
133
            gEnableEdit = true
133
        Session("login") = 1
134
            Session("login") = 1
-
 
135
    End If
-
 
136
    gHideWikiFooter = NOT gEnableEdit
134
Else
137
Else
135
    gHideLogin = true
138
    gHideLogin = true
136
    gHideWikiFooter = true
139
    gHideWikiFooter = true
137
End If
140
End If
138
 
141
 
Line 1242... Line 1245...
1242
  '---- some security here
1245
  '---- some security here
1243
 
1246
 
1244
  If gDataSourceFile <> gDefaultHomePage Then
1247
  If gDataSourceFile <> gDefaultHomePage Then
1245
    Dim pwd
1248
    Dim pwd
1246
    If Request.QueryString("pw") <> gPassword Then
1249
    If Request.QueryString("pw") <> gPassword Then
1247
        Response.Write("Sorry but the Database (db) requested does not exist.  Correct password must be sent to create it.")
1250
        Response.Write("Sorry but the Database (db) requested does not exist, or may not be writable.<br>Correct password must be sent to create it.")
-
 
1251
        Response.Write("<p>Folder:" & f1 & ".")
-
 
1252
        Response.Write("<br>DataBase:" & gDataSource & ".")
1248
        Response.End
1253
        Response.End
1249
    End If
1254
    End If
1250
  End If
1255
  End If
1251
  '--------------------------------------------
1256
  '--------------------------------------------
1252
  ' step 1: create the new db catalog, if necessary
1257
  ' step 1: create the new db catalog, if necessary
Line 1441... Line 1446...
1441
    Session("login") = 1
1446
    Session("login") = 1
1442
    Response.Redirect(url)
1447
    Response.Redirect(url)
1443
end sub
1448
end sub
1444
 
1449
 
1445
sub handleEdit
1450
sub handleEdit
1446
    If gHideLogin Then
1451
    If NOT gEnableEdit Then
1447
        Response.Write("<br/><br/><br/><br/><br/><center><h2>Editing is not allowed</h2></center>")
1452
        Response.Write("<br/><br/><br/><br/><br/><center><h2>Editing is not allowed</h2></center>")
1448
        Response.End
1453
        Response.End
1449
        exit sub
1454
        exit sub
1450
    End If
1455
    End If
1451
 
1456
 
Line 2060... Line 2065...
2060
      
2065
      
2061
      If gBannerTemplate = "" Then
2066
      If gBannerTemplate = "" Then
2062
         bannerPart = ""
2067
         bannerPart = ""
2063
         bannerPart =  bannerPart &  "<a href='" & gScriptURL & "'>Wiki Home</a>"
2068
         bannerPart =  bannerPart &  "<a href='" & gScriptURL & "'>Wiki Home</a>"
2064
         bannerPart =  bannerPart &  "&nbsp;|&nbsp;<a href='" & gScriptURL & "&a=list&o=ByTitle' title='this may take a loooong time'>List all pages</a>"
2069
         bannerPart =  bannerPart &  "&nbsp;|&nbsp;<a href='" & gScriptURL & "&a=list&o=ByTitle' title='this may take a loooong time'>List all pages</a>"
2065
         if ( gEnableEdit OR 1 ) Then
2070
         if ( NOT gHideLogin ) Then
2066
            bannerPart =  bannerPart &  "&nbsp;|&nbsp;<a href='" & gScriptURL & "&a=list&o=recent'>Recent pages</a>"
2071
            bannerPart =  bannerPart &  "&nbsp;|&nbsp;<a href='" & gScriptURL & "&a=list&o=recent'>Recent pages</a>"
2067
            bannerPart =  bannerPart &  "&nbsp;|&nbsp;<span style='color: #FF0000;font-weight: bold;'>Development Web Server</span>"
2072
            bannerPart =  bannerPart &  "&nbsp;|&nbsp;<span style='color: #FF0000;font-weight: bold;'>Development Web Server</span>"
2068
            if (search <> "") AND (gEnableEdit) then
2073
            if (search <> "") AND (gEnableEdit) then
2069
            bannerPart =  bannerPart &  "&nbsp;|&nbsp;<a href='" & gScriptURL & "&a=edit&o=" & search & "'>Edit page</a>"
2074
            bannerPart =  bannerPart &  "&nbsp;|&nbsp;<a href='" & gScriptURL & "&a=edit&o=" & search & "'>Edit page</a>"
2070
            bannerPart =  bannerPart &  "&nbsp;|&nbsp;<a href='" & gScriptURL & "&a=del&o=" & search & "'>Del page</a>"
2075
            bannerPart =  bannerPart &  "&nbsp;|&nbsp;<a href='" & gScriptURL & "&a=del&o=" & search & "'>Del page</a>"
Line 2157... Line 2162...
2157
 
2162
 
2158
  if rs.eof=true then
2163
  if rs.eof=true then
2159
        Response.Write("<center><h2>Page Creation</h2><hr>")
2164
        Response.Write("<center><h2>Page Creation</h2><hr>")
2160
    if gHideLogin Then
2165
    if gHideLogin Then
2161
        Response.Write("The page --> <b>" &  glsTopic & "</b> <--- Does not exit and it cannot be created on this Server")
2166
        Response.Write("The page --> <b>" &  glsTopic & "</b> <--- Does not exit and it cannot be created on this Server")
-
 
2167
    ElseIf NOT gEnableEdit Then
-
 
2168
        Response.Write("The page --> <b>" &  glsTopic & "</b> <--- Does not exit and it cannot be created until you log in")
2162
    Else
2169
    Else
2163
        response.write("Sorry! The page --> <b>" &  glsTopic & "</b>  <--- is not existing or it is a page that must be created </h4>")
2170
        response.write("Sorry! The page --> <b>" &  glsTopic & "</b>  <--- is not existing or it is a page that must be created </h4>")
2164
        response.write( "<br><a href='" & gScriptURL & "&a=edit&o=" & glsTopic & "'>Click this link to create this page.</a>" )
2171
        response.write( "<br><a href='" & gScriptURL & "&a=edit&o=" & glsTopic & "'>Click this link to create this page.</a>" )
2165
        response.write( "<br><br><a href='" & gScriptURL & "'>No,  don't create it.</a>" )
2172
        response.write( "<br><br><a href='" & gScriptURL & "'>No,  don't create it.</a>" )
2166
    End If
2173
    End If
2167
        Response.Write("</center>")
2174
        Response.Write("</center>")
2168
 
2175
 
2169
  else
2176
  else
2170
      EmitDebug 51, 3, "found...(" & rs("PageData") & ")<br/>" & vbcrlf
2177
      EmitDebug 51, 3, "found...(" & rs("PageData") & ")<br/>" & vbcrlf
2171
 
2178
 
2172
      If Not gHideLogin Then
2179
      If gEnableEdit Then
2173
        response.write" <body ondblclick=" & chr(34) & "document.location.href='" & _
2180
        response.write" <body ondblclick=" & chr(34) & "document.location.href='" & _
2174
            gScriptURL & "&a=edit&o=" & glsTopic    & "'" & chr(34) &">"
2181
            gScriptURL & "&a=edit&o=" & glsTopic    & "'" & chr(34) &">"
2175
      Else
2182
      Else
2176
         response.write" <body >"
2183
         response.write" <body >"
2177
 
2184
 
Line 2199... Line 2206...
2199
        Response.Write("<br/><br/><br/><br/><br/><center><h2>Editing is not allowed</h2></center>")
2206
        Response.Write("<br/><br/><br/><br/><br/><center><h2>Editing is not allowed</h2></center>")
2200
        Response.End
2207
        Response.End
2201
        exit sub
2208
        exit sub
2202
    End If
2209
    End If
2203
 
2210
 
-
 
2211
    If NOT gEnableEdit Then
-
 
2212
        Response.Write("<br/><br/><br/><br/><br/><center><h2>Editing is not allowed until logged in</h2></center>")
-
 
2213
        Response.End
-
 
2214
        exit sub
-
 
2215
    End If
-
 
2216
 
2204
  on error resume next
2217
  on error resume next
2205
  VerifyWikiTable
2218
  VerifyWikiTable
2206
  on error goto 0
2219
  on error goto 0
2207
  Response.Redirect gScriptURL
2220
  Response.Redirect gScriptURL
2208
end sub
2221
end sub