Subversion Repositories DevTools

Rev

Rev 2365 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2365 Rev 2735
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
-
 
1452
        Response.Write("<br/><br/><br/><br/><br/><center><h2>Editing is not allowed</h2></center>")
-
 
1453
        Response.End
1447
        Response.Write("<br/><br/><br/><br/><br/><center><h2>Editing is not allowed</h2></center>")
1454
        Response.Write("<br/><br/><br/><br/><br/><center><h2>Editing is not allowed</h2></center>")
1448
        Response.End
1455
        Response.End
1449
        exit sub
1456
        exit sub
1450
    End If
1457
    End If
1451
 
1458
 
Line 2060... Line 2067...
2060
      
2067
      
2061
      If gBannerTemplate = "" Then
2068
      If gBannerTemplate = "" Then
2062
         bannerPart = ""
2069
         bannerPart = ""
2063
         bannerPart =  bannerPart &  "<a href='" & gScriptURL & "'>Wiki Home</a>"
2070
         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>"
2071
         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
2072
         if ( NOT gHideLogin ) Then
2066
            bannerPart =  bannerPart &  "&nbsp;|&nbsp;<a href='" & gScriptURL & "&a=list&o=recent'>Recent pages</a>"
2073
            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>"
2074
            bannerPart =  bannerPart &  "&nbsp;|&nbsp;<span style='color: #FF0000;font-weight: bold;'>Development Web Server</span>"
2068
            if (search <> "") AND (gEnableEdit) then
2075
            if (search <> "") AND (gEnableEdit) then
2069
            bannerPart =  bannerPart &  "&nbsp;|&nbsp;<a href='" & gScriptURL & "&a=edit&o=" & search & "'>Edit page</a>"
2076
            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>"
2077
            bannerPart =  bannerPart &  "&nbsp;|&nbsp;<a href='" & gScriptURL & "&a=del&o=" & search & "'>Del page</a>"
Line 2157... Line 2164...
2157
 
2164
 
2158
  if rs.eof=true then
2165
  if rs.eof=true then
2159
        Response.Write("<center><h2>Page Creation</h2><hr>")
2166
        Response.Write("<center><h2>Page Creation</h2><hr>")
2160
    if gHideLogin Then
2167
    if gHideLogin Then
2161
        Response.Write("The page --> <b>" &  glsTopic & "</b> <--- Does not exit and it cannot be created on this Server")
2168
        Response.Write("The page --> <b>" &  glsTopic & "</b> <--- Does not exit and it cannot be created on this Server")
-
 
2169
    ElseIf NOT gEnableEdit Then
-
 
2170
        Response.Write("The page --> <b>" &  glsTopic & "</b> <--- Does not exit and it cannot be created until you log in")
2162
    Else
2171
    Else
2163
        response.write("Sorry! The page --> <b>" &  glsTopic & "</b>  <--- is not existing or it is a page that must be created </h4>")
2172
        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>" )
2173
        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>" )
2174
        response.write( "<br><br><a href='" & gScriptURL & "'>No,  don't create it.</a>" )
2166
    End If
2175
    End If
2167
        Response.Write("</center>")
2176
        Response.Write("</center>")
2168
 
2177
 
2169
  else
2178
  else
2170
      EmitDebug 51, 3, "found...(" & rs("PageData") & ")<br/>" & vbcrlf
2179
      EmitDebug 51, 3, "found...(" & rs("PageData") & ")<br/>" & vbcrlf
2171
 
2180
 
2172
      If Not gHideLogin Then
2181
      If gEnableEdit Then
2173
        response.write" <body ondblclick=" & chr(34) & "document.location.href='" & _
2182
        response.write" <body ondblclick=" & chr(34) & "document.location.href='" & _
2174
            gScriptURL & "&a=edit&o=" & glsTopic    & "'" & chr(34) &">"
2183
            gScriptURL & "&a=edit&o=" & glsTopic    & "'" & chr(34) &">"
2175
      Else
2184
      Else
2176
         response.write" <body >"
2185
         response.write" <body >"
2177
 
2186
 
Line 2199... Line 2208...
2199
        Response.Write("<br/><br/><br/><br/><br/><center><h2>Editing is not allowed</h2></center>")
2208
        Response.Write("<br/><br/><br/><br/><br/><center><h2>Editing is not allowed</h2></center>")
2200
        Response.End
2209
        Response.End
2201
        exit sub
2210
        exit sub
2202
    End If
2211
    End If
2203
 
2212
 
-
 
2213
    If NOT gEnableEdit Then
-
 
2214
        Response.Write("<br/><br/><br/><br/><br/><center><h2>Editing is not allowed until logged in</h2></center>")
-
 
2215
        Response.End
-
 
2216
        exit sub
-
 
2217
    End If
-
 
2218
 
2204
  on error resume next
2219
  on error resume next
2205
  VerifyWikiTable
2220
  VerifyWikiTable
2206
  on error goto 0
2221
  on error goto 0
2207
  Response.Redirect gScriptURL
2222
  Response.Redirect gScriptURL
2208
end sub
2223
end sub