fixes a bug that students in group can not remove page

This commit is contained in:
toyomoyo
2005-12-16 07:12:40 +00:00
parent 0441f512f5
commit f4141a0267
+2 -1
View File
@@ -70,9 +70,10 @@
error(get_string("notadministratewiki","wiki"));
}
$canedit = wiki_can_edit_entry($wiki_entry, $wiki, $USER, $course);
# Check for dangerous events (hacking) !
if(in_array($action,array("removepages","strippages","revertpages"))) {
if(!($wiki->wtype=="student" || isteacher($course->id))) {
if(!($wiki->wtype=="student" || ($wiki->wtype=="group" and $canedit) || isteacher($course->id))) {
add_to_log($course->id, "wiki", "hack", "", $wiki->name.": Tried to trick admin.php with action=$action.");
error("Hack attack detected !");
}