Пример #1
0
   $somecontent .= "\$siteoff=\"{$siteoff}\";\n";
   $somecontent .= "\$offtext=\"{$offtext}\";\n";
   $somecontent .= "\$cc_url=\"{$cc_url}\";\n";
   $somecontent .= "\$gzip_enable=\"{$gzip_enable}\";\n";
   $somecontent .= "\$commentsperpage_comments=" . (int) $commentsperpage_comments . ";\n";
   $somecontent .= "\$moder_comments=\"{$moder_comments}\";\n";
   $somecontent .= "\$sape_user=\"{$sape_user}\";\n";
   $somecontent .= "\$language=\"{$language}\";\n";
   $somecontent .= "\$rss_content=\"3\";\n";
   $somecontent .= "\$sperpage={$sperpage};\n";
   $somecontent .= "\$saftertitle={$saftertitle};\n";
   $somecontent .= "?>";
   full_chmod_dir(CONF, 0755, 0644);
   full_chmod_dir(ARTICLES, 0755, 0644);
   full_chmod_dir(ENGINE, 0755, 0644);
   full_chmod_dir($localpath . "pictures", 0755, 0644);
   $filename = CONF . 'config.php';
   @chmod(CONF . 'config.php', 0666);
   $fh = fopen($filename, 'w') or die("can't open file");
   fwrite($fh, $somecontent);
   fclose($fh);
   $line = $_POST['login'] . '::' . md5($_POST['login'] . $_POST['password']) . '::3::' . $_POST['admin_email'] . '::::::::::::' . time() . "::\n";
   @chmod(CONF . 'users.php', 0666);
   save(CONF . 'users.php', $line, 'w');
   @($content .= <<<EOT
t<h2>Установка успешно завершена</h2>
t<div style="text-align:left;font-size:12px">
t<ul>
t<li>Файл конфигурации - записан</li>
t<li>Имя пользователя и пароль - записан</li>
t<li>Права на каталоги и файлы - установлены</li>
Пример #2
0
function full_chmod_dir($directory, $permdir, $permfile)
{
    @chmod($directory, $permdir);
    $dir = opendir($directory);
    while ($file = readdir($dir)) {
        if (is_file($directory . '/' . $file)) {
            if ($file == '.htaccess') {
                @chmod($directory . '/' . $file, 0644);
            } else {
                @chmod($directory . '/' . $file, $permfile);
            }
        } elseif (is_dir($directory . '/' . $file) && $file != '.' && $file != '..') {
            @chmod($directory . '/' . $file, $permdir);
            full_chmod_dir($directory . '/' . $file, $permdir, $permfile);
        }
    }
    closedir($dir);
}
Пример #3
0
	перейти в <a href="elfinder.php">файловый менеджер</a>.';
    include $localpath . '/admin/admintemplate.php';
    exit;
}
if (isset($_POST['restore'])) {
    $src = $localpath . 'media/upgrade/' . $_POST['rfile'];
    if (file_exists($src)) {
        if ($_POST['deldir'] == '1') {
            full_del_dir(CONF);
            full_del_dir(ARTICLES);
            full_del_dir(ENGINE);
        }
        system('cd ' . $localpath . '; tar -xzf ' . $src);
        full_chmod_dir(CONF, $perm_dir, $perm_file);
        full_chmod_dir(ARTICLES, $perm_dir, $perm_file);
        full_chmod_dir(ENGINE, $perm_dir, $perm_file);
        $contentcenter .= 'Файл архива <b>' . $_POST['rfile'] . '</b> распакован.<br />
		Данные заменены.';
    } else {
        $contentcenter .= 'Файл архива <b>' . $_POST['rfile'] . '</b> отсутствует на сервере.';
    }
    include $localpath . '/admin/admintemplate.php';
    exit;
}
$drop = '<select name="rfile">';
$drop .= '<option value="">--choice--</option>';
$directory = $localpath . 'media/upgrade';
if (file_exists($directory)) {
    $dir = scandir($directory, 1);
    $matches = array();
    for ($i = 0; $i < count($dir) - 2; $i++) {
Пример #4
0
            $allok += perm_file($directory . '/' . $file, $permfile);
        } elseif (is_dir($directory . '/' . $file) && $file != '.' && $file != '..') {
            full_perm_dir($directory . '/' . $file, $permdir, $permfile);
        }
    }
    closedir($dir);
    return $allok;
}
if ($inst) {
    full_chmod_dir(CONF, $perm_dir, $perm_file);
    full_chmod_dir(ARTICLES, $perm_dir, $perm_file);
    full_chmod_dir(ENGINE, $perm_dir, $perm_file);
    #	full_chmod_dir(MYCODE,$perm_dir,$perm_file);
    full_chmod_dir(PICTURES, $perm_dir, $perm_file);
    full_chmod_dir($localpath . 'admin/templates', $perm_dir, $perm_file);
    full_chmod_dir($localpath . 'templates', $perm_dir, $perm_file);
    header('LOCATION: chmod.php');
}
@($allok = 0);
@($contentcenter .= '<h3>Установка прав CMS Кандидат</h3>');
$contentcenter .= '<br /><table cellpadding="2" cellspacing="0" width="90%">
	<thead>
    <td width="70%"><b>Файл</b></td>
    <td width="10%"><b>Права</b></td>
    <td width="10%"><b>Надо</b></td>
    <td width="10%"><b>ОК</b></td>
    </thead><tbody>';
$allok += full_perm_dir(CONF, $perm_dir, $perm_file);
$allok += full_perm_dir(ARTICLES, $perm_dir, $perm_file);
$allok += full_perm_dir(ENGINE, $perm_dir, $perm_file);
#$allok+=full_perm_dir(MYCODE,$perm_dir,$perm_file);