Skip to content
Browse files

Allow userid to be left out when calling this page

  • Loading branch information...
1 parent be66bb9 commit c322b224379cff9222f14b7bbc48f0556f27715f moodler committed Jul 13, 2005
Showing with 7 additions and 2 deletions.
  1. +7 −2 mod/forum/user.php
View
9 mod/forum/user.php
@@ -5,12 +5,17 @@
require_once('../../config.php');
require_once('lib.php');
- $id = required_param('id'); // user id
- $course = required_param('course'); // course id
+ $course = required_param('course'); // course id
+ $id = optional_param('id'); // user id
$mode = optional_param('mode', 'posts');
$page = optional_param('page', 0);
$perpage = optional_param('perpage', 5);
+ if (empty($id)) { // See your own profile by default
+ require_login();
+ $id = $USER->id;
+ }
+
if (! $user = get_record("user", "id", $id)) {
error("User ID is incorrect");
}

0 comments on commit c322b22

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