Skip to content

Commit dc3cfa2

Browse files
committed
solved - show message and take the user to the jobs page
1 parent 2c8b49a commit dc3cfa2

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

admin/jobs.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ function scripted_create_current_jobs_callback()
1010
$paged = (isset($_GET['paged']) and $_GET['paged'] !='') ? sanitize_text_field($_GET['paged']) : '';
1111
$per_page = 15;
1212
$validate = validateApiKey($ID,$accessToken);
13-
$out = '<div class="wrap">
14-
<div class="icon32" style="width:100px;padding-top:5px;" id="icon-scripted"><img src="'.SCRIPTED_LOGO.'"></div><h2>Jobs</h2>';
13+
$out = '<div class="wrap">';
14+
15+
if ( $_GET['auth'] )
16+
$out .= '<div class="notice notice-success" id="message"><p>Great! Your code validation is correct. Thanks, enjoy...</p></div>';
17+
18+
$out .= '<div class="icon32" style="width:100px;padding-top:5px;" id="icon-scripted"><img src="'.SCRIPTED_LOGO.'"></div><h2>Jobs</h2>';
1519

1620
$filter = (!isset($_GET['filter'])) ? 'all' : sanitize_text_field($_GET['filter']);
1721
$jobUrl = ($filter !='all') ? 'jobs/'.$filter : 'jobs/';

admin/settings.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ function scripted_settings_menu_function() {
5858
$validate = validateApiKey($_POST['ID_text'],$_POST['success_tokent_text']);
5959
if($validate) {
6060
update_option( '_scripted_ID', sanitize_text_field($_POST['ID_text']) );
61-
update_option( '_scripted_auccess_tokent', sanitize_text_field($_POST['success_tokent_text'] ));
62-
echo '<div class="notice notice-success" id="message"><p>Great! Your code validation is correct. Thanks, enjoy...</p></div>';
63-
} else {
61+
update_option( '_scripted_auccess_tokent', sanitize_text_field($_POST['success_tokent_text'] )); ?>
62+
63+
<script type="text/javascript">
64+
window.location = '<?php echo admin_url('/admin.php?page=scripted_jobs&auth=true') ?>';
65+
</script>
66+
67+
<?php } else {
6468
echo '<div class="notice notice-error" id="message"><p>Sorry, we found an error. Please confirm your Organization Key and Access Token are correct and try again.</p></div>';
6569
}
6670
}

0 commit comments

Comments
 (0)