Project

General

Profile

« Previous | Next » 

Revision 4f7bba46

Added by Renato Botelho almost 12 years ago

Do not allow local mac address to be added to passtrumac list in CP. It fixes #3122

View differences:

usr/local/www/services_captiveportal_mac_edit.php
100 100

  
101 101
	$_POST['mac'] = str_replace("-", ":", $_POST['mac']);
102 102

  
103
	if (($_POST['mac'] && !is_macaddr($_POST['mac'])))
104
		$input_errors[] = sprintf("%s. [%s]", gettext("A valid MAC address must be specified"), $_POST['mac']);
103
	if ($_POST['mac']) {
104
		if (is_macaddr($_POST['mac'])) {
105
			$iflist = get_interface_list();
106
			foreach ($iflist as $if) {
107
				if ($_POST['mac'] == strtolower($if['mac'])) {
108
					$input_errors[] = sprintf(gettext("The MAC address %s belongs to a local interface, you cannot use it here."), $_POST['mac']);
109
					break;
110
				}
111
			}
112
		} else {
113
			$input_errors[] = sprintf("%s. [%s]", gettext("A valid MAC address must be specified"), $_POST['mac']);
114
		}
115
	}
105 116
	if ($_POST['bw_up'] && !is_numeric($_POST['bw_up']))
106 117
		$input_errors[] = gettext("Upload speed needs to be an integer");
107 118
	if ($_POST['bw_down'] && !is_numeric($_POST['bw_down']))

Also available in: Unified diff