Skip to content

Clean distinction between UID database column and USERNAME database column? #189

@rotdrop

Description

@rotdrop

Hi there,

reading the source code I have the impression that the use of the UID column and the USERNAME column got somewhat mingled in the code. My understanding is the following (?):

  • UID column is only used internally in THIS app in order to have a fast index in the users table and a fast join column to map users to groups
  • USERNAME is actually the Nextcloud UID (i.e. User::getUID()) and thus is a string value

I now see some problems:

  • e.g. in GroupBackend::usersInGroup() the internal UID column is passed back to Nextcloud. Should not this be a list of username values, i.e. the list of Nextcloud-UID?
    $uids = $this->groupRepository->findAllUidsBySearchTerm(
  • as stated in confusion between uid and name #184 a similar problem occurs with the BELONGS_TO_ADMIN query which is used by GroupBackend::isAdmin().

This also means that perhaps the example given in README.md cannot work this way, as that one has exactly this setup?

I have also the impression that the search queries generally use the Nextcloud-UID (i.e. username) to find rows, but query the values of the user_sql::uid column.

OTOH, the password check routines in this app use the username column to verify the password, but all other parts of the code search the user_sql::uid column, but pass search terms from the Nextcloud UID (which should refer to the user_sql::username column?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions