This commit is contained in:
David Walsh 2016-03-09 12:35:04 -06:00
Родитель f1b22297a4
Коммит 2889ba33e2
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -22,8 +22,9 @@ class Offline_Shell_Admin {
public function get_files_ajax() { public function get_files_ajax() {
// If they've asked for files, just output the file HTML // If they've asked for files, just output the file HTML
if(isset($_POST['data']) && $_POST['data'] === 'files') { if(isset($_POST['data']) && $_POST['data'] === 'files') {
echo $this->options_files(); $this->options_files();
} }
exit();
} }
public function process_options() { public function process_options() {
@ -31,6 +32,9 @@ class Offline_Shell_Admin {
return false; return false;
} }
// Check nonce to avoid hacks
check_admin_referer('offline-shell-admin');
// Update "enabled" status // Update "enabled" status
update_option('offline_shell_enabled', isset($_POST['offline_shell_enabled']) ? intval($_POST['offline_shell_enabled']) : 0); update_option('offline_shell_enabled', isset($_POST['offline_shell_enabled']) ? intval($_POST['offline_shell_enabled']) : 0);
@ -188,6 +192,7 @@ class Offline_Shell_Admin {
</div> </div>
<input type="hidden" name="offline_shell_files_loaded" id="offline_shell_files_loaded" value="0"> <input type="hidden" name="offline_shell_files_loaded" id="offline_shell_files_loaded" value="0">
<?php wp_nonce_field('offline-shell-admin'); ?>
<?php submit_button(__('Save Changes'), 'primary'); ?> <?php submit_button(__('Save Changes'), 'primary'); ?>
</form> </form>