noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
extension.raw.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20// Copyright Author Dany De Bontridder danydb@aevalys.eu
21
22/*!\file
23 * \brief this file includes the called plugin. It check first
24 * the security. Load several javascript files
25 */
26require_once '../include/constant.php';
27require_once NOALYSS_INCLUDE.'/class/database.class.php';
28require_once NOALYSS_INCLUDE.'/class/dossier.class.php';
29require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
30require_once NOALYSS_INCLUDE.'/lib/function_javascript.php';
31require_once NOALYSS_INCLUDE.'/class/extension.class.php';
32require_once NOALYSS_INCLUDE.'/lib/html_input.class.php';
33require_once NOALYSS_INCLUDE.'/lib/iselect.class.php';
34require_once NOALYSS_INCLUDE . '/class/noalyss_user.class.php';
35
36MaintenanceMode("block.html");
37
39$cn=Dossier::connect();
41
43$cn=Dossier::connect();
44$g_user=new Noalyss_user($cn);
45$g_user->check();
46/**
47 * check if 2FA is completed
48 */
49if ( ! $g_user->is_double_identified()) {
50 exit();
51}
52$only_plugin=$g_user->check_dossier(dossier::id());
53
54
57
58if ( $ext->search($http->request("plugin_code")) != -1 )
59 {
60 /* security */
61 if ( !isset ($_SESSION[SESSION_KEY.'g_user']) || $ext->can_request($_SESSION[SESSION_KEY.'g_user']) == 0 )
62 {
63 exit();
64 }
65 define ('ALLOWED',True);
66 if ( LOGINPUT)
67 {
68 $file_loginput=fopen($_ENV['TMP'].'/plugin-export-'.$ext->me_code.'-'.$_SERVER['REQUEST_TIME'].'.php','a+');
69 fwrite ($file_loginput,"<?php \n");
70 fwrite ($file_loginput,'//@description: export '.$ext->me_code."\n");
71 fwrite($file_loginput, '$_GET='.var_export($_GET,true));
72 fwrite($file_loginput,";\n");
73 fwrite($file_loginput, '$_POST='.var_export($_POST,true));
74 fwrite($file_loginput,";\n");
75 fwrite($file_loginput, '$_POST[\'gDossier\']=$gDossierLogInput;');
76 fwrite($file_loginput,"\n");
77 fwrite($file_loginput, '$_GET[\'gDossier\']=$gDossierLogInput;');
78 fwrite($file_loginput,"\n");
79 fwrite($file_loginput,' $_REQUEST=array_merge($_GET,$_POST);');
80 fwrite($file_loginput,"\n");
81
82 $string='require_once "'.NOALYSS_PLUGIN.DIRECTORY_SEPARATOR.dirname(trim($ext->getp('me_file'))).DIRECTORY_SEPARATOR.'raw.php'.'";';
83 fwrite($file_loginput,sprintf("%s",$string));
84 fwrite($file_loginput,"\n");
85 fclose($file_loginput);
86 }
87 /* call the ajax script */
88 require_once NOALYSS_PLUGIN.DIRECTORY_SEPARATOR.dirname(trim($ext->getp('me_file'))).DIRECTORY_SEPARATOR.'raw.php';
89 }
90else
91 {
92 alert(j(_("Cette extension n'existe pas ")));
93 exit();
94 }
95?>
MaintenanceMode($p_file)
When you want to prevent users to connect, create a file in noalyss/ (NOALYSS_BASE) with the message ...
set_language()
set the lang thanks the _SESSION['g_lang'] var.
j($p_string)
escape correctly php string to javascript
Definition ac_common.php:96
alert($p_msg, $buffer=false)
alert in javascript
global $g_parameter
global $g_user
if no group available , then stop
_("actif, passif,charge,...")
$_GET['qcode']
manage the extension, it involves the table extension
manage the http input (get , post, request) and extract from an array
Class to manage the company parameter (address, name...)
$_POST['ac']
Definition do.php:323
for($e=0; $e< count($afiche); $e++) exit
if(! $g_user->is_double_identified()) $only_plugin
check if 2FA is completed