From 8f2a674038d2849aa5e3ee731044e8d9bc3c1857 Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Tue, 14 May 2013 21:12:48 -0700 Subject: [PATCH] Fix formatting --- civicrm.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/civicrm.php b/civicrm.php index 0f5d8cf5a130..f1b4e0674265 100644 --- a/civicrm.php +++ b/civicrm.php @@ -464,9 +464,7 @@ function civicrm_check_permission($args) { $arg3 = CRM_Utils_Array::value(3, $args); // allow editing of related contacts - if ($arg1 == 'contact' && - $arg2 == 'relatedcontact' - ) { + if ($arg1 == 'contact' && $arg2 == 'relatedcontact') { return TRUE; } @@ -505,7 +503,8 @@ function civicrm_check_permission($args) { return TRUE; } - if ($arg1 == 'pcp' && + if ( + $arg1 == 'pcp' && (!$arg2 || in_array($arg2, array('info'))) ) { return TRUE; @@ -513,21 +512,23 @@ function civicrm_check_permission($args) { } // allow mailing urls to be processed - if ($arg1 == 'mailing' && + if ( + $arg1 == 'mailing' && in_array('CiviMail', $config->enableComponents) ) { - if (in_array($arg2, + if ( + in_array( + $arg2, array('forward', 'unsubscribe', 'resubscribe', 'optout', 'subscribe', 'confirm', 'view') - )) { + ) + ) { return TRUE; } } // allow petition sign in, CRM-7401 if (in_array('CiviCampaign', $config->enableComponents)) { - if ($arg1 == 'petition' && - $arg2 == 'sign' - ) { + if ($arg1 == 'petition' && $arg2 == 'sign') { return TRUE; } } @@ -549,7 +550,7 @@ function wp_civicrm_capability() { if ( is_object($roleObj) && is_array($roleObj->capabilities) && - ! array_key_exists('access_civicrm', $wp_roles->get_role($role)->capabilities ) + !array_key_exists('access_civicrm', $wp_roles->get_role($role)->capabilities ) ) { $wp_roles->add_cap($role, 'access_civicrm'); } @@ -590,7 +591,7 @@ function civicrm_wp_main() { add_shortcode('civicrm', 'civicrm_shortcode_handler'); - if (! $isAdmin) { + if (!$isAdmin) { add_action('wp_head', 'civicrm_wp_head'); add_filter('get_header', 'civicrm_wp_shortcode_includes'); }