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,15 +14,30 @@ else {
|
||||||
|
|
||||||
$data=NULL;
|
$data=NULL;
|
||||||
if (!isset($_ERRORS)) {
|
if (!isset($_ERRORS)) {
|
||||||
$class = $_REQUEST['template'];
|
if (isset($_REQUEST['template'])) {
|
||||||
if (LSsession :: loadLSclass($class)) {
|
$class = $_REQUEST['template'];
|
||||||
$meth = 'ajax_'.$_REQUEST['action'];
|
if (LSsession :: loadLSclass($class)) {
|
||||||
if (method_exists($class,$meth)) {
|
$meth = 'ajax_'.$_REQUEST['action'];
|
||||||
$class :: $meth($data);
|
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);
|
LSsession :: displayAjaxReturn($data);
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
Loading…
Reference in a new issue