mirror of
https://github.com/pikami/palm-paste.git
synced 2025-12-19 00:39:48 +00:00
People can now signup and users can post private and unlisted pastes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user