CM Restrict User Account Access - Use Case - How To Limit Account Access by Logins


Use Case - How to limit account access by logins

Back to User Guides

Note: This guide requires:

Introduction

CM Restrict User Account allows you to automatically block or delete user accounts on your site after some period of time, or restrict user accounts by the amount of logins.

Use Case Front-End

Use Case Assumptions

In this example use case guide we will consider how to restrict a user account access by the amount of logins. You can set daily, weekly and total limits for accessing your site for every user. It means, when the user reaches one of the limits while logging in, he won't be able to login to the site.

We assume that you have already bought the plugin, but not installed it yet.

It follows:


Installing the Plugin

The process is the same for all CM plugins and add-ons.

  • Download the plugin from your customer dashboard
  • Log in to WordPress and navigate to the WordPress Admin → Plugins settings
  • Click on Add New
  • Activate it and add the license

Learn more: Installation


Configuring Default Settings

The logins restriction should be enabled separately for each user. But first we need to configure some general settings. Navigate to Admin Dashboard → CM Restrict User Account Access Pro → Settings.

Here you can find two tabs with options. We will consider only those options that are related to login restriction feature.

General

Here are the options that we need on the General tab:

  • Pick the First Day of The Week - Choose the day that the week should start from. You can choose between Sunday or Monday. This option is important for setting the weekly limits of accessing the site. This option defines, when to reset counter of accesses. It means, it doesn't matter on which day the user was registered - in can be on Friday or Saturday, for example - anyway the counter of his weekly limits will be reset on Sunday or Monday - depending on what day you choose as start of the week.
  • Login error message - You can set the message which appears if the user tries to login after he reached his login limits.

The following 3 fields let you define the default number of logging in for the user:

  • Pick the total accesses for user - This value must be more than for weekly and daily accesses.
  • Pick the weekly accesses for user - This value must be less than for total accesses and more than for daily accesses.
  • Pick the daily accesses for user - This value must be less than for total and weekly accesses.

To make any of these parameters unlimited, you can check the option Unlimited Access On/Off next to the needed parameter, or set the value "-1".

Note

The limits can be overridden separately for each user. The values you define in these fields are default. The default values are used in 2 cases:

  1. When the user is created and you enable limits for him - the start limit values are equal to default.
  2. If you changed the limit values for the user and later want to reset them to default. 

Notifications

The plugin has a few notifications that can be sent to the admin and user when the account is restricted.

To configure them, navigate to the  Notifications tab. There you can find two sections.

Admin notifications

In this section we need the following options:

  • Admin notification addresses - Write here the list of emails where the admin notifications should be sent. If there is more than one email, they should be separated by comma.
  • Enable limit reached notification - Enable this option if you want the admin to receive a notification when the user reached the access limit of logins.
  • Admin reached limit notification subject - Edit the email subject for the admin notification.
  • Admin reached limit notification text - Edit the email body for the admin notification.

User notifications

The options in this section are:

  • Enable user notification - Enable this option if you want the user to receive a notification when his account reached the access limit of logins.
  • User notification subject - Edit the email subject for the user notification. 
  • User notification text - Edit the email body for the user notification.

TIP: Shortcodes

Email subject and email body for both notifications accept the following shortcodes for adding dynamic content:

  • [action] - can be "restricted" or "deleted"
  • [user_name] - User Name
  • [user_login] - User Login

Configuration is completed, now click the button  Save at the bottom of the page.

Individual Settings

Now we can enable the restrictions for users. Navigate to Admin Dashboard → Users → All Users.

Hover on the user that you want to set the limits to and click Edit.

Then scroll down to the section  CM Restrict User Account Access. You can find there two options. We need the option Restrict user by number of accesses - choose Yes to enable this restriction.

When the option is enabled, a few new options will appear:

  • Restrict date (from) - Set the date and time, when the following limits will start working. Before the defined date and time the limits will not work. 

The following 3 parameters are duplicating the options from the plugin settings. Here you can override the default settings:

  • Total number of accesses - Set the number how many times the user can login to your site in total. This value must be more than for weekly and daily accesses.
  • Weekly number of accesses - Set the number how many times the user can login to your site during the week. This value must be less than for total accesses and more than for daily accesses.
  • Daily number of accesses - Set the number how many times the user can login to your site during the day. This value must be less than for total and weekly accesses.

To make any of these parameters unlimited, you can check the option  Unlimited Access On/Off next to the needed parameter, or set the value "-1".

When you first enable this restriction, the values in these 3 fields are equal to the default ones - from the plugin settings. If you changed these values for this user and want to reset them to the default, click the button Reset login limits.

Each of these 3 parameters has a counter called Used Accesses. It displays how many times the user logged in. 

The counter Daily number of access is reset every 24 hours, and Weekly number of accesses is reset in the beginning of every week (in our case - on Monday, we defined it in plugin settings). When the user reached the limit in Total number of accesses, he wouldn't be able to access the site anymore.

You can reset these counters by clicking on the button Reset login counters.

When you finished setting restriction for the user, scroll down and click the button  Update User.

Now get back to the list of all users. You can see restriction info for each user (if defined) in the column  Total / Weekly / Daily.

You can also see there a value  Grand Total - it counts how many times the user logged-in in general. So, even if you use the Reset login counters button - it will not affect the Grand total value, as it counts ALL user's log-ins while the access limits are enabled for him. This value can be erased automatically only with deleting the user's account.

Now, when the user reaches the limit, he will see the message that he is not able to login, and he and admin will receive an email notification about it.

End Result

Following instructions found in the plugin and guides, you should be able to restrict a user account access by the amount of logins. 

Use Case Front-End


More information about the CM Restrict User Account Access WordPress Plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.