Have you thought about setting up these types of users into UserGroups? It sounds like you are dealing with at least three types of users. I think there is some code here on the forums for you to parse out the UserGroup IDs that you are wanting. I mean that after you create each UserGroup you can use the code to identify the UserGroup. I'll look for it. I think I know where it is.
Here. Try these three links to research it:
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=65531&SearchTerms=getGroupMembership(
http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=63846&SearchTerms=getGroupMembership(
http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=62521&SearchTerms=getGroupMembership(
Just a mockup of the thought-process could be like this:
Code:
if the sever time is between this and that, then ' Normal business hours
Allow the "Everyone is Allowed" UserGroup
elseif the server time is between this and that, then ' Overtime business hours
Allow the "Overtime is Allowed" UserGroup
elseif the server time is between this and that, then ' Weekend business hours
Allow the "Weekends are Allowed" UserGroup
end if
Above is just a thought-process, you could code it differently to suite your needs of course.
- If worker A is allowed to work overtime and weekends as well as normal hours, then place worker A in all three UserGroups (normal hours, overtime, and weekends).
- If worker B is allowed to work overtime as well as normal business hours but not weekends, then place worker B in just two of the UserGroups (normal hours, and weekends).
- If worker C is only allowed to work normal hours, then place worker C only in one UserGroup (normal hours).
I think I would try that approach first if it were me trying to figure it out for my site.
<