Subversion Repositories ALCASAR

Rev

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

Rev 3193 Rev 3215
Line 367... Line 367...
367
		$dest_dir = $dir_blacklist."ossi-bl-".$file_name; # /etc/e2guardian/list/blacklist/ossi-bl-XXXXXXXX
367
		$dest_dir = $dir_blacklist."ossi-bl-".$file_name; # /etc/e2guardian/list/blacklist/ossi-bl-XXXXXXXX
368
		if((!empty($file_name)) && (!file_exists($dest_dir))){
368
		if((!empty($file_name)) && (!file_exists($dest_dir))){
369
			exec("mkdir ".escapeshellarg($dest_dir));
369
			exec("mkdir ".escapeshellarg($dest_dir));
370
			$file=$_FILES['fichier_ip']['tmp_name'];
370
			$file=$_FILES['fichier_ip']['tmp_name'];
371
			exec('/usr/bin/dos2unix '.escapeshellarg($file));
371
			exec('/usr/bin/dos2unix '.escapeshellarg($file));
372
			if(move_uploaded_file($_FILES['fichier_ip']['tmp_name'], $dest_dir."/domains")){ // copy in the file "domains" (containing @ip & domain names (like over Toulouse categories))
372
			if(move_uploaded_file($_FILES['fichier_ip']['tmp_name'], $dest_dir."/domains")){ // copy in the file "domains" (containing @ip & domain names (like other Toulouse categories))
373
				touch ($dest_dir."/urls"); // create the URL file even if it isn't used
373
				touch ($dest_dir."/urls"); // create the URL file even if it isn't used
374
				file_put_contents ($bl_categories, $dest_dir."\n", FILE_APPEND); // add to the categories list
374
				file_put_contents ($bl_categories, $dest_dir."\n", FILE_APPEND); // add to the categories list
375
				file_put_contents ($bl_categories_enabled, "ossi-bl-".$file_name."\n", FILE_APPEND); //Enabled by default
375
				file_put_contents ($bl_categories_enabled, "ossi-bl-".$file_name."\n", FILE_APPEND); //Enabled by default
376
				exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
376
				exec("sudo /usr/local/bin/alcasar-bl.sh --reload");
377
			}
377
			}