Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
optional_param was being called wrong
  • Loading branch information
moodler committed Apr 4, 2005
1 parent 9921028 commit 0e72da1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions user/edit.php
Expand Up @@ -3,18 +3,14 @@
require_once("../config.php");
require_once("$CFG->libdir/gdlib.php");

$id = optional_param('id', PARAM_INT); // user id
$course = optional_param('course', PARAM_INT); // course id
$id = optional_param('id', 0, PARAM_INT); // user id
$course = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site)

if (empty($id)) { // See your own profile by default
require_login();
$id = $USER->id;
}

if (empty($course)) { // See it at site level by default
$course = SITEID;
}

if (! $user = get_record("user", "id", $id)) {
error("User ID was incorrect");
}
Expand Down

0 comments on commit 0e72da1

Please sign in to comment.