Przeglądaj źródła

Ticket #185. Privacy engine improvements.

AntonLV 11 lat temu
rodzic
commit
fec480e3b0

+ 3 - 0
modules/base/notifications/classes/BxBaseModNotificationsConfig.php

@@ -35,6 +35,9 @@ class BxBaseModNotificationsConfig extends BxBaseModGeneralConfig
 		$this->_aPrefixes = array();
 		$this->_aObjects = array(
 			'alert' => $this->_sName,
+
+			'privacy_view' => $this->_sName . '_privacy_view',
+
 			'conn_subscriptions' => 'sys_profiles_subscriptions'
 		);
 

+ 25 - 0
modules/base/notifications/classes/BxBaseModNotificationsPrivacy.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    BaseNotifications Base classes for Notifications like modules
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxBaseModNotificationsPrivacy extends BxTemplPrivacy
+{
+	public function __construct ($aOptions, $oTemplate = false)
+    {
+        parent::__construct ($aOptions, $oTemplate);
+    }
+
+    protected function convertActionToField($sAction)
+    {
+    	return strtolower('object_privacy_' . $sAction);
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/notifications/classes/BxNtfsPrivacy.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Timeline Timeline
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxNtfsPrivacy extends BxBaseModNotificationsPrivacy
+{
+	public function __construct ($aOptions, $oTemplate = false)
+    {
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 2 - 7
modules/boonex/timeline/classes/BxTimelineConfig.php

@@ -62,8 +62,7 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         	'common_post' => 'timeline_common_'
         );
 
-        $this->_aObjects = array(
-        	'alert' => $this->_sName,
+        $this->_aObjects = array_merge($this->_aObjects, array(
         	'comment' => $this->CNF['OBJECT_COMMENTS'],
         	'vote' => $this->_sName,
         	'metatags' => $this->_sName,
@@ -76,10 +75,6 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         	'transcoder_videos_mp4' => $this->_sName . '_videos_mp4',
         	'transcoder_videos_webm' => $this->_sName . '_videos_webm',
 
-        	'privacy_view' => 'bx_timeline_privacy_view',
-
-        	'conn_subscriptions' => 'sys_profiles_subscriptions',
-
         	'menu_item_manage' => $this->_sName . '_menu_item_manage',
         	'menu_item_actions' => $this->_sName . '_menu_item_actions',
         	'menu_post_attachments' => $this->_sName . '_menu_post_attachments',
@@ -88,7 +83,7 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         	'form_attach_link' => $this->_sName . '_attach_link',
         	'form_display_post_add' => $this->_sName . '_post_add',
         	'form_display_attach_link_add' => $this->_sName . '_attach_link_add'
-        );
+        ));
 
         $this->_aHandlerDescriptor = array('module_name' => '', 'module_method' => '', 'module_class' => '', 'groupable' => '', 'group_by' => '');
         $this->_sHandlersMethod = 'get_timeline_data';

+ 1 - 6
modules/boonex/timeline/classes/BxTimelinePrivacy.php

@@ -9,17 +9,12 @@
  * @{
  */
 
-class BxTimelinePrivacy extends BxTemplPrivacy
+class BxTimelinePrivacy extends BxBaseModNotificationsPrivacy
 {
 	public function __construct ($aOptions, $oTemplate = false)
     {
         parent::__construct ($aOptions, $oTemplate);
     }
-
-    protected function convertActionToField($sAction)
-    {
-    	return strtolower('object_privacy_' . $sAction);
-    }
 }
 
 /** @} */

+ 1 - 1
modules/boonex/timeline/install/sql/disable.sql

@@ -18,7 +18,7 @@ DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
 
 
 -- PRIVACY 
-DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_timeline_privacy_view';
+DELETE FROM `sys_objects_privacy` WHERE `module` = 'bx_timeline';
 
 
 -- ACL