web/event_list.php
changeset 996 f40a6a61d224
parent 994 053de9a4e738
child 998 bf99ad0ba5ff
equal deleted inserted replaced
995:dd96593acbbb 996:f40a6a61d224
     5 $dir = $C_event_props;
     5 $dir = $C_event_props;
     6 
     6 
     7 if(isset($_REQUEST['delete']) && !empty($_REQUEST['delete'])) {
     7 if(isset($_REQUEST['delete']) && !empty($_REQUEST['delete'])) {
     8 	$delete_enc = base64_decode($_REQUEST['delete']);
     8 	$delete_enc = base64_decode($_REQUEST['delete']);
     9 	$iv = substr($delete_enc, 0, $C_openssl_cipher_iv_length);
     9 	$iv = substr($delete_enc, 0, $C_openssl_cipher_iv_length);
    10 	$delete_dec = openssl_decrypt(substr($delete_enc, $C_openssl_cipher_iv_length), 'aes256', hash('sha256', SECRET, true), 0, $iv);
    10 	$delete_dec = substr(openssl_decrypt($delete_enc, 'aes256', hash('sha256', SECRET, true), 0), $C_openssl_cipher_iv_length);
    11 	if(is_file($dir."/".$delete_dec)) {
    11 	if(is_file($dir."/".$delete_dec)) {
    12 		unlink($dir."/".$delete_dec);
    12 		unlink($dir."/".$delete_dec);
    13 	}
    13 	}
    14 }
    14 }
    15 
    15 
   101 		foreach($files as $ind_file) {
   101 		foreach($files as $ind_file) {
   102 			if (stripos($ind_file, '.') !== 0) {
   102 			if (stripos($ind_file, '.') !== 0) {
   103 				$token = base64_encode(
   103 				$token = base64_encode(
   104 					$iv .
   104 					$iv .
   105 					openssl_encrypt(
   105 					openssl_encrypt(
   106 						$ind_file,
   106 						$iv.$ind_file,
   107 						'aes256',
   107 						'aes256',
   108 						hash('sha256', SECRET, true),
   108 						hash('sha256', SECRET, true),
   109 						0,
   109 						0
   110 						$iv
       
   111 					)
   110 					)
   112 				);
   111 				);
   113 		?>
   112 		?>
   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>
   113 			<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
   114 		<?php