瀏覽代碼

do not register pre/post op plugins if disabled

the main init function is responsible for looking to see if it is enabled
and should not do any further processing, including registering the
pre/post op plugins, if it is disabled
Rich Megginson 15 年之前
父節點
當前提交
4ddeb0bd1e
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      ldap/servers/plugins/acctpolicy/acct_init.c

+ 8 - 0
ldap/servers/plugins/acctpolicy/acct_init.c

@@ -69,6 +69,14 @@ int
 acct_policy_init( Slapi_PBlock *pb )
 {
 	void *plugin_id;
+	int enabled;
+
+	slapi_pblock_get(pb, SLAPI_PLUGIN_ENABLED, &enabled);
+
+	if (!enabled) {
+		/* not enabled */
+		return( CALLBACK_OK );
+	}
 
 	if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
 				SLAPI_PLUGIN_VERSION_01 ) != 0 ||