Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions inc/cleantalk-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,10 @@ function apbct_action_adjust_change()
{
AJAXService::checkAdminNonce();

if (!current_user_can('activate_plugins')) {
wp_send_json_error('Permission denied');
}

if (in_array(Post::get('adjust'), array_keys(AdjustToEnvironmentHandler::SET_OF_ADJUST))) {
try {
$adjust = Post::getString('adjust');
Expand All @@ -1570,6 +1574,10 @@ function apbct_action_adjust_reverse()
{
AJAXService::checkAdminNonce();

if (!current_user_can('activate_plugins')) {
wp_send_json_error('Permission denied');
}

if (in_array(Post::getString('adjust'), array_keys(AdjustToEnvironmentHandler::SET_OF_ADJUST))) {
$adjust = Post::getString('adjust');
try {
Expand All @@ -1586,6 +1594,10 @@ function apbct_action_adjust_reverse()

function apbct_action__create_support_user()
{
if (!current_user_can('activate_plugins')) {
wp_send_json_error('Permission denied');
}

$support_user = new SupportUser();
$result = $support_user->ajaxProcess();
wp_send_json($result);
Expand Down
35 changes: 35 additions & 0 deletions inc/cleantalk-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2592,6 +2592,15 @@ function apbct_settings__sync($direct_call = false)

global $apbct;

if (!current_user_can('activate_plugins')) {
$out = array(
'success' => false,
'reload' => false,
'message' => __('You do not have sufficient permissions to access this page.', 'cleantalk-spam-protect'),
);
die(json_encode($out));
}

//Clearing all errors
$apbct->errorDeleteAll(true);

Expand Down Expand Up @@ -2720,6 +2729,15 @@ function apbct_settings__get_key_auto($direct_call = false)

global $apbct;

if (!current_user_can('activate_plugins')) {
$out = array(
'success' => false,
'message' => __('You do not have sufficient permissions to access this page.', 'cleantalk-spam-protect'),

);
die(json_encode($out));
}

$website = parse_url(get_option('home'), PHP_URL_HOST) . parse_url(get_option('home'), PHP_URL_PATH);
$platform = 'wordpress';
$user_ip = Helper::ipGet('real', false);
Expand Down Expand Up @@ -2983,6 +3001,14 @@ function apbct_settings__get__long_description()
global $apbct;
AJAXService::checkAdminNonce();

if (!current_user_can('activate_plugins')) {
$out = array(
'success' => false,
'message' => __('You do not have sufficient permissions to access this page.', 'cleantalk-spam-protect'),
);
die(json_encode($out));
}

$setting_id = TT::toString(Post::get('setting_id', null, 'word'));

$link_exclusion_by_form_signs = LinkConstructor::buildCleanTalkLink(
Expand Down Expand Up @@ -3150,6 +3176,15 @@ function apbct_settings__check_renew_banner()

AJAXService::checkAdminNonce();

if (!current_user_can('activate_plugins')) {
$out = array(
'success' => false,
'close_renew_banner' => false,
'message' => __('You do not have sufficient permissions to access this page.', 'cleantalk-spam-protect'),
);
die(json_encode($out));
}

die(
json_encode(
array('close_renew_banner' => ($apbct->data['notice_trial'] == 0 && $apbct->data['notice_renew'] == 0) ? true : false)
Expand Down
Loading
Loading