View file upgrade/index.php

File size: 2.83Kb
<?php
#-----------------------------------------------------#
#          ********* ROTORCMS *********               #
#              Made by  :  VANTUZ                     #
#               E-mail  :  [email protected]         #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#        для его дальнейшего распространения          #
#-----------------------------------------------------#	
require_once ('../includes/start.php');
require_once ('../includes/functions.php');
require_once ('../includes/header.php');
include_once ('../themes/' . $config['themes'] . '/index.php');

if ($config['rotorversion'] < '1.1') {
  $check = DB :: $dbh -> querySingle("SELECT `setting_name` FROM `setting` WHERE `setting_name`=?;", array('regmail'));
  if (empty($check)) {
    DB :: $dbh -> query("INSERT INTO `setting` (`setting_name`, `setting_value`) VALUES (?, ?);", array('regmail', '0'));
  } 

  $check = DB :: $dbh -> querySingle("SELECT `setting_name` FROM `setting` WHERE `setting_name`=?;", array('sendmail'));
  if (empty($check)) {
    DB :: $dbh -> query("INSERT INTO `setting` (`setting_name`, `setting_value`) VALUES (?, ?);", array('sendmail', '0'));
  } 

  $check = DB :: $dbh -> queryFetch("SHOW COLUMNS FROM `users` LIKE 'users_navigation';");
  if (empty($check)) {
    DB :: $dbh -> query("ALTER TABLE `users` ADD `users_navigation` tinyint(1) unsigned NOT NULL default '0' AFTER `users_ipbinding`;");
  } 

  $check = DB :: $dbh -> queryFetch("SHOW COLUMNS FROM `users` LIKE 'users_secquest';");
  if (empty($check)) {
    DB :: $dbh -> query("ALTER TABLE `users` ADD `users_secquest` varchar(50) NOT NULL default '' AFTER `users_confirmregkey`;");
    DB :: $dbh -> query("ALTER TABLE `users` ADD `users_secanswer` varchar(40) NOT NULL default '' AFTER `users_secquest`;");
  } 

  DB :: $dbh -> query("DELETE FROM `setting` WHERE `setting_name`=? LIMIT 1;", array('welcome'));
  DB :: $dbh -> query("REPLACE INTO `setting` (`setting_name`, `setting_value`) VALUES (?, ?);", array('rotorversion', '1.1'));
  save_setting();

  echo '<img src="../images/img/open.gif" alt="image" /> <b>RotorCMS успешно обновлен до версии 1.1</b><br /><br />';
} else {
  echo '<img src="../images/img/error.gif" alt="image" /> <b>Ваш сайт не нуждается в обновлении</b><br /><br />';
} 

echo '<b>Удалите файл upgrade/index.php после завершения апгрейда!</b><br /><br />';

echo '<img src="../images/img/homepage.gif" alt="image" /> <a href="../index.php?' . SID . '">На главную</a>';

include_once ('../themes/' . $config['themes'] . '/foot.php');

?>