• Aaron Wells's avatar
    Changing PluginAuth API to specifically indicate whether Auth requires remote username · 20512fdb
    Aaron Wells authored
    Bug 1160093: This adds a few new methods to the Auth class, which represents an auth instance:
    
     - is_parent_authority(): Indicates whether this auth instance is a parent authority or not
     - get_parent_authority(): Gets the ID of this auth instance's parent authority
     - needs_remote_username(): Indicates whether this auth instance needs the user to have a
          remote username setting (in auth_remote_user table)
    
    I've also updated the SAML and XMLRPC auth types, which are the only ones that use remote username.
    And I've updated create_user() to automatically populate auth_remote_user() for auth
    instances that use it.
    
    Note that an auth instance of ANY type will need a remote username if it's the parent to another
    authority (the parent feature allows a user to log in via the parent or the child auth instance;
    so it's quite possible for the user to have different usernames in the two of them. Currently
    only XMLRPC uses the parent auth feature.)
    
    Lastly, also updated the documentation of LiveUser->create_user() to indicate that it only
    uses the $remoteauth parameter as a boolean (which was true even before my code changes).
    
    Change-Id: I39b1b74e68cdbc9c2632b886655caaaece1bd312
    20512fdb
lib.php 87.7 KB