The REMP CRM Auth plugin allows you to read basic user and subscription information about CRM user visiting your WP website. Also adds simple login form with handling.
Go to the releases section of the repository and download the most recent release.
Then, from your WordPress administration panel, go to Plugins > Add New
and click the Upload Plugin
button at the top of the page.
From your WordPress administration panel go to Plugins > Installed Plugins
and scroll down until you find DN REMP CRM Auth
plugin. You will need to activate it first.
To configure the plugin, add DN_REMP_HOST
constant definition into your wp-config.php
file with the correct host of REMP installation.
define( 'DN_REMP_HOST', 'https://word.press/remp' );
CRM requires every call to be authorized by a user token. For each request presence of Authorization: Bearer token
HTTP header is validated. The token found in the header needs to match the token assigned to the user. This plugin gets user token from cookie n_token
which is set in login form after successful user login.
Plugin exposes 3 functions for usage in your theme or related plugin.
Returns String user token or false
if user is not logged in.
Name | Value | Required | Description |
---|---|---|---|
data | String | no | wether to return basic user info , or user subscriptions |
Returns Array containing data, false
if user is not logged in or null
if not correctly configured.
print_r( remp_get_user( 'info' ) );
Response:
Array
(
[body] => [
[status] => ok
[user] => Array
(
[id] => 14910
[email] => michalrusina@gmail.com
[first_name] =>
[last_name] =>
)
],
['error_msg'] => ''
)
print_r( remp_get_user( 'subscriptions' ) );
Response:
Array
(
[body] => [
[status] => ok
[subscriptions] => Array
(
[0] => Array
(
[start_at] => Array
(
[date] => 2018-07-18 00:00:00
[timezone_type] => 3
[timezone] => Europe/Bratislava
)
[end_at] => Array
(
[date] => 2020-09-25 00:00:00
[timezone_type] => 3
[timezone] => Europe/Bratislava
)
[code] => discount_10_months_web_app_klub
[access] => Array
(
[0] => mobile
)
)
)
],
['error_msg'] => ''
)
Name | Value | Required | Description |
---|---|---|---|
echo | Bool | no | wether to return or echo the form HTML |
Returns String containing HTML form. The form HTML can be altered by remp_login_form_html
filter hook.