mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
Cron, missed default setting to origin "cron" and some __String() to (string) replacements
This commit is contained in:
parent
97156b5596
commit
71485968d2
@ -70,7 +70,7 @@ class SettingsController extends ApiMutableModelControllerBase
|
||||
if ($node != null) {
|
||||
$result = array("result" => "failed", "validations" => array());
|
||||
$jobInfo = $this->request->getPost("job");
|
||||
if ($node->origin->__toString() != "cron") {
|
||||
if ((string)$node->origin != "cron") {
|
||||
if ($jobInfo["command"] != (string)$node->command) {
|
||||
$result["validations"]["job.command"] = gettext("This item has been created by " .
|
||||
"another service, command and parameter may not be changed.");
|
||||
@ -78,7 +78,7 @@ class SettingsController extends ApiMutableModelControllerBase
|
||||
if ($jobInfo["parameters"] != (string)$node->parameters) {
|
||||
$result["validations"]["job.parameters"] = sprintf(gettext("This item has been created by " .
|
||||
"another service, command and parameter may not be changed. (was: %s)"),
|
||||
(String)$node->parameters);
|
||||
(string)$node->parameters);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
<model>
|
||||
<mount>//OPNsense/cron</mount>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1</version>
|
||||
<description>Cron settings</description>
|
||||
<items>
|
||||
<jobs>
|
||||
<job type="ArrayField">
|
||||
<origin type="TextField">
|
||||
<Required>Y</Required>
|
||||
<default>cron</default>
|
||||
<mask>/^([a-z,A-Z,1-9]){0,30}$/</mask>
|
||||
<ValidationMessage>Origin should be regular text of max 30 characters.</ValidationMessage>
|
||||
</origin>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user