Skip to content
Browse files

Fixed errors in logic and lack of isteacher() check as pointed out by…

… Petr Skoda
  • Loading branch information...
1 parent 0b32d15 commit 1d44f3a5d74677af3d4553e95154351654c57a55 michaelpenne committed Sep 27, 2005
Showing with 8 additions and 4 deletions.
  1. +8 −4 grade/exceptions.php
View
12 grade/exceptions.php
@@ -12,6 +12,10 @@
require_login($course->id);
+ if (!isteacher($course->id)) {
+ error(get_string('notteachererror', 'grades'));
+ }
+
$group = get_current_group($course->id);
print_header("$course->shortname: ".get_string('grades'), "$course->fullname", grade_nav($course, $action));
@@ -57,9 +61,6 @@
$selectedgrade_item = $data->grade_itemid;
}
}
- if (isset($selectedgrade_item)) {
- clean_param($selectedgrade_item, PARAM_CLEAN);
- }
/// Calculate data ready to create the editing interface
@@ -124,7 +125,10 @@
}
if (empty($selectedgrade_item)) { // Choose the first group by default
- $selectedgrade_item = array_shift(array_keys($listgrade_items));
+ // doesn't work with php 5 :(
+ // $selectedgrade_item = array_shift(array_keys($listgrade_items));
+ $keys = array_keys($listgrade_items)
+ $selectedgrade_item = array_shift($keys);
}
include('exceptions.html');

0 comments on commit 1d44f3a

Please sign in to comment.
Something went wrong with that request. Please try again.