Changeset 3280795
- Timestamp:
- 04/24/2025 10:18:19 AM (12 months ago)
- Location:
- course-booking-system
- Files:
-
- 75 added
- 9 edited
-
tags/6.1.1 (added)
-
tags/6.1.1/assets (added)
-
tags/6.1.1/assets/css (added)
-
tags/6.1.1/assets/css/admin.css (added)
-
tags/6.1.1/assets/css/style.css (added)
-
tags/6.1.1/assets/js (added)
-
tags/6.1.1/assets/js/admin.js (added)
-
tags/6.1.1/assets/js/ajax.js (added)
-
tags/6.1.1/assets/js/script.js (added)
-
tags/6.1.1/assets/js/single-course.js (added)
-
tags/6.1.1/assets/js/slick (added)
-
tags/6.1.1/assets/js/slick/ajax-loader.gif (added)
-
tags/6.1.1/assets/js/slick/fonts (added)
-
tags/6.1.1/assets/js/slick/fonts/slick.eot (added)
-
tags/6.1.1/assets/js/slick/fonts/slick.svg (added)
-
tags/6.1.1/assets/js/slick/fonts/slick.ttf (added)
-
tags/6.1.1/assets/js/slick/fonts/slick.woff (added)
-
tags/6.1.1/assets/js/slick/slick-theme.css (added)
-
tags/6.1.1/assets/js/slick/slick.css (added)
-
tags/6.1.1/assets/js/slick/slick.js (added)
-
tags/6.1.1/assets/js/slick/slick.min.css (added)
-
tags/6.1.1/assets/js/slick/slick.min.js (added)
-
tags/6.1.1/block (added)
-
tags/6.1.1/block/elementor (added)
-
tags/6.1.1/block/elementor/index.php (added)
-
tags/6.1.1/block/elementor/preview.php (added)
-
tags/6.1.1/block/elementor/timetable.php (added)
-
tags/6.1.1/block/preview (added)
-
tags/6.1.1/block/preview/block.js (added)
-
tags/6.1.1/block/preview/index.php (added)
-
tags/6.1.1/block/preview/style.css (added)
-
tags/6.1.1/block/timetable (added)
-
tags/6.1.1/block/timetable/block.js (added)
-
tags/6.1.1/block/timetable/index.php (added)
-
tags/6.1.1/block/timetable/style.css (added)
-
tags/6.1.1/changelog-archive.txt (added)
-
tags/6.1.1/course-booking-system.php (added)
-
tags/6.1.1/includes (added)
-
tags/6.1.1/includes/admin (added)
-
tags/6.1.1/includes/admin/settings.php (added)
-
tags/6.1.1/includes/admin/single.php (added)
-
tags/6.1.1/includes/admin/user.php (added)
-
tags/6.1.1/includes/ajax (added)
-
tags/6.1.1/includes/ajax.php (added)
-
tags/6.1.1/includes/ajax/archive-course.php (added)
-
tags/6.1.1/includes/ajax/single-course.php (added)
-
tags/6.1.1/includes/assets.php (added)
-
tags/6.1.1/includes/cron.php (added)
-
tags/6.1.1/includes/csv-export.php (added)
-
tags/6.1.1/includes/db (added)
-
tags/6.1.1/includes/db/create.php (added)
-
tags/6.1.1/includes/db/drop.php (added)
-
tags/6.1.1/includes/db/update.php (added)
-
tags/6.1.1/includes/functions.php (added)
-
tags/6.1.1/includes/ics-download.php (added)
-
tags/6.1.1/includes/ics.php (added)
-
tags/6.1.1/includes/shortcodes.php (added)
-
tags/6.1.1/includes/woocommerce (added)
-
tags/6.1.1/includes/woocommerce/myaccount (added)
-
tags/6.1.1/includes/woocommerce/myaccount/dashboard-status.php (added)
-
tags/6.1.1/includes/woocommerce/myaccount/dashboard.php (added)
-
tags/6.1.1/includes/woocommerce/myaccount/delete.php (added)
-
tags/6.1.1/includes/woocommerce/payment-gateway.js (added)
-
tags/6.1.1/includes/woocommerce/payment-gateway.php (added)
-
tags/6.1.1/includes/woocommerce/product-type.php (added)
-
tags/6.1.1/includes/woocommerce/redeem.php (added)
-
tags/6.1.1/includes/woocommerce/subscription.php (added)
-
tags/6.1.1/includes/woocommerce/woocommerce.php (added)
-
tags/6.1.1/index.html (added)
-
tags/6.1.1/readme.txt (added)
-
tags/6.1.1/templates (added)
-
tags/6.1.1/templates/single-course.php (added)
-
tags/6.1.1/templates/single-weekday-course.php (added)
-
tags/6.1.1/templates/single-weekday.php (added)
-
tags/6.1.1/uninstall.php (added)
-
trunk/assets/js/admin.js (modified) (3 diffs)
-
trunk/assets/js/ajax.js (modified) (12 diffs)
-
trunk/course-booking-system.php (modified) (2 diffs)
-
trunk/includes/admin/single.php (modified) (2 diffs)
-
trunk/includes/admin/user.php (modified) (1 diff)
-
trunk/includes/ajax.php (modified) (11 diffs)
-
trunk/includes/assets.php (modified) (1 diff)
-
trunk/includes/woocommerce/woocommerce.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
course-booking-system/trunk/assets/js/admin.js
r3208605 r3280795 54 54 }); 55 55 56 // Single: Add Timeslot56 // Single: Edit Timeslots 57 57 jQuery( document ).ready( function() { 58 58 … … 74 74 data: { 75 75 action: 'cbs_add_timetable', 76 nonce: course_booking_system_ajax.nonce, 77 76 78 post_id: post_id, 77 79 id: id, … … 109 111 data: { 110 112 action: 'cbs_delete_timetable', 113 nonce: course_booking_system_ajax.nonce, 114 111 115 delete_id: delete_id, 112 116 post_id: post_id, -
course-booking-system/trunk/assets/js/ajax.js
r3278753 r3280795 117 117 data: { 118 118 action: 'cbs_action_substitute', 119 nonce: course_booking_system_ajax.nonce, 119 120 120 121 course_id: course_id, … … 148 149 data: { 149 150 action: 'cbs_note', 151 nonce: course_booking_system_ajax.nonce, 150 152 151 153 course_id: course_id, … … 221 223 data: { 222 224 action: 'cbs_action_booking', 225 nonce: course_booking_system_ajax.nonce, 223 226 224 227 course_id: course_id, … … 261 264 data: { 262 265 action: 'cbs_action_booking_delete', 266 nonce: course_booking_system_ajax.nonce, 263 267 264 268 course_id: course_id, … … 304 308 data: { 305 309 action: 'cbs_action_abo_delete', 310 nonce: course_booking_system_ajax.nonce, 306 311 307 312 course_id: course_id, … … 338 343 data: { 339 344 action: 'cbs_action_waitlist', 345 nonce: course_booking_system_ajax.nonce, 340 346 341 347 course_id: course_id, … … 369 375 data: { 370 376 action: 'cbs_action_waitlist_delete', 377 nonce: course_booking_system_ajax.nonce, 371 378 372 379 course_id: course_id, … … 401 408 data: { 402 409 action: 'cbs_action_attendance', 410 nonce: course_booking_system_ajax.nonce, 403 411 404 412 course_id: course_id, … … 448 456 data: { 449 457 action: 'cbs_action_week', 458 nonce: course_booking_system_ajax.nonce, 450 459 451 460 category: category, … … 476 485 data: { 477 486 action: 'cbs_action_subscription', 487 nonce: course_booking_system_ajax.nonce, 478 488 479 489 abo_course: abo_course … … 504 514 data: { 505 515 action: 'cbs_sms', 516 nonce: course_booking_system_ajax.nonce, 506 517 507 518 to: to, … … 536 547 data: { 537 548 action: 'cbs_notifications', 549 nonce: course_booking_system_ajax.nonce, 538 550 539 551 user_id: user_id, -
course-booking-system/trunk/course-booking-system.php
r3278879 r3280795 13 13 * Description: Individual course booking system for specific needs. Works perfectly with WooCommerce. 14 14 * Network: true 15 * Version: 6.1 15 * Version: 6.1.1 16 16 * Requires Plugins: woocommerce 17 17 * Requires at least: 5.5 18 18 * Requires PHP: 7.0 19 19 * WC requires at least: 5.7.0 20 * WC tested up to: 9.8. 120 * WC tested up to: 9.8.2 21 21 * Author: ComMotion 22 22 * Author URI: https://commotion.online/ … … 202 202 return; 203 203 204 $post__in = array();205 206 204 $day = isset( $_GET['weekday'] ) ? intval( $_GET['weekday'] ) : 0; 207 205 $date = isset( $_GET['date'] ) ? htmlspecialchars( $_REQUEST['date'] ) : date( 'Y-m-d', strtotime( 'Sunday +'.$day.' days' ) ); 208 206 207 $post__in = array(); 209 208 $courses = cbs_get_courses( array( 210 209 'day' => $day, -
course-booking-system/trunk/includes/admin/single.php
r3208605 r3280795 348 348 $post_id = intval( $_REQUEST['post_id'] ); 349 349 350 if ( empty( $post_id ) || !current_user_can( 'edit_course', $post_id ) || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 351 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); 352 350 353 $wpdb->insert( 351 354 $wpdb->prefix.'cbs_data', … … 365 368 cbs_save_timeslots(); 366 369 370 $post_id = intval( $_REQUEST['post_id'] ); 367 371 $delete_id = intval( $_REQUEST['delete_id'] ); 368 $post_id = intval( $_REQUEST['post_id'] ); 369 370 if ( !empty( $delete_id ) && !empty( $post_id ) ) :371 $wpdb->delete( 372 $wpdb->prefix.'cbs_data',373 array( 'id' => $delete_id, 'post_id' => $post_id ),374 array( '%d', '%d' )375 );376 endif;372 373 if ( empty( $post_id ) || empty( $delete_id ) || !current_user_can( 'edit_course', $post_id ) || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 374 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); 375 376 $wpdb->delete( 377 $wpdb->prefix.'cbs_data', 378 array( 'id' => $delete_id, 'post_id' => $post_id ), 379 array( '%d', '%d' ) 380 ); 377 381 378 382 echo cbs_data_options_table( $post_id ); -
course-booking-system/trunk/includes/admin/user.php
r3278753 r3280795 25 25 26 26 if ( $role ) { 27 foreach ( $capabilities as $capability ) {27 foreach ( $capabilities as $capability ) 28 28 $role->add_cap( $capability ); 29 }30 29 } 31 30 } -
course-booking-system/trunk/includes/ajax.php
r3278753 r3280795 9 9 $date = sanitize_text_field( $_REQUEST['date'] ); 10 10 $user_id = empty( $custom_user_id ) ? sanitize_text_field( $_REQUEST['user_id'] ) : $custom_user_id; 11 12 // Activate for version 6.1.2 13 /* if ( empty( $course_id ) || empty( $date ) || empty( $user_id ) || !is_user_logged_in() || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 14 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); */ 11 15 12 16 $courses = cbs_get_courses( array( … … 258 262 $date = sanitize_text_field( $_REQUEST['date'] ); 259 263 $user_id = sanitize_text_field( $_REQUEST['user_id'] ); 264 265 // Activate for version 6.1.2 266 /* if ( empty( $booking_id ) || empty( $course_id ) || empty( $date ) || empty( $user_id ) || !is_user_logged_in() || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 267 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); */ 260 268 261 269 $goodwill = ( !empty( $_REQUEST['goodwill'] ) ) ? sanitize_text_field( $_REQUEST['goodwill'] ) : false; … … 504 512 $user_id = sanitize_text_field( $_REQUEST['user_id'] ); 505 513 514 // Activate for version 6.1.2 515 /* if ( empty( $course_id ) || empty( $date ) || empty( $user_id ) || !is_user_logged_in() || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 516 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); */ 517 506 518 $goodwill = ( !empty( $_REQUEST['goodwill'] ) ) ? sanitize_text_field( $_REQUEST['goodwill'] ) : false; 507 519 … … 646 658 $user_id = sanitize_text_field( $_REQUEST['user_id'] ); 647 659 660 // Activate for version 6.1.2 661 /* if ( empty( $course_id ) || empty( $date ) || empty( $user_id ) || !is_user_logged_in() || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 662 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); */ 663 648 664 if ( is_user_logged_in() && !empty( $user_id ) && ( get_current_user_id() == $user_id || in_array( reset( $current_user->roles ), $roles ) ) ) { 649 665 $wpdb->insert( … … 672 688 $user_id = sanitize_text_field( $_REQUEST['user_id'] ); 673 689 690 // Activate for version 6.1.2 691 /* if ( empty( $course_id ) || empty( $date ) || empty( $user_id ) || !is_user_logged_in() || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 692 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); */ 693 674 694 if ( is_user_logged_in() && !empty( $user_id ) && ( get_current_user_id() == $user_id || in_array( reset( $current_user->roles ), $roles ) ) ) { 675 695 $waitlists = $wpdb->delete( … … 731 751 $user_id = sanitize_text_field( $_REQUEST['user_id'] ); 732 752 733 if ( is_user_logged_in() && !empty( $user_id ) && in_array( reset( $current_user->roles ), $roles ) ) { 734 $wpdb->delete( 735 $wpdb->prefix.'cbs_substitutes', 736 array( 'course_id' => $course_id, 'date' => $date ), 737 array( '%d', '%s') 738 ); 739 740 // Check if substitute is not actual user of course 741 $courses = $wpdb->get_results( $wpdb->prepare( "SELECT user_id FROM {$wpdb->prefix}cbs_data WHERE id = %d LIMIT 1", array( $course_id ) ) ); 742 foreach ( $courses as $course ) { 743 if ( $course->user_id != $user_id ) { 744 $wpdb->insert( 745 $wpdb->prefix.'cbs_substitutes', 746 array( 'course_id' => $course_id, 'date' => $date, 'user_id' => $user_id ), 747 array( '%d', '%s', '%d' ) 748 ); 749 } 753 if ( empty( $course_id ) || empty( $date ) || empty( $user_id ) || !is_user_logged_in() || !in_array( reset( $current_user->roles ), $roles ) || !current_user_can( 'edit_courses' ) || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 754 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); 755 756 $wpdb->delete( 757 $wpdb->prefix.'cbs_substitutes', 758 array( 'course_id' => $course_id, 'date' => $date ), 759 array( '%d', '%s') 760 ); 761 762 // Check if substitute is not actual user of course 763 $courses = $wpdb->get_results( $wpdb->prepare( "SELECT user_id FROM {$wpdb->prefix}cbs_data WHERE id = %d LIMIT 1", array( $course_id ) ) ); 764 foreach ( $courses as $course ) { 765 if ( $course->user_id != $user_id ) { 766 $wpdb->insert( 767 $wpdb->prefix.'cbs_substitutes', 768 array( 'course_id' => $course_id, 'date' => $date, 'user_id' => $user_id ), 769 array( '%d', '%s', '%d' ) 770 ); 750 771 } 751 752 wc_print_notice( __( 'Substitute saved successfully. Existing bookings remain unchanged. Participants will not be notified automatically.', 'course-booking-system' ), 'success' ); 753 }772 } 773 774 wc_print_notice( __( 'Substitute saved successfully. Existing bookings remain unchanged. Participants will not be notified automatically.', 'course-booking-system' ), 'success' ); 754 775 755 776 wp_die(); … … 767 788 $date = sanitize_text_field( $_REQUEST['date'] ); 768 789 $attendance = sanitize_text_field( $_REQUEST['attendance'] ); 790 791 // Activate for version 6.1.2 792 /* if ( empty( $course_id ) || empty( $date ) || empty( $user_id ) || !is_user_logged_in() || !current_user_can( 'edit_courses' ) || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 793 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); */ 769 794 770 795 if ( $attendance == 0 ) … … 1077 1102 $note = sanitize_text_field( $_REQUEST['note'] ); 1078 1103 1079 if ( is_user_logged_in() && ( in_array( reset( $current_user->roles ), $roles ) ) ) { 1080 $wpdb->delete( 1104 if ( empty( $course_id ) || empty( $date ) || empty( $note ) || !is_user_logged_in() || !in_array( reset( $current_user->roles ), $roles ) || !current_user_can( 'edit_courses' ) || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 1105 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); 1106 1107 $wpdb->delete( 1108 $wpdb->prefix.'cbs_notes', 1109 array( 'course_id' => $course_id, 'date' => $date ), 1110 array( '%d', '%s') 1111 ); 1112 1113 if ( !empty( $note ) ) { 1114 $wpdb->insert( 1081 1115 $wpdb->prefix.'cbs_notes', 1082 array( 'course_id' => $course_id, 'date' => $date ),1083 array( '%d', '%s' )1116 array( 'course_id' => $course_id, 'date' => $date, 'note' => $note ), 1117 array( '%d', '%s', '%s' ) 1084 1118 ); 1085 1086 if ( !empty( $note ) ) { 1087 $wpdb->insert( 1088 $wpdb->prefix.'cbs_notes', 1089 array( 'course_id' => $course_id, 'date' => $date, 'note' => $note ), 1090 array( '%d', '%s', '%s' ) 1091 ); 1092 } 1093 1094 wc_print_notice( __( 'Note saved successfully.', 'course-booking-system' ), 'success' ); 1095 } 1119 } 1120 1121 wc_print_notice( __( 'Note saved successfully.', 'course-booking-system' ), 'success' ); 1096 1122 1097 1123 wp_die(); … … 1127 1153 $abo_course = sanitize_text_field( $_REQUEST['abo_course'] ); 1128 1154 1129 if ( is_user_logged_in() ) { 1130 $user_id = get_current_user_id(); 1131 update_user_meta( $user_id, 'abo_course', sanitize_text_field( $_POST['abo_course'] ) ); 1132 1133 wc_print_notice( __( 'Subscription course saved successfully.', 'course-booking-system' ), 'success' ); 1134 } 1155 if ( empty( $abo_course ) || !is_user_logged_in() || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 1156 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); 1157 1158 $user_id = get_current_user_id(); 1159 update_user_meta( $user_id, 'abo_course', sanitize_text_field( $_POST['abo_course'] ) ); 1160 1161 wc_print_notice( __( 'Subscription course saved successfully.', 'course-booking-system' ), 'success' ); 1135 1162 1136 1163 wp_die(); … … 1149 1176 $message = sanitize_text_field( $_REQUEST['message'] ); 1150 1177 1151 if ( $sms && !empty( $to ) && !empty( $message ) ) 1152 wp_mail( 'email2sms@smspoint.de', $sms_token, 'from='.$sms_sender_name.'|to='.$to.'|message='.$message ); 1178 if ( !$sms || empty( $to ) || empty( $message ) || !is_user_logged_in() || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 1179 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); 1180 1181 wp_mail( 'email2sms@smspoint.de', $sms_token, 'from='.$sms_sender_name.'|to='.$to.'|message='.$message ); 1153 1182 1154 1183 wc_print_notice( __( 'The SMS was sent successfully.', 'course-booking-system' ), 'success' ); … … 1164 1193 $user_id = intval( $_REQUEST['user_id'] ); 1165 1194 $notifications = $_REQUEST['notifications']; 1195 1196 if ( !is_user_logged_in() || !wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' ) ) 1197 wp_die( __( 'AJAX nonce is not valid.', 'course-booking-system' ) ); 1166 1198 1167 1199 if ( empty( $user_id ) || empty( $notifications ) ) : -
course-booking-system/trunk/includes/assets.php
r3171387 r3280795 27 27 wp_localize_script( 'course-booking-system-ajax', 'course_booking_system_ajax', array( 28 28 'ajaxurl' => admin_url( 'admin-ajax.php' ), 29 'nonce' => wp_create_nonce( 'ajax-nonce' ), 29 30 'offset' => get_option( 'course_booking_system_message_offset' ) 30 31 ) -
course-booking-system/trunk/includes/woocommerce/woocommerce.php
r3278753 r3280795 450 450 // Check if supported download method is used 451 451 $woocommerce_file_download_method = get_option( 'woocommerce_file_download_method' ); 452 $woocommerce_downloads_require_login = get_option( 'woocommerce_downloads_require_login' );453 // if ( ( $woocommerce_file_download_method != 'xsendfile' && $woocommerce_file_download_method != 'redirect' ) || $woocommerce_downloads_require_login != 'yes' ) {452 /* $woocommerce_downloads_require_login = get_option( 'woocommerce_downloads_require_login' ); 453 if ( ( $woocommerce_file_download_method != 'xsendfile' && $woocommerce_file_download_method != 'redirect' ) || $woocommerce_downloads_require_login != 'yes' ) { */ 454 454 if ( ( $woocommerce_file_download_method != 'xsendfile' && $woocommerce_file_download_method != 'redirect' ) ) { 455 455 ?> -
course-booking-system/trunk/readme.txt
r3278753 r3280795 5 5 Tested up to: 6.8.1 6 6 Requires PHP: 7.0 7 Stable tag: 6.1 7 Stable tag: 6.1.1 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 106 106 == Changelog == 107 107 108 = 6.1.1 = 109 * Vulnerability fix. 110 * Compatibility for latest WooCommerce version. 111 108 112 = 6.1 = 109 113 * SMS sending service.
Note: See TracChangeset
for help on using the changeset viewer.