I’m relatively new to OpenEMR so bear with me. I’m currently working on a project for a professor to import users in bulk into OpenEMR without using the .php code (basically, importing the data into the database tables manually). From my understanding of the database tables:
Table “users” used to be the main table until “secure_users” was implemented to improve password security (adding Salts and the blowfish algorithm).
Table “gacl_aro” references the users in the “secure_users” table. The “gacl_groups_aro_map” table acts as a map to connect the “gacl_aro_groups” and “gacl_aro” tables together.
As such, if I wanted to add a new user manually I’d have to modify the users, secure_users, gacl_aro, and gacl_groups_aro_map tables.
However, I can’t login with my newly made user. In fact, if I modify a user added through OpenEMR and try to change his name in the tables, it doesn’t work either even if that user could log in fine before.
Can anyone point me in the direction of what table I’m missing?
I think I found the issue. The table “groups” is another table that needs to be changed/inserted even though it has no direct connection to other tables (the id column it uses isn’t used that I’ve found). Without looking at the php code, which is something I’m trying to do albeit slowly, it seems kinda unnecessary.
go find a daily refreshed OpenEMR Demo. Create some new USERS.
Now open Database and have a look at the different tables with changes.
Export CSV versions of each of these tables. Now learn how these tables interact.
Make huge tables with this information and impress the professor!
Remember: Don’t forget to mention Steward Little and the Dutch Caribbean Cheese-boy in your final report.
P.S. Importing a CSV Table of users might be tricky. The User that is logged in can’t be refreshed! It will render a not working USER and even with the new admin pass it is impossible to login again. Remember to skip the first line if you are logged in as admin pass.
If I understand correctly, if I import a table of users, the user that’s logged in (currently the default admin:pass administrator) will basically cause it to stop working/logging in?
Why is that? If I add new users through the import tab in phpMyAdmin I don’t believe that should be an issue. (Unless you’re saying don’t overwrite the admin:pass user, in which case I’ll try not to lose the keys to the DB while importing :P)
Anyways, I’ll be most likely importing in users with the phpMyAdmin root so that shouldn’t be a problem.
The only linkage between users & the gacl tables is gacl_aro_groups_map, which gets populated by the last entry in the Add User dialog, depicted in the screenshot.
It’s confusing because of the overlap in nomenclature. Administrator is a User as well as an Access Request Object in the Access Controls List.
This is a problem through OpenEMR. Too bad Latin is not taught any more. Biology has no difficulty with the genus, species system.
Best not to touch admin, pass. Work is difficult without login.
This is the PHP code which updates the tables when a new user is created through the interface.
Deeper inspection of the code should provide insight into what’s going on with a manual import. (e.g. find the set_user_aro function elsewhere in the code and confirm that your method of modifying data in the acl tables is doing the same thing.)
However, if this were my assignment, my approach would be use the PHP code here and write a simple command line tool that could take a username/password, then call the requisite PHP code to generate a new user. (Separate the data manipulation code from the HTML).
It’s much better to leverage the PHP code if possible rather than re-invent the wheel.
Sorry I didn’t respond to you. I was able to talk with the professor and she came around to using the innate PHP code instead of bulk importing into the tables. (Thanks for the suggestion)
Currently, I’m creating PHP that will connect to the usergroup_admin.php page you referenced and create a user although I’m running into issues connecting the many variables that the included/required classes need in order to make the page run.
I’m starting to think there might be a better entry point than the usergroup_admin page (I haven’t worked with PHP that long but it feels like I’m doing a lot of work “simulating” required variables for includes and function in order get my code to run, like some sort of undead/Frankenstein monster).
Feels kinda like a long game of whack-a-mole…
As for for school/program, it’s a little hinky but I’m essentially an unpaid intern telecommuting/remote working for a professor in Chicago while still going to classes at BCIT in Vancouver, BC.