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,7 +1,6 @@
<?php
function GetUsersIDBySession($sid,$skey){
include "config/config.php";
//SELECT * FROM pastes WHERE uid=
$stmt = $conn->prepare("SELECT uid FROM sessions WHERE id=:sid AND skey=:skey");
$stmt->bindParam(':skey', $skey);
$stmt->bindParam(':sid', $sid);
@@ -27,7 +26,17 @@ function UnsetBrowserCookies(){
setcookie("pp_sid", '', time() - 3600);
setcookie("pp_skey", '', time() - 3600);
}
function GetUsernameByID(){
//Placeholder
function GetUserByID($id){
include "config/config.php";
$stmt = $conn->prepare("SELECT * FROM users WHERE id=:id");
$stmt->bindParam(':id', $id);
$stmt->execute();
if($result = $stmt->fetch()){
$conn = null;
return $result;
} else {
$conn = null;
return array(-1,-1,-1,-1);
}
}
?>