Admidio / admidio

Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.
https://www.admidio.org
GNU General Public License v2.0
336 stars 131 forks source link

Password Reset not Working with Multiple Organisations #829

Closed davidrei closed 6 years ago

davidrei commented 6 years ago

Prerequisite:

Issue:

Analysis:

[2018-09-24 15:55:12.639039] Admidio.INFO: SQL: SELECT usr_id FROM adm_members INNER JOIN adm_roles ON rol_id = mem_rol_id INNER JOIN adm_categories ON cat_id = rol_cat_id INNER JOIN adm_users ON usr_id = mem_usr_id INNER JOIN adm_user_data AS email ON email.usd_usr_id = usr_id AND email.usd_usf_id = ? AND email.usd_value = ? WHERE LENGTH(usr_login_name) > 0 AND rol_valid = 1 AND usr_valid = 1 AND mem_begin <= ? AND mem_end > ? AND ( cat_org_id = ? OR cat_org_id IS NULL ) GROUP BY usr_id [12,"test@email.com","2018-09-24","2018-09-24",1] {"file":"/…/adm_program/system/classes/Database.php","line":723,"class":"Database","function":"queryPrepared"}

Possible Solution

  1. Remove the criteria which limits the search to only the default cat_org_id
  2. In case more than one record is found, invalidate the form and ask the user for an organisation (drop down menu)
  3. once only one record is found, proceed with the process as is and send out the mail
Fasse commented 6 years ago

thanks for the detailed description of the bug.

The solution will be not the check for the organization. We will only check for a valid role membership and thats all. The role membership could be from organization A or B or C that doesn't matter.