← Back to team overview

mahara-contributors team mailing list archive

[Bug 988254] [NEW] function get_file in api/xmlrpc/lib.php not respecting usersuniquebyusername

 

Public bug reported:

When I hook my 1 Mahara installation up to 2 (or more) Moodle
installations, and try to push content from Moodle to Mahara, I
encounter an error.

Failed to start communication with remote server: remote server error: code: , message: Could not find user BLAH for https://BLAH.BLAH.ac.ukERROR 4:
4: remote server error: code: , message: Could not find user BLAH for https://BLAH.BLAH.ac.uk

This error is from xmlrpc/lib.php get_file() (line 286) which calls
find_remote_user($username, $REMOTEWWWROOT).

I am fairly sure there is a bug in xmlrpc/lib.php find_remote_user()
because if I change the authentication of a user in Mahara to be from a
specific Moodle, I can export from that Moodle but not the other, and
vice versa.

This makes sense if each user from different systems (even if they have
the same username) is treated as a different user, which is default
behaviour. However I have the config option of usersuniquebyusername set
so that users from different systems with the same username are treated
as the same user.

    $cfg->usersuniquebyusername = true;

In this case I would expect Mahara NOT to try and confirm that the
source of the user is the same one listed within Mahara as their
authentication method.

My gut reaction is that the find_remote_user function in xmlrpc/lib.php
(line 125) should be checking for the CFG value of usersuniquebyusername
and if set then specifically NOT discriminate by authentication method.

So something along the lines of the following, changing line 134

from:

$authinstances = auth_get_auth_instances_for_institution($institution);

to:

if (get_config('usersuniquebyusername')) {
  $authinstances = auth_get_auth_instances();
}
else {
  $authinstances = auth_get_auth_instances_for_institution($institution);
}

** Affects: mahara
     Importance: Undecided
         Status: New


** Tags: moodle usersuniquebyusername xmlrpc

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
https://bugs.launchpad.net/bugs/988254

Title:
  function get_file in api/xmlrpc/lib.php not respecting
  usersuniquebyusername

Status in Mahara ePortfolio:
  New

Bug description:
  When I hook my 1 Mahara installation up to 2 (or more) Moodle
  installations, and try to push content from Moodle to Mahara, I
  encounter an error.

  Failed to start communication with remote server: remote server error: code: , message: Could not find user BLAH for https://BLAH.BLAH.ac.ukERROR 4:
  4: remote server error: code: , message: Could not find user BLAH for https://BLAH.BLAH.ac.uk

  This error is from xmlrpc/lib.php get_file() (line 286) which calls
  find_remote_user($username, $REMOTEWWWROOT).

  I am fairly sure there is a bug in xmlrpc/lib.php find_remote_user()
  because if I change the authentication of a user in Mahara to be from
  a specific Moodle, I can export from that Moodle but not the other,
  and vice versa.

  This makes sense if each user from different systems (even if they
  have the same username) is treated as a different user, which is
  default behaviour. However I have the config option of
  usersuniquebyusername set so that users from different systems with
  the same username are treated as the same user.

      $cfg->usersuniquebyusername = true;

  In this case I would expect Mahara NOT to try and confirm that the
  source of the user is the same one listed within Mahara as their
  authentication method.

  My gut reaction is that the find_remote_user function in
  xmlrpc/lib.php (line 125) should be checking for the CFG value of
  usersuniquebyusername and if set then specifically NOT discriminate by
  authentication method.

  So something along the lines of the following, changing line 134

  from:

  $authinstances =
  auth_get_auth_instances_for_institution($institution);

  to:

  if (get_config('usersuniquebyusername')) {
    $authinstances = auth_get_auth_instances();
  }
  else {
    $authinstances = auth_get_auth_instances_for_institution($institution);
  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/988254/+subscriptions


Follow ups

References