PluginProbe
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent / 2.3.1
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent v2.3.1
3.5.4 3.5.3 3.5.2 3.5.1 3.4.9 3.5.0 3.4.8 3.4.7 trunk 2.3.1 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6
supportcandy / includes / admin / tickets / individual_ticket / individual_ticket.php

individual_ticket.php in SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent 2.3.1, at includes/admin/tickets/individual_ticket/individual_ticket.php

50 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly
4 }
5
6 global $current_user, $wpscfunction;
7
8 // Get tiket id
9 $ticket_id = isset($_POST['ticket_id']) ? intval($_POST['ticket_id']) : 0;
10 if(!$ticket_id) die();
11
12 // Check if auth code is there
13 $auth_code = isset($_POST['auth_code']) ? sanitize_text_field($_POST['auth_code']) : '';
14
15 // Check ticket permanently deleted
16 if(!$ticket_id){
17 _e('Ticket not found.','supportcandy');
18 die();
19 }
20
21 $ticket_auth_code = $wpscfunction->get_ticket_fields($ticket_id,'ticket_auth_code');
22
23 // Check ticket in trash
24 $ticket_status = $wpscfunction->get_ticket_status($ticket_id);
25 if(!$ticket_status && $current_user && !$current_user->has_cap('wpsc_agent')){
26 _e('Ticket not found.','supportcandy');
27 die();
28 }
29
30 $wpsc_ticket_url_permission = get_option('wpsc_ticket_url_permission');
31 if( !is_user_logged_in() && !$wpsc_ticket_url_permission){
32 include WPSC_ABSPATH . 'includes/admin/tickets/sign_in/sign_in.php';
33 die();
34 }
35
36 $wpsc_ticket_public_mode = get_option('wpsc_ticket_public_mode');
37 if( ($wpscfunction->has_permission('view_ticket',$ticket_id) || $wpsc_ticket_public_mode) && is_user_logged_in()){
38
39 include WPSC_ABSPATH . 'includes/admin/tickets/individual_ticket/load_individual_ticket.php';
40
41 } else if ( $ticket_auth_code == $auth_code && $wpsc_ticket_url_permission) {
42
43 include WPSC_ABSPATH . 'includes/admin/tickets/individual_ticket/load_guest_individual_ticket.php';
44
45 } else {
46
47 _e('You are not authorized to view this ticket.','supportcandy');
48
49 }
50