* @param boolean $notify print notice with link and terminate
*/
function user_signup($user, $notify=true) {
- global $CFG;
+ global $CFG, $DB;
+
require_once($CFG->dirroot.'/user/profile/lib.php');
-
+
if ($this->user_exists($user->username)) {
print_error('auth_ldap_user_exists', 'auth');
}
$this->update_user_record($user->username);
update_internal_user_password($user, $plainslashedpassword);
- $user = get_record('user', 'id', $user->id);
+ $user = $DB->get_record('user', array('id'=>$user->id));
events_trigger('user_created', $user);
if (! send_confirmation_email($user)) {