[root@moodle mod_tmp]# diff -uNwB mrbs/web/view_entry.php ../blocks/mrbs/web/view_entry.php
--- mrbs/web/view_entry.php 2012-10-21 19:24:42.000000000 +0800
+++ ../blocks/mrbs/web/view_entry.php 2014-09-23 10:30:29.222906144 +0800
@@ -36,7 +36,7 @@
//if the booking belongs to the user looking at it, they probably want to edit it
if($record=$DB->get_record('block_mrbs_entry',array('id'=>$id))) {
- if(strtolower($record->create_by)==strtolower($USER->username)) {
+ if(if($record->room_id == $USER->id or authGetUserLevel($USER->id) == 2) {
$redirect = true;
if (has_capability('block/mrbs:editmrbsunconfirmed', $context, null, false)) {
if ($USER->email != $DB->get_field('block_mrbs_room', 'room_admin_email', array('id'=>$record->room_id))) {
@@ -49,6 +49,7 @@
redirect(new moodle_url('/blocks/mrbs/web/edit_entry.php', array('id'=>$id)));
}
}
+ else {return;}
}
//If we dont know the right date then make it up