MDL-40436: auth_ldap: Fixed warning when adding new LDAP users
authorTim Lock <tim.lock@netspot.com.au>
Thu, 27 Jun 2013 00:52:28 +0000 (10:22 +0930)
committerDamyon Wiese <damyon@moodle.com>
Mon, 8 Jul 2013 15:03:41 +0000 (23:03 +0800)
auth/ldap/auth.php

index fa7c2c5..dbc0332 100644 (file)
@@ -854,7 +854,7 @@ class auth_plugin_ldap extends auth_plugin_base {
 
                 $id = $DB->insert_record('user', $user);
                 echo "\t"; print_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)); echo "\n";
 
                 $id = $DB->insert_record('user', $user);
                 echo "\t"; print_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)); echo "\n";
-                $euser = $DB->get_record('user', array('id' => $user->id));
+                $euser = $DB->get_record('user', array('id' => $id));
                 events_trigger('user_created', $euser);
                 if (!empty($this->config->forcechangepassword)) {
                     set_user_preference('auth_forcepasswordchange', 1, $id);
                 events_trigger('user_created', $euser);
                 if (!empty($this->config->forcechangepassword)) {
                     set_user_preference('auth_forcepasswordchange', 1, $id);