noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
ajax.php
Go to the documentation of this file.
00001 <?php
00002 /**
00003  *  This file is part of NOALYSS under GPL
00004  * 
00005  */
00006 /**
00007  * @brief this file is used for the ajax from the extension, it will the ajax.php file from the plugin directory
00008  * all the variable are in $_REQUEST
00009  * The code (of the plugin) is required
00010  * Required variable in $_REQUEST
00011  *  - gDossier
00012  *  - plugin_code
00013  */
00014 define ('ALLOWED',1);
00015 require_once '../include/constant.php';
00016 require_once('class_database.php');
00017 require_once('class_user.php');
00018 require_once('class_extension.php');
00019 if ( !isset ($_REQUEST['gDossier'])) exit();
00020 
00021 require_once 'class_own.php';
00022 mb_internal_encoding("UTF-8");
00023 
00024 global $g_user,$cn,$g_parameter;
00025 $cn=new Database(dossier::id());
00026 $g_parameter=new Own($cn);
00027 $g_user=new User($cn);
00028 $g_user->check(true);
00029 
00030 /* if a code has been asked */
00031 if (isset($_REQUEST['plugin_code']) )
00032 {
00033 
00034     $ext=new Extension($cn);
00035 
00036     if ( $ext->search($_REQUEST['plugin_code']) != -1)
00037     {
00038         /* security */
00039         if ( !isset ($_SESSION['g_user']) || $ext->can_request($_SESSION['g_user']) == 0 )
00040         {
00041             exit();
00042         }
00043         /* call the ajax script */
00044         require_once('ext'.DIRECTORY_SEPARATOR.dirname(trim($ext->get_parameter('me_file'))).DIRECTORY_SEPARATOR.'ajax.php');
00045     }
00046     else
00047     {
00048         alert(j(_("Cette extension n'existe pas ")));
00049         exit();
00050     }
00051 
00052 }
00053 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations