mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
Implement dynamic form elements
Rename "isPostAndValid" to "isSubmittedAndValid" and refactor it. Add possibility for specific form elements to auto-submit their form. refs #4439
This commit is contained in:
parent
1b9885f274
commit
f5162189dd
@ -295,8 +295,12 @@ abstract class Form extends Zend_Form
|
||||
|
||||
if ($submitted) {
|
||||
$this->preValidation($checkData);
|
||||
return $this->isValid($checkData);
|
||||
} else {
|
||||
$this->populate($checkData);
|
||||
return false;
|
||||
}
|
||||
return parent::isValid($checkData) && $submitted;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -373,8 +377,6 @@ abstract class Form extends Zend_Form
|
||||
return false;
|
||||
}
|
||||
|
||||
$seed -= intval(time() / $this->tokenTimeout) * $this->tokenTimeout;
|
||||
|
||||
return $token === hash('sha256', $this->getSessionId() . $seed);
|
||||
}
|
||||
|
||||
@ -386,7 +388,6 @@ abstract class Form extends Zend_Form
|
||||
{
|
||||
$seed = mt_rand();
|
||||
$hash = hash('sha256', $this->getSessionId() . $seed);
|
||||
$seed += intval(time() / $this->tokenTimeout) * $this->tokenTimeout;
|
||||
|
||||
return array($seed, $hash);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user