Merge pull request #1824 from dlobo/CRM-13577
[civicrm-core.git] / CRM / Contact / Form / Contact.php
index 184f63bfaab0f74a766879ca8490c3d7fb98c20c..000931f50e36e4f7de5fc130106ea312020fadb7 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -206,9 +206,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
 
         // check for permissions
         $session = CRM_Core_Session::singleton();
-        if ($session->get('userID') != $this->_contactId &&
-          !CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::EDIT)
-        ) {
+        if (!CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::EDIT)) {
           CRM_Core_Error::statusBounce(ts('You do not have the necessary permission to edit this contact.'));
         }
 
@@ -593,7 +591,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
     }
 
     if (array_key_exists('Address', $this->_editOptions)) {
-      $this->addFormRule(array('CRM_Contact_Form_Edit_Address', 'formRule'));
+      $this->addFormRule(array('CRM_Contact_Form_Edit_Address', 'formRule'), $this);
     }
 
     if (array_key_exists('CommunicationPreferences', $this->_editOptions)) {