Fix sending
rodzic
325f43fc70
commit
864315d5f7
12
index.php
12
index.php
|
@ -791,8 +791,10 @@ die();
|
||||||
}
|
}
|
||||||
|
|
||||||
// User Interface for Writing:
|
// User Interface for Writing:
|
||||||
// This creates a basic HTML form. Type in your message and your password. It then POSTs the data to the `/send` endpoint.
|
// This creates a basic HTML form. Type in your message and your password. It then POSTs the data to the `/action/send` endpoint.
|
||||||
function write() {
|
function write() {
|
||||||
|
$send = "/action/send";
|
||||||
|
|
||||||
if ( isset( $_GET["announce"] ) && filter_var( $_GET["announce"], FILTER_VALIDATE_URL ) ) {
|
if ( isset( $_GET["announce"] ) && filter_var( $_GET["announce"], FILTER_VALIDATE_URL ) ) {
|
||||||
$announceURl = $_GET["announce"];
|
$announceURl = $_GET["announce"];
|
||||||
} else {
|
} else {
|
||||||
|
@ -823,7 +825,7 @@ echo <<< HTML
|
||||||
<body>
|
<body>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Send a message</legend>
|
<legend>Send a message</legend>
|
||||||
<form action="/action/send" method="post" enctype="multipart/form-data">
|
<form action="{$send}" method="post" enctype="multipart/form-data">
|
||||||
<input type="hidden" id="type" name="type" value="Create">
|
<input type="hidden" id="type" name="type" value="Create">
|
||||||
<label for="content">Your message:</label><br>
|
<label for="content">Your message:</label><br>
|
||||||
<textarea id="content" name="content" rows="5" cols="32"></textarea><br>
|
<textarea id="content" name="content" rows="5" cols="32"></textarea><br>
|
||||||
|
@ -840,7 +842,7 @@ echo <<< HTML
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Like a post</legend>
|
<legend>Like a post</legend>
|
||||||
<form action="/send" method="post" enctype="multipart/form-data">
|
<form action="{$send}" method="post" enctype="multipart/form-data">
|
||||||
<input type="hidden" id="type" name="type" value="Like">
|
<input type="hidden" id="type" name="type" value="Like">
|
||||||
<label for="postURl">URl of post to like:</label>
|
<label for="postURl">URl of post to like:</label>
|
||||||
<input type="url" name="postURl" id="postURl" size="32" value="{$likeURl}"><br>
|
<input type="url" name="postURl" id="postURl" size="32" value="{$likeURl}"><br>
|
||||||
|
@ -851,7 +853,7 @@ echo <<< HTML
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Boost a post</legend>
|
<legend>Boost a post</legend>
|
||||||
<form action="/send" method="post" enctype="multipart/form-data">
|
<form action="{$send}" method="post" enctype="multipart/form-data">
|
||||||
<input type="hidden" id="type" name="type" value="Announce">
|
<input type="hidden" id="type" name="type" value="Announce">
|
||||||
<label for="postURl">URl of post to boost:</label>
|
<label for="postURl">URl of post to boost:</label>
|
||||||
<input type="url" name="postURl" id="postURl" size="32" value="{$announceURl}"><br>
|
<input type="url" name="postURl" id="postURl" size="32" value="{$announceURl}"><br>
|
||||||
|
@ -875,7 +877,7 @@ HTML;
|
||||||
global $password, $server, $username, $key_private, $directories;
|
global $password, $server, $username, $key_private, $directories;
|
||||||
|
|
||||||
// Does the posted password match the stored password?
|
// Does the posted password match the stored password?
|
||||||
if( $password != $_POST["password"] ) { die(); }
|
if( $password != $_POST["password"] ) { echo "Wrong password."; die(); }
|
||||||
|
|
||||||
// What sort of message is being sent?
|
// What sort of message is being sent?
|
||||||
$type = $_POST["type"];
|
$type = $_POST["type"];
|
||||||
|
|
Ładowanie…
Reference in New Issue