%\r
% You should have received a copy of the GNU General Public License\r
% along with Euphorik. If not, see <http://www.gnu.org/licenses/>.\r
-% \r
+%\r
% Ce module est fait pour répondre à des requêtes JSON via 'AJAX'.\r
% Il est définit comme 'appmods' pour l'url "request" dans Yaws.\r
% Par exemple http://www.euphorik.ch/request abouti sur la fonction out/1 de ce module.\r
\r
-module(euphorik_requests).\r
-export([out/1]).\r
--include_lib("yaws/include/yaws_api.hrl").\r
+-include_lib("yaws_api.hrl").\r
-include("../include/euphorik_defines.hrl").\r
\r
\r
% Point d'entrée pour les requêtes AJAX sur http://www.euphorik.ch/request.\r
-out(A) -> \r
+out(A) ->\r
IP = case inet:peername(A#arg.clisock) of\r
{ok, {Adresse, _Port}} -> Adresse;\r
_ -> inconnue\r
)))\r
end\r
).\r
- \r
+\r
\r
% Authentification d'un client.\r
traiter_action("authentification", JSON, IP) ->\r
% Un ekMaster slap un utilisateur.\r
traiter_action("slap", JSON, _) ->\r
euphorik_protocole:slap(JSON);\r
-% Un ekMaster envoie un nouveau troll.\r
-traiter_action("put_troll", JSON, _) ->\r
- euphorik_protocole:put_troll(JSON);\r
-% Un ekMaster modifie un troll.\r
-traiter_action("mod_troll", JSON, _) ->\r
- euphorik_protocole:mod_troll(JSON);\r
-% Un ekMaster supprime un troll.\r
-traiter_action("del_troll", JSON, _) ->\r
- euphorik_protocole:del_troll(JSON);\r
% Un ekMaster demande la liste des ips bannies.\r
traiter_action("list_banned_ips", JSON, _) ->\r
euphorik_protocole:list_banned_ips(JSON);\r
% Un ekMaster débannie une ip.\r
traiter_action("unban", JSON, _) ->\r
euphorik_protocole:unban_ip(JSON).\r
-
\ No newline at end of file