Changeset 1917088
- Timestamp:
- 07/30/2018 09:17:23 PM (7 years ago)
- Location:
- ad-buttons/tags/3.0
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ad-buttons/tags/3.0/adbuttons.php
r1915633 r1917088 360 360 echo $after_widget; 361 361 } 362 362 363 363 function ad_buttons_widget_control() { 364 364 $options = $newoptions = get_option('widget_adbuttons_cfg'); 365 if($_SERVER['REQUEST_METHOD'] == 'POST'){ 366 if ( !empty($_POST['ad_buttons_widget_submit']) ) { 365 if($_SERVER['REQUEST_METHOD'] == 'POST' && current_user_can( 'manage_options' )) { 366 // add a nonce check here 367 //adbuttonsupdtitle 368 369 if ( !empty($_POST['ad_buttons_widget_submit']) && wp_verify_nonce( $_POST['adbuttonsupdtitle'], 'adbuttons_updatewidgettitle' )) { 367 370 $newoptions['ab_title'] = sanitize_text_field( $_POST['ad_buttons_widget_title'] ); 368 371 } … … 373 376 } 374 377 $title = esc_attr($options['ab_title']); 378 // add a nonce creation here 375 379 ?> 376 380 <p><label for="ad_buttons_widget_title"><?php _e('Title:'); ?> <input class="widefat" id="ad_buttons_widget_title" 377 381 name="ad_buttons_widget_title" type="text" value="<?php echo esc_html( $title ); ?>" /></label></p> 382 <?php wp_nonce_field( 'adbuttons_updatewidgettitle', 'adbuttonsupdtitle' ); ?> 378 383 <input type="hidden" id="ad_buttons_widget_submit" name="ad_buttons_widget_submit" value="1" /><br/> 379 384 That's all you can set here. All other options and ad controls can be found in the <strong>Ad Buttons</strong> -
ad-buttons/tags/3.0/adbuttonsact.php
r1915633 r1917088 68 68 69 69 // check if the form has been submitted and validate input 70 if( $_SERVER['REQUEST_METHOD'] == 'POST' ){70 if( $_SERVER['REQUEST_METHOD'] == 'POST' && current_user_can( 'manage_options' )){ 71 71 if ( ! isset( $_POST['_abupd'] ) || ! wp_verify_nonce( $_POST['_abupd'], 'update-ad' )) { 72 72 print 'Sorry, your nonce did not verify.'; -
ad-buttons/tags/3.0/adbuttonsadmin.php
r1915633 r1917088 36 36 37 37 // check if the form has been submitted and validate input 38 if( $_SERVER['REQUEST_METHOD'] == 'POST' ){38 if( $_SERVER['REQUEST_METHOD'] == 'POST' && current_user_can( 'manage_options' )){ 39 39 if ( ! isset( $_POST['_abupd'] ) || ! wp_verify_nonce( $_POST['_abupd'], 'update-settings' )) { 40 40 print 'Sorry, your nonce did not verify.'; -
ad-buttons/tags/3.0/adbuttonsstats.php
r1915633 r1917088 55 55 <p> 56 56 <?php 57 if ($cleanup === 1 ) {58 57 if ($cleanup === 1 && wp_verify_nonce( $_REQUEST['adbuttonscleanup'], 'cleanupstats' ) && current_user_can( 'manage_options' )) { 58 59 59 echo "cleaning up stats database...</br>"; 60 60 // CLEANUP PROCEDURE … … 84 84 85 85 if ($old_records > 0) { 86 echo "Total old records: <b>"; 87 echo $old_records; 88 echo "</b> cleaning up old records will free up space in the database. The daily totals will still be available for viewing here.</br>"; 89 echo "<a class=\"button button-primary \" href=\"$nplink&cln=1\">clean up now</a>"; 86 echo 'Total old records: <b>'.$old_records.'</b> cleaning up old records will free up space in the database. The daily totals will still be available for viewing here.</br>'; 87 echo '<a class="button button-primary" href="'.esc_url( add_query_arg( array( 'cln' => '1', 'adbuttonscleanup' => wp_create_nonce('cleanupstats') ) ) ).'">clean up now</a>'; 90 88 } 89 91 90 92 91 ?>
Note: See TracChangeset
for help on using the changeset viewer.