This topic is locked

How to make a group's entries show up

10/19/2010 6:01:57 PM
PHPRunner General questions
K
karmacomposer author

My client emailed me back after trying out the database:
When we log in as recruiters, we still can’t see the candidates who have associated themselves with us
So, how do I make it so that when a Recruiter logs in, they can see the candidates associated with them. I currently have the recruiter names as a dynamic table (the recruiter's company gets added to the table when they register). I also have the RecruiterData table (the table recruiters use to add their company) linked to the candidate forms (the field linked is Recruiter Company Name in one table to Recruiting Agent in the other). When I sign in as an admin, I can see these relationships. Recruiters sign up as a recruiter (group) and are given access that way. How would I do it without giving recruiters admin privileges, but see all candidates assigned to them (who chose their name from the RecruiterNames table when adding their record)?
Mike

Sergey Kornilov admin 10/20/2010

According to what I see you need to use 'Users can see and edit their own data only' advanced security option.

K
karmacomposer author 10/20/2010



According to what I see you need to use 'Users can see and edit their own data only' advanced security option.


OK, but it is already set at that and when they enter other records (their candidates), they do not see a list of what they entered on the list page (I only have picture, first and last names chosen for list page). They only see their record only.
What I need is, whether the recruiter entered a candidate themselves or not, if any candidate chooses a particular recruiter based on a drop down with the recruiters name in it and saves their record, when the recruiter logs in, they want to see a list of all the candidates who chose their name and have records in the database (without doing a search).
The way it has been explained to me, a recruiter signs up, gets approved and then proceeds to enter candidates into the database. However, other candidates who live in other countries may also enter data and choose that same recruiter in the appropriate place on the candidate form. No matter whether the recruiter types a record in personally or someone else did and chose them as the recruiter, I need the recruiter to be able to see ALL the people associated with their name. Currently, I have another table, called RecruiterNames, that is dynamically created whenever a recruiter signs up. I also have a table called RecruiterData that houses all the Recruiter's data. Finally, every candidate form has a dropdown attached to the RecruiterNames table. Now I need to use those tables as a way to orient who goes with what.
How can I achieve this - it's very important to several areas of this database project.
Thanks for your help.
Mike

K
karmacomposer author 10/21/2010

Anyone? This is the only thing stopping my client from beginning to use their database with clients.
Mike

K
karmacomposer author 10/21/2010

Could a permission have been altered or not used to make this work? Does it need to point to a group? Do I need to set up a master->child relationship or could setting one up cause it not to work?
Mike

K
karmacomposer author 10/21/2010

I am trying a new angle (this affects the list page):
=================================================
//** Check if specific record exists ****

global $conn;

$strSQLExists = "select * from RecruiterData where RecruiterID=".$values["RecruiterID"];

$rsExists = db_query($strSQLExists,$conn);

$data=db_fetch_array($rsExists);

if($data)

{

// if record exists do something

}

else

{

// if dont exist do something else

}
return true;
=======================================
The idea is to check and see what the Recruiting_Company_Name is and list all records associated with that person's login GroupID (which is the same as the Recruiting_Company_Name). Like the Master->Child relationship (or groups you can see), I need these to be links so you can click on them and go to those records.
How????
Mike

P
procheck 10/21/2010

Getting back to your first post, can you not just create a view of the table called admin_tableA with admin rights (Admin Group) and give

reduced candidate (candidate Group) rights to Table A. I think one of the example apps might do something similar.

K
karmacomposer author 10/21/2010



Getting back to your first post, can you not just create a view of the table called admin_tableA with admin rights (Admin Group) and give

reduced candidate (candidate Group) rights to Table A. I think one of the example apps might do something similar.


I tried that just now and I still see all candidates and not the ones associated with only RecruiterA.
That's my dilemma. How the heck do I make it so that RecruiterA sees everyone associated with RecruiterA, but not anyone associated with RecruiterB, etc.
Is the problem that they are referencing a NAME and not a INT?
Mike

P
procheck 10/21/2010

Can you list the tables in question?

K
karmacomposer author 10/22/2010



Can you list the tables in question?


The tables are:
RecruiterData - table that the Recruiter uses to sign up

RecruiterApproved - once approved, is now using this custom view

RecruiterNames - a small table that houses the recruiters names. It is automatically updated when a recruiter signs up

CandidateCC - a candidate table - Recruiter and candidates fill out

CandidateSWT - another candidate table - Recruiter and candidates fill out

EmployerView - will be used for an employer to view approved candidates

EmployerPlaced - will be used once an employer hires a candidate
There are more, but the above are the main tables.
Mike

P
procheck 10/22/2010

I was looking more for how your Security GroupID's are setup and the relations between your tables. This is the key.

K
karmacomposer author 10/22/2010



I was looking more for how your Security GroupID's are setup and the relations between your tables. This is the key.


Thank you for helping me here. Support has been good, but they insist everything is fine and everything is NOT fine.
My security is UserID in my UserValidation table. That is the 1st thing people sign in/sign up for.
Every table has a key, like RecruiterID, CandidateID, EmployerID.
Now, how am I SUPPOSED to set this up so that the IDs are all transferable from table to table.
In advanced security, I have set up every single table to reference the UserID from the validation table and the ID field from the current table.
I have set permissions on the groups and I am pretty sure it is all setup properly.
I am at a loss at what else to do other than programming. If I have wired something incorrectly, I wish someone would point it out so I can fix it and get to more important areas of the database.
At this point, I am ready to pay someone a bit to at least advise me or set this up for me so it works and I can continue to program it from there.
Time is not on my side right now.
Here is what is SUPPOSED to happen:
Someone signs up as Recruiter. They go through the motions and login. They add one or more records.
They then logout.
Someone else signs up as CandidateCC. They go through the motions and add a record. They are required to use the drop down under Recruiter field and choose the recruiter they signed up with.
They logout.
Someone else will sign up as CandidateSWT. They go through the motions. They add one record. They are required to use the drop down under Recruiter field and choose the recruiter they signed up with.
Logout
The following is KEY to the problem and is what's NOT working: The Recruiter logs back in. They SHOULD see not only the records they added as recruiter, but the CandidateCC and CandidateSWT entries from other people as well (that chose them as the Recruiter from the Recruiter drop down box), but NOT any other Recruiter's Candidates. This is NOT working right now. They can only see the people THEY added. No one else. They SHOULD be able to see any candidate that chose their name from the Recruiter drop down list (which is stored in a table called RecruiterNames)
If I gave Recruiters admin access, they would see all records, period. This includes other recruiter's candidates. Since there are federal privacy guidelines for my client to adhere to, I cannot have this happen.
I hope this illustrates the problem.
Mike

P
procheck 10/23/2010

Mike,
You need to understand that this is not a support forum. You have a lot going on so they can only give you ideas about how to proceed. The security was one of the hardest things for me to grasp at first. And once I got it right, I did screen prints of my setup just in case.
Without seeing this in front of me it's hard to debug. I can only give you an example of what I've done and maybe something will help you. If you're short on time you might want to buy some support and they can do it for you using the demo account.
Here's what I do. I have two GroupID's (admin and user). The relation is 1 admin to many users within a section. You might have more user groups. To separate what the admin can see or do, verses what the users can see/do, I use a view. So for example, the admin can edit all members within their SectionID which is a column in most of my tables. Users can only see their own info but this could also have been set so they see others within their section
The members table:
GroupID SectionID FirstName LastName UserName Password
Admin & users all have usernames in this table. GroupID is set to admin for administrators and users have the GroupID set to user
To visualize:
Permissions: GroupID>> admin & user
In Permissions, I've set the members table as follows for users:

List and Export (They cannot delete/add/edit/import)

Nothing selected for admin_members(a view of members).
For admin I've set:

Nothing selected for members table

Everything (add, edit etc..) for admin_members
In Advanced Settings:

The member table is the main table

The link field is UserName for member (& most user tables). In my case "Users can see and edit their own data".

The link in admin_member is SectionID ("Users can see and edit their own data")
Based on the link field the admin can see all of the users in his Section but not other sections.
In Visual Edit in the members List/Edit, under username\properties\EditAs the default value is set to @$SESSION["" . $strTableName."_OwnerID"]
In Visual Edit in the members List/Edit/Add, under username\properties\EditAs the default value is set to "SectionID='".$_SESSION["SectionID"] . "'"
So for some tables I link using SectionID so others can see other data. If I only want the user to see his own data, then I link using username
Hopefully this helps
Al

K
karmacomposer author 10/23/2010

Thank you for the excellent explanation.
My only problem is how to set up the tables.
Is the SectionID an integer or does a user input some value? If it's a integer, is it auto-increment? Is it NULL?
How do you choose a username as the link field when all I can choose seem to be integer fields? Is it because you chose to link via username in your users table (the table they sign up with)? Or is it because you made the username field the primary key? I thought a primary key HAD to be an integer.
Mike

P
procheck 10/24/2010

You're going to need to sit down with a pencil & paper to figure out your SectionID. Think of SectionID as a grouping or sub-group. You might have a Recruiter Group for starters. Don't try and get everything working at once. When you get one thing working, you'll probably get the others working. The username is created on registration and it is a primary key in the members table although link fields don't need to be. Primary keys don't need to be integers but they do need to be unique.

K
karmacomposer author 10/24/2010



You're going to need to sit down with a pencil & paper to figure out your SectionID. Think of SectionID as a grouping or sub-group. You might have a Recruiter Group for starters. Don't try and get everything working at once. When you get one thing working, you'll probably get the others working. The username is created on registration and it is a primary key in the members table although link fields don't need to be. Primary keys don't need to be integers but they do need to be unique.


What are your fees for helping? I really need this done quickly at this point and I could use some outside help.
Mike

P
procheck 10/24/2010

Sorry but you're asking the wrong guy. You can buy some support from xlinesoft - http://xlinesoft.com/buy_support.htm

or DALEM - see his post at the top of this forum.

K
karmacomposer author 10/24/2010



Sorry but you're asking the wrong guy. You can buy some support from xlinesoft - http://xlinesoft.com/buy_support.htm

or DALEM - see his post at the top of this forum.


Sent him a PM.
Mike