People can now signup and users can post private and unlisted pastes

This commit is contained in:
pikami
2016-06-12 15:32:25 +00:00
parent beb9cdd9ec
commit df2eabccb0
9 changed files with 159 additions and 22 deletions

View File

@@ -1,15 +1,24 @@
<div class="panel panel-default">
<div class="panel-body">
<div class="container">
<div class="panel panel-default">
<div class="panel-body">
<?php
if(isset($uid)){
include "config/config.php";
include_once "includes/user.php";
$stmt = $conn->query('SELECT * FROM pastes WHERE uid="'.$uid.'"');
if($result = $stmt->fetch(PDO::FETCH_ASSOC)){
$conn = null;
if($result["exposure"]==2 && $result["owner"]!=GetUsersIDBySession($_COOKIE["pp_sid"],$_COOKIE["pp_skey"])){
echo "<h1>This paste is private</h1>";
die();
}
echo "<h1>".$result["title"]."</h1>";
echo "<textarea class=\"form-control\" rows=\"5\" disabled=\"true\">".$result["text"]."</textarea>";
}
else echo "Paste does not exist";
$conn = null;
} else echo "Error: id not set";
?>
</div>
</div>
</div>
</div>