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',
|
action: 'generatePassword',
|
||||||
attribute: this.name,
|
attribute: this.name,
|
||||||
objecttype: varLSform.objecttype,
|
objecttype: varLSform.objecttype,
|
||||||
|
objectdn: varLSform.objectdn,
|
||||||
idform: varLSform.idform
|
idform: varLSform.idform
|
||||||
};
|
};
|
||||||
data.imgload=varLSdefault.loadingImgDisplay(this.generateBtn);
|
data.imgload=varLSdefault.loadingImgDisplay(this.generateBtn);
|
||||||
|
|
|
@ -97,11 +97,15 @@ if (!isset($_ERRORS)) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'generatePassword':
|
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'])) {
|
if ($GLOBALS['LSsession'] -> loadLSobject($_REQUEST['objecttype'])) {
|
||||||
$object = new $_REQUEST['objecttype']();
|
$object = new $_REQUEST['objecttype']();
|
||||||
|
if ($object) {
|
||||||
|
if ($object -> loadData($_REQUEST['objectdn'])) {
|
||||||
$form = $object -> getForm($_REQUEST['idform']);
|
$form = $object -> getForm($_REQUEST['idform']);
|
||||||
|
if ($form) {
|
||||||
$field=$form -> getElement($_REQUEST['attribute']);
|
$field=$form -> getElement($_REQUEST['attribute']);
|
||||||
|
if ($field) {
|
||||||
$val = $field -> generatePassword();
|
$val = $field -> generatePassword();
|
||||||
if ( $val ) {
|
if ( $val ) {
|
||||||
$data = array(
|
$data = array(
|
||||||
|
@ -109,6 +113,10 @@ if (!isset($_ERRORS)) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(1004,$_REQUEST['objecttype']);
|
$GLOBALS['LSerror'] -> addErrorCode(1004,$_REQUEST['objecttype']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue