This topic is locked
[SOLVED]

 Still Need Help with my problem

10/6/2010 2:22:43 PM
PHPRunner General questions
K
karmacomposer author



You cannot have four login tables. You can only have one.
The best approach is to have a field GroupID (or 'Sign Up As') which will take values of 'Recruiter', 'Employer' etc.
Then on Registration add GroupID field and make it a radio-button control with the same four values. Nothing to code manually.


I tried this. It still does not work. On the registration page, I have a field called GroupID with radio buttons (though I am changing them back to a drop down list).
Where I am not understanding (and not getting anywhere here) is the 1st part of your advice (The best approach is to have a field GroupID (or 'Sign Up As') which will take values of 'Recruiter', 'Employer' etc.)
You do not specify which table or where that goes. I renamed "Sign Up As" to GroupID in the UserValidation table, which also changed it on all the other tables relating to security. You say there is no programming needed, yet it is NOT working.
Perhaps the problem lies in the security tab and not the tables. Right now, in the ADVANCED tab, I have it set for the middle option (users can see and edit their own data only), The table I am using as the Current Table is UserValidation. The two fields are both set to UserID (GroupID is greyed out).
Is this where I should be looking to solve my problem?
Mike

Sergey Kornilov admin 10/6/2010

GroupID field should be added to the login table. You already done that.

You need to explain what exactly is not working.
In regards to grayed out field - make sure field types are compatible i.e. you cannot link numeric field to text one.

K
karmacomposer author 10/6/2010

OK, perhaps I see where the problem lies then. Right now, the GroupID is a Varchar due to the drop down or radio choices. Since that is not a integer, that is why it is not showing up to be chosen in the security area.
So, I created a new field called GroupIDNum. Now, here's my idea.
If GroupID = "Recruiters" then GroupIDNum = 1

If GroupID = "Employers" then GroupIDNum = 2

If GroupID = "Candidates" then GroupIDNum = 3

If GroupID = "CandidatesVisaOnly" then GroupIDNum = 4
If I can somehow do that, then I can assign the proper ID Number to the security by choosing GroupIDNum (since it is an integer).
If you agree, could you please help me with how I would code that and where (on which form or as an event) I would put it.
Thank you.
Mike

Sergey Kornilov admin 10/7/2010

I'm not sure why you have to create an extra entity here. It's easier to manage and understand text values like 'Recruiters' than numbers like 1,2 and 3. I would suggest to drop GroupIDNum field and work with textual representation only.
If you still want to do it this way create a new lookup table with IDs and Names of security groups and make your radio-button database-based choosing ID as a link field and Name as a display field.

K
karmacomposer author 10/7/2010



I'm not sure why you have to create an extra entity here. It's easier to manage and understand text values like 'Recruiters' than numbers like 1,2 and 3. I would suggest to drop GroupIDNum field and work with textual representation only.
If you still want to do it this way create a new lookup table with IDs and Names of security groups and make your radio-button database-based choosing ID as a link field and Name as a display field.


I agree. I would rather deal with names. However, that particular field is in the UserValidation table as a simple field (GroupID). It does not link to anything, so it does not alter anything.
Am I supposed to link it to something? If so, what am I supposed to link it to? It does not alter the user's permission.
Again, if I am doing something wrong here, tell me. I have four groups, Recruiters, Employers, Candidates and CandidatesVisaOnly. Users need to pick one of these. Depending on which group they choose, there is a certain form they need to fill out. So, if you pick Recruiter, then you fill out the Recruiter form (based on the Recruiter table). If you pick Candidate, then you fill out the Candidate form, etc.
However, I have the security set as dynamic usernames and passwords with group permissions. It needs to be that way. So, when someone signs up with their username and password, they have to choose their group - then the database needs to set that person's group in the admin section automatically. That way, my client does not have to validate and set each person's group because there could literally be thousands of kids signing up.
I hope that makes it clear.
Mike

K
karmacomposer author 10/8/2010

Wait, are you meaning that I need to set the type of Security to STATIC PERMISSIONS and then define the users and groups and then choose the GroupID field from the UserValidation form as the source for the GroupID in PHPRunner's security section?
You do know that I set up DYNAMIC PERMISSIONS for security, right? I see no way to choose or link the GroupID field using dynamic permissions.
Mike

Sergey Kornilov admin 10/8/2010

You need to setup static user group permissions choosing GroupID as a group field. There will be for user groups and each group will have access to one table only i.e. 'Recruiters' group will have access to 'Recruiters' table etc.

K
karmacomposer author 10/8/2010



You need to setup static user group permissions choosing GroupID as a group field. There will be for user groups and each group will have access to one table only i.e. 'Recruiters' group will have access to 'Recruiters' table etc.


That was it. As I had said in almost every single post, I chose DYNAMIC PERMISSIONS, which was wrong. Static Permissions allowed me to easily fix this.
Thank you.
Mike