First - Mea Culpa
Over the years, I have been someone who has received more from this Board than I have given. This is not because I don't want to give something, it's just that the technology has moved along so fast that I have had a lot of trouble keeping up. Getting to the position where I can help, is a truly awesome thing indeed. So I greatly admire and applaud all those who have become my friends over the years in helping people like me get the most out of this truly awesome product. Thank-you guys and girls!
OK. So that being said, I think I have found a solution to a problem that I have had for the past several months. Hopefully it will help someone else.
The problem for me relates to the Edit Existing Security Users Dialog. While this component works great, the problem I have been having is how to get the field UserRoles into my password database. I need the user's group level for the way in which I am programming my application. Storing and using this "level" field allows me to see who is signing in and direct them to their own form designed for that level. An Admin gets directed to an Admin page, and a User to a User page and so forth. Makes my job a little easier.
The problem comes about when one sets up the Modify security component with the field "UserRoles". In the component, it is set up as a radio button, where the user can select from the existing groups available. But, I found that there was no way to capture this group in order to store it in my password dbf. When I tried, I saw a group of numbers on the screen.
I did a little investigating and found that these numbers were consistent with the group being shown. I placed a debug(1) in the validate code and checked the condition of e.datasubmitted.userroles. By changing the values of the groups I was able to tell what sequence of characters went with what group.
From there I was able to write the following code:
This code was added at the end of the AfterDialogValidate event.
I know it's kind of crude, but it works for me and now each time a user changes a group, it gets saved in my database.
I hope this helps someone else struggling with the same problem.
Thanks!
Over the years, I have been someone who has received more from this Board than I have given. This is not because I don't want to give something, it's just that the technology has moved along so fast that I have had a lot of trouble keeping up. Getting to the position where I can help, is a truly awesome thing indeed. So I greatly admire and applaud all those who have become my friends over the years in helping people like me get the most out of this truly awesome product. Thank-you guys and girls!
OK. So that being said, I think I have found a solution to a problem that I have had for the past several months. Hopefully it will help someone else.
The problem for me relates to the Edit Existing Security Users Dialog. While this component works great, the problem I have been having is how to get the field UserRoles into my password database. I need the user's group level for the way in which I am programming my application. Storing and using this "level" field allows me to see who is signing in and direct them to their own form designed for that level. An Admin gets directed to an Admin page, and a User to a User page and so forth. Makes my job a little easier.
The problem comes about when one sets up the Modify security component with the field "UserRoles". In the component, it is set up as a radio button, where the user can select from the existing groups available. But, I found that there was no way to capture this group in order to store it in my password dbf. When I tried, I saw a group of numbers on the screen.
I did a little investigating and found that these numbers were consistent with the group being shown. I placed a debug(1) in the validate code and checked the condition of e.datasubmitted.userroles. By changing the values of the groups I was able to tell what sequence of characters went with what group.
From there I was able to write the following code:
Code:
dim plevel as c="" if e.datasubmitted.userroles = "261706b43e574fc3b9d7d60e1dc51ce6" plevel="Supreme" end if if e.datasubmitted.userroles = "197af57d122940058631aa2acd900b9c" plevel="Parent" end if if e.datasubmitted.userroles = "d290c173ee6f400fb26a4e356cde6a9b" plevel="Main" end if if e.datasubmitted.userroles = "adec4df353d54b7a97a4519bddcc24e5" plevel="Admin" end if if e.datasubmitted.userroles = "d95e818c27e5493488e27342364e065c" plevel="User" end if dim fac as c=e.datasubmitted.username t=table.open("password.dbf") query.filter = "username="+quote(fac) t.query_create() t.change_begin() t.level= var->plevel t.change_end() t.close()
I know it's kind of crude, but it works for me and now each time a user changes a group, it gets saved in my database.
I hope this helps someone else struggling with the same problem.
Thanks!
Comment