Changeset 3043713
- Timestamp:
- 03/01/2024 03:00:56 PM (2 years ago)
- Location:
- constellation-client-portal
- Files:
-
- 131 added
- 1 deleted
- 12 edited
-
tags/1.7.5 (deleted)
-
tags/1.8.0 (added)
-
tags/1.8.0/LICENSE.txt (added)
-
tags/1.8.0/README.txt (added)
-
tags/1.8.0/admin (added)
-
tags/1.8.0/admin/class-ars-constellation-client-portal-admin.php (added)
-
tags/1.8.0/admin/class-ars-constellation-client-portal-client-pages.php (added)
-
tags/1.8.0/admin/class-ars-constellation-client-portal-company.php (added)
-
tags/1.8.0/admin/class-ars-constellation-client-portal-core-authorization.php (added)
-
tags/1.8.0/admin/class-ars-constellation-client-portal-core-file-checks.php (added)
-
tags/1.8.0/admin/class-ars-constellation-client-portal-file.php (added)
-
tags/1.8.0/admin/class-ars-constellation-client-portal-invoice.php (added)
-
tags/1.8.0/admin/class-ars-constellation-client-portal-settings.php (added)
-
tags/1.8.0/admin/class-ars-constellation-client-portal-users.php (added)
-
tags/1.8.0/admin/css (added)
-
tags/1.8.0/admin/css/ars-constellation-client-portal-admin.css (added)
-
tags/1.8.0/admin/css/jquery-ui (added)
-
tags/1.8.0/admin/css/jquery-ui/1.11.1 (added)
-
tags/1.8.0/admin/css/jquery-ui/1.11.1/themes (added)
-
tags/1.8.0/admin/css/jquery-ui/1.11.1/themes/cupertino (added)
-
tags/1.8.0/admin/css/jquery-ui/1.11.1/themes/cupertino/jquery-ui.css (added)
-
tags/1.8.0/admin/css/select2.min.css (added)
-
tags/1.8.0/admin/index.php (added)
-
tags/1.8.0/admin/js (added)
-
tags/1.8.0/admin/js/ars-constellation-client-portal-admin.js (added)
-
tags/1.8.0/admin/js/i18n (added)
-
tags/1.8.0/admin/js/i18n/af.js (added)
-
tags/1.8.0/admin/js/i18n/ar.js (added)
-
tags/1.8.0/admin/js/i18n/az.js (added)
-
tags/1.8.0/admin/js/i18n/bg.js (added)
-
tags/1.8.0/admin/js/i18n/bs.js (added)
-
tags/1.8.0/admin/js/i18n/ca.js (added)
-
tags/1.8.0/admin/js/i18n/cs.js (added)
-
tags/1.8.0/admin/js/i18n/da.js (added)
-
tags/1.8.0/admin/js/i18n/de.js (added)
-
tags/1.8.0/admin/js/i18n/dsb.js (added)
-
tags/1.8.0/admin/js/i18n/el.js (added)
-
tags/1.8.0/admin/js/i18n/en.js (added)
-
tags/1.8.0/admin/js/i18n/es.js (added)
-
tags/1.8.0/admin/js/i18n/et.js (added)
-
tags/1.8.0/admin/js/i18n/eu.js (added)
-
tags/1.8.0/admin/js/i18n/fa.js (added)
-
tags/1.8.0/admin/js/i18n/fi.js (added)
-
tags/1.8.0/admin/js/i18n/fr.js (added)
-
tags/1.8.0/admin/js/i18n/gl.js (added)
-
tags/1.8.0/admin/js/i18n/he.js (added)
-
tags/1.8.0/admin/js/i18n/hi.js (added)
-
tags/1.8.0/admin/js/i18n/hr.js (added)
-
tags/1.8.0/admin/js/i18n/hsb.js (added)
-
tags/1.8.0/admin/js/i18n/hu.js (added)
-
tags/1.8.0/admin/js/i18n/hy.js (added)
-
tags/1.8.0/admin/js/i18n/id.js (added)
-
tags/1.8.0/admin/js/i18n/is.js (added)
-
tags/1.8.0/admin/js/i18n/it.js (added)
-
tags/1.8.0/admin/js/i18n/ja.js (added)
-
tags/1.8.0/admin/js/i18n/km.js (added)
-
tags/1.8.0/admin/js/i18n/ko.js (added)
-
tags/1.8.0/admin/js/i18n/lt.js (added)
-
tags/1.8.0/admin/js/i18n/lv.js (added)
-
tags/1.8.0/admin/js/i18n/mk.js (added)
-
tags/1.8.0/admin/js/i18n/ms.js (added)
-
tags/1.8.0/admin/js/i18n/nb.js (added)
-
tags/1.8.0/admin/js/i18n/nl.js (added)
-
tags/1.8.0/admin/js/i18n/pl.js (added)
-
tags/1.8.0/admin/js/i18n/ps.js (added)
-
tags/1.8.0/admin/js/i18n/pt-BR.js (added)
-
tags/1.8.0/admin/js/i18n/pt.js (added)
-
tags/1.8.0/admin/js/i18n/ro.js (added)
-
tags/1.8.0/admin/js/i18n/ru.js (added)
-
tags/1.8.0/admin/js/i18n/sk.js (added)
-
tags/1.8.0/admin/js/i18n/sl.js (added)
-
tags/1.8.0/admin/js/i18n/sr-Cyrl.js (added)
-
tags/1.8.0/admin/js/i18n/sr.js (added)
-
tags/1.8.0/admin/js/i18n/sv.js (added)
-
tags/1.8.0/admin/js/i18n/th.js (added)
-
tags/1.8.0/admin/js/i18n/tr.js (added)
-
tags/1.8.0/admin/js/i18n/uk.js (added)
-
tags/1.8.0/admin/js/i18n/vi.js (added)
-
tags/1.8.0/admin/js/i18n/zh-CN.js (added)
-
tags/1.8.0/admin/js/i18n/zh-TW.js (added)
-
tags/1.8.0/admin/js/select2.full.min.js (added)
-
tags/1.8.0/admin/js/select2.min.js (added)
-
tags/1.8.0/ars-constellation-client-portal.php (added)
-
tags/1.8.0/assets (added)
-
tags/1.8.0/assets/css (added)
-
tags/1.8.0/assets/css/font-awesome (added)
-
tags/1.8.0/assets/css/font-awesome/css (added)
-
tags/1.8.0/assets/css/font-awesome/css/all.css (added)
-
tags/1.8.0/assets/css/font-awesome/css/all.min.css (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-brands-400.eot (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-brands-400.svg (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-brands-400.ttf (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-brands-400.woff (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-brands-400.woff2 (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-regular-400.eot (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-regular-400.svg (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-regular-400.ttf (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-regular-400.woff (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-regular-400.woff2 (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-solid-900.eot (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-solid-900.svg (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-solid-900.ttf (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-solid-900.woff (added)
-
tags/1.8.0/assets/css/font-awesome/webfonts/fa-solid-900.woff2 (added)
-
tags/1.8.0/assets/img (added)
-
tags/1.8.0/assets/img/accp-full-logo.png (added)
-
tags/1.8.0/includes (added)
-
tags/1.8.0/includes/ars-constellation-client-portal-install-uninstall.php (added)
-
tags/1.8.0/includes/class-ars-constellation-client-portal-activator.php (added)
-
tags/1.8.0/includes/class-ars-constellation-client-portal-deactivator.php (added)
-
tags/1.8.0/includes/class-ars-constellation-client-portal-i18n.php (added)
-
tags/1.8.0/includes/class-ars-constellation-client-portal-loader.php (added)
-
tags/1.8.0/includes/class-ars-constellation-client-portal-utility-functions.php (added)
-
tags/1.8.0/includes/class-ars-constellation-client-portal.php (added)
-
tags/1.8.0/includes/index.php (added)
-
tags/1.8.0/index.php (added)
-
tags/1.8.0/languages (added)
-
tags/1.8.0/languages/ars-constellation-client-portal.pot (added)
-
tags/1.8.0/public (added)
-
tags/1.8.0/public/assets (added)
-
tags/1.8.0/public/assets/index.php (added)
-
tags/1.8.0/public/class-ars-constellation-client-portal-public.php (added)
-
tags/1.8.0/public/css (added)
-
tags/1.8.0/public/css/ars-constellation-client-portal-list-shortcode-styles.css (added)
-
tags/1.8.0/public/css/ars-constellation-client-portal-public.css (added)
-
tags/1.8.0/public/index.php (added)
-
tags/1.8.0/public/js (added)
-
tags/1.8.0/public/js/ars-constellation-client-portal-public.js (added)
-
tags/1.8.0/public/shortcodes (added)
-
tags/1.8.0/public/shortcodes/class-ars-constellation-client-portal-list-shortcodes.php (added)
-
tags/1.8.0/uninstall.php (added)
-
trunk/README.txt (modified) (7 diffs)
-
trunk/admin/class-ars-constellation-client-portal-admin.php (modified) (27 diffs)
-
trunk/admin/class-ars-constellation-client-portal-client-pages.php (modified) (2 diffs)
-
trunk/admin/class-ars-constellation-client-portal-company.php (modified) (3 diffs)
-
trunk/admin/class-ars-constellation-client-portal-core-authorization.php (modified) (1 diff)
-
trunk/admin/class-ars-constellation-client-portal-file.php (modified) (5 diffs)
-
trunk/admin/class-ars-constellation-client-portal-invoice.php (modified) (3 diffs)
-
trunk/admin/class-ars-constellation-client-portal-settings.php (modified) (5 diffs)
-
trunk/admin/css/ars-constellation-client-portal-admin.css (modified) (2 diffs)
-
trunk/admin/js/ars-constellation-client-portal-admin.js (modified) (10 diffs)
-
trunk/ars-constellation-client-portal.php (modified) (2 diffs)
-
trunk/public/shortcodes/class-ars-constellation-client-portal-list-shortcodes.php (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
constellation-client-portal/trunk/README.txt
r3030228 r3043713 5 5 Requires at least: 5.0.0 6 6 Tested up to: 6.4 7 Stable tag: 1. 7.67 Stable tag: 1.8.0 8 8 Requires PHP: 7.4 9 9 License: GPLv3 or later … … 12 12 == Description == 13 13 14 Turn your WordPress site into a professional client portal and streamline your operation. Create private pages for your clients, customers, and team members. Create private posts and attach private files (example: pdf, jpg, docx, xlsx, etc).14 Turn your WordPress site into a professional client portal. Create private pages and posts, and attach private files (example: pdf, jpg, docx, xlsx, etc.) for secure collaboration and document management. 15 15 16 16 Upgrade to the [Pro version](https://adrianrodriguezstudios.com/constellation-client-portal/?utm_source=wporg "Get Constellation Client Portal Pro") and integrate with WooCommerce to accept payments for invoices and services. 17 18 Streamline your operation and improve client satisfaction with Constellation Client Portal. 17 19 18 20 == Features == … … 42 44 * Export file and invoice lists to CSV. 43 45 * Create [global client pages](https://adrianrodriguezstudios.com/2023/05/16/how-to-utilize-global-pages/ "Client Portal Global Pages"). 46 * Create global client files that can be accessed by more than one company. 44 47 45 48 == Use Cases == … … 124 127 * **class** Accepted Values: any valid HTML class attribute name or names (separate multiple class names with a space). Default: null. 125 128 129 = Global Files (Pro) = 130 131 `[accp_global_files]` 126 132 127 133 = Company Menu (Pro) = … … 200 206 201 207 == Changelog == 208 = 1.8.0 (Pro) - 2024-3-1 = 209 * Update: Updated the CSV import functionality to add warnings to import logs if company id or file attachment data is missing or malformed. 210 * Update: Added new Global Files section to the plugin settings. 211 * Update: Updated the list shortcode settings to account for the new global files. 212 * Feature: Added functionality that allows for global file posts to be created and displayed via a new accp_global_files shortcode. 213 * Update: Updated the global page functionality to deny access if any published company that a user is assigned to contains a status other than "active." 214 * Fix: Fixed issue preventing notes from being deleted. 215 * Update: Updated the WP list table delete page permanent delete admin notice text. 216 * Update: Updated the functionality that generates taxonomy list column content to improve organization and maintainability. 217 * Update: Updated the WP list table filter query functionality for better organization and maintainability. 218 * Update: Updated the functionality that generates the post WP list table Category column content to improve organization and maintainability. 219 * Update: Updated the functionality that generates the post WP list table Company column content to improve organization and maintainability. 220 * Update: Updated the excluded user and excluded role WP list table column content functionality for better organization and maintainability. 221 * Update: Added new global file post type and associated taxonomies. 222 * Improvement: Improved the client page, client invoice, and client file meta save functionality. 223 * Improvement: Improved capability checks and sanitization for the excluded user and excluded role sections for pages and posts. 224 * Improvement: Updated the functionality that saves the accp_client_file_categories, accp_client_invoice_categories, and accp_client_page_categories exclude user and exclude role taxonomy meta data better organization and maintainability. 225 * Improvement: Updated the functionality that adds the exclude user and exclude role sections to the accp_client_file_categories, accp_client_invoice_categories, and accp_client_page_categories edit taxonomy page for better organization and maintainability. 226 * Improvement: Updated the functionality that adds the exclude user and exclude role sections to the accp_client_file_categories, accp_client_invoice_categories, and accp_client_page_categories add taxonomy form for better organization and maintainability. 227 228 = 1.8.0 (Core) - 2024-3-1 = 229 * Improvement: Improved the assign company directory settings instructions. 230 * Update: Updated the assign company dir functionality to prevent assigning the reserved "global-files" dir. 231 * Update: Updated the WP list table delete page permanent delete admin notice UI. 232 * Improvement: Updated the post bulk edit UI to provide better user feedback on button click. 233 * Fix: Removed functionality that automatically saves an 'unpaid' status to file posts if no value is saved. 234 202 235 = 1.7.6 (Pro) - 2024-2-1 = 203 236 * Update: Minor code formatting updates. … … 561 594 * Fix: Fixed issue preventing download of new files in the list after the recent code updates caused malformed paths. 562 595 * Update: Added functionality to flush the rewrite rules on plugin upgrade. 563 * NewFeature: Added excerpt support and functionality to the clientfile and accp_clientinvoice post types.596 * Feature: Added excerpt support and functionality to the clientfile and accp_clientinvoice post types. 564 597 * Update: Updated the the file and invoice shortcodes to pull from the excerpt field, instead of the content field, if excerpts are enabled. 565 598 * Improvement: Updated static references to WP dirs and updated functionality to get this data dynamically. … … 578 611 * Change: Updated the file output functionality. 579 612 * Change: Updated the file and invoice list shortcode CSS classes. 580 * NewFeature: Updated the invoice add-to-cart functionality to support simple and variable subscription products.613 * Feature: Updated the invoice add-to-cart functionality to support simple and variable subscription products. 581 614 * Improvement: Updated the admin invoice product select options to exclude variable products and subscriptions (not variations) since top-level variable products cannot be added to the cart. 582 615 * Improvement: Added additional options to the invoice status select field. -
constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-admin.php
r3030228 r3043713 48 48 $this->plugin_name = $plugin_name; 49 49 $this->version = $version; 50 $this->accp_utility_functions = new ACCP_Utility_Functions(); 50 $this->accp_utility_functions = new ACCP_Utility_Functions(); 51 $this->is_pro = $this->accp_utility_functions->is_pro_plugin($this->plugin_name); 51 52 52 53 /** … … 205 206 * If this is the Basic tier, serve the file here if the base checks passed. 206 207 */ 207 if( $this->plugin_name != 'ars-constellation-client-portal-pro'){208 if( true !== $this->is_pro ){ 208 209 209 210 if($base_checks == true){ … … 230 231 231 232 /** 232 * Proceed through Pro checks 233 * Proceed through Pro checks. 233 234 */ 234 235 … … 241 242 } 242 243 244 $pro_admin = new ARS_Constellation_Client_Portal_Pro_Admin($this->plugin_name, $this->version); 245 $is_global_files_dir = $pro_admin->check_if_uri_is_global_files_dir($request_uri); 243 246 $pro_check_class = new ARS_Constellation_Client_Portal_Pro_File_Checks(); 244 $pro_checks = $pro_check_class->accp_direct_file_access_pro_checks($request_uri); 245 246 if($base_checks == true && $pro_checks == true){ 247 248 $checks_passed = true; 247 $pro_checks = $pro_check_class->accp_direct_file_access_pro_checks($request_uri); 248 249 if( true === $is_global_files_dir ){ 249 250 250 251 /** 251 * Serve the requested file.252 * Global file checks. 252 253 */ 253 $this->accp_load_requested_file($request_uri, $checks_passed); 254 exit(); 254 $global_file_authorized = $pro_check_class->accp_direct_global_file_access_pro_checks($request_uri); 255 256 if( true === $global_file_authorized ){ 257 258 $checks_passed = true; 259 260 /** 261 * Serve the requested file. 262 */ 263 $this->accp_load_requested_file($request_uri, $checks_passed); 264 exit(); 265 266 }else{ 267 268 /** 269 * Redirect to the home page. 270 */ 271 wp_redirect('/'); 272 exit; 273 274 } 255 275 256 276 }else{ 257 277 258 278 /** 259 * Redirect to the home page.279 * Standard client file checks. 260 280 */ 261 wp_redirect('/'); 262 exit; 281 if($base_checks == true && $pro_checks == true){ 282 283 $checks_passed = true; 284 285 /** 286 * Serve the requested file. 287 */ 288 $this->accp_load_requested_file($request_uri, $checks_passed); 289 exit(); 290 291 }else{ 292 293 /** 294 * Redirect to the home page. 295 */ 296 wp_redirect('/'); 297 exit; 298 299 } 263 300 264 301 } … … 505 542 $post_type = $post->post_type; 506 543 $accp_file = get_post_meta($post_id, 'accp_file', true); 507 508 if($post_type != 'accp_clientcompany'){ 544 $included_post_types = array( 'accp_clientinvoice', 'accp_clientfile', 'accp_global_file' ); 545 546 if( in_array($post_type, $included_post_types) ){ 509 547 510 548 /** … … 545 583 546 584 /** 547 * If the post doesn't have file just delete the post.585 * If the post doesn't have a file just delete the post. 548 586 */ 549 587 wp_delete_post($post_id, true); … … 557 595 558 596 /** 559 * Remove any associated post notes if this if 560 * this is the Pro version. 597 * Remove any associated post notes if this is the Pro version. 561 598 */ 562 599 $this->accp_delete_post_notes_on_post_delete($post_id); … … 634 671 635 672 $file_ids = json_decode(stripslashes($_POST['del_file_post_id_json'])); // Sanitize in loop. 673 $included_post_types = array( 'accp_clientinvoice', 'accp_clientfile', 'accp_global_file' ); 636 674 637 675 if($file_ids != null && !empty($file_ids)){ … … 643 681 $post_type = $post->post_type; 644 682 $accp_file = get_post_meta($post_id, 'accp_file', true); 645 646 if($post_type !== 'accp_clientcompany'){ 683 684 685 if( in_array($post_id, $included_post_types) ){ 647 686 648 687 /** … … 816 855 817 856 /** 818 * Restrict access to Client Pages Client File and819 * Client Invoice Posts on front-end.857 * Restrict access to Client Pages, Client File and 858 * Client Invoice, and Global File posts on front-end. 820 859 */ 821 860 function accp_restrict_client_page_access(){ … … 834 873 835 874 /** 836 * Exit if this is not a Client Page, Client File, 875 * Exit if this is not a Client Page, Client File, Global File 837 876 * or Client Invoice post type. 838 877 */ 839 if( $post_type !== 'accp_client_pages' && $post_type !== 'accp_clientfile' && $post_type !== 'accp_clientinvoice' ) 878 if( $post_type !== 'accp_client_pages' && 879 $post_type !== 'accp_clientfile' && 880 $post_type !== 'accp_clientinvoice' && 881 $post_type !== 'accp_global_file' 882 ) 840 883 return; 841 884 … … 872 915 * Check if pro access checks need to be instantiated. 873 916 */ 874 if ( $this->plugin_name == 'ars-constellation-client-portal-pro' ){ 917 if ( $this->plugin_name == 'ars-constellation-client-portal-pro' ){ 875 918 876 919 $authorization = new ARS_Constellation_Client_Portal_Pro_Authorization( $this->plugin_name, $this->version ); 877 $check_authorization = $authorization->verify_page_or_post_authorization_pro($post_id, $user_id); 920 921 if( 'accp_global_file' !== $post_type ){ 922 923 $check_authorization = $authorization->verify_page_or_post_authorization_pro($post_id, $user_id); 924 925 }else{ 926 927 $check_authorization = $authorization->verify_global_file_post_authorization_pro($post_id, $user_id); 928 929 } 878 930 879 931 }else{ … … 994 1046 995 1047 global $post; 996 997 if( (get_post_type($post->ID) != 'accp_clientfile' && get_post_type($post->ID) != 'accp_clientinvoice') || !$post ) return; 1048 1049 if( !$post ) 1050 return; 1051 1052 $post_type = get_post_type($post->ID); 1053 1054 if( 'accp_clientfile' != $post_type && 'accp_clientinvoice' != $post_type && 'accp_global_file' != $post_type ) 1055 return; 998 1056 999 1057 $enctype = ' enctype=multipart/form-data'; // No need for double quotes. … … 1010 1068 1011 1069 $screens = array( 'accp_clientfile', 'accp_clientinvoice' ); 1070 1071 $is_pro = $this->accp_utility_functions->is_pro_plugin($this->plugin_name); 1072 1073 if( true === $is_pro ){ 1074 1075 $screens[] = 'accp_global_file'; 1076 1077 } 1012 1078 1013 1079 foreach ( $screens as $screen ) { 1014 1080 1015 add_meta_box('clientfile', __('Client File', ' ars-constellation-client-portal'), array($this, 'accp_client_file_meta_fields'), $screen, 'normal', 'high');1081 add_meta_box('clientfile', __('Client File', 'constellation-client-portal'), array($this, 'accp_client_file_meta_fields'), $screen, 'normal', 'high'); 1016 1082 1017 1083 } … … 1021 1087 1022 1088 /** 1023 * Client File meta boxes. 1089 * Client file meta boxes. 1090 * 1091 * Adds the file upload and current file UI. 1024 1092 */ 1025 1093 public function accp_client_file_meta_fields() { … … 1028 1096 1029 1097 $file_save_nonce = wp_create_nonce('accp_file_save_nonce'); 1030 $curr_post_id = get_the_id(); 1031 $accp_file = get_post_meta($curr_post_id, 'accp_file', true); 1032 $post_company = get_post_meta($curr_post_id, 'accp_user', true); 1033 $accp_clientfiles_full_dir_path = $this->accp_utility_functions->accp_get_clientfiles_path(); 1098 $post_id = $post->ID; 1099 $post_type = get_post_type($post_id); 1100 $accp_file = get_post_meta($post_id, 'accp_file', true); 1101 $post_company = get_post_meta($post_id, 'accp_user', true) ? get_post_meta($post_id, 'accp_user', true) : ''; 1102 $accp_clientfiles_full_dir_path = $this->accp_utility_functions->accp_get_clientfiles_path(); 1034 1103 1035 1104 ?> … … 1037 1106 <?php 1038 1107 1039 if ( !empty($accp_file) ): 1040 1041 $company_dir = $this->accp_get_company_dir($post_company); 1042 $accp_file_path = parse_url($accp_file['url'], PHP_URL_PATH); 1043 $accp_file_full_path = $accp_clientfiles_full_dir_path . '/' . $company_dir . '/' . basename($accp_file_path); 1108 if ( $accp_file && !empty($accp_file) ): 1109 1110 $company_dir = $post_company ? $this->accp_get_company_dir($post_company) : ''; 1111 $accp_file_path = parse_url($accp_file['url'], PHP_URL_PATH); 1112 1113 if( 'accp_clientinvoice' === $post_type || 'accp_clientfile' === $post_type ){ 1114 1115 $accp_file_full_path = $accp_clientfiles_full_dir_path . '/' . $company_dir . '/' . basename($accp_file_path); 1116 1117 }else{ 1118 1119 $accp_file_full_path = $accp_clientfiles_full_dir_path . '/global-files/' . basename($accp_file_path); 1120 1121 } 1122 1044 1123 1045 1124 /** … … 1051 1130 ?> 1052 1131 1053 <div id="curr_file_container" data-post-id="<?php echo esc_attr($ curr_post_id); ?>" data-file-path="<?php echo esc_attr($accp_file_full_path); ?>" data-assigned-company="<?php echo esc_attr($post_company); ?>">1132 <div id="curr_file_container" data-post-id="<?php echo esc_attr($post_id); ?>" data-file-path="<?php echo esc_attr($accp_file_full_path); ?>" data-assigned-company="<?php echo $post_company ? esc_attr($post_company) : 'global'; ?>"> 1054 1133 1055 1134 <p>Current File</p> … … 1111 1190 1112 1191 <?php 1113 if(!empty($post_company)){ 1192 /** 1193 * Exit if this is not a client invoice or 1194 * client file post type. 1195 */ 1196 if( 'accp_clientinvoice' != $post_type && 'accp_clientfile' != $post_type ) 1197 return; 1198 1199 if( !empty($post_company) ){ 1114 1200 1115 1201 echo '<p>Assigned Company</p>'; … … 1177 1263 <?php 1178 1264 1179 } 1265 } 1180 1266 1181 1267 … … 1691 1777 1692 1778 if(empty($new_company_dir)) 1693 die(); 1779 die(); 1780 1781 /** 1782 * Check for use of reserved "global-file" dir name. 1783 */ 1784 if( 'global-files' === strtolower($new_company_dir) || 1785 'global_files' === strtolower($new_company_dir) || 1786 'globalfiles' === strtolower($new_company_dir) || 1787 'global.files' === strtolower($new_company_dir) 1788 ){ 1789 1790 $note_content = 'The '.esc_html( strtolower($new_company_dir) ).' directory name is reserved and cannot be used. Please enter a different name.'; 1791 1792 $this->accp_add_directory_update_note($company_id, $note_content); 1793 1794 die(); 1795 1796 } 1694 1797 1695 1798 $new_company_path = $accp_clientfiles_full_dir_path . DIRECTORY_SEPARATOR . $new_company_dir; … … 1871 1974 return $post_id; 1872 1975 1873 } 1976 } 1874 1977 1875 if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)1978 if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) 1876 1979 return $post_id; 1877 1980 1878 if( $post_type !== 'accp_clientfile' && $post_type !== 'accp_clientinvoice' )1981 if( $post_type !== 'accp_clientfile' && $post_type !== 'accp_clientinvoice' && $post_type !== 'accp_global_file') 1879 1982 return $post_id; 1880 1983 1881 if( !is_user_logged_in())1984 if( !is_user_logged_in() ) 1882 1985 return wp_die('Invalid command.'); 1883 1986 1884 if(!current_user_can('upload_files'))1885 return $post_id;1886 1887 /**1888 * Add the company ID to the file post meta.1889 */1890 if(!$_POST['accp_user']) return $post_id;1891 1892 $company_post_data = $this->accp_utility_functions->accp_sanitize_integers($_POST['accp_user']);1893 $company = get_post( $company_post_data );1894 $company_id = $company->ID;1895 1896 update_post_meta($post_id, 'accp_user', $company_id);1897 1898 1987 if( !current_user_can('upload_files') ) 1899 1988 return $post_id; 1900 1989 1990 1991 /** 1992 * Add the company ID to the file post meta. 1993 */ 1994 if( 'accp_clientfile' === $post_type || 'accp_clientinvoice' === $post_type ){ 1995 1996 if( !$_POST['accp_user'] ) 1997 return $post_id; 1998 1999 $company_post_data = $this->accp_utility_functions->accp_sanitize_integers($_POST['accp_user']); 2000 $company = get_post( $company_post_data ); 2001 $company_id = $company->ID; 2002 2003 update_post_meta($post_id, 'accp_user', $company_id); 2004 2005 } 2006 1901 2007 1902 2008 /** … … 1925 2031 1926 2032 } 2033 1927 2034 1928 2035 /** … … 1949 2056 * Prep upload. 1950 2057 */ 1951 if( !empty($file_type_array['type'])){2058 if( !empty($file_type_array['type']) ){ 1952 2059 $upload = wp_handle_upload( $_FILES['accp_file'], array( 'test_form' => false ) ); 1953 2060 } … … 2022 2129 /** 2023 2130 * Configure custom upload directory for the 2024 * 'clientfile' and 'accp_clientinvoice' post types. 2131 * 'accp_clientfile' and 'accp_clientinvoice' post types. 2132 * 2133 * This sets the company-specific upload dir, and not 2134 * the global file upload dir. 2135 * 2136 * @param array $default_dir - Default uploads directory array. 2025 2137 * 2026 * Uses the 'upload_dir' WP filter. 2138 * @return array $custom_dir|$default_dir - Custom dir if customized, else $default_dir. 2139 * 2140 * @hooked upload_dir. 2027 2141 */ 2028 2142 function accp_set_upload_dir($default_dir){ … … 2765 2879 $screen->parent_file === 'edit.php?post_type=accp_clientfile' || 2766 2880 $screen->parent_file === 'edit.php?post_type=accp_clientinvoice' || 2767 $screen->parent_file === ' admin.php?page=accp-settings.php'2881 $screen->parent_file === 'edit.php?post_type=accp_global_file' 2768 2882 ){ 2769 2883 2884 /** 2885 * Add content to the clientfile trash page. 2886 */ 2887 if (strpos($_SERVER['REQUEST_URI'],'post_status=trash') !== false) { 2888 2770 2889 /** 2771 * Add content to the clientfile trash page.2890 * Add a nonce to the accp_clientfile trash header that can be used for ajax calls. 2772 2891 */ 2773 if (strpos($_SERVER['REQUEST_URI'],'post_status=trash') !== false) { 2774 2775 /** 2776 * Add a nonce to the accp_clientfile trash header that can be used for ajax calls. 2777 */ 2778 $clientfile_admin_nonce = wp_create_nonce('clientfile_admin_nonce'); 2779 2780 echo '<span id="clientfile-admin-nonce" data-nonce="' . esc_attr($clientfile_admin_nonce) . '" class="hidden"> </span>'; 2781 2782 /** 2783 * Add an admin notice on the trash page. 2784 */ 2785 if($screen->parent_file !== 'admin.php?page=accp-settings.php'){ 2786 echo '<span class="delete-screen-notice">Deleting posts on this screen will also delete any file attached to the post.</span>'; 2787 } 2892 $clientfile_admin_nonce = wp_create_nonce('clientfile_admin_nonce'); 2893 2894 echo wp_kses_post('<span id="clientfile-admin-nonce" data-nonce="' . esc_attr($clientfile_admin_nonce) . '" class="hidden"> </span>'); 2788 2895 2789 } 2896 /** 2897 * Add an admin notice on the trash page. 2898 */ 2899 $permanent_delete_notice = 'Deleting posts on this screen will also delete any file attached to the post.'; 2900 $permanent_delete_notice = apply_filters('accp_update_permanent_post_delete_notice', $permanent_delete_notice); 2901 2902 echo wp_kses_post('<div class="notice notice-error"><p>'.esc_html($permanent_delete_notice).'</p></div>'); 2903 2904 } 2790 2905 2791 2906 } … … 3347 3462 } 3348 3463 3464 3465 /** 3466 * Get the Company column content html. 3467 * 3468 * This generates the Company column content for post 3469 * (file, invoice, global file) WP list tables, and 3470 * not for taxonomy lists. 3471 * 3472 * @param string $column_name - The column name slug. 3473 * @param int $post_id - The post ID. 3474 * 3475 * @return string $html - The column content html. 3476 */ 3477 function get_company_column_content_for_post_lists($column_name, $post_id){ 3478 3479 if( !is_admin() || !is_user_logged_in() || !current_user_can('manage_options') ) 3480 return; 3481 3482 if ( 'company' != $column_name ) 3483 return; 3484 3485 $company_id = get_post_meta($post_id, 'accp_user', true) ? get_post_meta($post_id, 'accp_user', true) : ''; 3486 3487 if( !$company_id || empty($company_id) ) 3488 return; 3489 3490 $company_name = get_the_title($company_id) ? get_the_title($company_id) : ''; 3491 3492 $html = ''; 3493 3494 $html .= $company_name; 3495 3496 /** 3497 * If a file exists, output the file path data that 3498 * is used when deleting posts. 3499 */ 3500 $accp_file = get_post_meta($post_id, 'accp_file', true); 3501 3502 if ( !empty($accp_file) && isset($accp_file['url']) ) { 3503 3504 $accp_file_path = parse_url($accp_file['url'], PHP_URL_PATH); 3505 $accp_file_full_path = untrailingslashit( get_home_path() ) . $accp_file_path; 3506 $accp_del_nonce = wp_create_nonce('post_delete_file_nonce'); 3507 3508 $html .= '<span class="data-path-container hidden" data-file-path="' . esc_url($accp_file_full_path) . '" data-nonce="' . esc_attr($accp_del_nonce) . '"></span>'; 3509 3510 } 3511 3512 echo wp_kses_post($html); 3513 3514 } 3515 3516 3517 /** 3518 * Get the Category column content html. 3519 * 3520 * This generates the Category column content for post 3521 * (file, invoice, client page, global file, etc) WP list tables, 3522 * and not for taxonomy lists. 3523 * 3524 * @param string $column_name - The column name slug. 3525 * @param int $post_id - The post ID. 3526 * 3527 * @return string $html - The column content html. 3528 */ 3529 function get_category_column_content_for_post_lists($column_name, $post_id){ 3530 3531 if( !is_admin() || !is_user_logged_in() || !current_user_can('manage_options') ) 3532 return; 3533 3534 if ( 'file_category' != $column_name ) 3535 return; 3536 3537 $post_type = get_post_type($post_id); 3538 3539 if(!$post_type) 3540 return; 3541 3542 $category_slug = ''; 3543 3544 if( 'accp_clientinvoice' === $post_type ){ 3545 3546 $category_slug = 'accp_invoice_categories'; 3547 3548 } 3549 3550 if( 'accp_clientfile' === $post_type ){ 3551 3552 $category_slug = 'accp_file_categories'; 3553 3554 } 3555 3556 if( 'accp_client_pages' === $post_type ){ 3557 3558 $category_slug = 'accp_client_page_categories'; 3559 3560 } 3561 3562 if( 'accp_global_file' === $post_type ){ 3563 3564 $category_slug = 'accp_global_file_categories'; 3565 3566 } 3567 3568 if(empty($category_slug)) 3569 return; 3570 3571 $terms = get_the_terms( $post_id, $category_slug ); 3572 3573 if ( $terms && !is_wp_error( $terms ) ){ 3574 3575 $categories = array(); 3576 3577 foreach ( $terms as $term ) { 3578 3579 $categories[] = $term->name; 3580 3581 } 3582 3583 $category_list = join( ", ", $categories ); 3584 3585 echo esc_html($category_list); 3586 3587 } 3588 3589 } 3590 3349 3591 } //End ARS_Constellation_Client_Portal_Admin Class -
constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-client-pages.php
r3004306 r3043713 47 47 $this->version = $version; 48 48 $this->utilities = new ACCP_Utility_Functions($this->plugin_name, $this->version); 49 $this->admin = new ARS_Constellation_Client_Portal_Admin($this->plugin_name, $this->version); 49 50 50 51 if( class_exists('ARS_Constellation_Client_Portal_Pro_Admin') ){ … … 294 295 * @param int $post_id - The post ID of the Client Page. 295 296 */ 296 public function accp_client_pages_column_display_company_name( $column_name, $post_id ) { 297 public function accp_client_pages_column_display_company_name( $column_name, $post_id ) { 298 299 if( !is_admin() || !is_user_logged_in() || !current_user_can('manage_options') ) 300 return; 297 301 298 302 /** -
constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-company.php
r3030228 r3043713 967 967 $generate_dir_text = 'Uploading a new file and selecting this company will also automatically generate a company directory. So creating a directory here is <strong>not required</strong>.'; 968 968 969 $specify_dir_text = 'If you have already created a directory for this company on the server, you can specify the directory name here. Uploading a new file and selecting this company will also automatically generate a company directory. So specifying a directory here is <strong>not required</strong>.';969 $specify_dir_text = 'If you have already manually created a directory for this company on the server, you can specify the directory name here. Uploading a new file and selecting this company will also automatically generate a company directory. So specifying a directory here is <strong>not required</strong>.'; 970 970 971 971 $dir_assigned_class = ''; … … 1051 1051 ?> 1052 1052 1053 <?php echo esc_html($truncated_path . '/'); ?><input type="text" id="accp-specify-dir-name" name="accp_specify_dir_name" value=""> <span class="accp-field-note">Letters, numbers, underscores, or hyphens only. </span>1053 <?php echo esc_html($truncated_path . '/'); ?><input type="text" id="accp-specify-dir-name" name="accp_specify_dir_name" value=""> <span class="accp-field-note">Letters, numbers, underscores, or hyphens only. The "global-files" name is reserved and cannot be used.</span> 1054 1054 1055 1055 <input class="button" data-nonce="<?php echo esc_attr($generate_nonce); ?>" data-post-id="<?php echo esc_attr($id); ?>" type="submit" value="Assign Directory" id="accp-assign-dir-btn" /> … … 1065 1065 1066 1066 } 1067 1067 1068 1068 1069 /** -
constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-core-authorization.php
r2920206 r3043713 421 421 422 422 423 /** 424 * Check if this is a Global File post 425 * (Global File posts only), and return authorization. 426 * 427 * @param int $post_id - the ID of the Client File post. 428 * 429 * @return bool $is_global_file - true if this is a global file. 430 */ 431 function is_global_file_post($post_id){ 432 433 if(!$post_id) 434 return false; 435 436 $post = get_post($post_id); 437 438 if(!$post) 439 return false; 440 441 $post_type = $post->post_type; 442 443 /** 444 * Return false if the post type is not "accp_client_pages." 445 */ 446 if( !$post_type || $post_type != 'accp_global_file' ) 447 return false; 448 449 if( 'accp_global_file' === $post_type ) 450 return true; 451 452 return false; 453 454 } 455 456 423 457 } // END ARS_Constellation_Client_Portal_Core_Authorization -
constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-file.php
r3004306 r3043713 47 47 $this->version = $version; 48 48 $this->utilities = new ACCP_Utility_Functions($this->plugin_name, $this->version); 49 $this->admin = new ARS_Constellation_Client_Portal_Admin($this->plugin_name, $this->version); 49 50 50 51 if( class_exists('ARS_Constellation_Client_Portal_Pro_Admin') ){ … … 272 273 * Display the Company column content in the Client File WP List Table. 273 274 */ 274 function clientfile_column_display_company_name( $column_name, $post_id ) { 275 276 if ( 'company' != $column_name ) 277 return; 278 279 if( get_post_meta($post_id, 'accp_user', true) ){ 280 281 $company_id = get_post_meta($post_id, 'accp_user', true); 282 283 if($company_id != $post_id){ 284 285 $company = get_the_title($company_id); 286 287 }else{ 288 289 $company = null; 290 291 } 292 293 if($company != null){ 294 295 /** 296 * Display the company name. 297 */ 298 echo esc_html($company); 299 300 /** 301 * If a file exists, output the file path data that 302 * is used when deleting posts. 303 */ 304 $accp_file = get_post_meta($post_id, 'accp_file', true); 305 306 if ( !empty($accp_file) && isset($accp_file['url']) ) { 307 308 $accp_file_path = parse_url($accp_file['url'], PHP_URL_PATH); 309 $accp_file_full_path = untrailingslashit( get_home_path() ) . $accp_file_path; 310 $accp_del_nonce = wp_create_nonce('post_delete_file_nonce'); 311 312 echo '<span class="data-path-container hidden" data-file-path="' . esc_url($accp_file_full_path) . '" data-nonce="' . esc_attr($accp_del_nonce) . '"></span>'; 313 314 } 315 316 317 } 318 319 } 275 function clientfile_column_display_company_name( $column_name, $post_id ) { 276 277 $this->admin->get_company_column_content_for_post_lists($column_name, $post_id); 320 278 321 279 } … … 359 317 function clientfile_column_display_category( $column_name, $post_id ) { 360 318 361 if ( 'file_category' != $column_name ) 362 return; 363 364 $id = get_the_ID(); 365 366 $terms = get_the_terms( $id, 'accp_file_categories' ); 367 368 if ( $terms && ! is_wp_error( $terms ) ){ 369 370 $file_cats = array(); 371 372 foreach ( $terms as $term ) { 373 $file_cats[] = $term->name; 374 } 375 376 $file_cat_list = join( ", ", $file_cats ); 377 378 echo esc_html($file_cat_list); 379 380 } 319 $this->admin->get_category_column_content_for_post_lists($column_name, $post_id); 381 320 382 321 } … … 501 440 * Company Filter 502 441 */ 503 if ( $pagenow =='edit.php' && isset($_GET['accp_file_company_filter']) && $_GET['accp_file_company_filter'] != '' && $query->is_main_query() ) {442 if ( $pagenow == 'edit.php' && isset($_GET['accp_file_company_filter']) && $_GET['accp_file_company_filter'] != '' && $query->is_main_query() ) { 504 443 505 444 $query->query_vars['meta_key'] = 'accp_user'; … … 573 512 global $post; 574 513 575 $saved_status = get_post_meta($post->ID, 'file_status', true); 576 577 /** 578 * If there is no saved status, set the invoice 579 * status to the default - 'unpaid.' 580 */ 581 if(is_object($post) && !$saved_status){ 582 update_post_meta($post->ID, 'invoice_status', 'unpaid'); 583 } 584 514 $saved_status = get_post_meta($post->ID, 'file_status', true); 585 515 $defined_statuses = $this->accp_get_defined_file_statuses(); 586 516 -
constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-invoice.php
r3004306 r3043713 47 47 $this->version = $version; 48 48 $this->utilities = new ACCP_Utility_Functions($this->plugin_name, $this->version); 49 $this->admin = new ARS_Constellation_Client_Portal_Admin($this->plugin_name, $this->version); 49 50 50 51 if( class_exists('ARS_Constellation_Client_Portal_Pro_Admin') ){ … … 276 277 function accp_clientinvoice_column_display_company_name( $column_name, $post_id ) { 277 278 278 if ( 'company' != $column_name ) 279 return; 280 281 if( get_post_meta($post_id, 'accp_user', true) ){ 282 283 $company_id = get_post_meta($post_id, 'accp_user', true); 284 285 if($company_id != $post_id){ 286 287 $company = get_the_title($company_id); 288 289 }else{ 290 291 $company = null; 292 293 } 294 295 if($company != null){ 296 297 /** 298 * Display the company name. 299 */ 300 echo esc_html($company); 301 302 /** 303 * If a file exists, output the file path data that 304 * is used when deleting posts. 305 */ 306 $accp_file = get_post_meta($post_id, 'accp_file', true); 307 308 if ( !empty($accp_file) && isset($accp_file['url']) ) { 309 310 $accp_file_path = parse_url($accp_file['url'], PHP_URL_PATH); 311 $accp_file_full_path = untrailingslashit( get_home_path() ) . $accp_file_path; 312 $accp_del_nonce = wp_create_nonce('post_delete_file_nonce'); 313 314 echo '<span class="data-path-container hidden" data-file-path="' . esc_url($accp_file_full_path) . '" data-nonce="' . esc_attr($accp_del_nonce) . '"></span>'; 315 316 } 317 318 319 } 320 321 } 279 $this->admin->get_company_column_content_for_post_lists($column_name, $post_id); 322 280 323 281 } … … 360 318 function accp_clientinvoice_column_display_categories( $column_name, $post_id ) { 361 319 362 if ( 'file_category' != $column_name ) 363 return; 364 365 $id = get_the_ID(); 366 367 $terms = get_the_terms( $id, 'accp_invoice_categories' ); 368 369 if ( $terms && ! is_wp_error( $terms ) ){ 370 371 $file_cats = array(); 372 373 foreach ( $terms as $term ) { 374 $file_cats[] = $term->name; 375 } 376 377 $file_cat_list = join( ", ", $file_cats ); 378 379 echo esc_html($file_cat_list); 380 381 } 320 $this->admin->get_category_column_content_for_post_lists($column_name, $post_id); 382 321 383 322 } -
constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-settings.php
r3004306 r3043713 358 358 359 359 360 /** 361 * File settings page content. 362 */ 360 363 function get_file_settings_page_content(){ 361 364 … … 388 391 389 392 393 /** 394 * Global File settings page content. 395 */ 396 function get_global_file_settings_page_content(){ 397 398 if( !is_admin() || !is_user_logged_in() || !current_user_can('manage_options') ) 399 return; 400 401 $allowed_html = $this->get_customized_allowed_html_for_wp_kses(); 402 $is_pro = $this->utilities->is_pro_plugin($this->plugin_name); 403 $html = ''; 404 405 /** 406 * Section html filter. 407 */ 408 if( true === $is_pro ){ 409 410 $html = apply_filters('accp_global_file_settings_page_section_html', $html); 411 412 } 413 414 if( !empty($html) ){ 415 416 $form_action = 'options.php'; 417 $instatiate_wp_settings = 'accp-global-file-settings-group'; 418 419 echo wp_kses( $this->generate_settings_page_html($html, true, true, $form_action, $instatiate_wp_settings), $allowed_html ); 420 421 } 422 423 } 424 425 426 /** 427 * Client Page settings page content. 428 */ 390 429 function get_client_page_settings_page_content(){ 391 430 … … 785 824 $p_class = 'accp-function-error'; 786 825 $dir_writable_message = 'Error: Your file directory is not writable. Your file uploads will not work until this issue is resolved. If you have not yet created a File or Invoice post and uploaded a file, this may be the problem. Create a test File post and attach a file to it. This will create the accp-clientfiles upload directory. If this notice is still visable after you have done that, please contact your administrator for more information.'; 826 787 827 } 788 828 … … 898 938 $page_list['accp-invoice-settings'] = 'Invoices'; 899 939 $page_list['accp-file-settings'] = 'Files'; 940 $page_list['accp-global-file-settings'] = 'Global Files'; 900 941 $page_list['accp-client-page-settings'] = 'Client Pages'; 901 942 $page_list['accp-company-settings'] = 'Companies'; … … 1154 1195 'data-term-slug' => array(), 1155 1196 'step' => array(), 1156 'maxlength' => array(), 1197 'maxlength' => array(), 1198 'data-post-type' => array(), 1157 1199 ); 1158 1200 -
constellation-client-portal/trunk/admin/css/ars-constellation-client-portal-admin.css
r2973972 r3043713 106 106 } 107 107 108 .tax-company-exclude{ 109 margin-bottom: 15px; 110 } 111 108 112 .tax-user-exclude .select2, 109 113 .tax-role-exclude .select2, 114 .tax-company-exclude .select2, 110 115 .tax-custom-select .select2 { 111 116 width: 95% !important; … … 730 735 } 731 736 732 .accp-spinner.spinner {737 .accp-spinner.spinner{ 733 738 margin-top: 20px; 739 } 740 741 .accp-spinner.spinner.accp-spinner-after-bulk-edit{ 742 margin-top: 0px; 734 743 } 735 744 -
constellation-client-portal/trunk/admin/js/ars-constellation-client-portal-admin.js
r3004306 r3043713 11 11 $('table a.submitdelete').click(function (e) { 12 12 13 if (window.location.href.indexOf("post_status=trash&post_type=accp_clientfile") > -1 || window.location.href.indexOf("post_status=trash&post_type=accp_clientinvoice") > -1 ) { 13 if( window.location.href.indexOf("post_status=trash&post_type=accp_clientfile") > -1 || 14 window.location.href.indexOf("post_status=trash&post_type=accp_clientinvoice") > -1 || 15 window.location.href.indexOf("post_status=trash&post_type=accp_global_file") > -1 16 ){ 14 17 15 18 var file_del_nonce = $('#clientfile-admin-nonce').attr('data-nonce'); … … 47 50 48 51 }); 49 50 // Add a notice to the accp_clientfile delete WP List Table 51 /* if (window.location.href.indexOf("post_status=trash&post_type=accp_clientfile") > -1) { 52 $('<span class="delete-screen-notice">Deleting posts on this screen will also delete any file attached to the post</span>').insertAfter('input#delete_all'); 53 } */ 52 54 53 55 54 /** … … 64 63 ( 65 64 window.location.href.indexOf("post_status=trash&post_type=accp_clientfile") > -1 || 66 window.location.href.indexOf("post_status=trash&post_type=accp_clientinvoice") > -1 65 window.location.href.indexOf("post_status=trash&post_type=accp_clientinvoice") > -1 || 66 window.location.href.indexOf("post_status=trash&post_type=accp_global_file") > -1 67 67 ) && 68 68 $('#bulk-action-selector-top').val() == 'delete' … … 116 116 $('#delete_all').click(function (e) { 117 117 118 if (window.location.href.indexOf("post_status=trash&post_type=accp_clientfile") > -1 || window.location.href.indexOf("post_status=trash&post_type=accp_clientinvoice") > -1 ) {118 if (window.location.href.indexOf("post_status=trash&post_type=accp_clientfile") > -1 || window.location.href.indexOf("post_status=trash&post_type=accp_clientinvoice") > -1 || window.location.href.indexOf("post_status=trash&post_type=accp_global_file") > -1 ) { 119 119 120 120 e.preventDefault(); … … 124 124 if(window.location.href.indexOf("post_status=trash&post_type=accp_clientfile") > -1){ 125 125 var post_type = 'accp_clientfile'; 126 } 127 128 if(window.location.href.indexOf("post_status=trash&post_type=accp_global_file") > -1){ 129 var post_type = 'accp_global_file'; 126 130 } 127 131 … … 291 295 var generate_nonce = $('#accp-generate-dir-btn').attr('data-nonce'); 292 296 var dir_name = $('#accp-specify-dir-name').val(); 297 298 if( 'global-files' === dir_name.toLowerCase().replace(/\s/g, '') || 299 'globalfiles' === dir_name.toLowerCase().replace(/\s/g, '') || 300 'global_files' === dir_name.toLowerCase().replace(/\s/g, '') || 301 'global.files' === dir_name.toLowerCase().replace(/\s/g, '') 302 ){ 303 304 alert('The '+dir_name.toLowerCase().replace(/\s/g, '')+' directory name is reserved and cannot be used. Please enter a different name.'); 305 306 return; 307 308 } 309 293 310 var spinner_elem = '<span class="accp-dir-assign-spinner spinner" style="float: none;"></span>'; 294 295 311 var move_files = ''; 296 312 var update_links = ''; … … 512 528 513 529 }, 514 success: function(data){ 515 516 //dev 517 console.log(data); 530 success: function(data){ 518 531 519 532 try { … … 717 730 }); 718 731 719 $('#bulk_edit').on( 'click', function() { 720 721 if( $('#invoice-status-bulk-edit-select').length ){ 722 723 var post_ids = new Array(); 724 var invoice_status = $('#invoice-status-bulk-edit-select').val(); 725 var nonce = $('#accp-invoice-bulk-edit-section').attr('data-nonce'); 726 727 $( 'tr#bulk-edit ul#bulk-titles-list li button' ).each( function() { 728 post_ids.push( $( this ).attr( 'id' ).replace( /^(_)/i, '' ) ); 729 }); 730 731 if(invoice_status != "-1"){ 732 733 $.ajax({ 734 url: ajaxurl, 735 type: 'POST', 736 async: false, 737 data: { 738 action: 'accp_save_invoice_bulk_edit', 739 post_ids: post_ids, 740 invoice_status: invoice_status, 741 nonce: nonce 742 }, 743 success: function(data){ 744 745 746 }, 747 error: function(jqXHR, textStatus, errorThrown){ 748 console.log(textStatus, errorThrown); 749 console.log(jqXHR); 750 }, 751 752 }); 753 754 } 755 756 757 } 758 759 }); 760 761 762 $('#bulk_edit').on( 'click', function() { 763 764 if( $('#file-status-bulk-edit-select').length ){ 732 $('#bulk_edit').on( 'click', function(e) { 733 734 accp_save_invoice_bulk_edit(e); 735 736 accp_save_file_bulk_edit(e); 737 738 accp_save_global_file_bulk_edit(e); 739 740 }); 741 742 743 }); // End document ready 744 745 746 function accp_save_invoice_bulk_edit(e){ 747 748 if( $('#invoice-status-bulk-edit-select').length ){ 749 750 /** 751 * Disable pointer events instead of setting 752 * a "disabled" property to allow native WP 753 * post data to be saved normally. 754 */ 755 accp_disable_pointer_events_by_event_target(e); 756 accp_add_and_show_status_spinner_after_bulk_add_buttons(e); 757 758 var post_ids = new Array(); 759 var invoice_status = $('#invoice-status-bulk-edit-select').val(); 760 var nonce = $('#accp-invoice-bulk-edit-section').attr('data-nonce'); 761 762 $( 'tr#bulk-edit ul#bulk-titles-list li button' ).each( function() { 763 post_ids.push( $( this ).attr( 'id' ).replace( /^(_)/i, '' ) ); 764 }); 765 766 if(invoice_status != "-1"){ 767 768 $.ajax({ 769 url: ajaxurl, 770 type: 'POST', 771 async: false, 772 data: { 773 action: 'accp_save_invoice_bulk_edit', 774 post_ids: post_ids, 775 invoice_status: invoice_status, 776 nonce: nonce 777 }, 778 success: function(data){ 779 780 781 }, 782 error: function(jqXHR, textStatus, errorThrown){ 783 784 accp_reset_pointer_events_by_selector('#bulk-edit'); 785 $('.accp-spinner-after-bulk-edit').remove(); 786 787 console.log(textStatus, errorThrown); 788 console.log(jqXHR); 789 }, 790 791 }); 792 793 } 794 795 } 796 797 } 798 799 function accp_save_file_bulk_edit(e){ 800 801 if( $('#file-status-bulk-edit-select').length ){ 802 803 /** 804 * Disable pointer events instead of setting 805 * a "disabled" property to allow native WP 806 * post data to be saved normally. 807 */ 808 accp_disable_pointer_events_by_event_target(e); 809 accp_add_and_show_status_spinner_after_bulk_add_buttons(e); 765 810 766 var post_ids = new Array(); 767 var file_status = $('#file-status-bulk-edit-select').val(); 768 var nonce = $('#accp-file-bulk-edit-section').attr('data-nonce'); 769 770 $( 'tr#bulk-edit ul#bulk-titles-list li button' ).each( function() { 771 post_ids.push( $( this ).attr( 'id' ).replace( /^(_)/i, '' ) ); 772 }); 773 774 console.log(post_ids); 775 776 if(file_status != "-1"){ 777 778 $.ajax({ 779 url: ajaxurl, 780 type: 'POST', 781 async: false, 782 data: { 783 action: 'accp_save_file_bulk_edit', 784 post_ids: post_ids, 785 file_status: file_status, 786 nonce: nonce 787 }, 788 success: function(data){ 789 790 console.log(data); 791 }, 792 error: function(jqXHR, textStatus, errorThrown){ 793 console.log(textStatus, errorThrown); 794 console.log(jqXHR); 795 }, 796 797 }); 798 799 } 800 801 802 } 803 804 }); 805 806 }); // End document ready 811 var post_ids = new Array(); 812 var file_status = $('#file-status-bulk-edit-select').val(); 813 var nonce = $('#accp-file-bulk-edit-section').attr('data-nonce'); 814 815 $( 'tr#bulk-edit ul#bulk-titles-list li button' ).each( function() { 816 post_ids.push( $( this ).attr( 'id' ).replace( /^(_)/i, '' ) ); 817 }); 818 819 if(file_status != "-1"){ 820 821 $.ajax({ 822 url: ajaxurl, 823 type: 'POST', 824 async: false, 825 data: { 826 action: 'accp_save_file_bulk_edit', 827 post_ids: post_ids, 828 file_status: file_status, 829 nonce: nonce 830 }, 831 success: function(data){ 832 833 834 }, 835 error: function(jqXHR, textStatus, errorThrown){ 836 837 accp_reset_pointer_events_by_selector('#bulk-edit'); 838 $('.accp-spinner-after-bulk-edit').remove(); 839 840 console.log(textStatus, errorThrown); 841 console.log(jqXHR); 842 }, 843 844 }); 845 846 } 847 848 } 849 850 } 851 852 853 function accp_save_global_file_bulk_edit(e){ 854 855 if( $('#global-file-status-bulk-edit-select').length ){ 856 857 /** 858 * Disable pointer events instead of setting 859 * a "disabled" property to allow native WP 860 * post data to be saved normally. 861 */ 862 accp_disable_pointer_events_by_event_target(e); 863 accp_add_and_show_status_spinner_after_bulk_add_buttons(e); 864 865 var post_ids = new Array(); 866 var file_status = $('#global-file-status-bulk-edit-select').val(); 867 var nonce = $('#accp-file-bulk-edit-section').attr('data-nonce'); 868 869 $( 'tr#bulk-edit ul#bulk-titles-list li button' ).each( function() { 870 post_ids.push( $( this ).attr( 'id' ).replace( /^(_)/i, '' ) ); 871 }); 872 873 if(file_status != "-1"){ 874 875 $.ajax({ 876 url: ajaxurl, 877 type: 'POST', 878 async: false, 879 data: { 880 action: 'accp_save_global_file_bulk_edit', 881 post_ids: post_ids, 882 file_status: file_status, 883 nonce: nonce 884 }, 885 success: function(data){ 886 887 888 889 }, 890 error: function(jqXHR, textStatus, errorThrown){ 891 892 accp_reset_pointer_events_by_selector('#bulk-edit'); 893 $('.accp-spinner-after-bulk-edit').remove(); 894 895 console.log(textStatus, errorThrown); 896 console.log(jqXHR); 897 }, 898 899 }); 900 901 } 902 903 } 904 905 } 807 906 808 907 … … 860 959 861 960 862 function accp_admin_tab_click_actions(){863 864 $(document).on('click','ul.accp-settings-tabs li', function() {865 866 // Change the tab menu display867 $('ul.accp-settings-tabs li').removeAttr('data-tab-status');868 $(this).attr('data-tab-status', 'active');869 870 // Display the active tab871 var active_id = $(this).attr('data-tab-id');872 var active_tab = $('.accp-settings-tab[data-tab-id="' + active_id + '"]');873 874 // Remove active status from all other tabs875 $('.accp-settings-tab').removeAttr('data-tab-content-status');876 877 // Make the new tab active878 $(active_tab).attr('data-tab-content-status', 'active');879 880 });881 882 }883 884 function accp_admin_load_last_active_tab_on_load(){885 886 if($('ul.accp-settings-tabs li').length > -1){887 888 var url = document.location.toString();889 890 if (url.match('#')) {891 892 var active_id = url.split('#')[1];893 894 // Change the tab menu display895 $('ul.accp-settings-tabs li').removeAttr('data-tab-status');896 $('[data-tab-id = '+ active_id +' ]').attr('data-tab-status', 'active');897 898 var active_id = $('[data-tab-id = '+ active_id +' ]').attr('data-tab-id');899 var active_tab = $('.accp-settings-tab[data-tab-id="' + active_id + '"]');900 901 // Remove active status from all other tabs902 $('.accp-settings-tab').removeAttr('data-tab-content-status');903 904 // Make the new tab active905 $(active_tab).attr('data-tab-content-status', 'active');906 907 }908 909 }910 911 }912 913 961 function accp_add_and_show_status_spinner(e){ 914 962 … … 922 970 923 971 return new_spinner_class; 972 973 } 974 975 976 function accp_add_and_show_status_spinner_after_bulk_add_buttons(e){ 977 978 var target_elem = e.target.closest('.submit.inline-edit-save'); 979 var unique_class = 'accp-' + Math.random().toString(36).slice(2) + '-spinner'; 980 var spinner_elem = '<span class="'+unique_class+' accp-spinner spinner accp-spinner-after-bulk-edit" style="float: none;"></span>'; 981 var new_spinner_class = '.' + unique_class + '.accp-spinner.spinner'; 982 983 $(spinner_elem).appendTo(target_elem); 984 $(new_spinner_class).css('visibility', 'visible'); 985 986 return new_spinner_class; 987 988 } 989 990 991 function accp_disable_element_by_event_target(e){ 992 993 var target_elem = e.target; 994 995 $(target_elem).prop('disabled', true); 996 997 } 998 999 1000 function accp_disable_pointer_events_by_event_target(e){ 1001 1002 var target_elem = e.target; 1003 1004 $(target_elem).attr('style', 'pointer-events: none;'); 1005 1006 } 1007 1008 function accp_reset_pointer_events_by_selector(selector){ 1009 1010 $(selector).attr('style', 'pointer-events: all;'); 1011 1012 } 1013 1014 1015 function accp_remove_disabled_prop_from_element(selector){ 1016 1017 $(selector).prop('disabled', false); 924 1018 925 1019 } -
constellation-client-portal/trunk/ars-constellation-client-portal.php
r3030228 r3043713 5 5 * Plugin URI: https://adrianrodriguezstudios.com/constellation-client-portal/ 6 6 * Description: Create private pages for each of your clients, post private files, and protect your client files from unauthorized users and search engines. <strong>Important:</strong> All Site-level File Protection features will cease to function if the plugin is disabled or uninstalled. 7 * Version: 1. 7.67 * Version: 1.8.0 8 8 * Author: ARS 9 9 * Author URI: https://adrianrodriguezstudios.com … … 55 55 */ 56 56 define('ACCP_PLUGIN_NAME', 'ARS_CONSTELLATION_CLIENT_PORTAL'); 57 define('ACCP_PLUGIN_VERSION', '1. 7.6'); // Change the version in the header as well.57 define('ACCP_PLUGIN_VERSION', '1.8.0'); // Change the version in the header as well. 58 58 define( ACCP_PLUGIN_NAME, ACCP_PLUGIN_VERSION ); 59 59 define('ACCP_PLUGIN_FILE_NAME', __FILE__); -
constellation-client-portal/trunk/public/shortcodes/class-ars-constellation-client-portal-list-shortcodes.php
r3018869 r3043713 113 113 114 114 /** 115 * Generate the shortcode content .115 * Generate the shortcode content (for non-global shortcodes). 116 116 * 117 117 * @param array $atts - array of atts passed in via the shortcode. … … 150 150 if( false === $authorized_company_id || !$authorized_company_id ) 151 151 return; 152 152 153 153 154 154 /** … … 163 163 $atts = shortcode_atts( $this->get_clientfile_core_shortcode_atts(), $atts ); 164 164 165 } 165 } 166 166 167 167 … … 452 452 return apply_filters( 'accp_update_invoice_atts_array', $atts ); 453 453 454 } 454 } 455 456 457 /** 458 * Get the core atts for the global_file shortcode. 459 * 460 * @return array $atts - array of defined shortcode atts. 461 */ 462 function get_global_file_core_shortcode_atts(){ 463 464 $atts = array( 465 'id' => '', // This is reserved and is for internal use only. 466 'css_id' => '', // Optional ID for the accp_documents_filelist list div. Defaults to null. 467 'class' => '', // Optional additional class(es) for the accp_documents_filelist list div. Defaults to null. 468 'categories' => '', // Category atts can be entered as the Slug or ID in the shortcode 469 'file_status' => '', // File status to show - file status slug or null. Defaults to null. 470 'display_number' => '', // This is the number of posts per page 471 'order_by' => '', // This allows ordering by post title - default is post date - options "title" or "date" 472 'order' => '', // This can be set as ASC or DESC - default is DESC 473 'show_excerpt' => '', // Displays truncated text from the post content field 474 'show_thumbnail' => '', // Displays the posts featured image in the loop 475 'excerpt_length' => '', // Accepts the number of words for the excerpt 476 'thumbnail_size' => '', // Enter the thumbnail slug defined in the theme 477 'align_thumbnail' => '', // center, left, right, float-left, float-right 478 'show_post_date' => '', // Display the post date - default is false 479 'list_id' => '', // Integer - Useful when there are multiple shortcode lists on the same page - default is null 480 'link_title' => '' // nolink or empty. Used to disable post link titles - default is null. 481 ); 482 483 return apply_filters( 'accp_update_global_file_atts_array', $atts ); 484 485 } 455 486 456 487 … … 1749 1780 * @return string $html - The section html. 1750 1781 */ 1751 privatefunction get_list_item_title_html($post_id, $user_id, $link_title){1782 function get_list_item_title_html($post_id, $user_id, $link_title){ 1752 1783 1753 1784 if( !is_user_logged_in() || is_admin() ) … … 1759 1790 /** 1760 1791 * Verify Authorization. 1761 */ 1792 */ 1793 $core_authorization = new ARS_Constellation_Client_Portal_Core_Authorization( $this->plugin_name, $this->version ); 1794 1762 1795 if ( true === $this->is_pro ){ 1763 1796 1764 $authorization = new ARS_Constellation_Client_Portal_Pro_Authorization( $this->plugin_name, $this->version ); 1765 $check_authorization = $authorization->verify_page_or_post_authorization_pro($post_id, $user_id); 1797 $authorization = new ARS_Constellation_Client_Portal_Pro_Authorization( $this->plugin_name, $this->version ); 1798 $is_global_file = $core_authorization->is_global_file_post($post_id); 1799 1800 if( true === $is_global_file ){ 1801 1802 $check_authorization = $authorization->verify_global_file_post_authorization_pro($post_id, $user_id); 1803 1804 }else{ 1805 1806 $check_authorization = $authorization->verify_page_or_post_authorization_pro($post_id, $user_id); 1807 1808 } 1766 1809 1767 1810 }else{ … … 1770 1813 * Use the default file check if this is the Core version 1771 1814 * to determine if access should be granted. 1772 */ 1773 $authorization = new ARS_Constellation_Client_Portal_Core_Authorization( $this->plugin_name, $this->version ); 1774 $check_authorization = $authorization->verify_page_or_post_authorization($post_id, $user_id); 1815 */ 1816 $check_authorization = $core_authorization->verify_page_or_post_authorization($post_id, $user_id); 1775 1817 1776 1818 } … … 1811 1853 * @return string $html - The section html. 1812 1854 */ 1813 privatefunction get_list_item_meta_html($post_id, $user_id, $atts, $due_date, $past_due_notice){1855 function get_list_item_meta_html($post_id, $user_id, $atts, $due_date, $past_due_notice){ 1814 1856 1815 1857 if( !is_user_logged_in() || is_admin() ) … … 1821 1863 /** 1822 1864 * Verify Authorization. 1823 */ 1865 */ 1866 $core_authorization = new ARS_Constellation_Client_Portal_Core_Authorization( $this->plugin_name, $this->version ); 1867 1824 1868 if ( true === $this->is_pro ){ 1825 1869 1826 $authorization = new ARS_Constellation_Client_Portal_Pro_Authorization( $this->plugin_name, $this->version ); 1827 $check_authorization = $authorization->verify_page_or_post_authorization_pro($post_id, $user_id); 1870 $authorization = new ARS_Constellation_Client_Portal_Pro_Authorization( $this->plugin_name, $this->version ); 1871 $is_global_file = $core_authorization->is_global_file_post($post_id); 1872 1873 if( true === $is_global_file ){ 1874 1875 $check_authorization = $authorization->verify_global_file_post_authorization_pro($post_id, $user_id); 1876 1877 }else{ 1878 1879 $check_authorization = $authorization->verify_page_or_post_authorization_pro($post_id, $user_id); 1880 1881 } 1828 1882 1829 1883 }else{ … … 1832 1886 * Use the default file check if this is the Core version 1833 1887 * to determine if access should be granted. 1834 */ 1835 $authorization = new ARS_Constellation_Client_Portal_Core_Authorization( $this->plugin_name, $this->version ); 1836 $check_authorization = $authorization->verify_page_or_post_authorization($post_id, $user_id); 1888 */ 1889 $check_authorization = $core_authorization->verify_page_or_post_authorization($post_id, $user_id); 1837 1890 1838 1891 } … … 1880 1933 * @return string $html - The section html. 1881 1934 */ 1882 privatefunction get_list_item_thumbnail_html($post_id, $user_id, $atts){1935 function get_list_item_thumbnail_html($post_id, $user_id, $atts){ 1883 1936 1884 1937 if( !is_user_logged_in() || is_admin() ) … … 1890 1943 /** 1891 1944 * Verify Authorization. 1892 */ 1945 */ 1946 $core_authorization = new ARS_Constellation_Client_Portal_Core_Authorization( $this->plugin_name, $this->version ); 1947 1893 1948 if ( true === $this->is_pro ){ 1894 1949 1895 $authorization = new ARS_Constellation_Client_Portal_Pro_Authorization( $this->plugin_name, $this->version ); 1896 $check_authorization = $authorization->verify_page_or_post_authorization_pro($post_id, $user_id); 1950 $authorization = new ARS_Constellation_Client_Portal_Pro_Authorization( $this->plugin_name, $this->version ); 1951 $is_global_file = $core_authorization->is_global_file_post($post_id); 1952 1953 if( true === $is_global_file ){ 1954 1955 $check_authorization = $authorization->verify_global_file_post_authorization_pro($post_id, $user_id); 1956 1957 }else{ 1958 1959 $check_authorization = $authorization->verify_page_or_post_authorization_pro($post_id, $user_id); 1960 1961 } 1897 1962 1898 1963 }else{ … … 1901 1966 * Use the default file check if this is the Core version 1902 1967 * to determine if access should be granted. 1903 */ 1904 $authorization = new ARS_Constellation_Client_Portal_Core_Authorization( $this->plugin_name, $this->version ); 1905 $check_authorization = $authorization->verify_page_or_post_authorization($post_id, $user_id); 1968 */ 1969 $check_authorization = $core_authorization->verify_page_or_post_authorization($post_id, $user_id); 1906 1970 1907 1971 } … … 1941 2005 * @return string $html - The section html. 1942 2006 */ 1943 privatefunction get_list_item_excerpt_html($post_id, $user_id, $atts){2007 function get_list_item_excerpt_html($post_id, $user_id, $atts){ 1944 2008 1945 2009 if( !is_user_logged_in() || is_admin() ) … … 1951 2015 /** 1952 2016 * Verify Authorization. 1953 */ 2017 */ 2018 $core_authorization = new ARS_Constellation_Client_Portal_Core_Authorization( $this->plugin_name, $this->version ); 2019 1954 2020 if ( true === $this->is_pro ){ 1955 2021 1956 $authorization = new ARS_Constellation_Client_Portal_Pro_Authorization( $this->plugin_name, $this->version ); 1957 $check_authorization = $authorization->verify_page_or_post_authorization_pro($post_id, $user_id); 2022 $authorization = new ARS_Constellation_Client_Portal_Pro_Authorization( $this->plugin_name, $this->version ); 2023 $is_global_file = $core_authorization->is_global_file_post($post_id); 2024 2025 if( true === $is_global_file ){ 2026 2027 $check_authorization = $authorization->verify_global_file_post_authorization_pro($post_id, $user_id); 2028 2029 }else{ 2030 2031 $check_authorization = $authorization->verify_page_or_post_authorization_pro($post_id, $user_id); 2032 2033 } 1958 2034 1959 2035 }else{ … … 1962 2038 * Use the default file check if this is the Core version 1963 2039 * to determine if access should be granted. 1964 */ 1965 $authorization = new ARS_Constellation_Client_Portal_Core_Authorization( $this->plugin_name, $this->version ); 1966 $check_authorization = $authorization->verify_page_or_post_authorization($post_id, $user_id); 2040 */ 2041 $check_authorization = $core_authorization->verify_page_or_post_authorization($post_id, $user_id); 1967 2042 1968 2043 } … … 2004 2079 * @return string $html - The section html. 2005 2080 */ 2006 privatefunction get_list_item_download_section_html($post_id, $user_id, $attached_file, $atts){2081 function get_list_item_download_section_html($post_id, $user_id, $attached_file, $atts){ 2007 2082 2008 2083 if( !is_user_logged_in() || is_admin() ) … … 2014 2089 /** 2015 2090 * Verify Authorization. 2016 */ 2091 */ 2092 $core_authorization = new ARS_Constellation_Client_Portal_Core_Authorization( $this->plugin_name, $this->version ); 2093 2017 2094 if ( true === $this->is_pro ){ 2018 2095 2019 $authorization = new ARS_Constellation_Client_Portal_Pro_Authorization( $this->plugin_name, $this->version ); 2020 $check_authorization = $authorization->verify_page_or_post_authorization_pro($post_id, $user_id); 2096 $authorization = new ARS_Constellation_Client_Portal_Pro_Authorization( $this->plugin_name, $this->version ); 2097 $is_global_file = $core_authorization->is_global_file_post($post_id); 2098 2099 if( true === $is_global_file ){ 2100 2101 $check_authorization = $authorization->verify_global_file_post_authorization_pro($post_id, $user_id); 2102 2103 }else{ 2104 2105 $check_authorization = $authorization->verify_page_or_post_authorization_pro($post_id, $user_id); 2106 2107 } 2021 2108 2022 2109 }else{ … … 2025 2112 * Use the default file check if this is the Core version 2026 2113 * to determine if access should be granted. 2027 */ 2028 $authorization = new ARS_Constellation_Client_Portal_Core_Authorization( $this->plugin_name, $this->version ); 2029 $check_authorization = $authorization->verify_page_or_post_authorization($post_id, $user_id); 2114 */ 2115 $check_authorization = $core_authorization->verify_page_or_post_authorization($post_id, $user_id); 2030 2116 2031 2117 }
Note: See TracChangeset
for help on using the changeset viewer.