From a07600473d4f8fd3adc72db511dae31c3ed847ff Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Fri, 4 Jun 2010 07:30:42 +0000 Subject: [PATCH] MDL-22646 create_context() is internal implementation function, to be used only inside accesslib.php --- lib/accesslib.php | 6 +++--- user/lib.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/accesslib.php b/lib/accesslib.php index cd49e3cf20e..22a908f0dad 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -1865,13 +1865,13 @@ function is_safe_capability($capability) { **********************************/ /** - * Create a new context record for use by all roles-related stuff + * Context creation - internal implementation. * * Create a new context record for use by all roles-related stuff * assumes that the caller has done the homework. * - * @global object - * @global object + * DO NOT CALL THIS DIRECTLY, instead use {@link get_context_instance}! + * * @param int $contextlevel * @param int $instanceid * @param int $strictness diff --git a/user/lib.php b/user/lib.php index 6f1a6c1b188..fe4c08c2b57 100644 --- a/user/lib.php +++ b/user/lib.php @@ -48,7 +48,7 @@ function user_create_user($user) { $newuserid = $DB->insert_record('user', $user); /// create USER context for this user - create_context(CONTEXT_USER, $newuserid); + get_context_instance(CONTEXT_USER, $newuserid); return $newuserid;