How to Sync CPT Data oder BG Group Meta with User/member - wordpress

i have big Challenge and i want to know, if it’s possible.
I need a Solution to create Company Profiles with Fields about the Adress, ZipCode, City etc… This Company can create a user (employee).
This User can invite another User(employee) to this Company.
If he do that, the Company profile Fields must be Synced with the Employee Profile Field Data.
The Employee Fild Data about the Company must be the Same as tthe Company.
My Acutally Setup:
User Creation: BuddyPress
Company Profiles: With BuddyPress Groups
To create a Group (Company) and a User Registration i use Buddyforms.
Buddyforms Create a new Post in a Custom Post Type with the Company Information an attach this Post to the Group.
Maybe is it possible, all BP Group Members will be synced with this custom fields?
Or maybe i need another Solution?
Regards

Related

Fetch data from dynamodb table based upon user role/access

I have created a single table DB Model for my project. It contains multiple products. The application has 3 user roles SuperUser, ProductOwner & BasicUser. I want to fetch multiple products to show in a table in UI where logged-in user should see only those products on which user is having access. e.g. SuperUser can see all the products whereas a ProductOwner can see only those products on which he is ProductOwner. How can I achieve this behavior in dynamodb model
You can put another attribute in dynamodb which basically stores the users/role names to whom the product is accessible. As you are saying for superuser everything is accessible, so for SuperUser you can directly return all the products but for the other two roles you can use this technique

Unique User Role Report WooCommerce

Two questions involved in my quagmire:
Where do I find 'report functionality' in the woo themes plugins?
How do I implement reporting for a custom user role in the orders section (the custom user role has already been created in WP?
Example:
sales by date | sales by product | sales by 'custom user role here'
Solution for Query 1:
The report functionality can be assessed from front-end via WooCommerce->Reports as shown in the following image
The backend of this functionality comes from the Package WooCommerce/Admin/Reports i.e. within the file structure of
/woocommerce/includes/admin/reports/
Solution for Query 2:
WooCommerce doesn't provide "sales by 'custom user role here'" by deafult but you can code so or you can use Woocommerce Order Report Snapshot plugin to get roles specific reports

How create a views showing sponsored user profile field

I created a profile field called Sponsor name, who sponsor or introduce him into the website. The sponsor must be a user in the website. A user can sponsor any number of users to the website. When a user wants to register, he must give the sponsor name. I have done it successfully.
Now I want to create a view showing a list of sponsored users corresponding to each user.
for example:
User James sponsor's
Williams
Perter
John
User Williams sponsor's
Adam
Jimmy
Thanks in advance.
If you want a single page per user, then what you would want to do is to add an argument to your view. Where the argument would be the field you created for the sponsors name, and then in the settings for that argument, you would get the user id or username from the URL.

"Role Management" vs "User Management" in ASP.NET

Question No 1
I am familiar with role management, a particular member in a particular role can do this and access this functionally. What I need to do is Manage individual user, not the role he is in.
For example, lets say I create a role, called "Sales". I setup the role permission what the sales persons can do. Now i want to keep a check on individual user. For example if this is "john", i want to show him the records only he created. If his is peter, I want to show him only that records which he created, not by john or other sales people.
Is there a thing called "User Management" in ASP.NET that we can use? If not we have to create it ourselves and I believe the integration with ASP.NET "Role Management" will not be that smooth.
Question No 2.
I am using control for user login. I want to create a session at this time so I can keep track of which user is signed in so I can show him the records only pertaining to him. How can I do that?
Your Q1 isn't really about Role vs User management (ie: authorizations) at this point. It's about audit tracking within your application.
And the way you do that is you capture the ID of the user who created the record in question with the record, so that later you can filter on that ID.
Pseudo database structure
Table Sales
Field...
Field...
Field...
CreatedByUser int not null, -- Populate this on creation and never change it again
ModifiedByUser int not null - populate this on every row update including insert
See ASP.NET Profile Properties.
Assuming the records in the database correspond to a unique ID for a user, you can store the unique id in a profile property per user.
1) If you want to filter records by the creating user, you need to record in your table the ID of the user who created the record. You can access the name of current user through User.Identity.Name and their ID (provider-dependent) through User.ProviderUserKey.
2) Sessions are created automatically in ASP.NET and provided you have a properly configured MembershipProvider, you can retrieve all the needed user info using the User object as shown above.
It sounds like you are a little unfamiliar with ASP.NET Membership and Roles capabilities, because they are actually set up quite well to accomplish what you are describing. I would recommend checking out this tutorial series:
https://web.archive.org/web/20211020202857/http://www.4guysfromrolla.com/articles/120705-1.aspx
You are talking about Authentication and Authorization. For question 1 you and implement a custom authorization provider to allow for user level control http://msdn.microsoft.com/en-us/library/aa479048.aspx For question 2, once you log in and are Authenticated, the session contains a userprinciple object that has the info in it automatically.

Drupal Views Content Profile User as an argument

I have a normal Drupal User. I have used the content_profile module to create a profile content type. This content type contains a node reference to another content type company. The company node then references a type of node called Task.
I want to create a view that list all the tasks for a given user id.
So I imagine I would create a view with an argument of user id. Then I would add the relationship to the profile and the company and output the Task title.
The user id used seems to work on the created used ID and not the user id of the content profile that it is referencing. In our system the "admin" user creates the profiles so it causing some problems.
Any ideas? I feel I may need to write a custom module to do what I want.
i have answered a similar question in the past about how to create a view using part of the url as an argument to filter the view by the user profile. check out this url. the answer you are looking for may be a variation of my original response.
also, how are you creating those profiles? on one of my sites, when i created the profile page, its author ID is automatically changed to the user it is associated with.

Resources