Commit cf274fef authored by Franco Fichtner's avatar Franco Fichtner

firewall: fix schedule clone when in use; closes #976

parent 2b74af0c
......@@ -128,7 +128,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
/* check for name conflicts */
foreach ($a_schedules as $schedId => $schedule) {
if ( $schedId != $id && $schedule['name'] == $pconfig['name']) {
if ((!isset($id) || $schedId != $id) && $schedule['name'] == $pconfig['name']) {
$input_errors[] = gettext("A Schedule with this name already exists.");
break;
}
......@@ -796,11 +796,11 @@ function removeRow(el) {
<td><a id="help_for_name" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Schedule Name");?></td>
<td>
<?php
if(is_schedule_inuse($pconfig['name']) == true):?>
if (is_schedule_inuse($pconfig['name']) && isset($id)): ?>
<input name="name" type="hidden" id="name" value="<?=htmlspecialchars($pconfig['name']);?>" />
<?=$pconfig['name']; ?>
<p>
<?=gettext("NOTE: This schedule is in use so the name may not be modified!");?>
<?=gettext("This schedule is in use so the name may not be modified!");?>
</p>
<?php
else: ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment