Okay, so I am completely new to Joomla and I am trying to edit the source files of a component I built using component-creator.com.
I have a database which stores different data for multiple different users, and I want to design several views where the logged-in user can view only the data associated with their own user name in the database. Currently, every user can see a listing of the data of every other user in the database, which is unacceptable for security reasons. I assume that I need to somehow retrieve the current session user id and use a WHERE query to filter the list view down to only the database entries associated with that user id.
First off, what files do I need to edit? Component-creator seems to suggest here that I need to edit views/students/view.html.php, while some other forums seem to point to models/students.php. models/students.php seems to already have several SQL queries with chaining and WHERE clauses, but I wanted to make sure.
Secondly, how do I retrieve and/ or pass the current session user id? Do I somehow need to pass that variable from views/students/tmpl/default.php, or can I retrieve it directly from within models/students.php?
Any insight is appreciated. Thank you!