Subversion Repositories ALCASAR

Rev

Rev 3076 | Rev 3132 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3076 Rev 3130
Line 111... Line 111...
111
	else {$taille_fichier = $taille_fichier . " o";}
111
	else {$taille_fichier = $taille_fichier . " o";}
112
	return $taille_fichier;
112
	return $taille_fichier;
113
}
113
}
114
 
114
 
115
if (isset($_POST['action'])){
115
if (isset($_POST['action'])){
116
	$mac= str_replace ("'",'',escapeshellarg($_POST['mac_addr']));
116
	if (filter_var(trim($_POST['mac_addr']), FILTER_VALIDATE_MAC) !== false){
117
	unset($_POST['mac_addr']);
117
		$mac= trim($_POST['mac_addr']);
118
	switch ($_POST['action']){
118
		switch ($_POST['action']){
119
		case "$l_disconnect" :
119
			case "$l_disconnect" :
120
			exec("sudo /usr/sbin/chilli_query logout ".$mac);
120
				exec("sudo /usr/sbin/chilli_query logout ".$mac);
121
		break;
121
			break;
122
		case "$l_stop_capture_disconnect" :
122
			case "$l_stop_capture_disconnect" :
123
			exec('sudo /usr/local/bin/alcasar-iot_capture.sh -k '.$mac.' &>/dev/null &');
123
				exec('sudo /usr/local/bin/alcasar-iot_capture.sh -k '.$mac.' &>/dev/null &');
124
			exec("sudo /usr/sbin/chilli_query logout ".$mac);
124
				exec("sudo /usr/sbin/chilli_query logout ".$mac);
125
		break;
125
			break;
126
		case "$l_dissociate" :
126
			case "$l_dissociate" :
127
			exec("sudo /usr/sbin/chilli_query dhcp-release ".$mac);
127
				exec("sudo /usr/sbin/chilli_query dhcp-release ".$mac);
128
		break;
128
			break;
129
		case "$l_connect" :
129
			case "$l_connect" :
130
			exec("sudo /usr/sbin/chilli_query authorize mac ".$mac);
130
				exec("sudo /usr/sbin/chilli_query authorize mac ".$mac);
131
		break;
131
			break;
132
		case "$l_captureon" :
132
			case "$l_captureon" :
133
			exec('sudo /usr/local/bin/alcasar-iot_capture.sh -l '.$mac.' &>/dev/null &');
133
				exec('sudo /usr/local/bin/alcasar-iot_capture.sh -l '.$mac.' &>/dev/null &');
134
			exec("sudo /usr/sbin/chilli_query authorize mac ".$mac);
134
				exec("sudo /usr/sbin/chilli_query authorize mac ".$mac);
135
		break;
135
			break;
136
		case "$l_captureonly_on" :
136
			case "$l_captureonly_on" :
137
			exec('sudo /usr/local/bin/alcasar-iot_capture.sh -l '.$mac.' &>/dev/null &');
137
				exec('sudo /usr/local/bin/alcasar-iot_capture.sh -l '.$mac.' &>/dev/null &');
138
		break;	
138
			break;	
139
		case "$l_captureoff" :
139
			case "$l_captureoff" :
140
			exec('sudo /usr/local/bin/alcasar-iot_capture.sh -k '.$mac.' &>/dev/null &');
140
				exec('sudo /usr/local/bin/alcasar-iot_capture.sh -k '.$mac.' &>/dev/null &');
141
		break;
141
			break;
-
 
142
		}
142
	}
143
	}
-
 
144
	unset($_POST['mac_addr']);
143
}
145
}
144
?>
146
?>
145
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
147
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
146
<html><!-- written by Rexy -->
148
<html><!-- written by Rexy -->
147
<head>
149
<head>