ソースを参照

- add a new module, called 'userblacklist' for handling user and global blacklists
- credits for this module goes to Hardy Kahl, hardy dot kahl at 1und1 dot de
- add documentation, database scheme and test for this module


git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3760 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt 17 年 前
コミット
cb87dcad1f

+ 2 - 1
lib/srdb1/schema/Makefile

@@ -5,7 +5,8 @@
 # OpenSER database descriptions for modules
 TABLES = standard acc imc lcr siptrace domainpolicy cpl domain group \
 	dialog permissions registrar usrloc msilo alias_db uri_db speeddial \
-	avpops auth_db pdt dispatcher presence rls serweb extensions carrierroute
+	avpops auth_db pdt dispatcher presence rls serweb extensions carrierroute \
+	userblacklist
 
 ROOT=../..
 STYLESHEETS=$(ROOT)/doc/dbschema/xsl

+ 58 - 0
lib/srdb1/schema/globalblacklist.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE table PUBLIC "-//openser.org//DTD DBSchema V1.1//EN" 
+  "http://openser.org/pub/openser/dbschema/dtd/1.1/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<table id="globalblacklist" xmlns:db="http://docbook.org/ns/docbook">
+    <name>globalblacklist</name>
+    <version>1</version>
+    <type db="mysql">&MYSQL_TABLE_TYPE;</type>
+    <description>
+        <db:para>This table is used by the userblacklist module for the global blacklists. More information is available at: &OPENSER_MOD_DOC;userblacklist.html
+        </db:para>
+    </description>
+
+    <column id="id">
+        <name>id</name>
+        <type>unsigned int</type>
+        <size>&table_id_len;</size>
+        <autoincrement/>
+        <primary/>
+        <type db="postgres">SERIAL PRIMARY KEY</type>
+        <type db="dbtext">int,auto</type>
+        <description>unique ID</description>
+    </column>
+
+    <column id="prefix">
+        <name>prefix</name>
+        <type>string</type>
+        <size>&user_len;</size>
+        <default/>
+        <description>The prefix that is matched for the blacklist.</description>
+    </column>
+
+    <column>
+        <name>whitelist</name>
+        <type>unsigned int</type>
+        <size>1</size>
+        <default>0</default>
+        <description>Specify if this a blacklist (0) or a whitelist (1) entry.</description>
+    </column>
+
+     <column>
+        <name>comment</name>
+        <type>string</type>
+        <size>&user_len;</size>
+        <default/>
+        <description>A comment for the entry.</description>
+    </column>
+
+    <index>
+        <name>userblacklist_idx</name>
+        <colref linkend="prefix"/>
+    </index>
+</table>

+ 14 - 0
lib/srdb1/schema/openser-userblacklist.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE database PUBLIC "-//openser.org//DTD DBSchema V1.1//EN"
+  "http://openser.org/pub/openser/dbschema/dtd/1.1/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<database xmlns:xi="http://www.w3.org/2001/XInclude">
+    <name>User and global blacklists</name>
+    <xi:include href="userblacklist.xml"/>
+    <xi:include href="globalblacklist.xml"/>
+</database>

+ 76 - 0
lib/srdb1/schema/userblacklist.xml

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE table PUBLIC "-//openser.org//DTD DBSchema V1.1//EN" 
+  "http://openser.org/pub/openser/dbschema/dtd/1.1/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<table id="userblacklist" xmlns:db="http://docbook.org/ns/docbook">
+    <name>userblacklist</name>
+    <version>1</version>
+    <type db="mysql">&MYSQL_TABLE_TYPE;</type>
+    <description>
+        <db:para>This table is used by the userblacklist module for the user specific blacklists. More information is available at: &OPENSER_MOD_DOC;userblacklist.html
+        </db:para>
+    </description>
+
+    <column id="id">
+        <name>id</name>
+        <type>unsigned int</type>
+        <size>&table_id_len;</size>
+        <autoincrement/>
+        <primary/>
+        <type db="postgres">SERIAL PRIMARY KEY</type>
+        <type db="dbtext">int,auto</type>
+        <description>unique ID</description>
+    </column>
+
+    <column id="username">
+        <name>username</name>
+        <type>string</type>
+        <size>&user_len;</size>
+        <default/>
+        <description>The user that is used for the blacklist lookup.</description>
+    </column>
+
+    <column id="domain">
+        <name>domain</name>
+        <type>string</type>
+        <size>&domain_len;</size>
+        <default/>
+        <description>The domain that is used for the blacklist lookup.</description>
+    </column>
+
+    <column id="prefix">
+        <name>prefix</name>
+        <type>string</type>
+        <size>&user_len;</size>
+        <default/>
+        <description>The prefix that is matched for the blacklist.</description>
+    </column>
+
+    <column>
+        <name>whitelist</name>
+        <type>unsigned int</type>
+        <size>1</size>
+        <default>0</default>
+        <description>Specify if this a blacklist (0) or a whitelist (1) entry.</description>
+    </column>
+
+     <column>
+        <name>comment</name>
+        <type>string</type>
+        <size>&user_len;</size>
+        <default/>
+        <description>A comment for the entry.</description>
+    </column>
+
+    <index>
+        <name>userblacklist_idx</name>
+        <colref linkend="username"/>
+        <colref linkend="domain"/>
+        <colref linkend="prefix"/>
+    </index>
+</table>