Menu="OtherSettings"
Title="Identification"
Icon="ident.png"
Tag="id-badge"
---
<?PHP
/* Copyright 2005-2017, Lime Technology
 * Copyright 2012-2017, Bergware International.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version 2,
 * as published by the Free Software Foundation.
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 */
?>
<?
$disabled = $var['fsState']!='Stopped' ? 'disabled' : '';
$name_regex = '^[A-Za-z0-9]([A-Za-z0-9\-\.]{0,13}[A-Za-z0-9])?$';
$name_warn = preg_match('/'.$name_regex.'/', $var['NAME']) ? 'none' : 'block';
?>
<form markdown="1" name="NameSettings" method="POST" action="/update.htm" target="progressFrame">

Server name:
: <input type="text" name="NAME" id="NAME" maxlength="15" pattern="<?=$name_regex;?>" value="<?=htmlspecialchars($var['NAME'])?>" title="Only alphanumeric characters (&quot;A-Z&quot;, &quot;a-z&quot;, and &quot;0-9&quot;), dashes (&quot;-&quot;), and dots (&quot;.&quot;); and, the first and last characters must be alphanumeric" <?=$disabled?> required> <span id="name_warning" style="display:<?=$name_warn?>"><i class="fa fa-warning icon warning"></i> Not compatible with NetBIOS</span>

> The network identity of your server.  Also known as *hostname* or *short hostname*. Windows networking
> refers to this as the *NetBIOS name* and must be 15 characters or less in length.
> Use only alphanumeric characters (that is, "A-Z", "a-z", and "0-9"), dashes ("-"), and dots (".");
> and, the first and last characters must be alphanumeric.

Description:
: <input type="text" name="COMMENT" value="<?=htmlspecialchars($var['COMMENT'])?>" <?=$disabled?>>

> This is a text field that is seen next to a server when listed within Network or Network Neighborhood
> (Windows), or Finder (Mac OS X).

Model:
: <input type="text" name="SYS_MODEL" value="<?=htmlspecialchars($var['SYS_MODEL'])?>" <?=$disabled?>>

> This is the server model number.

&nbsp;
: <input type="submit" name="changeNames" value="Apply" <?=$disabled?>><input type="button" value="Done" onclick="done()"><?if ($disabled):?>Array must be <span class="strong big">Stopped</span> to change<?endif;?>
</form>
<script>
$("#NAME").keypress(function(event) {
	return event.key.match(/[A-Za-z0-9\-\.]/)!==null;
});
$("#NAME").on("input change", function() {
	if ($(this).val().match(/<?=$name_regex;?>/) === null) {
		$('#name_warning').fadeIn('fast');
	} else {
		$('#name_warning').fadeOut('fast');
	}
});
</script>