diff options
author | Nicolas BERNSTEIN <alexis211@gmail.com> | 2011-09-17 16:48:29 +0200 |
---|---|---|
committer | Nicolas BERNSTEIN <alexis211@gmail.com> | 2011-09-17 16:48:29 +0200 |
commit | d0060968b77c39bdf8abffb071c971c166b59edb (patch) | |
tree | 0be52e00a25bd298235a0cf916fb07496d3ab95f /lib/notes/source.php | |
download | Bits-d0060968b77c39bdf8abffb071c971c166b59edb.tar.gz Bits-d0060968b77c39bdf8abffb071c971c166b59edb.zip |
First commit.
Diffstat (limited to 'lib/notes/source.php')
-rw-r--r-- | lib/notes/source.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/notes/source.php b/lib/notes/source.php new file mode 100644 index 0000000..4ff40d7 --- /dev/null +++ b/lib/notes/source.php @@ -0,0 +1,22 @@ +<?php + +assert_redir(count($args) == 3, 'notes'); +$noteid = intval($args[2]); + +$note = mysql_fetch_assoc(sql("SELECT id, title, text, public, owner FROM notes WHERE id = $noteid")); +assert_error($note && ($note['public'] != 0 || $note['owner'] == $user['id']), + "This note does not exist, or you are not allowed to see it."); + +//header("Content-Type: text/plain: charset=utf-8"); +?> +<!DOCTYPE html> +<html> +<head> + <meta http-equiv="Content-Type" value="text/html; charset=utf-8" /> +</head> +<body> +<pre><? echo $note['text']; ?></pre> +</body> +</html> +<? +die(); |