<?php


namespace OTP\Objects;

use OTP\Helper\MoConstants;
use OTP\Helper\MoMessages;
use OTP\Helper\MoUtility;
class BaseActionHandler
{
    protected $_nonce;
    protected function __construct()
    {
    }
    protected function isValidRequest()
    {
        if (!(!current_user_can("\155\141\156\x61\x67\x65\137\x6f\x70\164\x69\157\156\163") || !check_admin_referer($this->_nonce))) {
            goto rI;
        }
        wp_die(MoMessages::showMessage(MoMessages::INVALID_OP));
        rI:
        return true;
    }
    protected function isValidAjaxRequest($yU)
    {
        if (check_ajax_referer($this->_nonce, $yU)) {
            goto Es;
        }
        wp_send_json(MoUtility::createJson(MoMessages::showMessage(BaseMessages::INVALID_OP), MoConstants::ERROR_JSON_TYPE));
        Es:
    }
    public function getNonceValue()
    {
        return $this->_nonce;
    }
}
