mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-01 00:03:18 +01:00
LSldapObject : Fixed bug in previous commit witch block validation error return in LSform
This commit is contained in:
parent
7249d9fd52
commit
879442a5b7
1 changed files with 11 additions and 6 deletions
|
@ -309,7 +309,7 @@ class LSldapObject {
|
||||||
* @see validateAttrsData()
|
* @see validateAttrsData()
|
||||||
* @see submitChange()
|
* @see submitChange()
|
||||||
*/
|
*/
|
||||||
private function _updateData($new_data) {
|
private function _updateData($new_data,$idForm=null) {
|
||||||
if(!is_array($new_data)) {
|
if(!is_array($new_data)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -367,9 +367,14 @@ class LSldapObject {
|
||||||
*
|
*
|
||||||
* @retval boolean true si les données sont valides, false sinon
|
* @retval boolean true si les données sont valides, false sinon
|
||||||
*/
|
*/
|
||||||
function validateAttrsData($idForm) {
|
function validateAttrsData($idForm=null) {
|
||||||
$retval = true;
|
$retval = true;
|
||||||
|
if ($idForm) {
|
||||||
$LSform=$this -> forms[$idForm][0];
|
$LSform=$this -> forms[$idForm][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$LSform=false;
|
||||||
|
}
|
||||||
foreach($this -> attrs as $attr) {
|
foreach($this -> attrs as $attr) {
|
||||||
$attr_values = $attr -> getValue();
|
$attr_values = $attr -> getValue();
|
||||||
if (!$attr -> isValidate()) {
|
if (!$attr -> isValidate()) {
|
||||||
|
@ -460,13 +465,13 @@ class LSldapObject {
|
||||||
$ret=LSldap :: getNumberResult ($sfilter,$sbasedn,$sparams);
|
$ret=LSldap :: getNumberResult ($sfilter,$sbasedn,$sparams);
|
||||||
if($test['result']==0) {
|
if($test['result']==0) {
|
||||||
if($ret!=0) {
|
if($ret!=0) {
|
||||||
$LSform -> setElementError($attr,$msg_error);
|
if ($LSform) $LSform -> setElementError($attr,$msg_error);
|
||||||
$retval = false;
|
$retval = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if($ret<0) {
|
if($ret<0) {
|
||||||
$LSform -> setElementError($attr,$msg_error);
|
if ($LSform) $LSform -> setElementError($attr,$msg_error);
|
||||||
$retval = false;
|
$retval = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -475,7 +480,7 @@ class LSldapObject {
|
||||||
else if(isset($test['function'])) {
|
else if(isset($test['function'])) {
|
||||||
if (function_exists($test['function'])) {
|
if (function_exists($test['function'])) {
|
||||||
if(!$test['function']($this)) {
|
if(!$test['function']($this)) {
|
||||||
$LSform -> setElementError($attr,$msg_error);
|
if ($LSform) $LSform -> setElementError($attr,$msg_error);
|
||||||
$retval = false;
|
$retval = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue