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',
|
LSerror :: defineError('LSsession_20',
|
||||||
_("LSsession : Error during password recovery. Contact administrators.(Step : %{step})")
|
_("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',
|
LSerror :: defineError('LSsession_22',
|
||||||
_("LSsession : problem during initialisation.")
|
_("LSsession : problem during initialisation.")
|
||||||
);
|
);
|
||||||
|
|
|
@ -14,6 +14,7 @@ else {
|
||||||
|
|
||||||
$data=NULL;
|
$data=NULL;
|
||||||
if (!isset($_ERRORS)) {
|
if (!isset($_ERRORS)) {
|
||||||
|
if (isset($_REQUEST['template'])) {
|
||||||
$class = $_REQUEST['template'];
|
$class = $_REQUEST['template'];
|
||||||
if (LSsession :: loadLSclass($class)) {
|
if (LSsession :: loadLSclass($class)) {
|
||||||
$meth = 'ajax_'.$_REQUEST['action'];
|
$meth = 'ajax_'.$_REQUEST['action'];
|
||||||
|
@ -21,8 +22,22 @@ if (!isset($_ERRORS)) {
|
||||||
$class :: $meth($data);
|
$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);
|
LSsession :: displayAjaxReturn($data);
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
Loading…
Reference in a new issue