Subversion Repositories ALCASAR

Rev

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

Rev 2177 Rev 2178
Line 87... Line 87...
87
			$line ="\nuamdomain=\"" . trim($_POST['add_uamdomain']) . "\" #" . trim($_POST['add_domain_comment']);
87
			$line ="\nuamdomain=\"" . trim($_POST['add_uamdomain']) . "\" #" . trim($_POST['add_domain_comment']);
88
			$pointeur=fopen(DOMAIN_ALLOWED_LIST,"a");
88
			$pointeur=fopen(DOMAIN_ALLOWED_LIST,"a");
89
			fwrite ($pointeur, $line);
89
			fwrite ($pointeur, $line);
90
			fclose ($pointeur);
90
			fclose ($pointeur);
91
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh"); # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
91
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh"); # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
92
			exec ("sudo /usr/bin/systemctl restart dnsmasq-blackhole");
-
 
93
			sleep (1); # be sure that dnsmasq-blackhole is restarted before killing tun0 ! 
92
			sleep (1); # be sure that dnsmasq-blackhole is restarted before killing tun0 ! 
94
			exec ("sudo /usr/bin/systemctl restart chilli");
93
			exec ("sudo /usr/bin/systemctl restart chilli");
95
			}
94
			}
96
		}
95
		}
97
	break;
96
	break;
Line 122... Line 121...
122
				fwrite($pointeur,$ligne);
121
				fwrite($pointeur,$ligne);
123
				}
122
				}
124
			}
123
			}
125
		fclose($pointeur);
124
		fclose($pointeur);
126
		}
125
		}
127
	exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
126
	exec ("sudo /usr/local/bin/alcasar-file-clean.sh");  # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
128
	exec ("sudo /usr/bin/systemctl restart dnsmasq-blackhole");
-
 
129
	sleep (1); # be sure that dnsmasq-blackhole is restarted before killing tun0 ! 
127
	sleep (1); # be sure that dnsmasq-blackhole is restarted before killing tun0 ! 
130
	exec ("sudo /usr/bin/systemctl restart chilli");
128
	exec ("sudo /usr/bin/systemctl restart chilli");
131
	break;
129
	break;
132
	case 'new_ip' :
130
	case 'new_ip' :
133
	if (trim($_POST['add_ip']) != "") 
131
	if (trim($_POST['add_ip']) != "") 
Line 150... Line 148...
150
			{
148
			{
151
			$line ="\nuamallowed=\"" . trim($_POST['add_ip']) ."\" #" . trim($_POST['add_ip_comment']);
149
			$line ="\nuamallowed=\"" . trim($_POST['add_ip']) ."\" #" . trim($_POST['add_ip_comment']);
152
			$pointeur=fopen(IP_ALLOWED_LIST,"a");
150
			$pointeur=fopen(IP_ALLOWED_LIST,"a");
153
			fwrite ($pointeur, $line);
151
			fwrite ($pointeur, $line);
154
			fclose ($pointeur);
152
			fclose ($pointeur);
155
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
153
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh");  # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
156
			exec ("sudo /usr/bin/systemctl restart chilli");
154
			exec ("sudo /usr/bin/systemctl restart chilli");
157
			}
155
			}
158
		}
156
		}
159
	break;
157
	break;
160
	case 'change_ip' :
158
	case 'change_ip' :
Line 184... Line 182...
184
				fwrite($pointeur,$ligne);
182
				fwrite($pointeur,$ligne);
185
				}
183
				}
186
			}
184
			}
187
		fclose($pointeur);
185
		fclose($pointeur);
188
		}
186
		}
189
	exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
187
	exec ("sudo /usr/local/bin/alcasar-file-clean.sh");  # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
190
	exec ("sudo /usr/bin/systemctl restart chilli");
188
	exec ("sudo /usr/bin/systemctl restart chilli");
191
	break;
189
	break;
192
	}
190
	}
193
}
191
}
194
?>
192
?>