summaryrefslogtreecommitdiff
path: root/lib/list/edit.php
diff options
context:
space:
mode:
authorroot <root@adnab.me>2014-01-31 16:42:40 +0100
committerroot <root@adnab.me>2014-01-31 16:42:40 +0100
commitb0c23ea84327d48e3a4383fac3e795c2dc0a1215 (patch)
tree625a8f0882815d9442a4ff2ec15a49e669a15ed3 /lib/list/edit.php
parentcee55b766230837c21453f85e76a921cb5b8b89e (diff)
downloadBits-b0c23ea84327d48e3a4383fac3e795c2dc0a1215.tar.gz
Bits-b0c23ea84327d48e3a4383fac3e795c2dc0a1215.zip
Remove all studying apps code.
Diffstat (limited to 'lib/list/edit.php')
-rw-r--r--lib/list/edit.php43
1 files changed, 0 insertions, 43 deletions
diff --git a/lib/list/edit.php b/lib/list/edit.php
deleted file mode 100644
index 64394be..0000000
--- a/lib/list/edit.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-
-require("lib/markdown.php");
-
-assert_redir(count($args) == 3, 'list');
-$listid = intval($args[2]);
-
-$list = mysql_fetch_assoc(sql(
- "SELECT lists.id AS id, lists.name AS name, lists.comment_md AS comment, account.id AS owner_id ".
- "FROM lists LEFT JOIN account ON account.id = lists.owner ".
- "WHERE lists.id = $listid"));
-assert_error($list && $list['owner_id'] == $user['id'],
- "This list does not exist, or you are not allowed to edit it.");
-
-$list_name = $list['name'];
-$list_comment = $list['comment'];
-if (isset($_POST['name']) && isset($_POST['comment'])) {
- $list_name = esca($_POST['name']);
- $list_comment = esca($_POST['comment']);
- $list_comment_html = Markdown($list_comment);
- if ($list_name == "") {
- $error = "You must enter a name for your list.";
- } else if (mysql_fetch_assoc(sql("SELECT id FROM lists WHERE owner = " . $user['id'] . " AND name = '" . escs($list_name) . "' AND id != $listid"))) {
- $error = "You already have a list with that title.";
- } else if ($list_comment == "") {
- $error = "Please enter a comment on your list.";
- } else {
- sql("UPDATE lists SET name = '" . escs($list_name) . "', comment_md = '" . escs($list_comment) .
- "', comment_html = '" . escs($list_comment_html) . "' WHERE id = $listid");
- header("Location: view-list-" . $listid);
- die();
- }
-}
-
-$title = "Edit list : " . $list['name'];
-$fields = array(
- array("label" => "Name : ", "name" => "name", "value" => $list_name),
- array("label" => "Comment : ", "name" => "comment", "type" => "textarea", "value" => $list_comment),
-);
-$validate = "Edit list";
-
-require("tpl/list/ef.php");
-