altocompta/html/ajax.php
Dany De Bontridder 0e5fcddfc1 Reformat the code with
- astyle --style=ansi
Broke : the <<<<EOF
.
2010-09-14 15:27:31 +00:00

44 lines
No EOL
1.1 KiB
PHP

<?php
/**
* @brief this file is used for the ajax from the extension, it will the ajax.php file from the plugin directory
* all the variable are in $_REQUEST
* The code (of the plugin) is required
* Required variable in $_REQUEST
* - gDossier
* - plugin_code
*/
require_once('class_database.php');
require_once('class_user.php');
require_once('class_extension.php');
if ( !isset ($_REQUEST['gDossier'])) exit();
$cn=new Database(dossier::id());
$user=new User($cn);
$user->check(true);
/* if a code has been asked */
if (isset($_REQUEST['plugin_code']) )
{
$ext=new Extension($cn);
$ext->search('code',$_REQUEST['plugin_code']);
if ( $ext->get_parameter('id') != 0 )
{
/* security */
if ( !isset ($_SESSION['g_user']) || $ext->can_request($_SESSION['g_user']) == 0 )
{
exit();
}
/* call the ajax script */
require_once('ext'.DIRECTORY_SEPARATOR.dirname(trim($ext->get_parameter('filepath'))).DIRECTORY_SEPARATOR.'ajax.php');
}
else
{
alert(j(_("Cette extension n'existe pas ")));
exit();
}
}
?>
?>
?>