- Автор темы
- Администратор
- Модер.
- Команда форума
- #1
Здесь публикую Вашему вниманию инструкцию по обнулению Okay CMS
Устанавливаем Okay CMS получаем тестовый ключ и чистим
ИЛИ распаковываем архив из дистрибутива, делаем необходимые манипуляции и пакуем все назад с тем же именем.
Нуление установки OKAY CMS
[HIDE=5
]1. В файле \install\models\ModelStep_5.php
Вырезаем строки 8-22:
Вырезаем строки 26-45 (10-29)
Вырезаем строки 49-70 (14-34):
2. В файле \install\design\html\step_5.php
Меняем строки 9-29:
На следующие:
3. В файле \install\controllers\ControllerStep_5.php
удаляем строки 10-12:
Обнуление для установки готово!
[/HIDE]
Устанавливаем Okay CMS получаем тестовый ключ и чистим
ИЛИ распаковываем архив из дистрибутива, делаем необходимые манипуляции и пакуем все назад с тем же именем.
Нуление установки OKAY CMS
[HIDE=5
]1. В файле \install\models\ModelStep_5.php
Вырезаем строки 8-22:
PHP:
public function __construct($lang_file) {
parent::__construct($lang_file);
$this->config_file = dirname(dirname(__DIR__ )) . '/config/config.php';
if($license = @file_get_contents("http://license.okay-cms.com/index.php?domain=".$_SERVER['HTTP_HOST'])) {
$this->result['test_license'] = $license;
}
if(isset($_POST['license'])) {
$this->license = $_POST['license'];
}
$this->result['license'] = $this->license;
}
Вырезаем строки 26-45 (10-29)
PHP:
if(!is_writable($this->config_file)) {
$this->result['errors'][] = $this->get_translation('error_config_file_not_writable');
}
if(!empty($_POST['license'])) {
if(!$this->result['end_date'] = $this->check_license()) {
$this->result['errors'][] = $this->get_translation('error_check_license');
}
if(!isset($this->result['errors'])) {
$conf = file_get_contents($this->config_file);
$conf = preg_replace("/license.*/i", 'license = "'.$this->license.'"', $conf);
file_put_contents($this->config_file, $conf);
$this->result['success'] = new stdCLass;
$this->result['success']->title = $this->get_translation('thanks_for_license');
$this->result['success']->license_date_text = $this->get_translation('license_date_text');
}
}
return $this->result;
Вырезаем строки 49-70 (14-34):
PHP:
$p=13; $g=3; $x=5; $r = ''; $s = $x;
$bs = explode(' ', $this->license);
foreach($bs as $bl){
for($i=0, $m=''; $i<strlen($bl)&&isset($bl[$i+1]); $i+=2){
$a = base_convert($bl[$i], 36, 10)-($i/2+$s)%27;
$b = base_convert($bl[$i+1], 36, 10)-($i/2+$s)%24;
$m .= ($b * (pow($a,$p-$x-5) )) % $p;}
$m = base_convert($m, 10, 16); $s+=$x;
for ($a=0; $a<strlen($m); $a+=2) $r .= @chr(hexdec($m{$a}.$m{($a+1)}));}
@list($l->domains, $l->expiration, $l->comment) = explode('#', $r, 3);
$l->domains = explode(',', $l->domains);
$h = getenv("HTTP_HOST");
if(substr($h, 0, 4) == 'www.') $h = substr($h, 4);
if(!in_array($h, $l->domains) || (strtotime($l->expiration)<time() && $l->expiration!='*')) {
return false;
} else {
return $l->expiration;
}
2. В файле \install\design\html\step_5.php
Меняем строки 9-29:
PHP:
<?if(isset($success)) {?>
<p class="check_true"><?=$lang->thanks_for_license?></p>
<?if($end_date) {?>
<p class="step_info"><?=$lang->license_date_text?> <?=$end_date?></p>
<?}?>
<form method="GET" class="clearfix">
<input name="route" type="hidden" value="Step_6" />
<input class="next_step_button" type="submit" value="<?=$lang->next_step?>" />
</form>
<?} else { ?>
<p class="step_info"><?=$lang->for_work_okay_cms?>:</p>
<form method="POST" name="license" class="clearfix">
<textarea class="license_area" name="license"><?=$license?></textarea>
<?if(!empty($test_license)) {?>
<input class="get_button" type="button" value="<?=$lang->get_test_license?>" onclick="document.license.license.value='<?=$test_license?>';">
<?} else {?>
<a target="_blank" href="http://license.okay-cms.com/index.php?domain=<?=$_SERVER['HTTP_HOST']?>"><?=$lang->get_test_license?></a>
<?}?>
<input class="next_step_button" type="submit" value="<?=$lang->next_step?>">
</form>
<?}?>
На следующие:
PHP:
<p class="check_true"><?=$lang->thanks_for_license?></p>
<form method="GET" class="clearfix">
<input name="route" type="hidden" value="Step_6" />
<input class="next_step_button" type="submit" value="<?=$lang->next_step?>" />
</form>
3. В файле \install\controllers\ControllerStep_5.php
удаляем строки 10-12:
PHP:
foreach($this->model->get_license() as $key_result=>$result) {
$this->design_vars->$key_result = $result;
}
Обнуление для установки готово!
[/HIDE]
