Subversion Repositories ALCASAR

Rev

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

Rev 1955 Rev 1957
Line 233... Line 233...
233
	unlink ("$dir_tmp/blacklists.tar.gz"); unlink ("$dir_tmp/md5sum");
233
	unlink ("$dir_tmp/blacklists.tar.gz"); unlink ("$dir_tmp/md5sum");
234
	break;
234
	break;
235
case 'MAJ_cat_bl' :
235
case 'MAJ_cat_bl' :
236
	if (file_exists($bl_categories_enabled))
236
	if (file_exists($bl_categories_enabled))
237
	{
237
	{
238
		$fichier=fopen($update_file_cat,"w+");
238
		$cat_tab=file_get_contents("$bl_categories_enabled");
-
 
239
		$ossi_cat_tab=preg_match_all('/^ossi-/',$cat_tab);
-
 
240
		foreach ($cat_tab as $key => $line)
-
 
241
		{
-
 
242
			echo $key."-".$line;
-
 
243
			//if (preg_match ('/^ossi-/', $line))
-
 
244
			//{
-
 
245
			//	$ossi_cat_tab[$n]=$line;
-
 
246
			//	$n=$n+1;
-
 
247
			//}
-
 
248
		}
-
 
249
		foreach ($ossi_cat_tab as $$key => $ossi_cat)
-
 
250
		{
-
 
251
			echo "tab-".$ossi_cat;	
-
 
252
		}
239
		$pointeur=fopen($bl_categories_enabled, "w+");
253
		$pointeur=fopen($bl_categories_enabled, "w+");
-
 
254
		$fichier=fopen($update_file_cat,"w+");
240
		foreach ($_POST as $key => $value)
255
		foreach ($_POST as $key => $value)
241
		{
256
		{
242
			if (strstr($key,'chk-'))
257
			if (strstr($key,'chk-'))
243
			{	
258
			{	
244
				$line=str_replace('chk-','',$key)."\n";
259
				$line=str_replace('chk-','',$key)."\n";
245
				fwrite($pointeur,$line);
260
				fwrite($pointeur,$line);
246
				if(trim($line) == 'malware' && $_POST['update_cat'] == 1)
261
				if(trim($line) == 'malware' && $_POST['update_cat'] == 1) //auto-update of malware
247
				{
262
				{
248
					fputs($fichier, "malware rsync://ftp.ut-capitole.fr/blacklist/dest/malware\n");
263
					fputs($fichier, "malware rsync://ftp.ut-capitole.fr/blacklist/dest/malware\n");
249
				}
264
				}
250
			}
265
			}
251
		}
266
		}
-
 
267
		//foreach ($ossi_cat_tab as $ossi_cat)
-
 
268
		//{
-
 
269
		//	fwrite($pointeur,$ossi_cat); //restore OSSI custom categories
252
			
270
		//}
253
		fclose($pointeur);
271
		fclose($pointeur);
-
 
272
		fclose($fichier);
254
	}
273
	}
255
	else {echo "$l_error_open_file $bl_categories_enabled";}
274
	else {echo "$l_error_open_file $bl_categories_enabled";}
256
	$fichier=fopen($dir_blacklist."ossi-bl/domains","w+");
275
	$fichier=fopen($dir_blacklist."ossi-bl/domains","w+");
257
	fputs($fichier, form_filter($_POST['OSSI_bl']));
276
	fputs($fichier, form_filter($_POST['OSSI_bl']));
258
	fclose($fichier);
277
	fclose($fichier);