Commit db3224c8 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

new login scenario

parent 7c652cc5
......@@ -62,24 +62,32 @@ else if (tokenize($exist:path, '/') = "get") then
switch ($exist:resource)
case "code.html" return
replace(serialize($doc//xhtml:div[@class="teixml"]), "xhtml:", "")
case "trans.html" return
replace(serialize($doc/xhtml:body/xhtml:div/xhtml:div[not(@class="teixml")][not(@class="facs")]), "xhtml:", "")
case "facs.html" return
replace(serialize($doc//xhtml:div[@class="facs"]), "xhtml:", "")
case "toc.html" return
replace(serialize(doc( $docCollection || "toc.xml" )), "xhtml:", "")
case "comm.html" return
replace(serialize($doc//xhtml:div[@class="notes"]), "xhtml:", "")
default return "supported requests are: facs, trans, code"
return
response:stream($content, "method=text media-type=text/plain")
(: the important stuff :)
else if(
$exist:resource = "edition.html"
and config:get("sade.develop") = "true"
and string(request:get-cookie-value('fontaneAuth')) != config:get("secret")
) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<redirect url="login.html?redirect={$exist:path => substring-after("textgrid/")}?{request:get-query-string()}"/>
</dispatch>
else if (ends-with($exist:resource, ".html")) then
let $doc-path := $config:projects-dir || $project || config:get("template") || $exist:resource
return
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment