ACTION="$(echo "$_GET[\"action\"]" |egrep '^[a-zA-Z0-9_-]+$')"
ACTION="${_EXEC}/actions/${ACTION}.sh"
-[ -x "$ACTION" ] || echo -n "Location: http://$HTTP_HOST/?page=error\n\n"
+[ -x "$ACTION" ] || echo -n "Location: ?page=error\n\n"
. $ACTION
cat <<AdminEND
<div id="LEFT"></div>
<div id="MAIN">
- <div class="section"><form method="post" accept-charset="utf-8" action="/?action=projectmeta">
+ <div class="section"><form method="post" accept-charset="utf-8" action="./?action=projectmeta">
<h1>General</h1>
<fieldset><legend>Title Display</legend>
edit_intro(){
cat <<HomeEND
<div id="introedit" style="display: none;">
- <form action="/?action=introedit&i=intro" method="post" accept-charset="UTF-8">
+ <form action="./?action=introedit&i=intro" method="post" accept-charset="UTF-8">
<textarea name="text" rows="10">$([ -r "Home/intro" ] && cat Home/intro)</textarea><br>
<input type="submit">
$(switchbutton introedit introtext Cancel)
<div class="NEWS">
<a id="new" class='function' href='#add' onclick='javascript:hide_screen("new");show_screen("add");'>Add News</a>
<div id="add" style="display: none;">
- <form action="/?action=introedit&i=news" method="post" accept-charset="UTF-8">
+ <form action="./?action=introedit&i=news" method="post" accept-charset="UTF-8">
<textarea name="text" rows="10"></textarea><br>
<input type="submit">
$(switchbutton add new Cancel)
cat <<HomeEND
<div id="edit_$info" style="display: none;">
- <form action="/?action=introedit&i=$info" method="post" accept-charset="UTF-8">
+ <form action="./?action=introedit&i=$info" method="post" accept-charset="UTF-8">
<textarea name="text" rows="10">$([ -r "$each" ] && cat $each)</textarea><br>
<input type="submit">
$(switchbutton edit_$info news_$info Cancel)
cat <<HomeEND
<div id="LEFT">
- <form method="GET" action="/${SCRIPTNAME}" accept-charset="utf-8">
+ <form method="GET" action="./" accept-charset="utf-8">
<input type="hidden" name="p" value="Home">
<input type="text" name="s" placeholder="Search"><br>
<input type="submit" value="Search News">
echo "<h1>Tasks search results for: $search</h1>"
for each in $(grep -ile "$search" Tasks/<0000000000-9999999999>_<000-999>); do
id=$(sed -r 's:^.*/::;s:.task$::' <<<$each)
- echo "<div class='search'><a href='${SCRIPTNAME}?p=Tasks&i=$id'><h2>$(date -d @$(cut -d_ -f1 <<<"$id"))</h2></a>"
+ echo "<div class='search'><a href='./?p=Tasks&i=$id'><h2>$(date -d @$(cut -d_ -f1 <<<"$id"))</h2></a>"
grep -C1 -ie "$search" "$each" |sed "s:$search:<b>&</b>:g;s:$:<br>:g"
echo '</div>'
done
[ -z "$attendant" ] && attendant='(none)'
cat <<TasksEND
<div class="Task">
- <a href="${SCRIPTNAME}?p=Tasks&i=${info}"><b>$headline</b></a><br>
+ <a href="./?p=Tasks&i=${info}"><b>$headline</b></a><br>
<span><b>Status:</b> $taskstatus</span>
<span><b>Section:</b> $section</span>
<span><b>Attendant:</b> $attendant</span>
cat <<TasksEND
<a id='newTask_button' class='function' href='#' onclick='javascript:show_screen("newTask");hide_screen("newTask_button");'>New Task</a>
<div id="newTask" style="display: none;">
- <form action="/${SCRIPTNAME}" method="get" accept-charset="UTF-8">
+ <form action="./" method="get" accept-charset="UTF-8">
<b>Headline:</b><br>
<input type="hidden" name="p" value="Tasks">
<textarea name="n" rows="2" style="width:99%;"></textarea><br>
cat <<TasksEND
<div id="LEFT">
- <form method="GET" action="/${SCRIPTNAME}" accept-charset="utf-8">
+ <form method="GET" action="./" accept-charset="utf-8">
<input type="hidden" name="p" value="Tasks">
<input type="text" name="s" placeholder="Search"><br>
<input type="submit" value="Search Tasks">
cat <<WikiEND
<div id="change_$info" style="display: none;">
- <form action="/?action=wikimeta&i=$info" method="post" accept-charset="UTF-8">
+ <form action="./?action=wikimeta&i=$info" method="post" accept-charset="UTF-8">
<b>Title:</b> <input type="text" name="title" value="$title"><br>
<b>Description:</b><br>
<textarea name="desc" rows="6" style="width:100%;">$description</textarea><br>
cat <<WikiEND
<a id='addp_button' class='function' href='#' onclick='javascript:show_screen("add_page");hide_screen("addp_button");'>Add a new Page</a>
<div id="add_page" style="display: none;">
- <form action="/?action=wikimeta" method="post" accept-charset="UTF-8">
+ <form action="./?action=wikimeta" method="post" accept-charset="UTF-8">
<br><b>Title:</b><br>
<input type="text" name="title" placeholder="Fill in a title"><br>
<b>Description:</b><br>
cat <<WikiEND
<div class="article">
<div id="display_$info">
- <a name="$info" href="/?p=Wiki&i=$info"><h1>$title</h1></a>
+ <a name="$info" href="./?p=Wiki&i=$info"><h1>$title</h1></a>
$description<br><br>
- <a class="function" href="/?p=Wiki&i=$info">View</a>
+ <a class="function" href="./?p=Wiki&i=$info">View</a>
$($ACL_WIKIEDIT && echo "<a class='function' href='#' onclick=\"javascript:show_screen('change_$info');hide_screen('display_$info');\">Change Info</a>")
</div>
$($ACL_WIKIEDIT && change_wiki $info)
cat <<WikiEND
<div id="LEFT">
- <form method="GET" action="/${SCRIPTNAME}" accept-charset="utf-8">
+ <form method="GET" action="./" accept-charset="utf-8">
<input type="hidden" name="p" value="Wiki">
<input type="text" name="s" placeholder="Search"><br>
<input type="submit" value="Search Wiki">
<a id='comment_button' class='function' href='#'
onclick='javascript:show_screen("comment");hide_screen("comment_button");'>Comment / Ask</a>
<div id="comment" style="display: none;">
- <form action="/?action=wikimeta&i=$info" method="post" accept-charset="UTF-8">
+ <form action="./?action=wikimeta&i=$info" method="post" accept-charset="UTF-8">
<b>Comment:</b><br>
<textarea name="comm" rows="6" style="width:99%;"></textarea><br>
<input type="submit" value="Submit">
cat <<WikiEND
<div id="LEFT">
- <form method="GET" action="/${SCRIPTNAME}" accept-charset="utf-8">
+ <form method="GET" action="./" accept-charset="utf-8">
<input type="hidden" name="p" value="Wiki">
<input type="text" name="s" placeholder="Search"><br>
<input type="submit" value="Search Wiki">
done) <a class='rev' href='?p=Wiki&i=$info'>Latest</a><br>
<hr>
$($LOGIN && if [ -z "$lock" ]; then
- [ -z "$rev" ] && echo "<a class='function' href='/?action=lock&p=Wiki&e=$info'>edit this page</a>"
- [ -n "$rev" ] && echo "Click <a class='function' href='/?action=lock&p=Wiki&e=${info}&r=${rev:s/.//}'>edit</a> to derive a new page revision from this one."
+ [ -z "$rev" ] && echo "<a class='function' href='./?action=lock&p=Wiki&e=$info'>edit this page</a>"
+ [ -n "$rev" ] && echo "Click <a class='function' href='./?action=lock&p=Wiki&e=${info}&r=${rev:s/.//}'>edit</a> to derive a new page revision from this one."
else
- echo "<b>This page is currently being edited by $lock</b><a class='function' href='/?action=lock&p=Wiki&e=$info'>edit anyway</a>"
+ echo "<b>This page is currently being edited by $lock</b><a class='function' href='./?action=lock&p=Wiki&e=$info'>edit anyway</a>"
fi
$LOGIN && echo '<hr>')
<h1>Table of Content</h1>
<span id="SLOGAN">$(egrep '^slogan=.*$' project.meta |cut -d= -f2-)</span>
</div>
<div id="USERMENU">
- $( $LOGIN || echo '<form action="/?action=login" method="post" accept-charset="UTF-8">
+ $( $LOGIN || echo '<form action="./?action=login" method="post" accept-charset="UTF-8">
Login:<br>
<input type="text" name="user" value placeholder="Username"><br>
<input type="password" name="pass" value placeholder="Password"><br>
$(list_accounts)
</div>
<div id="MENU">
- <a href='/?p=Home'>Home</a>
- <a href='/?p=Wiki'>Wiki</a>
- <a href='/?p=Subversion'>Code</a>
- <a href='/?p=Tasks'>Tasks</a>
+ <a href='./?p=Home'>Home</a>
+ <a href='./?p=Wiki'>Wiki</a>
+ <a href='./?p=Subversion'>Code</a>
+ <a href='./?p=Tasks'>Tasks</a>
</div>
$(. $PAGE body)