Fix wrong query.
Implement moodle.user:symToDrupal($muser, $duser, $field_mapping = array())
Format install file
Sync Moodle user to Drupal user on login.