<?php
session_start();
					if (file_exists ('../../sg_cm/root.php') && (time() - filemtime('../../sg_cm/root.php') > 86400)) {
					session_destroy();}
					
$fn="../../sg_cm/conf/conf/conf.php";
   $file=file($fn);
   if($file[2]!=session_id())
     {
     	echo "<meta http-equiv=refresh content='0; url=../../sg_cm/admin/index.php'>";
        exit();
     } 
touch('../../sg_cm/root.php');	 
if(isset($_GET['quit']))
 {

    $f=fopen($fn,"w");
    fwrite($f,$file[0].$file[1]."111");
    fclose($f);
     echo "<meta http-equiv=refresh content='0; url=http://$_SERVER[SERVER_NAME]'>";
     exit();
  }
 $time=time();
        $date=mktime(date('H'),date('i'),date('s'),date('m'),date('d'),date('y'));
       $news_cat="";
        $f=fopen("../upload/gs_foto/db/news/$time","w+");
        fwrite($f,"$date\r\n".''."\r\n".'Новый альбом'."\r\n".''."\r\n".'');
        fclose($f);

        $f=fopen("../upload/gs_foto/db/id_foto/$time","w+");
        fclose($f);

        if($news_cat!="")
          {
          	 $f=fopen("../upload/gs_foto/db/cat/$news_cat","a+");
             fwrite($f,"$time\r\n");
             fclose($f);
          }


        echo "<meta http-equiv=refresh content='0; url=red.php?id=$time&op=1&c=1&page=1&ind=1'>";


?>
 