frosix-httpd_terms.c (2199B)
1 /* 2 This file is part of Frosix 3 Copyright (C) 2020 Anastasis SARL 4 5 Frosix is free software; you can redistribute it and/or modify it under the 6 terms of the GNU Affero General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 Frosix is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 12 13 You should have received a copy of the GNU Affero General Public License along with 14 Frosix; see the file COPYING.GPL. If not, see <http://www.gnu.org/licenses/> 15 */ 16 /** 17 * @file backend/frosix-httpd_terms.c 18 * @brief headers for /terms handler 19 * @author Christian Grothoff 20 * @author Dennis Neufeld 21 * @author Dominik Meister 22 */ 23 #include "platform.h" 24 #include "frosix-httpd_terms.h" 25 #include <taler/taler_json_lib.h> 26 27 /** 28 * Our terms of service. 29 */ 30 static struct TALER_MHD_Legal *tos; 31 32 33 /** 34 * Our privacy policy. 35 */ 36 static struct TALER_MHD_Legal *pp; 37 38 39 MHD_RESULT 40 FH_handler_terms (struct FH_RequestHandler *rh, 41 struct MHD_Connection *connection) 42 { 43 (void) rh; 44 return TALER_MHD_reply_legal (connection, 45 tos); 46 } 47 48 49 MHD_RESULT 50 FH_handler_privacy (struct FH_RequestHandler *rh, 51 struct MHD_Connection *connection) 52 { 53 (void) rh; 54 return TALER_MHD_reply_legal (connection, 55 pp); 56 } 57 58 59 void 60 FH_load_terms (const struct GNUNET_CONFIGURATION_Handle *cfg) 61 { 62 tos = TALER_MHD_legal_load (cfg, 63 "frosix", 64 "TERMS_DIR", 65 "TERMS_ETAG"); 66 if (NULL == tos) 67 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 68 "Terms of service not configured\n"); 69 pp = TALER_MHD_legal_load (cfg, 70 "frosix", 71 "PRIVACY_DIR", 72 "PRIVACY_ETAG"); 73 if (NULL == pp) 74 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 75 "Privacy policy not configured\n"); 76 } 77 78 79 /* end of frosix-httpd_terms.c */