1cadcd648bd77e054cabc5fee0122be82a2921f2
[euphorik.git] / modules / include / euphorik_bd.hrl
1 % Copyright 2008 Grégory Burri\r
2 %\r
3 % This file is part of Euphorik.\r
4 %\r
5 % Euphorik is free software: you can redistribute it and/or modify\r
6 % it under the terms of the GNU General Public License as published by\r
7 % the Free Software Foundation, either version 3 of the License, or\r
8 % (at your option) any later version.\r
9 %\r
10 % Euphorik is distributed in the hope that it will be useful,\r
11 % but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 % GNU General Public License for more details.\r
14 %\r
15 % You should have received a copy of the GNU General Public License\r
16 % along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
17 %\r
18 % @author GBurri\r
19
20
21 % Pour générer des id\r
22 -record(counter,\r
23    {\r
24       key,\r
25       value\r
26    }).\r
27    
28    
29 % Mémorse toutes les propriétés, entre autre la version des données
30 -record(proprietes,
31    {
32       nom,
33       valeur
34    }).\r
35
36 \r
37 % décrit un enregistrement d'un message\r
38 -record(minichat,
39    {\r
40       id, % integer\r
41       auteur_id, % -> #user.id
42       date, % erlang:now()
43       pseudo, % chaine de caractère
44       contenu, % chaine de caractère
45       troll_id = undefined % l'id du troll associé correspondant
46    }).\r
47    
48    \r
49 % type bag\r
50 % 'repondant' repond à 'cible'\r
51 -record(reponse_minichat,\r
52    {\r
53       repondant, % -> #minichat.id\r
54       cible % -> #minichat.id\r
55    }). \r
56
57 \r
58 -record(user,\r
59    {\r
60       id,\r
61       cookie, % string()\r
62       pseudo = [], % string()
63       login = [], % string()
64       password = [], % string() (md5)
65       email = [], % string()\r
66       date_creation, % erlang:now()\r
67       date_derniere_connexion, % erlang:now(), est mis à jour lors de n'importe quelle activitée (envoie de message par exemple)\r
68       css = [], % string()
69       nick_format = nick, %atom(), peut valoir 'nick', 'login' ou 'nick_login'
70       view_times = true,
71       view_tooltips = true,
72       indice_flood = 0, % integer() est incrémenté lorsque l'utilisateur envoie trop rapidement des messages.
73       page_principale = 1, % la page de la conversation principale
74       conversations = [], % [{integer(), integer()}], la liste des messages correspondant au conversation ainsi que la page affichée
75       ek_master = false,
76       last_ip = undefined % integer(), undefined si inconnu\r
77    }).
78
79
80 % identificateur : (ip)
81 -record(ip_table,
82    {
83       ip, % {integer(), integer(), integer(), integer()}
84       ban = undefined, % la date du dernier bannissement
85       ban_duration = 0, % le temps de ban en minute
86       nb_try_register = 0,
87       nb_try_login = 0, % pour l'instant pas utilisé
88       date_last_try_register,
89       date_last_try_login % pour l'instant pas utilisé
90    }).
91    
92    
93 -record(troll,
94    {
95       id,
96       id_user,
97       date_create, % erlang:now()
98       date_post = undefined, % date à laquelle le troll est affiché sur la page principale. undefined initialement puis erlang:now() quand affiché
99       content % chaine de caractère
100    }).
101