View file modules/kabinet/del_mes_copy.php

File size: 1.48Kb
<?php
include ('../../config.php');
include ('../../templates/run.php');
include ('../../templates/func.php');
####################
if(isset($_SESSION['sespass']) && isset($passw) && $_SESSION['sespass'] == $passw)
 {
if($_GET['box']=='copybox')
   {
    if($_GET['clear']==1)
     {
      write_to_file('../../data/copybox/'.$login.'.php', "<?php\r\n/*\r\n*/\r\n?>");
   
      header ("Location: copybox.php?&".session_name()."=".session_id()."");
     }
      else
     {
      $copybox_f = @file('../../data/copybox/'.$login.'.php');
      $copybox_count = count($copybox_f);
      for($i=2; $i < $copybox_count - 2; $i++)
       {
        $messages[] = $copybox_f[$i];
       }

      $mes_count = count($messages);


      for($i=0; $i < $mes_count; $i++)
       {
        if($i != $_GET['id'])
         {	
          $mes_to_file .= trim($messages[$i])."\r\n";
         }
       }
      $mes_to_file = trim($mes_to_file);
      if(!empty($mes_to_file))
       { $mes_to_file = "\r\n".$mes_to_file; } else
       { $mes_to_file = ''; }
      
      write_to_file('../../data/copybox/'.$login.'.php', "<?php\r\n/*$mes_to_file\r\n*/\r\n?>");
   
      header ("Location: copybox.php?page=$_GET[page]&".session_name()."=".session_id()."");
     }
   }
 }
  else
 {
  include ("../../themes/$themes.php");
  echo"<p class=\"b\">Вы не авторизованы!!! Войдите в личный кабинет.<br /></p>";
  include ("../../templates/foot.php");
 }

?>