diff options
author | Nicolas BERNSTEIN <alexis211@gmail.com> | 2011-11-20 13:39:47 +0100 |
---|---|---|
committer | Nicolas BERNSTEIN <alexis211@gmail.com> | 2011-11-20 13:39:47 +0100 |
commit | d45c7f14891d951f8a6987cc6492073b97e05b5b (patch) | |
tree | d6467b1202c27f67fd8e894d25fd4aea0085b559 /lib/study/listrm.php | |
parent | 4d7e065c2d2ec407b6a7ebfc7569628bac9149d1 (diff) | |
download | Bits-d45c7f14891d951f8a6987cc6492073b97e05b5b.tar.gz Bits-d45c7f14891d951f8a6987cc6492073b97e05b5b.zip |
Added the bit list study system
Diffstat (limited to 'lib/study/listrm.php')
-rw-r--r-- | lib/study/listrm.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/study/listrm.php b/lib/study/listrm.php new file mode 100644 index 0000000..a761e97 --- /dev/null +++ b/lib/study/listrm.php @@ -0,0 +1,16 @@ +<?php + +assert_redir(count($args) >= 3, 'study'); +$studyid = intval($args[2]); + +$study = mysql_fetch_assoc(sql( + "SELECT ". + " list_study.user AS learn_user ". + "FROM list_study ". + "WHERE list_study.id = $studyid")); +assert_error($study && $study['learn_user'] == $user['id'], "You are not at the right place here."); + +token_validate("Do you really want to remove this list from your studies ? Your progress will not be lost.", "list-study-$studyid"); +sql("DELETE FROM list_study WHERE id = $studyid"); +header("Location: study"); +die(); |