- Restricts router access to explicitly defined endpoint actions

This commit is contained in:
Vlad
2016-08-24 11:23:12 -04:00
parent a8f4779bfe
commit ae6269eb63
5 changed files with 18 additions and 4 deletions

View File

@@ -7,6 +7,14 @@ if(!defined('ABSPATH')) exit;
class Subscription {
const ENDPOINT = 'subscription';
const ACTION_CONFIRM = 'confirm';
const ACTION_MANAGE = 'manage';
const ACTION_UNSUBSCRIBE = 'unsubscribe';
public $allowed_actions = array(
self::ACTION_CONFIRM,
self::ACTION_MANAGE,
self::ACTION_UNSUBSCRIBE
);
function confirm($data) {
$subscription = new UserSubscription\Pages('confirm', $data);