first commit
This commit is contained in:
commit
dc1afb2cb2
228 changed files with 12529 additions and 0 deletions
29
tpl/_debug.tpl
Normal file
29
tpl/_debug.tpl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
% if(! ~ $#debug_shell 0) {
|
||||
<form method="POST" name="prompt">
|
||||
<input size="80" type="text" name="command" value="%($"post_arg_command%)">
|
||||
<input type="submit" Value="Run">
|
||||
</form>
|
||||
<script language="javascript"><!--
|
||||
document.prompt.command.focus()
|
||||
//--></script>
|
||||
|
||||
%{
|
||||
fn evl {
|
||||
# Buffering is probably messing this up:
|
||||
#rc -c 'flag x +;{'^$post_arg_command'} |[2] awk ''{print ">> "$0}'''
|
||||
rc -c 'flag s +; flag x +;'^$post_arg_command
|
||||
}
|
||||
if(! ~ $#post_arg_command 0 && ! ~ $#post_arg_command '') {
|
||||
echo '<hr><pre>'
|
||||
evl | escape_html |[2] awk '{print "<b>"$0"</b>"}'
|
||||
echo '</pre>'
|
||||
}
|
||||
%}
|
||||
% }
|
||||
|
||||
<hr><pre>
|
||||
% env | escape_html
|
||||
</pre><hr>
|
||||
|
||||
% umask
|
||||
|
||||
35
tpl/_tools/hash.tpl
Normal file
35
tpl/_tools/hash.tpl
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<h1>Password Hash Generator</h1>
|
||||
<p>This tool is for generating password hashes to be used for your Third Culture user account.</p>
|
||||
<form method="POST" action="" style="text-align: right; float: left;">
|
||||
<fieldset class="log">
|
||||
<label>Enter password: <input type="password" name="password" value="%($"post_arg_password%)"/></label><br>
|
||||
<label>Verify password: <input type="password" name="verify_password" value="%($"post_arg_verify_password%)"/></label><br>
|
||||
<input name="s" type="submit" value="Generate Hashes">
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<br style="clear:left">
|
||||
|
||||
% if(~ $REQUEST_METHOD POST) {
|
||||
% if(~ $#post_arg_password 0 || ~ $#post_arg_verify_password 0) {
|
||||
<div class="notify_errors">Error: Both password fields are required!</div>
|
||||
% }
|
||||
% if not if(! ~ $"post_arg_password $"post_arg_verify_password) {
|
||||
<div class="notify_errors">Error: Passwords do not match!</div>
|
||||
% }
|
||||
% if not {
|
||||
% fn sanitize_input { printf '%s' $1 | sed 's/[[:cntrl:]]//g' }
|
||||
% clean_password=`{sanitize_input $"post_arg_password}
|
||||
% mkpasswd_hash=`{printf '%s' $"clean_password | mkpasswd}
|
||||
% htpasswd_hash=`{printf '%s' $"clean_password | htpasswd -n -b dummy - | sed 's/^dummy://'}
|
||||
<h3>Generated Hashes:</h3>
|
||||
<div class="copybox">
|
||||
<code>
|
||||
mkpasswd hash: <b>%(`{echo $mkpasswd_hash | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/''/\"/g'}%)</b><br>
|
||||
htpasswd hash: <b>%(`{echo $htpasswd_hash | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/''/\"/g'}%)</b>
|
||||
</code>
|
||||
</div>
|
||||
<small>Copy the output in the box above and send them to q. DM or over email (moridori@disroot.org).</small>
|
||||
<br />
|
||||
% }
|
||||
% }
|
||||
18
tpl/_users/login.tpl
Normal file
18
tpl/_users/login.tpl
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<h1>User login</h1>
|
||||
<br />
|
||||
% if(check_user) {
|
||||
You are logged in as: <b>%($logged_user%)</b>
|
||||
% }
|
||||
% if not {
|
||||
% if (~ $REQUEST_METHOD POST)
|
||||
% echo '<div class="notify_errors">Login failed!</div>'
|
||||
<form method="POST" action="" style="text-align: right; float: left;">
|
||||
<fieldset class="log">
|
||||
<label>User name: <input type="text" name="user_name" value="%($"post_arg_user_name%)"/></label><br>
|
||||
<label>User password: <input type="password" name="user_password"></label><br>
|
||||
<input name="s" type="submit" value="Login">
|
||||
</fieldset>
|
||||
</form>
|
||||
% }
|
||||
|
||||
<br style="clear:left">
|
||||
67
tpl/sitemap.tpl
Normal file
67
tpl/sitemap.tpl
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<h1>Site map</h1>
|
||||
|
||||
%{
|
||||
tmpfile=/tmp/werc_sitemap_$pid.txt
|
||||
tmpfilex=/tmp/werc_sitemapx_$pid.txt
|
||||
saveddf=$dirfilter
|
||||
|
||||
MON2NUM='s/Jan/01/; s/Feb/02/; s/Mar/03/; s/Apr/04/; s/May/05/; s/Jun/06/; s/Jul/07/; s/Aug/08/; s/Sep/09/; s/Oct/10/; s/Nov/11/; s/Dec/12/;'
|
||||
|
||||
fn get_mdate {
|
||||
t=`{mtime $1}
|
||||
t=`{date $t(1) | sed -e $MON2NUM -e 's/ ([0-9]) / 0\1 /g'} # Make sure day of the month is two digits.
|
||||
echo $t(6)^'-'^$t(2)^'-'^$t(3)
|
||||
}
|
||||
|
||||
fn listDir {
|
||||
d=$1
|
||||
dirfilter=$saveddf
|
||||
if(test -f $d/_werc/config)
|
||||
. $d/_werc/config
|
||||
|
||||
if(~ $#perm_redir_to 0) {
|
||||
echo '<ul class="sitemap-list">'
|
||||
|
||||
for(i in `{ls -dF $d^*/ $d^*.md $d^*.html $d^*.txt >[2]/dev/null | sed $dirfilter}) {
|
||||
desc=`{get_file_title $i}
|
||||
u=`{echo $i|sed 's!'$sitedir'!!; '$dirclean's!/index$!/!; '}
|
||||
if(! ~ $#desc 0 && ! ~ $desc '')
|
||||
desc=' - '$"desc
|
||||
n=`{echo /$u|sed 's/[\-_]/ /g; s,.*/([^/]+)/?$,\1,'}
|
||||
echo '<li><a href="'$u'">'^$"n^'</a>' $"desc '</li>'
|
||||
echo $base_url^$u >> $tmpfile
|
||||
echo '<url><loc>'$base_url^$u'</loc><lastmod>'^`{get_mdate $i}^'</lastmod></url>' >> $tmpfilex
|
||||
if(test -d $i)
|
||||
@{ listDir $i }
|
||||
}
|
||||
echo '</ul>'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fltr_cache listDir $sitedir/
|
||||
|
||||
if(test -s $tmpfile) {
|
||||
mv $tmpfile $sitedir/sitemap.txt &
|
||||
}
|
||||
if not if(test -f $tmpfile)
|
||||
rm $tmpfile
|
||||
|
||||
if(test -s $tmpfilex) {
|
||||
{
|
||||
echo '<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
|
||||
|
||||
cat $tmpfilex
|
||||
rm $tmpfilex &
|
||||
echo '</urlset>'
|
||||
# TODO Enable automaic search engine update notification.
|
||||
#hget 'http://google.com/ping?sitemap='^`{url_encode $base_url'/sitemap.gz'} > /dev/null
|
||||
|
||||
} | gzip > $sitedir/sitemap.gz &
|
||||
#} > $sitedir/sitemap.xml &
|
||||
}
|
||||
if not if(test -f $tmpfilex)
|
||||
rm $tmpfilex
|
||||
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue