mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 14:33:49 +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,15 +14,30 @@ else {
|
|||
|
||||
$data=NULL;
|
||||
if (!isset($_ERRORS)) {
|
||||
$class = $_REQUEST['template'];
|
||||
if (LSsession :: loadLSclass($class)) {
|
||||
$meth = 'ajax_'.$_REQUEST['action'];
|
||||
if (method_exists($class,$meth)) {
|
||||
$class :: $meth($data);
|
||||
if (isset($_REQUEST['template'])) {
|
||||
$class = $_REQUEST['template'];
|
||||
if (LSsession :: loadLSclass($class)) {
|
||||
$meth = 'ajax_'.$_REQUEST['action'];
|
||||
if (method_exists($class,$meth)) {
|
||||
$class :: $meth($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
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