mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 08:19:05 +01:00
Permit LSaddon to provide ajax callable function
This commit is contained in:
parent
b4105c04d6
commit
9a09cf491e
2 changed files with 25 additions and 8 deletions
|
@ -2353,7 +2353,9 @@ class LSsession {
|
|||
LSerror :: defineError('LSsession_20',
|
||||
_("LSsession : Error during password recovery. Contact administrators.(Step : %{step})")
|
||||
);
|
||||
// 21 : not yet used
|
||||
LSerror :: defineError('LSsession_21',
|
||||
_("LSsession : call function %{func} do not provided from LSaddon %{addon}.")
|
||||
);
|
||||
LSerror :: defineError('LSsession_22',
|
||||
_("LSsession : problem during initialisation.")
|
||||
);
|
||||
|
|
|
@ -14,6 +14,7 @@ else {
|
|||
|
||||
$data=NULL;
|
||||
if (!isset($_ERRORS)) {
|
||||
if (isset($_REQUEST['template'])) {
|
||||
$class = $_REQUEST['template'];
|
||||
if (LSsession :: loadLSclass($class)) {
|
||||
$meth = 'ajax_'.$_REQUEST['action'];
|
||||
|
@ -22,7 +23,21 @@ if (!isset($_ERRORS)) {
|
|||
}
|
||||
}
|
||||
}
|
||||
elseif (isset($_REQUEST['addon'])) {
|
||||
$addon = $_REQUEST['addon'];
|
||||
if (LSsession :: loadLSaddon($addon)) {
|
||||
$func = 'ajax_'.$_REQUEST['action'];
|
||||
if (function_exists($func)) {
|
||||
$func = new ReflectionFunction($func);
|
||||
if (basename($func->getFileName())=="LSaddons.$addon.php") {
|
||||
$func->invokeArgs(array(&$data));
|
||||
}
|
||||
else {
|
||||
LSerror :: addErrorCode('LSsession_21',array('func' => $func -> getName(),'addon' => $addon));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LSsession :: displayAjaxReturn($data);
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue