php – How to restrict content based on product purchase for specific woocommerce category?

I need a pay per post system for specific woocommerce products category.

Hi, my site is currently running the latest version of WordPress V5.4.1 with the woocommerce V4.0.0 plugin installed.

With woocommerce, by default the product page is accessible to all users. I would like to be able to restrict access to the product page to users who have already purchased the product. That is to say after adding it to the cart from the store and paying at checkout.

Product = a post type Woocommerce plugin link =

So, I would like to display the content of the product page only if the product has already been purchased by the user. That is, if the product is contained in the user’s order list.

I would like to apply this system only to products of certain specific categories to be defined.

As for the restriction of products, which are not yet purchased by the user, I would also like to have the possibility of defining a redirect page whose content remains under my sole responsibility.

For this, I will expressly need a small parameter in the rediction link which would display the ID of the product to buy in this way for example: **_redirect_id=PRODUCT_ID (It will be useful for me to display on the page, some product information by the get method 😉 Like this:

I found from my research, certain articles which deal with the subject but which always seem vague to me. Articles link:

I know it shouldn’t be too complicated if you merge some of the information from the links above, but I admit that I really don’t know how to go about it, I’m worried above for days .. Thanks in advance for your help !

linux – Postfix, Dovecot Virtual Mail Server Unable to Restrict Access Different Hostname for SMTP, IMAP & POP3

I want to restrict access for SMTP for, IMAP for & POP3 for for my own mail server which i am building using POSTFIX & Dovecot i tried different ways and documentation but unable to do this all domains are accessible all services on the same server whole setup is on the same server not on different.

How this can be possible to restrict access for service on specific domain/hostname?

permissions – How to restrict access to S3 bucket folders using “folder-per-client” strategy with policy limited to 20KB?

I was originally planning on an S3 bucket per client, with bucket policies restricting access to that bucket to a single IP (the clients’ single-tenant server). The problem I quickly ran into is that most S3 compatible service providers have limits of 100 buckets per account, which didn’t make sense until I came across this at Amazon…

Because bucket operations work against a centralized, global resource space, it is not appropriate to create or delete buckets on the high-availability code path of your application.”

In knowing that, I’m now looking at how to adjust our strategy for a single bucket, and a folder-per client. In case a client server is ever compromised, I don’t want someone with the credentials from that server to have access to all other client folders, so I need to apply a restriction that says “Only give this IP access to this folder”. Easy enough, there is a simple policy for that…

  "Version": "2012-10-17",
  "Id": "S3PolicyId1",
  "Statement": (
      "Sid": "S3PolicyId1",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:*",
      "Resource": (
      "Condition": {
        "NotIpAddress": {
          "aws:SourceIp": (

Here’s the problem… Amazon limits S3 bucket policies to 20KB in size, most providers are same or similar. The example above is ~500 bytes, and the portion that I would have to repeat to apply similar limits to additional client folders within the bucket is ~400 bytes of that.

That would mean that I would hit a hard limit of ~50 clients per bucket due to the restriction on policy size. Further, at a limit of 100 buckets, or even 1000 if lets say I was granted an increase…. that would mean an overall hard limit of 50,000 clients per account.

That would obviously not work in the long term for a growing business. So how do other businesses using S3 using folder-per-client achieve separation of permissions?

Restrict Access to Posts based on Custom User and Post Meta Data

I have a custom Post Type called Club Pages, and a custom role called “Club Leader”. Club Leaders currently can only read, modify, and delete all Club Pages posts. However, there are many different clubs that have their own sets of pages in this post type, and I need to make sure that Club Leaders can only read, edit, and delete the pages in WP Admin that are associated with their specific club.

Currently, each Club Pages post has a custom meta data field called club_name. I’m not using hierarchical post types to represent each club because there will be about 100 of them — all of which need to use the same template and menu, which seems like a super cluttered and unmanageable admin area for super admins. I’m not opposed to using child post types if I need to, though.

So, my plan was to add a custom User Meta field, also called club_name, to represent which club Club Leaders are associated with, and somehow filter the Post Listing in the WP Admin to only show posts that have the same club_name as that user. So I’m thinking the logic for this filter would be something like:

If User->Role == 'Club Leader'
 get `user->club_name`
For each Post
 If `post->club_name` == `user->club_name`
  return `post_item`
  return nothing

I expect each Club Leader to only be associated with one club each, but bonus points your solution allows me to give a single Club Leader access to multiple clubs’ pages, in case that changes in the future.

Also, I know I only provided pseudo-code, but I’m looking for the full PHP code solution.

Restrict fail2ban Filter to range of IPs

Is there a way to restrict a fail2ban rule to only set of IP ranges? This would basically be the opposite of the ignoreip config.

We’re experiencing intermittent (~2 hours a day, usually in the morning) bursts of Apache traffic from random IPs in AWS us-west-2 and I’ve built a fail2ban filter that will catch it, but the problem is we are sweeping up legitimate traffic with these. We’ve had to disable the filter after ~48 hours because no matter what settings we use, legitimate users are getting blocked. If we could restrict the filter to us-west-2 IPs, which is easy enough to get, it should function the way we need it to.

We’re unable to block us-west-2 altogether because this server receives legitimate traffic from some IPs there, though that list of IPs changes regularly without any kind of warning.

This is fail2ban 0.8.6, so it is a outdated. I should be able to update if a solution calls for it.

permissions – How can I restrict access to visitors in a SP Online Modern Communication Site?

Basically we don’t want Visitors to have access to the Site Contents page and also Site usage.

I’ve tried changing the permission from Read to Restricted Read but then the user can’t even see the home page (it’s a modern page), it gets a Sorry, you don’t have access.

Is this possible to accomplish in Communication Site?

files – How can I restrict access to a static HTML page served from a subfolder of my site to authenticated users only?

I have a Drupal 8 site that has all roles and permissions necessary for authenticated users. One of the new requirements is to serve a static microsite (like a campaign site, totally different design compare to Drupal site) which is a single folder with all the static assets (HTML, CSS, JS , images). We have to serve this site under the same domain drupal is hosted and should be accessed ONLY by authenticated users.

I tried to host it under sites/default/files/ directory, but it means it is public and anyone can access it.

vpn – Xfinity fiber WiFi router that can restrict a Mac address to domain selection?

Is there a Comcast Fiber Internet compatible WiFi router on the market with an integrated firewall and functions that I can use to limit a MAC address to a handful of domains? Something that can't be hacked by spoofing your Mac address or using a VPN or proxy site?

Does the product have good logging so we can see which users are surfing?

What if the client is a Chromebook that doesn't have administrator privileges on the device?

Group Policy – SLES 12 – Restrict access and automatic provisioning of USB devices

I need help with a scenario that I have to deploy to my company with SLES12 SP3.

My system has 3 local users belonging to different groups:

uid=1000(admin-role) gid=100(users) groups=1002(sudo),1003(usbwriters),100(users)

uid=1001(admin-role2) gid=100(users) groups=1002(sudo),1001(usbreaders),100(users)

uid=1002(auditor-role) gid=100(users) groups=1001(usbreaders),100(users)

In /etc/auto.master I added the following line:

/run/media  /etc/auto.master.d/auto-USB.autofs --timeout=10,noexec,nosuid,uid=$USER,umask=660,gid=usbreaders

I have created the following file /etc/udev/rules.d/usb_control.rules
with the following content:


I also created the following file: /etc/auto.master.d/auto-USB.autofs

USB_TEST       -fstype=auto    :/dev/USB_MASS_STORAGE1

After that, I change the permissions of the media directory, although this directory is created every time the system is restarted with the core group and user ownership.

chgrp usbreaders /run/media
chmod 750 /run/media

ls -la /media
    total 4
    drwxr-x---  2 root usbreaders    0 Sep 19 11:42 .
    drwxr-xr-x 23 root root       4096 Sep 19 10:46 ..

Then I reload the rules and restart the autos service:

systemctl restart autofs
udevadm control --reload-rules

But doesn't work properly. All users can still provide a removable USB stick (root password is requested). It is always provided as a read-only device, regardless of the group. Instead of creating the USB_TEST directory, a directory is created under / run / media for every user who provides a new file system.

I would need that only USB readers can mount and read and USB writers can mount, read and write to USBs. The rest of them should not be able to assemble them.

Could someone please help me?

Thank you very much.

Plugins – How can users restrict the display of selected forms in WP Forms?

I am using WP Forms with my WordPress application. I have approximately 10 forms and would like to reserve each form for access by a specific user only through the backend. The customers send the forms with details from the front end. These details should only be accessible to the user who has been assigned access to this form.
In short, I want to restrict users' access to the forms so that not everyone can view them. How can I do that?