web/event_list.php
changeset 988 954019f62866
child 994 053de9a4e738
equal deleted inserted replaced
987:18cb05f027a0 988:954019f62866
       
     1 <?php
       
     2 include_once 'common.php';
       
     3 
       
     4 $user_data = authenticate($C_event_users, $translate);
       
     5 $dir = $C_event_props;
       
     6 
       
     7 if(isset($_REQUEST['delete']) && !empty($_REQUEST['delete'])) {
       
     8 	$delete_enc = base64_decode($_REQUEST['delete']);
       
     9 	$iv = substr($delete_enc, 0, openssl_cipher_iv_length('aes256'));
       
    10 	$delete_dec = openssl_decrypt(substr($delete_enc, openssl_cipher_iv_length('aes256')), 'aes256', hash('sha256', SECRET, true), 0, $iv);
       
    11 	if(is_file($dir."/".$delete_dec)) {
       
    12 		unlink($dir."/".$delete_dec);
       
    13 	}
       
    14 }
       
    15 
       
    16 ?>
       
    17 <!DOCTYPE html>
       
    18 <html lang="<?php echo($actual); ?>">
       
    19 <head>
       
    20     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
       
    21     <title>Polemic Tweet &mdash; event form</title>
       
    22     <meta http-equiv="X-UA-Compatible" content="IE=9" />
       
    23 
       
    24     <!-- FONT -->
       
    25     <link href='<?php echo(registry_url('PT-Sans_Narrow','font'))?>' rel='stylesheet' type='text/css'>
       
    26     <link href='<?php echo(registry_url('PT-Sans','font'))?>' rel='stylesheet' type='text/css'>
       
    27     
       
    28     <!-- CSS -->
       
    29     <link rel="stylesheet" href="<?php echo(registry_url('blueprint-screen','css'));?>" type="text/css" media="screen, projection"/>
       
    30     <link rel="stylesheet" href="<?php echo(registry_url('blueprint-print','css'));?>" type="text/css" media="print"/>
       
    31     <!--[if lt IE 8]><link rel="stylesheet" href="<?php echo(registry_url('blueprint-ie','css'));?>" type="text/css" media="screen, projection"><![endif]-->
       
    32 	<link rel="stylesheet" href="<?php echo(registry_url('blueprint-plugins-fancy-type','css'));?>" type="text/css" media="screen, projection"/>
       
    33 	<link rel="stylesheet" href="<?php echo(registry_url('custom','css'));?>" type="text/css" media="screen, projection"/>
       
    34     
       
    35     <!-- JAVASCRIPT -->
       
    36     <script type="text/javascript" src="<?php echo(registry_url('jquery','js'))?>"></script>
       
    37     <script type="text/javascript" src="<?php echo(registry_url('underscore','js'))?>"></script>
       
    38     
       
    39     <script type="text/javascript">
       
    40     	$(function() {
       
    41         	$(".delete-lnk").click(function(e) {
       
    42             	if(!confirm("<?php echo $translate->_('Event_confirm_delete_archive'); ?>")) {
       
    43                 	e.preventDefault();
       
    44             	}
       
    45         	});
       
    46     	});
       
    47     </script>
       
    48     
       
    49 </head>
       
    50 <body>
       
    51 
       
    52 	<div id="sendUsFeedBack"><a href="<?php echo($C_feedback_form_url); ?>" target="_blank"><img src="<?php echo(URL_ROOT); ?>images/sendusfeedback.png"></a></div>
       
    53     <div class="container">
       
    54       <img src="images/ENMI_2010_logo.gif" class="logo">
       
    55 	  <ul class="menu">
       
    56 		  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>" class="menuLink">
       
    57 		  	<?php print $translate->_("Accueil"); ?></a></li>
       
    58 		  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>about.php" class="menuLink">
       
    59 		  	<?php print $translate->_("A propos"); ?></a></li>
       
    60 		  <li ><a href="mailto:contact@iri.centrepompidou.fr" class="menuLink" >
       
    61 		  	<?php print $translate->_("Contact"); ?></a></li>
       
    62 	  </ul>
       
    63 	  <ul class="menu">
       
    64 		  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>archives.php" class="menuLink">
       
    65 		  	<?php print $translate->_("Archives"); ?></a></li>
       
    66 		<?php
       
    67 		if($_SESSION['auth']) { ?>
       
    68 		  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>logout.php" class="menuLink">
       
    69 		  	<?php print $translate->_("Logout"); ?></a></li>
       
    70 		<?php
       
    71 		}
       
    72 		?>
       
    73 	  </ul>
       
    74 	  
       
    75 	  
       
    76 	  <ul class="menu lang" >
       
    77 	  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>event_list.php?lang=ja_JP" class="menuLink" >
       
    78 	       <img src='images/flag_jp.gif'<?php if($actual!="ja_JP"){echo("style='opacity: .5;'"); } ?> />
       
    79 	        <?php print $translate->_("Japonais"); ?></a></li>
       
    80 	  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>event_list.php?lang=fr" class="menuLink">
       
    81 	       <img src='images/flag_fr.gif' <?php if($actual!="fr"){echo("style='opacity: .5;'"); } ?> />
       
    82 	       <?php print $translate->_("Français"); ?></a></li>
       
    83 	  <li ><a href="<?php echo(URL_ROOT); ?>event_list.php?lang=en" class="menuLink">
       
    84 	       <img src='images/flag_en.gif' <?php if($actual!="en"){echo("style='opacity: .5;'"); } ?> />
       
    85 	       <?php print $translate->_("Anglais"); ?></a></li>
       
    86 	  </ul>
       
    87 	</div>
       
    88 	<div class="container">
       
    89 	<?php
       
    90 	if(!isset($user_data) || isset($user_data['error'])) {
       
    91 		print "<div class=\"error-message\"><h2>".$user_data['error']."</h2></div>";
       
    92 	}
       
    93 	else {
       
    94 	?>
       
    95 	
       
    96 		<ul class="event-list">
       
    97 		<?php
       
    98 		$files = scandir($dir);
       
    99 		$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes256'));
       
   100 		
       
   101 		foreach($files as $ind_file) {
       
   102 			if (stripos($ind_file, '.') !== 0) {
       
   103 				$token = base64_encode(
       
   104 					$iv .
       
   105 					openssl_encrypt(
       
   106 						$ind_file,
       
   107 						'aes256',
       
   108 						hash('sha256', SECRET, true),
       
   109 						0,
       
   110 						$iv
       
   111 					)
       
   112 				);
       
   113 		?>
       
   114 			<li><a href="<?php echo "event_props/".$ind_file;?>"><?php echo $ind_file;?></a><a href="?delete=<?php print urlencode($token); ?>" class="delete-lnk"><span class="delete-btn"></span></a></li>
       
   115 		<?php
       
   116 			}
       
   117 		}
       
   118 		?>
       
   119 		</ul>
       
   120 	<?php }?>
       
   121 	</div>
       
   122 </body>
       
   123 </html>