mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 14:33:49 +01:00
- LSformElement_password : Correction de la méthode de génération de mot de
passe via Ajax bugant dans certain cas.
This commit is contained in:
parent
eac7ef4d46
commit
ef6e0eda4d
2 changed files with 17 additions and 8 deletions
|
@ -140,6 +140,7 @@ var LSformElement_password_field = new Class({
|
|||
action: 'generatePassword',
|
||||
attribute: this.name,
|
||||
objecttype: varLSform.objecttype,
|
||||
objectdn: varLSform.objectdn,
|
||||
idform: varLSform.idform
|
||||
};
|
||||
data.imgload=varLSdefault.loadingImgDisplay(this.generateBtn);
|
||||
|
|
|
@ -97,16 +97,24 @@ if (!isset($_ERRORS)) {
|
|||
}
|
||||
break;
|
||||
case 'generatePassword':
|
||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['idform'])) ) {
|
||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['objectdn'])) && (isset($_REQUEST['idform'])) ) {
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($_REQUEST['objecttype'])) {
|
||||
$object = new $_REQUEST['objecttype']();
|
||||
$form = $object -> getForm($_REQUEST['idform']);
|
||||
$field=$form -> getElement($_REQUEST['attribute']);
|
||||
$val = $field -> generatePassword();
|
||||
if ( $val ) {
|
||||
$data = array(
|
||||
'generatePassword' => $val
|
||||
);
|
||||
if ($object) {
|
||||
if ($object -> loadData($_REQUEST['objectdn'])) {
|
||||
$form = $object -> getForm($_REQUEST['idform']);
|
||||
if ($form) {
|
||||
$field=$form -> getElement($_REQUEST['attribute']);
|
||||
if ($field) {
|
||||
$val = $field -> generatePassword();
|
||||
if ( $val ) {
|
||||
$data = array(
|
||||
'generatePassword' => $val
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue