Skip to content

Commit

Permalink
Merge pull request #737 from ramiy/master
Browse files Browse the repository at this point in the history
Permission Error Messages
  • Loading branch information
Devin Walker committed Jul 15, 2016
2 parents aef4f4a + a97b18b commit 2809c80
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion includes/admin/customers/customer-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function give_customer_delete( $args ) {
$customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' );

if ( ! is_admin() || ! current_user_can( $customer_edit_role ) ) {
wp_die( __( 'You do not have permission to delete this donor.', 'give' ) );
wp_die( __( 'You do not have permission to delete donors.', 'give' ) );
}

if ( empty( $args ) ) {
Expand Down
10 changes: 5 additions & 5 deletions includes/admin/payments/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
function give_update_payment_details( $data ) {

if ( ! current_user_can( 'edit_give_payments', $data['give_payment_id'] ) ) {
wp_die( __( 'You do not have permission to edit this payment record', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'You do not have permission to edit payment records.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

check_admin_referer( 'give_update_payment_details_nonce' );
Expand Down Expand Up @@ -223,7 +223,7 @@ function give_trigger_purchase_delete( $data ) {
$payment_id = absint( $data['purchase_id'] );

if ( ! current_user_can( 'edit_give_payments', $payment_id ) ) {
wp_die( __( 'You do not have permission to edit this payment record', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'You do not have permission to edit payment records.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

give_delete_purchase( $payment_id );
Expand All @@ -243,7 +243,7 @@ function give_ajax_store_payment_note() {
$note = wp_kses( $_POST['note'], array() );

if ( ! current_user_can( 'edit_give_payments', $payment_id ) ) {
wp_die( __( 'You do not have permission to edit this payment record', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'You do not have permission to edit payment records.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

if ( empty( $payment_id ) ) {
Expand Down Expand Up @@ -276,7 +276,7 @@ function give_trigger_payment_note_deletion( $data ) {
}

if ( ! current_user_can( 'edit_give_payments', $data['payment_id'] ) ) {
wp_die( __( 'You do not have permission to edit this payment record', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'You do not have permission to edit payment records.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

$edit_order_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-note-deleted&id=' . absint( $data['payment_id'] ) );
Expand All @@ -300,7 +300,7 @@ function give_trigger_payment_note_deletion( $data ) {
function give_ajax_delete_payment_note() {

if ( ! current_user_can( 'edit_give_payments', $_POST['payment_id'] ) ) {
wp_die( __( 'You do not have permission to edit this payment record', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'You do not have permission to edit payment records.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

if ( give_delete_payment_note( $_POST['note_id'], $_POST['payment_id'] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/reporting/pdf-reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
function give_generate_pdf( $data ) {

if ( ! current_user_can( 'view_give_reports' ) ) {
wp_die( __( 'You do not have permission to generate PDF sales reports', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'You do not have permission to generate PDF sales reports.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'give_generate_pdf' ) ) {
Expand Down
6 changes: 3 additions & 3 deletions includes/admin/upgrades/upgrade-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function give_show_upgrade_notices() {
function give_trigger_upgrades() {

if ( ! current_user_can( 'manage_give_settings' ) ) {
wp_die( __( 'You do not have permission to do Give upgrades', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'You do not have permission to do Give upgrades.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

$give_version = get_option( 'give_version' );
Expand Down Expand Up @@ -176,7 +176,7 @@ function give_get_completed_upgrades() {
function give_v132_upgrade_give_payment_customer_id() {
global $wpdb;
if ( ! current_user_can( 'manage_give_settings' ) ) {
wp_die( __( 'You do not have permission to do Give upgrades', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'You do not have permission to do Give upgrades.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

ignore_user_abort( true );
Expand Down Expand Up @@ -213,7 +213,7 @@ function give_v134_upgrade_give_offline_status() {
global $wpdb;

if ( ! current_user_can( 'manage_give_settings' ) ) {
wp_die( __( 'You do not have permission to do Give upgrades', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'You do not have permission to do Give upgrades.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

ignore_user_abort( true );
Expand Down
2 changes: 1 addition & 1 deletion includes/emails/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function give_resend_donation_receipt( $data ) {
}

if ( ! current_user_can( 'edit_give_payments', $purchase_id ) ) {
wp_die( __( 'You do not have permission to edit this payment record', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
wp_die( __( 'You do not have permission to edit payment records.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
}

give_email_donation_receipt( $purchase_id, false );
Expand Down

0 comments on commit 2809c80

Please sign in to comment.