| @@ 38-40 (lines=3) @@ | ||
| 35 | wp_die( __( 'We\'re unable to recognize your session. Please refresh the screen to try again; otherwise contact your website administrator for assistance.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
| 36 | } |
|
| 37 | ||
| 38 | if ( ! file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/give-pdf.php' ) ) { |
|
| 39 | wp_die( __( 'Dependency missing.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
| 40 | } |
|
| 41 | ||
| 42 | require_once GIVE_PLUGIN_DIR . '/includes/libraries/give-pdf.php'; |
|
| 43 | ||
| @@ 1892-1897 (lines=6) @@ | ||
| 1889 | __( 'You do not have permission to %s API keys for this user.', 'give' ), $process ), __( 'Error', 'give' ), array( |
|
| 1890 | 'response' => 403, |
|
| 1891 | ) ); |
|
| 1892 | } elseif ( ! current_user_can( 'manage_give_settings' ) ) { |
|
| 1893 | wp_die( sprintf( /* translators: %s: process */ |
|
| 1894 | __( 'You do not have permission to %s API keys for this user.', 'give' ), $process ), __( 'Error', 'give' ), array( |
|
| 1895 | 'response' => 403, |
|
| 1896 | ) ); |
|
| 1897 | } |
|
| 1898 | ||
| 1899 | switch ( $process ) { |
|
| 1900 | case 'generate': |
|
| @@ 186-190 (lines=5) @@ | ||
| 183 | ||
| 184 | $donor_view_role = apply_filters( 'give_view_donors_role', 'view_give_reports' ); |
|
| 185 | ||
| 186 | if ( ! is_admin() || ! current_user_can( $donor_view_role ) ) { |
|
| 187 | wp_die( __( 'You do not have permission to edit this donor.', 'give' ), __( 'Error', 'give' ), array( |
|
| 188 | 'response' => 403, |
|
| 189 | ) ); |
|
| 190 | } |
|
| 191 | ||
| 192 | if ( empty( $args ) ) { |
|
| 193 | return false; |
|
| @@ 269-273 (lines=5) @@ | ||
| 266 | ||
| 267 | $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
| 268 | ||
| 269 | if ( ! is_admin() || ! current_user_can( $donor_edit_role ) ) { |
|
| 270 | wp_die( __( 'You do not have permission to edit this donor.', 'give' ), __( 'Error', 'give' ), array( |
|
| 271 | 'response' => 403, |
|
| 272 | ) ); |
|
| 273 | } |
|
| 274 | ||
| 275 | if ( empty( $args ) ) { |
|
| 276 | return false; |
|
| @@ 370-374 (lines=5) @@ | ||
| 367 | $donor_id = ''; |
|
| 368 | $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
| 369 | ||
| 370 | if ( ! is_admin() || ! current_user_can( $donor_edit_role ) ) { |
|
| 371 | wp_die( __( 'You do not have permission to edit this donor.', 'give' ), __( 'Error', 'give' ), array( |
|
| 372 | 'response' => 403, |
|
| 373 | ) ); |
|
| 374 | } |
|
| 375 | ||
| 376 | $output = array(); |
|
| 377 | if ( empty( $args ) || empty( $args['email'] ) || empty( $args['customer_id'] ) ) { |
|