mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-21 07:53:50 +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
trunk
|
@ -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,11 +97,15 @@ 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']();
|
||||
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(
|
||||
|
@ -109,6 +113,10 @@ if (!isset($_ERRORS)) {
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSerror'] -> addErrorCode(1004,$_REQUEST['objecttype']);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue