Project

General

Profile

« Previous | Next » 

Revision a4edef21

Added by Berger Alexander about 10 years ago

fixed indent according to the style guide.

View differences:

usr/local/www/services_dhcp_edit.php
187 187
	}
188 188

  
189 189
	/* check for overlaps */
190
  foreach ($a_maps as $mapent) {
191
    if (isset($id) && ($a_maps[$id]) && ($a_maps[$id] === $mapent))
192
      continue;
193
      /* The fully qualified hostname (hostname + '.' + domainname) must be unique.
194
        The unqualified hostname does not have to be unique as long as the fully
195
        qualified hostname is unique. */
190
	foreach ($a_maps as $mapent) {
191
		if (isset($id) && ($a_maps[$id]) && ($a_maps[$id] === $mapent))
192
			continue;
193
		/* The fully qualified hostname (hostname + '.' + domainname) must be unique.
194
		 * The unqualified hostname does not have to be unique as long as the fully
195
		 * qualified hostname is unique. */
196 196
		$existingFqn = "{$mapent['hostname']}.{$mapent['domain']}";
197
    $candidateFqn = "{$_POST['hostname']}.{$_POST['domain']}";
198
    if ((($existingFqn == $candidateFqn) && $mapent['hostname']) || (($mapent['mac'] == $_POST['mac']) && $mapent['mac']) || (($mapent['ipaddr'] == $_POST['ipaddr']) && $mapent['ipaddr'] ) || (($mapent['cid'] == $_POST['cid']) && $mapent['cid'])) {
199
      $input_errors[] = gettext("This fully qualified hostname (Hostname + Domainname), IP, MAC address or Client identifier already exists.");
200
      break;
201
    }
202
  }
197
		$candidateFqn = "{$_POST['hostname']}.{$_POST['domain']}";
198
		if ((($existingFqn == $candidateFqn) && $mapent['hostname']) || (($mapent['mac'] == $_POST['mac']) && $mapent['mac']) || (($mapent['ipaddr'] == $_POST['ipaddr']) && $mapent['ipaddr'] ) || (($mapent['cid'] == $_POST['cid']) && $mapent['cid'])) {
199
			$input_errors[] = gettext("This fully qualified hostname (Hostname + Domainname), IP, MAC address or Client identifier already exists.");
200
			break;
201
		}
202
	}
203 203

  
204 204
	/* make sure it's not within the dynamic subnet */
205 205
	if ($_POST['ipaddr']) {

Also available in: Unified diff