RomanL 7 years ago
parent
commit
eba633f5d9
2 changed files with 22 additions and 22 deletions
  1. 1 1
      inc/classes/BxDolAcl.php
  2. 21 21
      modules/base/general/classes/BxBaseModGeneralModule.php

+ 1 - 1
inc/classes/BxDolAcl.php

@@ -581,7 +581,7 @@ class BxDolAcl extends BxDolFactory implements iBxDolSingleton
 
         // audit
         $aDataForAudit = array();
-        if (!is_empty($aMembershipCurrent))
+        if (!empty($aMembershipCurrent))
             $aDataForAudit = array('new_membership_level' => _t($aLevel['name']), 'old_membership_level' => _t($aMembershipCurrent['name']));
         BxDolProfile::getInstance($iProfileId)->doAudit('_sys_audit_action_set_membership', $aDataForAudit);
         

+ 21 - 21
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -1691,6 +1691,26 @@ class BxBaseModGeneralModule extends BxDolModule
     {
         return CHECK_ACTION_RESULT_ALLOWED === $this->checkAllowedEditAnyEntry ($isPerformAction);
     }
+    
+    public function _prepareAuditParams($aContentInfo, $bIsSaveData = true, $aOverrideAuditParams  = array())
+    {
+        $CNF = &$this->_oConfig->CNF;
+        
+        $iContextId = isset($CNF['FIELD_ALLOW_VIEW_TO']) && (!empty($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]) && (int)$aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']] < 0) ? - $aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']] : 0;
+        
+        $AuditParams = array(
+            'content_title' => (isset($CNF['FIELD_TITLE']) && isset($aContentInfo[$CNF['FIELD_TITLE']])) ? $aContentInfo[$CNF['FIELD_TITLE']] : '',
+            'context_profile_id' => $iContextId,
+            'content_info_object' =>  isset($CNF['OBJECT_CONTENT_INFO']) ? $CNF['OBJECT_CONTENT_INFO'] : '',
+            'data' => ($bIsSaveData ? $aContentInfo : array())
+        );
+        if ($iContextId > 0)
+            $AuditParams['context_profile_title'] = BxDolProfile::getInstance($iContextId)->getDisplayName();
+        
+        $AuditParams = array_merge($AuditParams, $aOverrideAuditParams);
+        
+        return $AuditParams;
+    }
 
     // ====== PROTECTED METHODS
 
@@ -1927,27 +1947,7 @@ class BxBaseModGeneralModule extends BxDolModule
 
 		echoJson($aResponse);
 		exit;
-    }
-    
-    protected function _prepareAuditParams($aContentInfo, $bIsSaveData = true, $aOverrideAuditParams  = array())
-    {
-        $CNF = &$this->_oConfig->CNF;
-        
-        $iContextId = isset($CNF['FIELD_ALLOW_VIEW_TO']) && (!empty($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]) && (int)$aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']] < 0) ? - $aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']] : 0;
-        
-        $AuditParams = array(
-            'content_title' => (isset($CNF['FIELD_TITLE']) && isset($aContentInfo[$CNF['FIELD_TITLE']])) ? $aContentInfo[$CNF['FIELD_TITLE']] : '',
-            'context_profile_id' => $iContextId,
-            'content_info_object' =>  isset($CNF['OBJECT_CONTENT_INFO']) ? $CNF['OBJECT_CONTENT_INFO'] : '',
-            'data' => ($bIsSaveData ? $aContentInfo : array())
-        );
-        if ($iContextId > 0)
-            $AuditParams['context_profile_title'] = BxDolProfile::getInstance($iContextId)->getDisplayName();
-        
-        $AuditParams = array_merge($AuditParams, $aOverrideAuditParams);
-        
-        return $AuditParams;
-    }
+    }    
 }
 
 /** @} */