summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--leave-a-message/.htaccess1
-rw-r--r--leave-a-message/blossom.pngbin140486 -> 0 bytes
-rw-r--r--leave-a-message/extras.css20
-rw-r--r--leave-a-message/index.php91
-rw-r--r--leave-a-message/writemessage.php66
5 files changed, 1 insertions, 177 deletions
diff --git a/leave-a-message/.htaccess b/leave-a-message/.htaccess
index 1604995..db52361 100644
--- a/leave-a-message/.htaccess
+++ b/leave-a-message/.htaccess
@@ -1,3 +1,4 @@
+Options -Indexes
<Files "archive.txt">
Require all denied
</Files>
diff --git a/leave-a-message/blossom.png b/leave-a-message/blossom.png
deleted file mode 100644
index 6f2c304..0000000
--- a/leave-a-message/blossom.png
+++ /dev/null
Binary files differ
diff --git a/leave-a-message/extras.css b/leave-a-message/extras.css
deleted file mode 100644
index 907e88c..0000000
--- a/leave-a-message/extras.css
+++ /dev/null
@@ -1,20 +0,0 @@
-.CTitle {
- color: #fff;
-}
-.TText {
- color: #fff;
-}
-body {
- background: #000;
- background-image: url(blossom.png);
-}
-table {
- background: rgba(0,0,0,0.8);
-}
-note, .note {
- vertical-align: super;
- font-size: 60%;
-}
-reduced, .reduced {
- font-size: 75%;
-}
diff --git a/leave-a-message/index.php b/leave-a-message/index.php
deleted file mode 100644
index 3589515..0000000
--- a/leave-a-message/index.php
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta http-equiv="expires" content="Friday 24 October 1997 09:30 GMT">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Chrisoft::Leave a message</title>
- <link rel=stylesheet href='../common.css' type='text/css'>
- <link rel=stylesheet href='extras.css' type='text/css'>
- <style type="text/css">
- div.comment{
- border:1px solid #CCC;
- }
- div.author{
- text-align:right;
- }
- </style>
- <script src='https://www.google.com/recaptcha/api.js'></script>
- <script type="text/javascript">
- function verify()
- {
- if(document.getElementById("content").value.length+document.getElementById("name").value.length>16300)return;
- try
- {
- if(grecaptcha.getResponse().length===0)
- document.getElementById("ann").style.display="inline-block";
- else document.getElementById("msgform").submit();
- }
- catch(e){return;}
- }
- function ol()
- {
- if( navigator.userAgent.match(/Android/i)
- || navigator.userAgent.match(/webOS/i)
- || navigator.userAgent.match(/iPhone/i)
- || navigator.userAgent.match(/iPad/i)
- || navigator.userAgent.match(/iPod/i)
- || navigator.userAgent.match(/BlackBerry/i)
- || navigator.userAgent.match(/Windows Phone/i)
- )
- document.getElementById("tab").style.width="98%",
- document.getElementById("msgform").style.width="96%";
- }
- </script>
- <?php
- if(isset($_POST['name']))
- echo "<script>
- window.onload=function()
- {
- document.getElementById(\"ann\").style.display=\"inline-block\";
- document.getElementById(\"name\").value=\"".$_POST['name']."\";
- document.getElementById(\"content\").value=\"".$_POST['content']."\";
- }
- </script>";
- ?>
-</head>
-<body onload="ol()">
-<table id="tab" border="0" style="width:70%;margin:auto;">
- <tr>
- <td class="CTitle" style="font-size:2em;">
- <a href="../">Chrisoft</a>::Messages
- </td>
- </tr>
- <tr><td>
- <h1 class="TText">Deprecated. Use Guestbook found in the homepage instead.</h1>
- <div class="TText" style="margin:auto;width:80%">
- <?php
- $file=fopen("/var/www/html/leave-a-message/messages.txt","r");
- $comms;$i=0;
- while(($str=fgets($file,16384))!==false)$comms[$i++]=$str;
- fclose($file);
- while(--$i>=0)echo $comms[$i];
- ?>
- <form action="writemessage.php" id="msgform" method="post" style="width:50%;margin:auto;padding:5px;border:1px solid #CCC;">
- <span style="width:90%;display:table;">
- <label for="name" style="display:table-cell;width:1px;white-space:nowrap;">Your honourable name:</label>
- <input type="text" id="name" name="name" required style="margin-left:5px;display:table-cell;width:100%;">
- </span>
- <p>Message:</p>
- <textarea required id="content" name="content" rows="5" style="width:90%;margin-left:1px;"></textarea>
- <p>
- Something Annoying: <span id="ann" style="color:#F00;display:none;">Please complete the annoying challenge!</span></p>
- <div class="g-recaptcha" data-sitekey="6Lf1lAcUAAAAAGep8SpTETdIrEiw6w8uVy8IXp9U"></div><br>
- <div style="text-align:center;">
- <button onclick="verify();" type="button" style="border:none;color:white;padding:0.5em 2em;text-align:center;background-color:#44AA44;-webkit-transition-duration:0.4s;transition-duration:0.4s;">Leave the message!</button>
- </div>
- </form>
- </div>
- </td></tr>
-</table>
-</body>
diff --git a/leave-a-message/writemessage.php b/leave-a-message/writemessage.php
deleted file mode 100644
index 5308954..0000000
--- a/leave-a-message/writemessage.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<html>
-<?php
- function onerror($n,$m)
- {
- echo "<script>
- window.onload=function()
- {
- var f = document.createElement('form');
- f.action='https://chrisoft.org/leave-a-message/';
- f.method='POST';
- f.style.display='none';
-
- var i=document.createElement('input');
- i.type='hidden';
- i.name='name';
- i.value='".$n."';
- f.appendChild(i);
- i=document.createElement('input');
- i.type='hidden';
- i.name='content';
- i.value='".$m."';
- f.appendChild(i);
-
- document.body.appendChild(f);
- f.submit();
- }
- </script>";
- }
- $name;$mesg;$captcha;
- if(isset($_POST['name']))
- $name=$_POST['name'];
- if(isset($_POST['content']))
- $mesg=$_POST['content'];
- if(isset($_POST['g-recaptcha-response']))
- $captcha=$_POST['g-recaptcha-response'];
- if(!$captcha){
- onerror($name,$mesg);
- exit;
- }
- //OH SHIT I LEAKED MY OWN KEY!!!
- //$response=json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=6Lf1lAcUAAAAABRj_EJ1OzhzGfiorpfYFbcGQE5r&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']), true);
- //if($response['success'] == false)onerror($name,$mesg);
- if(false)
- {
- if(strlen($mesg)+strlen($name)>16300)echo "Your message is too long!!!";
- $rmesg=htmlspecialchars($mesg);
- $rmesg=nl2br($rmesg,false);
- $rmesg=trim(preg_replace('/\s\s+/', ' ', $rmesg));
- $f=fopen("/var/www/html/leave-a-message/messages.txt","a");
- $str=sprintf("<div class=\"comment\"><p>%s</p><div class=\"author\">%s at %s</div></div><br>\n",$rmesg,htmlspecialchars($name),strftime("%Y-%m-%d %H:%M"));
- fwrite($f,$str);
- fclose($f);
- $f=fopen("/var/www/html/leave-a-message/messages.json","a");
- $str=sprintf("{\"cont\":\"%s\",\"author\":\"%s\",\"time\":\"%s\"}\n",$rmesg,htmlspecialchars($name),strftime("%Y-%m-%d %H:%M"));
- fwrite($f,$str);
- fclose($f);
- $f=fopen("/var/www/html/leave-a-message/archive.txt","a");
- $str=sprintf("comment: %s\nauthor: %s\ntime: %s\nIP: %s\n\n",$mesg,$name,strftime("%Y-%m-%d %H:%M:%S"),$_SERVER['HTTP_X_FORWARDED_FOR']?$_SERVER['HTTP_X_FORWARDED_FOR']:$_SERVER['REMOTE_ADDR']);
- fwrite($f,$str);
- fclose($f);
- echo "<script>window.location='https://chrisoft.org/#guestbook'</script>";
- }
-?>
-</html>
-<body>
-</body>