-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost.php
More file actions
25 lines (18 loc) · 770 Bytes
/
post.php
File metadata and controls
25 lines (18 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
require_once '../../../wp-load.php';
if (!current_user_can('administrator')) {
wp_safe_redirect(home_url());
die;
}
if (empty($_POST['app_id']) || empty($_POST['secret'])) {
wp_safe_redirect(admin_url('options-general.php?page=justauthme&manual_error'));
die;
}
global $wpdb;
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
$sql = $wpdb->prepare("UPDATE " . JustAuthMe::get()->getSettingTableName() . " SET value=%s WHERE name='app_id'", $_POST['app_id']);
dbDelta($sql);
$sql = $wpdb->prepare("UPDATE " . JustAuthMe::get()->getSettingTableName() . " SET value=%s WHERE name='secret'", $_POST['secret']);
dbDelta($sql);
wp_safe_redirect(admin_url('options-general.php?page=justauthme&manual_success'));
die;