noalyss Version-9
service.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * PhpCompta is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * PhpCompta is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with PhpCompta; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright (2002-2019) Author Dany De Bontridder <danydb@noalyss.eu>
21
22define ("ALLOWED",true);
23/**
24 * @file
25 * @brief take request for webservice , decrypt the message and give it to the plugin NWS if installed.
26 * Mandatory parameter is dossier_id and message
27 *
28 */
29
30// 1. Get dossier_id and message
31
32if ( ! defined ('ALLOWED') ) define ('ALLOWED',1);
33require_once '../include/constant.php';
34require_once NOALYSS_INCLUDE.'/class/database.class.php';
35require_once NOALYSS_INCLUDE.'/lib/icon_action.class.php';
36require_once NOALYSS_INCLUDE . '/class/noalyss_user.class.php';
37require_once NOALYSS_INCLUDE.'/class/extension.class.php';
38require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
39
40if ( !isset ($_REQUEST['gDossier'])) exit();
42
43try {
44 $dossier_id=$http->request("dossier_id","numeric");
45 $message=$http->request("message");
46} catch (Exception $e) {
47 record_log(date("Y-m-d H.i.s")."Invalide call from %s %s",$_SERVER['REMOTE_ADDR'],$e->getMessage());
48 return;
49}
50
51
52
54
56
57// if Dossier exists, get if the crypt is mandatory, plugin enable , retrieve the key and decode message
59
60if ( $menu->search() == -1 ) exit();
61
62
63// Call the plugin WebService
64require_once(NOALYSS_PLUGIN.DIRECTORY_SEPARATOR.dirname(trim($menu->getp('me_file'))).DIRECTORY_SEPARATOR.'nw_service.php');
65
66
record_log($p_message)
Record an error message into the log file of the server.
Definition: ac_common.php:1342
$dossier_id
Definition: ajax_poste.php:43
$_REQUEST['ac']
static set_current($p_dossier)
Set the current dossier to $p_dossier.
static connect()
manage the extension, it involves the table extension
manage the http input (get , post, request) and extract from an array
for($e=0; $e< count($afiche); $e++) exit
$cn
Definition: service.php:55
$menu
Definition: service.php:58
$http
Definition: service.php:41
$message
Definition: service.php:45