Complex Login Scheme

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
SiteCrafter
User
Posts: 13

Complex Login Scheme

Post by SiteCrafter »

v2017

I have a website that lists events which site visitors may look up by the type of event and the area where the event will be held. My phpMaker project is intended to handle the "back end" of the website, where those who are presenting the events can log in then add / update event details. I want to be sure that only the "right person" can touch their own event info.

The thing that complicates this a bit is that there are people who want to log in that only host events in one place for their own organization, and there are other people who log in that are event presenters at multiple locations for a number of organizations. In the 'event' table, I have fields for the organization ID (which links to an organization table) and for the event presenter (which links to a presenter table).

When an organization rep logs in, they should be able to add & update data for all events at their location, hosted by their group.
When an event presenter logs in, they should be able to add & update data for all events that they are presenting - regardless of WHERE the event is being held.

My thought on how to handle this is to have 3 phpMaker projects, two of them would be very similar with just a few crucial differences:

For organization reps, they would only get events on their Event List page that had an organization ID matching a field in the user table (regardless of who the presenter is) and when they add a record, it would have the same organization ID as their login record specifies.

For the event presenters, they would only get events on their Event List page that had a presenter ID matching a field in the user table and when they add a record, it would have the same presenter ID as their login record specifies.

In the User table, there would be fields for access_type (organization or presenter) and access_id (which would match the ID value in either the organization or presenter table).

My idea to tie these together would be to have a third project which would just be designed to handle the login / registration / lost password, etc. and then when there is a successful login, the user would be redirected to the home page of the project which is appropriate to their user type.

Does this make sense? Would it be workable? Is there a better way to do this?

Thanks for taking the time to read all this and in advance for whatever guidance you have to offer!


mobhar
User
Posts: 11703

Post by mobhar »

You should keep the project simple as possible. In other words, you should not create three PHPMaker projects for such case, moreover two of them would be very similar with just a few crucial differences.

I suggest you to play with "User ID Security" and "User Level Security". In addition, you may play with some related server events such as "User_CustomValidate", "User_Validated", "UserLevel_Loaded", "TablePermission_Loaded", and "UserID_Loading".

Just read those info from "Tutorials" and "Server Events and Client Scripts" topic from PHPMaker Help menu.


Post Reply