View file modules/link/admin.php

File size: 2.28Kb
<?php
########################################
##	           WAP-ENGINE             ##
########################################
##                                    ##
##  Автор : CHUMA (Токарев Владимир)  ##
##  e-mail : [email protected]     ##
##  WAP : http://wap-engine.ru        ##
##                                    ##
########################################
##         ВЫ НЕ ИМЕЕТЕ ПРАВО         ##
##        ИЗМЕНЯТЬ КОД СКРИПТА        ##
##  ДЛЯ ДАЛЬНЕЙШЕГО РАСПРОСТРАНЕНИЯ!  ##
########################################
include ('../../config.php');
include ('../../templates/run.php');
include ('../../templates/func.php');
####################
$str = filter($_GET['str']);
####################
if($_GET[act]=='del')
 {
  if(isset($_SESSION['sespass']) && isset($passw) && $_SESSION['sespass'] == $passw && ($status == '1' || $status == '2' || $status == '3'))
   {
   	$basedel = '../../data/links.txt';
 	$basestr = file($basedel);
 	$delstr = trim($basestr[$str]);
    $buff = @file_get_contents($basedel);
    $buff = str_replace("$delstr\r\n",'',$buff);
    $file = fopen($basedel,'w');
    flock ($file,LOCK_EX);
    fputs($file,$buff);
    fflush ($file); 
    flock ($file,LOCK_UN);
    fclose($file);
    
    $date = date('d.m.Y / H:i:s', time() + ($sdvigclock*3600));
    $adm_log_f = @file('../../data/adm_log.php');
    $adm_log_count = count($adm_log_f) - 2;
    $mes_to_adm_log = "$login|$date|Удалил ссылку на главной \"$delstr\"\r\n";
    for($i=2; $i < $adm_log_count; $i++)
     {
      $mes_to_adm_log .= $adm_log_f[$i];
     }
    $mes_to_adm_log = trim($mes_to_adm_log);
      
    $adm_log_file = fopen('../../data/adm_log.php','w');
    flock ($adm_log_file,LOCK_EX);
    fputs($adm_log_file,"<?php\r\n/*\r\n$mes_to_adm_log\r\n*/\r\n?>");
    fflush ($adm_log_file);
    flock ($adm_log_file,LOCK_UN);
    fclose($adm_log_file);
    
    header ('Location: ../../index.php?'.session_name().'='.session_id().'');
   }
    else 
   {
    include '../../themes/'.$themes.'.php';
    echo '<p class="err">Ошибка авторизации!!!<br /></p>';
    include '../../templates/foot.php';
   }
 }
####################
?>