initial thridculture edits

This commit is contained in:
q 2025-09-23 17:59:02 -04:00
commit 0ba2a2e03b
172 changed files with 6733 additions and 24 deletions

35
tpl/_tools/hash.tpl Normal file
View 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/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/''/\&quot;/g'}%)</b><br>
htpasswd hash: <b>%(`{echo $htpasswd_hash | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/''/\&quot;/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 />
% }
% }

View file

@ -7,7 +7,11 @@
% if (~ $REQUEST_METHOD POST)
% echo '<div class="notify_errors">Login failed!</div>'
<form method="POST" action="" style="text-align: right; float: left;">
<<<<<<< HEAD
<fieldset>
=======
<fieldset class="log">
>>>>>>> tcremote/main
<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">