コード例 #1
0
ファイル: templates.php プロジェクト: Gordondalos/union
 function open_dir($dir, $newdir)
 {
     //The function that will copy the files
     if (file_exists($dir) && file_exists($newdir)) {
         $open_dir = opendir($dir);
         while (false !== ($file = readdir($open_dir))) {
             if ($file != "." && $file != "..") {
                 if (@filetype($dir . "/" . $file . "/") == "dir") {
                     if (!file_exists($newdir . "/" . $file . "/")) {
                         mkdir($newdir . "/" . $file . "/");
                         @chmod($newdir . "/" . $file, 0777);
                         open_dir($dir . "/" . $file . "/", $newdir . "/" . $file . "/");
                     }
                 } else {
                     copy($dir . "/" . $file, $newdir . "/" . $file);
                     @chmod($newdir . "/" . $file, 0666);
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: index.php プロジェクト: Vladimir25/marykay
if (file_exists($ind_file)) {
    require TEMP_FOLDER . 'config.php';
    include $ind_file;
    //$c = ob_get_contents();
    //ob_end_clean();
    //echo str_replace("\n", "", str_replace("\r", "", str_replace("\t", "", $c)));
} else {
    header('HTTP/1.1 503 Service temporary down');
    die("Отсутствует файл " . $ind_file . "");
}
$site->db->write_dump();
//----- Проверка целостности файлов
//--Проверяем включена ли проверка
if (intval($sets['secure_files'])) {
    //--Проверяем прошел ли час после прошлой проверки
    if ($sets['secure_files_time'] + $sets['secure_files_period'] < time() && intval(date("H")) > 9) {
        //------Проверка
        if ($dir = opendir($_SERVER['DOCUMENT_ROOT'])) {
            $otchet = open_dir($dir, "/");
            if ($otchet != '' && intval($sets['secure_files_once'])) {
                send_mail('admin@' . $_SERVER['HTTP_HOST'], 'Проверка файлов', $sets['mn_email'], 'admin', '', '', 'Проверка файлов', $otchet);
            }
            //----------Пишем новое время проверки.
            mysql_query("UPDATE " . TABLE_PREFIX . "settings SET value='" . time() . "' WHERE id='secure_files_time'") or die(mysql_error());
            if (!intval($sets['secure_files_once'])) {
                mysql_query("UPDATE " . TABLE_PREFIX . "settings SET value='1' WHERE id='secure_files_once'") or die(mysql_error());
            }
        }
    }
}
l('end');