My Calendar - Version 3.1.1

Version Description

  • Bug fix: unspamming event_ID passed incorrect variable name
  • Bug fix: Don't run spam check on users with mc_add_event
  • Bug fix: Users with mc_add_event should not be able to trash other's events.
  • Bug fix: Refine permissions; add mc_publish_events allowing users to publish own events without access to others
  • Bug fix: Refine permissions; don't display links that users can't use.
Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 My Calendar
Version 3.1.1
Comparing to
See all releases

Code changes from version 3.1.0 to 3.1.1

my-calendar-core.php CHANGED
@@ -898,7 +898,7 @@ function my_calendar_send_email( $event ) {
898
  */
899
  function mc_spam( $event_url = '', $description = '', $post = array() ) {
900
  global $akismet_api_host, $akismet_api_port;
901
- if ( current_user_can( 'mc_manage_events' ) || apply_filters( 'mc_disable_spam_checking', false, $post ) ) { // is a privileged user.
902
  return apply_filters( 'mc_custom_spam_status', 0, $post );
903
  }
904
  $akismet = false;
898
  */
899
  function mc_spam( $event_url = '', $description = '', $post = array() ) {
900
  global $akismet_api_host, $akismet_api_port;
901
+ if ( current_user_can( 'mc_add_events' ) || apply_filters( 'mc_disable_spam_checking', false, $post ) ) { // is a privileged user.
902
  return apply_filters( 'mc_custom_spam_status', 0, $post );
903
  }
904
  $akismet = false;
my-calendar-event-manager.php CHANGED
@@ -304,12 +304,12 @@ function mc_bulk_action( $action ) {
304
  // send ham report to Akismet.
305
  // send notifications.
306
  foreach ( $ids as $id ) {
307
- $post_ID = mc_get_event_post( $event_id );
308
  $submitter = get_post_meta( $post_ID, '_submitter_details', true );
309
  if ( is_array( $submitter ) && ! empty( $submitter ) ) {
310
  $name = $submitter['first_name'] . ' ' . $submitter['last_name'];
311
  $email = $submitter['email'];
312
- do_action( 'mcs_complete_submission', $name, $email, $event_id, 'edit' );
313
  }
314
  }
315
  break;
@@ -2215,9 +2215,11 @@ function mc_list_events() {
2215
  <a href="<?php echo add_query_arg( 'preview', 'true', $view_url ); ?>" class='view'><?php _e( 'Preview', 'my-calendar' ); ?></a> |
2216
  <?php
2217
  }
2218
- ?>
2219
- <a href="<?php echo $copy_url; ?>" class='copy'><?php _e( 'Copy', 'my-calendar' ); ?></a>
2220
- <?php
 
 
2221
  if ( $can_edit ) {
2222
  if ( mc_event_is_grouped( $event->event_group_id ) ) {
2223
  ?>
@@ -2233,7 +2235,7 @@ function mc_list_events() {
2233
  ?>
2234
  |
2235
  <?php
2236
- if ( current_user_can( 'mc_approve_events' ) ) {
2237
  if ( 1 == $event->event_approved ) {
2238
  $mo = 'reject';
2239
  $te = __( 'Trash', 'my-calendar' );
@@ -3355,7 +3357,7 @@ function mc_controls( $mode, $has_data, $event, $position = 'header' ) {
3355
  if ( 'header' == $position ) {
3356
  if ( 'edit' == $mode ) {
3357
  $controls['prev_status'] = "<input type='hidden' name='prev_event_status' value='" . absint( $event->event_approved ) . "' />";
3358
- if ( current_user_can( 'mc_approve_events' ) ) { // Added by Roland P.
3359
  if ( $has_data && '1' == $event->event_approved ) {
3360
  $checked = ' checked="checked"';
3361
  } elseif ( $has_data && 0 == $event->event_approved ) {
@@ -3371,13 +3373,13 @@ function mc_controls( $mode, $has_data, $event, $position = 'header' ) {
3371
  <option value='2'" . selected( $event->event_approved, '2', false ) . '>' . __( 'Trash', 'my-calendar' ) . '</option>';
3372
  }
3373
  } else { // Case: adding new event (if user can, then 1, else 0).
3374
- if ( current_user_can( 'mc_approve_events' ) ) {
3375
  $status_control = "
3376
  <option value='1'>" . __( 'Published', 'my-calendar' ) . "</option>
3377
  <option value='0'>" . __( 'Draft', 'my-calendar' ) . '</option>';
3378
  } else {
3379
  $status_control = "
3380
- <option value='0'" . $drafted . '>' . __( 'Draft', 'my-calendar' ) . '</option>';
3381
  }
3382
  }
3383
  $controls['status'] = "
304
  // send ham report to Akismet.
305
  // send notifications.
306
  foreach ( $ids as $id ) {
307
+ $post_ID = mc_get_event_post( $id );
308
  $submitter = get_post_meta( $post_ID, '_submitter_details', true );
309
  if ( is_array( $submitter ) && ! empty( $submitter ) ) {
310
  $name = $submitter['first_name'] . ' ' . $submitter['last_name'];
311
  $email = $submitter['email'];
312
+ do_action( 'mcs_complete_submission', $name, $email, $id, 'edit' );
313
  }
314
  }
315
  break;
2215
  <a href="<?php echo add_query_arg( 'preview', 'true', $view_url ); ?>" class='view'><?php _e( 'Preview', 'my-calendar' ); ?></a> |
2216
  <?php
2217
  }
2218
+ if ( $can_edit ) {
2219
+ ?>
2220
+ <a href="<?php echo $copy_url; ?>" class='copy'><?php _e( 'Copy', 'my-calendar' ); ?></a>
2221
+ <?php
2222
+ }
2223
  if ( $can_edit ) {
2224
  if ( mc_event_is_grouped( $event->event_group_id ) ) {
2225
  ?>
2235
  ?>
2236
  |
2237
  <?php
2238
+ if ( current_user_can( 'mc_approve_events' ) && $can_edit ) {
2239
  if ( 1 == $event->event_approved ) {
2240
  $mo = 'reject';
2241
  $te = __( 'Trash', 'my-calendar' );
3357
  if ( 'header' == $position ) {
3358
  if ( 'edit' == $mode ) {
3359
  $controls['prev_status'] = "<input type='hidden' name='prev_event_status' value='" . absint( $event->event_approved ) . "' />";
3360
+ if ( current_user_can( 'mc_approve_events' ) || current_user_can( 'mc_publish_events' ) ) { // Added by Roland P.
3361
  if ( $has_data && '1' == $event->event_approved ) {
3362
  $checked = ' checked="checked"';
3363
  } elseif ( $has_data && 0 == $event->event_approved ) {
3373
  <option value='2'" . selected( $event->event_approved, '2', false ) . '>' . __( 'Trash', 'my-calendar' ) . '</option>';
3374
  }
3375
  } else { // Case: adding new event (if user can, then 1, else 0).
3376
+ if ( current_user_can( 'mc_approve_events' ) || current_user_can( 'mc_publish_events' ) ) {
3377
  $status_control = "
3378
  <option value='1'>" . __( 'Published', 'my-calendar' ) . "</option>
3379
  <option value='0'>" . __( 'Draft', 'my-calendar' ) . '</option>';
3380
  } else {
3381
  $status_control = "
3382
+ <option value='0'>" . __( 'Draft', 'my-calendar' ) . '</option>';
3383
  }
3384
  }
3385
  $controls['status'] = "
my-calendar-settings.php CHANGED
@@ -232,6 +232,7 @@ function my_calendar_settings() {
232
  $perms = $_POST['mc_caps'];
233
  $caps = array(
234
  'mc_add_events' => __( 'Add Events', 'my-calendar' ),
 
235
  'mc_approve_events' => __( 'Approve Events', 'my-calendar' ),
236
  'mc_manage_events' => __( 'Manage Events', 'my-calendar' ),
237
  'mc_edit_cats' => __( 'Edit Categories', 'my-calendar' ),
@@ -974,6 +975,7 @@ function mc_remote_db() {
974
  $roles = $wp_roles->get_names();
975
  $caps = array(
976
  'mc_add_events' => __( 'Add Events', 'my-calendar' ),
 
977
  'mc_approve_events' => __( 'Approve Events', 'my-calendar' ),
978
  'mc_manage_events' => __( 'Manage Events', 'my-calendar' ),
979
  'mc_edit_cats' => __( 'Edit Categories', 'my-calendar' ),
232
  $perms = $_POST['mc_caps'];
233
  $caps = array(
234
  'mc_add_events' => __( 'Add Events', 'my-calendar' ),
235
+ 'mc_publish_events' => __( 'Publish Events', 'my-calendar' ),
236
  'mc_approve_events' => __( 'Approve Events', 'my-calendar' ),
237
  'mc_manage_events' => __( 'Manage Events', 'my-calendar' ),
238
  'mc_edit_cats' => __( 'Edit Categories', 'my-calendar' ),
975
  $roles = $wp_roles->get_names();
976
  $caps = array(
977
  'mc_add_events' => __( 'Add Events', 'my-calendar' ),
978
+ 'mc_publish_events' => __( 'Publish Events', 'my-calendar' ),
979
  'mc_approve_events' => __( 'Approve Events', 'my-calendar' ),
980
  'mc_manage_events' => __( 'Manage Events', 'my-calendar' ),
981
  'mc_edit_cats' => __( 'Edit Categories', 'my-calendar' ),
my-calendar.php CHANGED
@@ -17,7 +17,7 @@
17
  * License: GPL-2.0+
18
  * License URI: http://www.gnu.org/license/gpl-2.0.txt
19
  * Domain Path: lang
20
- * Version: 3.1.0
21
  */
22
 
23
  /*
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
42
  }
43
 
44
  global $mc_version, $wpdb;
45
- $mc_version = '3.1.0';
46
 
47
  define( 'MC_DEBUG', false );
48
 
17
  * License: GPL-2.0+
18
  * License URI: http://www.gnu.org/license/gpl-2.0.txt
19
  * Domain Path: lang
20
+ * Version: 3.1.1
21
  */
22
 
23
  /*
42
  }
43
 
44
  global $mc_version, $wpdb;
45
+ $mc_version = '3.1.1';
46
 
47
  define( 'MC_DEBUG', false );
48
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: calendar, dates, times, event, events, scheduling, schedule, event manager
5
  Requires at least: 4.4
6
  Tested up to: 4.9
7
  Requires PHP: 5.3
8
- Stable tag: 3.1.0
9
  Text domain: my-calendar
10
  License: GPLv2 or later
11
 
@@ -85,6 +85,14 @@ Translating my plug-ins is always appreciated. Visit <a href="https://translate.
85
 
86
  TODO: Support limiting views to multiple locations
87
 
 
 
 
 
 
 
 
 
88
  = 3.1.0 =
89
 
90
  * Add feature (by Josef Fällman): Print & export view for search results.
5
  Requires at least: 4.4
6
  Tested up to: 4.9
7
  Requires PHP: 5.3
8
+ Stable tag: 3.1.1
9
  Text domain: my-calendar
10
  License: GPLv2 or later
11
 
85
 
86
  TODO: Support limiting views to multiple locations
87
 
88
+ = 3.1.1 =
89
+
90
+ * Bug fix: unspamming event_ID passed incorrect variable name
91
+ * Bug fix: Don't run spam check on users with mc_add_event
92
+ * Bug fix: Users with mc_add_event should not be able to trash other's events.
93
+ * Bug fix: Refine permissions; add mc_publish_events allowing users to publish own events without access to others
94
+ * Bug fix: Refine permissions; don't display links that users can't use.
95
+
96
  = 3.1.0 =
97
 
98
  * Add feature (by Josef Fällman): Print & export view for search results.