Version 3.0.5

This commit is contained in:
Neo committed 2025-12-19 00:31:03 -08:00
1 parent 19b38c7c74
commit 1d4720f3e2
3755 files changed
+508378 -664541

No files matched your search

@@ -0,0 +1,85 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Installer: EULA file
* Last Updated: $LastChangedDate: 2009-06-11 17:11:57 -0400 (Thu, 11 Jun 2009) $
*
* @author $Author: josh $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 4765 $
*
*/
class install_address extends ipsCommand
{
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
/* INIT */
$error = false;
/* Check input? */
if ( $this->request['do'] == 'check' )
{
/* Check Directory */
if ( ! ( is_dir( $this->request['install_dir'] ) ) )
{
$error = true;
$this->registry->output->addWarning( 'Указанной директории не существует' );
}
/* Check URL */
if ( ! $this->request['install_dir'] )
{
$error = true;
$this->registry->output->addWarning( 'Вы не указали URL' );
}
if( ! $error )
{
/* Save Form Data */
IPSSetUp::setSavedData('install_dir', preg_replace( "#(//)$#", "", str_replace( '\\', '/', $this->request['install_dir'] ) . '/' ) );
IPSSetUp::setSavedData('install_url', preg_replace( "#(//)$#", "", str_replace( '\\', '/', $this->request['install_url'] ) . '/' ) );
/* Next Action */
$this->registry->autoLoadNextAction( 'db' );
}
}
/* Guess at directory */
$dir = str_replace( 'admin/install' , '' , getcwd() );
$dir = str_replace( 'admin\install' , '' , $dir ); // Windows
$dir = str_replace( '\\' , '/', $dir );
/* Guess at URL */
$url = str_replace( "/admin/installer/index.php" , "", $_SERVER['HTTP_REFERER'] );
$url = str_replace( "/admin/installer/" , "", $url);
$url = str_replace( "/admin/installer" , "", $url);
$url = str_replace( "/admin/install/index.php" , "", $_SERVER['HTTP_REFERER'] );
$url = str_replace( "/admin/install/" , "", $url);
$url = str_replace( "/admin/install" , "", $url);
$url = str_replace( "/admin" , "", $url);
$url = str_replace( "index.php" , "", $url);
$url = preg_replace( "!\?(.+?)*!" , "", $url );
$url = "{$url}/";
/* Page Output */
$this->registry->output->setTitle( "Директории и URLы" );
$this->registry->output->setNextAction( "address&do=check" );
$this->registry->output->addContent( $this->registry->output->template()->page_address( $dir, $url ) );
$this->registry->output->sendOutput();
}
}
@@ -0,0 +1,86 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Installer: ADMIN file
* Last Updated: $LastChangedDate: 2009-04-22 14:33:03 -0400 (Wed, 22 Apr 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 4532 $
*
*/
class install_admin extends ipsCommand
{
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
$_e = 0;
/* Check input? */
if( $this->request['do'] == 'check' )
{
if( ! $this->request['username'] )
{
$_e = 1;
$this->registry->output->addWarning( 'Необходимо указать имя пользователя' );
}
if( ! $this->request['password'] )
{
$_e = 1;
$this->registry->output->addWarning( 'Необходимо ввести пароль' );
}
else
{
if( $this->request['password'] != $this->request['confirm_password'] )
{
$_e = 1;
$this->registry->output->addWarning( 'Введенные пароли не совпадают' );
}
}
if( ! $this->request['email'] )
{
$_e = 1;
$this->registry->output->addWarning( 'Необходимо указать Email' );
}
if ( $_e )
{
$this->registry->output->setTitle( "Администратор: Ошибка" );
$this->registry->output->setNextAction( 'admin&do=check' );
$this->registry->output->addContent( $this->registry->output->template()->page_admin() );
$this->registry->output->sendOutput();
}
else
{
/* Save Form Data */
IPSSetUp::setSavedData('admin_user', $this->request['username'] );
IPSSetUp::setSavedData('admin_pass', $this->request['password'] );
IPSSetUp::setSavedData('admin_email', $this->request['email'] );
/* Next Action */
$this->registry->autoLoadNextAction( 'install' );
return;
}
}
/* Output */
$this->registry->output->setTitle( "Создание учетной записи администратора" );
$this->registry->output->setNextAction( 'admin&do=check' );
$this->registry->output->addContent( $this->registry->output->template()->page_admin() );
$this->registry->output->sendOutput();
}
}
@@ -0,0 +1,150 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Installer: EULA file
* Last Updated: $LastChangedDate: 2009-05-11 19:24:23 -0400 (Mon, 11 May 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 4629 $
*
*/
class install_apps extends ipsCommand
{
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
/* Check input? */
if( $this->request['do'] == 'check' )
{
/* Check Directory */
if ( ! is_array( $_POST['apps'] ) OR ! count( $_POST['apps'] ) )
{
$this->registry->output->addError( 'Нужно выбрать хотя бы одно приложение' );
}
else
{
/* Save Form Data */
IPSSetUp::setSavedData('install_apps', implode( ',', array_keys( $_POST['apps'] ) ) );
/* Check writeable files */
foreach( array_keys( $_POST['apps'] ) as $appDir )
{
$info = IPSSetUp::fetchXmlAppWriteableFiles( $appDir );
if ( count( $info['notexist'] ) )
{
foreach( $info['notexist'] as $path )
{
$this->registry->output->addWarning( 'Файл или директория "' . $path . '" не существует, создайте ее' );
}
}
if ( count( $info['notwrite'] ) )
{
foreach( $info['notwrite'] as $path )
{
$this->registry->output->addWarning( 'Запись в "' . $path . '" невозможна, измените права доступа' );
}
}
/**
* Custom errors
*/
if ( count( $info['other'] ) )
{
foreach( $info['other'] as $error )
{
$this->registry->output->addWarning( $error );
}
}
}
/* Do we have errors? */
if ( ! count( $this->registry->output->fetchWarnings() ) )
{
/* Next Action */
$this->registry->autoLoadNextAction( 'address' );
}
}
}
/* Generate apps... */
$apps = array( 'core' => array(), 'ips' => array(), 'other' => array() );
foreach( array( 'applications', 'applications_addon/ips', 'applications_addon/other' ) as $_pBit )
{
$path = IPS_ROOT_PATH . $_pBit;
$handle = opendir( $path );
while ( ( $file = readdir( $handle ) ) !== FALSE )
{
if ( ! preg_match( "#^\.#", $file ) )
{
if ( is_dir( $path . '/' . $file ) )
{
//-----------------------------------------
// Get it!
//-----------------------------------------
if ( ! file_exists( IPS_ROOT_PATH . $_pBit . '/' . $file . '/xml/information.xml' ) )
{
continue;
}
$data = IPSSetUp::fetchXmlAppInformation( $file );
switch( $_pBit )
{
case 'applications':
$apps['core'][ $file ] = $data;
break;
case 'applications_addon/ips':
$apps['ips'][ $file ] = $data;
break;
case 'applications_addon/other':
$apps['other'][ $file ] = $data;
break;
}
}
}
}
closedir( $handle );
}
/* Reorder the array so that core is first */
$new_array = array();
$new_array['core'] = $apps['core']['core'];
foreach( $apps['core'] as $app => $data )
{
if( $app == 'core' )
{
continue;
}
$new_array[$app] = $data;
}
$apps['core'] = $new_array;
/* Page Output */
$this->registry->output->setTitle( "Приложения" );
$this->registry->output->setNextAction( 'apps&do=check' );
$this->registry->output->addContent( $this->registry->output->template()->page_apps( $apps ) );
$this->registry->output->sendOutput();
}
}
@@ -0,0 +1,261 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Installer: EULA file
* Last Updated: $LastChangedDate: 2009-04-22 14:33:03 -0400 (Wed, 22 Apr 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 4532 $
*
*/
class install_db extends ipsCommand
{
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
/* Dealing with the result of the form asking for DB input */
if ( $this->request['do'] == 'check' )
{
/* Make sure the fields were filled out */
if ( ! $this->request['overwrite'] AND ( ! $this->request['db_host'] || ! $this->request['db_name'] || ! $this->request['db_user'] ) )
{
$this->registry->output->addWarning( 'Необходимо полностью заполнить форму' );
}
/* No special characters */
else if( preg_match( "/[^a-zA-Z0-9_]/", $this->request['db_pre'] ) )
{
$this->registry->output->addWarning( 'Нельзя использовать специальные символы в префиске таблиц' );
}
else
{
//-----------------------------------------
// Load DB driver..
//-----------------------------------------
require_once( IPS_KERNEL_PATH . 'classDb' . ucwords( IPSSetUp::getSavedData('sql_driver') ) . '.php' );
$classname = "db_driver_".IPSSetUp::getSavedData('sql_driver');
$DB = new $classname;
$DB->obj['sql_database'] = $this->request['db_name'];
$DB->obj['sql_user'] = $this->request['db_user'];
$DB->obj['sql_pass'] = $_REQUEST['db_pass'];
$DB->obj['sql_host'] = $this->request['db_host'];
$DB->obj['sql_tbl_prefix'] = $this->request['db_pre'];
//--------------------------------------------------
// Any "extra" configs required for this driver?
//--------------------------------------------------
if ( file_exists( IPS_ROOT_PATH . 'setup/sql/'.IPSSetUp::getSavedData('sql_driver').'_install.php' ) )
{
require_once( IPS_ROOT_PATH . 'setup/sql/'.IPSSetUp::getSavedData('sql_driver').'_install.php' );
$extra_install = new install_extra( $this->registry );
$extra_install->install_form_process();
if ( count( $extra_install->errors ) )
{
$this->registry->output->addWarning( implode( "<br />", $extra_install->errors ) );
}
if ( is_array( $extra_install->info_extra ) and count( $extra_install->info_extra ) )
{
foreach( $extra_install->info_extra as $k => $v )
{
IPSSetUp::setSavedData( '__sql__' . $k, $v );
}
}
if ( is_array( $DB->connect_vars ) and count( $DB->connect_vars ) )
{
foreach( $DB->connect_vars as $k => $v )
{
$DB->connect_vars[ $k ] = $extra_install->info_extra[ $k ];
}
}
}
//-----------------------------------------
// Error check
//-----------------------------------------
if ( count( $extra_install->errors ) )
{
$this->registry->output->setTitle( "База данных: Ошибка" );
$this->registry->output->setNextAction( 'db&do=check' );
$this->registry->output->addContent( $this->fetchContent() );
$this->registry->output->sendOutput();
return;
}
//------------------------------------------
// Make CONSTANT
//------------------------------------------
define( 'SQL_DRIVER' , IPSSetUp::getSavedData('sql_driver') );
define( 'IPS_MAIN_DB_CLASS_LOADED', TRUE );
//------------------------------------------
// Try a DB connection
//------------------------------------------
$DB->return_die = true;
if ( ! $DB->connect() )
{
$errors[] = $DB->error;
}
//-----------------------------------------
// Error check
//-----------------------------------------
if ( is_array( $errors ) AND count( $errors ) )
{
$this->registry->output->setTitle( "База данных: Ошибка" );
$this->registry->output->setNextAction( 'db&do=check' );
$this->registry->output->addWarning( implode( "<br />", $errors ) );
$this->registry->output->addContent( $this->fetchContent() );
$this->registry->output->sendOutput();
return;
}
/* Save Form Data */
IPSSetUp::setSavedData('db_host', $this->request['db_host'] );
IPSSetUp::setSavedData('db_name', $this->request['db_name'] );
IPSSetUp::setSavedData('db_user', $this->request['db_user'] );
IPSSetUp::setSavedData('db_pass', $_REQUEST['db_pass'] );
IPSSetUp::setSavedData('db_pre' , $this->request['db_pre'] );
/* Are we overwriting an IP.Board 2.x or 3.x installation? */
if ( ! $this->request['overwrite'] )
{
if ( $DB->checkForTable( 'upgrade_history' ) )
{
/* Get latest version */
$latest = $DB->buildAndFetch( array( 'select' => '*',
'from' => 'upgrade_history',
'order' => 'upgrade_version_id DESC',
'limit' => array( 0, 1 ) ) );
if ( is_array( $latest ) )
{
$this->registry->output->setTitle( "База данных: Ошибка" );
$this->registry->output->setNextAction( 'db&do=check' );
$this->registry->output->addWarning( "Обнаружена установленная IP.Board " . $latest['upgrade_version_human'] );
$this->registry->output->addContent( $this->fetchContent( TRUE ) );
$this->registry->output->sendOutput();
return;
}
}
}
/* Next Action */
$this->registry->autoLoadNextAction( 'admin' );
return;
}
}
//--------------------------------------------------
// DO WE HAVE A DB DRIVER SET?
//--------------------------------------------------
IPSSetUp::setSavedData('sql_driver', strtolower( ( IPSSetUp::getSavedData('sql_driver') == "" ) ? $_REQUEST['sql_driver'] : IPSSetUp::getSavedData('sql_driver') ) );
if ( ! IPSSetUp::getSavedData('sql_driver') )
{
//----------------------------------------------
// Test to see how many DB driver's we've got..
//----------------------------------------------
$dh = opendir( IPS_KERNEL_PATH );
while ( $file = @readdir( $dh ) )
{
if ( preg_match( "/^classDb([a-zA-Z0-9]*)\.php/i", $file, $driver ) )
{
if ( stristr( $driver[1], 'client' ) OR ! $driver[1] )
{
continue;
}
$drivers[] = $driver[1];
}
}
@closedir( $dh );
//----------------------------------------------
// Got more than one?
//----------------------------------------------
if ( count($drivers) > 1 )
{
//------------------------------------------
// Show choice screen first...
//------------------------------------------
/* Page Output */
$this->registry->output->setTitle( "База данных" );
$this->registry->output->setNextAction( 'db' );
$this->registry->output->addContent( $this->registry->output->template()->page_check_db( $drivers ) );
$this->registry->output->sendOutput();
}
else
{
//------------------------------------------
// Use only driver installed
//------------------------------------------
IPSSetUp::setSavedData( 'sql_driver', strtolower($drivers[0]) );
}
}
$this->request['db_host'] = ( $this->request['db_host'] ) ? $this->request['db_host'] : 'localhost';
$this->registry->output->setTitle( "База данных" );
$this->registry->output->setNextAction( 'db&do=check' );
$this->registry->output->addContent( $this->fetchContent() );
$this->registry->output->sendOutput();
}
/**
* Fetch content
*
* @access public
* @param bool
* @return string
*/
public function fetchContent( $check=FALSE )
{
/* Output */
$content = ( $check === FALSE ) ? $this->registry->output->template()->page_db() : $this->registry->output->template()->page_dbOverride();
/* Driver extras? */
if ( file_exists( IPS_ROOT_PATH . 'setup/sql/'.IPSSetUp::getSavedData('sql_driver').'_install.php' ) )
{
require_once( IPS_ROOT_PATH . 'setup/sql/'.IPSSetUp::getSavedData('sql_driver').'_install.php' );
$extra_install = new install_extra( $this->registry );
$content = str_replace( '<!--{EXTRA.SQL}-->', $extra_install->install_form_extra(), $content );
}
return $content;
}
}
@@ -0,0 +1,46 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Installer: EULA file
* Last Updated: $LastChangedDate: 2009-05-21 08:29:40 -0400 (Thu, 21 May 2009) $
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 4681 $
*
*/
class install_done extends ipsCommand
{
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
$installLocked = FALSE;
/* Lock the page */
if ( @file_put_contents( DOC_IPS_ROOT_PATH . 'cache/installer_lock.php', 'Just out of interest, what did you expect to see here?' ) )
{
$installLocked = TRUE;
}
/* Clean conf global */
IPSInstall::cleanConfGlobal();
/* Simply return the EULA page */
$this->registry->output->setTitle( "Установка завершена!" );
$this->registry->output->setHideButton( TRUE );
$this->registry->output->addContent( $this->registry->output->template()->page_installComplete( $installLocked ) );
$this->registry->output->sendOutput( FALSE );
}
}
@@ -0,0 +1,34 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Installer: EULA file
* Last Updated: $LastChangedDate: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 3887 $
*
*/
class install_eula extends ipsCommand
{
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
/* Simply return the EULA page */
$this->registry->output->setTitle( "Соглашение" );
$this->registry->output->addContent( $this->registry->output->template()->page_eula() );
$this->registry->output->sendOutput();
}
}
@@ -0,0 +1,158 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Installer: Index file
* Last Updated: $LastChangedDate: 2009-07-16 10:24:48 -0400 (Thu, 16 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 4900 $
*
*/
class install_index extends ipsCommand
{
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
/* INIT */
$filesOK = NULL;
$extensions = get_loaded_extensions();
$extensionsOK = TRUE;
$extensionData = array();
/* Test Extensions */
include( IPS_ROOT_PATH . 'setup/xml/requiredextensions.php' );
if ( is_array( $INSTALLDATA ) )
{
foreach( $INSTALLDATA as $data )
{
if ( ! in_array( $data['testfor'], $extensions ) )
{
//-----------------------------------------
// Added 'nohault' key which will show a
// warning but not prohibit installation
//-----------------------------------------
if( $data['nohault'] )
{
$data['_ok'] = 1; // Anything but true or false
$extensionsOK = 1; // Anything but true or false
}
else
{
$extensionsOK = FALSE;
}
}
else
{
$data['_ok'] = TRUE;
}
$extensionData[] = $data;
}
}
/* Check for conf_global.dist.php */
if ( file_exists( DOC_IPS_ROOT_PATH . 'conf_global.dist.php') AND ! file_exists( DOC_IPS_ROOT_PATH.'conf_global.php') )
{
if ( ! @rename( DOC_IPS_ROOT_PATH.'conf_global.dist.php', DOC_IPS_ROOT_PATH.'conf_global.php' ) )
{
$filesOK = FALSE;
$this->registry->output->addError( "<strong>Вы должны переименовать файл 'conf_global.<b style='color:red'>dist.php</b>' в 'conf_global.<b style='color:red'>php</b>' перед продолжением.</strong>
Этот файл можно найти в корневой директории IP.Board." );
}
}
/* All extensions loaded OK? */
if ( $extensionsOK == TRUE AND $filesOK === NULL )
{
$filesOK = FALSE;
/* Fetch core writeable files */
require_once( IPS_KERNEL_PATH . 'classXML.php' );
$xml = new classXML( IPSSetUp::charSet );
try
{
$xml->load( IPS_ROOT_PATH . 'setup/xml/writeablefiles.xml' );
foreach( $xml->fetchElements( 'file' ) as $xmlelement )
{
$data = $xml->fetchElementsFromRecord( $xmlelement );
if ( $data['path'] )
{
$_path = DOC_IPS_ROOT_PATH . $data['path'];
if ( ! file_exists( $_path ) )
{
if ( $data['dir'] )
{
if ( ! @mkdir( $_path, 0777, TRUE ) )
{
$this->registry->output->addError( 'Директория "' . $data['path'] . '" не существует, создайте ее' );
}
}
else
{
$this->registry->output->addError( 'Файл "' . $data['path'] . '" не существует, создайте его' );
}
}
if ( ! is_writeable( $_path ) )
{
if ( ! @chmod( $_path, 0777 ) )
{
if ( is_dir( $_path ) )
{
$this->registry->output->addError( 'Запись в директорию: "' . $data['path'] . '" невозможна , измените права доступа' );
}
else
{
$this->registry->output->addError( 'Запись в файл "' . $data['path'] . '" невозможна, измените права доступа' );
}
}
}
}
}
if ( ! count( $this->registry->output->fetchErrors() ) )
{
$filesOK = TRUE;
}
}
catch( Exception $error )
{
$filesOK = FALSE;
$this->registry->output->addError( "Файл " . IPS_ROOT_PATH . 'setup/xml/writeablefiles.xml не найден' );
}
}
/* Hide buttons? */
if ( $filesOK !== TRUE OR $extensionsOK != TRUE )
{
$this->registry->output->setNextAction( '' );
$this->registry->output->setHideButton( TRUE );
}
/* Simply return the requirements page */
$this->registry->output->setTitle( "Требования" );
$this->registry->output->addContent( $this->registry->output->template()->page_requirements( $filesOK, $extensionsOK, $extensionData ) );
$this->registry->output->sendOutput();
}
}
?>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,292 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Installer: EULA file
* Last Updated: $LastChangedDate: 2009-01-05 22:21:54 +0000 (Mon, 05 Jan 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 3572 $
*
*/
class upgrade_apps extends ipsCommand
{
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
/* Save data */
if ( $this->request['do'] == 'save' )
{
$apps = explode( ',', IPSSetUp::getSavedData('install_apps') );
$toSave = array();
$vNums = array();
if ( is_array( $apps ) and count( $apps ) )
{
foreach( $apps as $app )
{
/* Grab version numbers */
$numbers = IPSSetUp::fetchAppVersionNumbers( $app );
/* Grab all numbers */
$nums[ $app ] = IPSSetUp::fetchXmlAppVersions( $app );
/* Grab app data */
$appData[ $app ] = IPSSetUp::fetchXmlAppInformation( $app );
$appClasses[ $app ] = IPSSetUp::fetchVersionClasses( $app, $numbers['current'][0], $numbers['latest'][0] );
/* Store starting vnums */
$vNums[ $app ] = $numbers['current'][0];
}
/* Got anything? */
if ( count( $appClasses ) )
{
foreach( $appClasses as $app => $data )
{
foreach( $data as $num )
{
if ( file_exists( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' ) )
{
$_class = 'version_class_' . $num;
require_once( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' );
$_tmp = new $_class( $this->registry );
if ( method_exists( $_tmp, 'preInstallOptionsSave' ) )
{
$_t = $_tmp->preInstallOptionsSave();
if ( is_array( $_t ) AND count( $_t ) )
{
$toSave[ $app ][ $num ] = $_t;
}
}
}
}
}
/* Save it */
if ( count( $toSave ) )
{
IPSSetUp::setSavedData('custom_options', $toSave );
}
if ( count( $vNums ) )
{
IPSSetUp::setSavedData('version_numbers', $vNums );
}
}
}
/* Next Action */
$this->registry->autoLoadNextAction( 'upgrade' );
}
/* Check input? */
else if ( $this->request['do'] == 'check' )
{
/* Check Directory */
if ( ! is_array( $_POST['apps'] ) OR ! count( $_POST['apps'] ) )
{
$this->registry->output->addError( 'Необходмо выбрать приложения для обновления.' );
}
else
{
/* If it's lower than 3.0.0, then add in the removed apps */
if ( IPSSetUp::is300plus() !== TRUE )
{
$_POST['apps']['forums'] = 1;
$_POST['apps']['members'] = 1;
$_POST['apps']['calendar'] = 1;
$_POST['apps']['chat'] = 1;
$_POST['apps']['portal'] = 1;
//$_POST['apps']['subscriptions'] = 1;
}
else
{
if( $_POST['apps']['core'] )
{
$_POST['apps']['forums'] = 1;
$_POST['apps']['members'] = 1;
}
}
/* Save Form Data */
IPSSetUp::setSavedData('install_apps', implode( ',', array_keys( $_POST['apps'] ) ) );
/* Got any app-version classes? */
$appClasses = array();
$output = array();
$nums = array();
$appData = array();
foreach( $_POST['apps'] as $app => $val )
{
/* Grab version numbers */
$numbers = IPSSetUp::fetchAppVersionNumbers( $app );
/* Grab all numbers */
$nums[ $app ] = IPSSetUp::fetchXmlAppVersions( $app );
/* Grab app data */
$appData[ $app ] = IPSSetUp::fetchXmlAppInformation( $app );
$appClasses[ $app ] = IPSSetUp::fetchVersionClasses( $app, $numbers['current'][0], $numbers['latest'][0] );
}
/* Got anything? */
if ( count( $appClasses ) )
{
foreach( $appClasses as $app => $data )
{
foreach( $data as $num )
{
if ( file_exists( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' ) )
{
$_class = 'version_class_' . $num;
require_once( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' );
$_tmp = new $_class( $this->registry );
if ( method_exists( $_tmp, 'preInstallOptionsForm' ) )
{
$_t = $_tmp->preInstallOptionsForm();
if ( $_t )
{
$output[ $app ][ $num ] = array( 'long' => $nums[ $app ][ $num ],
'app' => $appData[ $app ],
'out' => $_t );
}
}
}
}
}
}
/* Finally... */
if ( count( $output ) )
{
$this->registry->output->setTitle( "Приложения" );
$this->registry->output->setNextAction( 'apps&do=save' );
//$this->registry->output->setHideButton( TRUE );
$this->registry->output->addContent( $this->registry->output->template()->upgrade_appsOptions( $output ) );
$this->registry->output->sendOutput();
}
else
{
/* Next Action */
$this->registry->autoLoadNextAction( 'upgrade' );
}
}
}
/* Generate apps... */
$apps = array( 'core' => array(), 'ips' => array(), 'other' => array() );
foreach( array( 'applications', 'applications_addon/ips', 'applications_addon/other' ) as $_pBit )
{
$path = IPS_ROOT_PATH . $_pBit;
$handle = opendir( $path );
while ( ( $file = readdir( $handle ) ) !== FALSE )
{
if ( ! preg_match( "#^\.#", $file ) )
{
if ( is_dir( $path . '/' . $file ) )
{
//-----------------------------------------
// Get it!
//-----------------------------------------
if ( ! file_exists( IPS_ROOT_PATH . $_pBit . '/' . $file . '/xml/information.xml' ) )
{
continue;
}
$data = IPSSetUp::fetchXmlAppInformation( $file );
switch( $_pBit )
{
case 'applications':
$apps['core'][ $file ] = $data;
break;
case 'applications_addon/ips':
$apps['ips'][ $file ] = $data;
break;
case 'applications_addon/other':
$apps['other'][ $file ] = $data;
break;
}
}
}
}
closedir( $handle );
}
/* Reorder the array so that core is first */
$new_array = array();
$new_array['core'] = $apps['core']['core'];
foreach( $apps['core'] as $app => $data )
{
if( $app == 'core' )
{
continue;
}
$new_array[$app] = $data;
}
$apps['core'] = $new_array;
/* Now get version numbers */
foreach( $apps as $type => $app )
{
foreach( $apps[ $type ] as $app => $data )
{
if ( $type == 'core' and ( $app == 'forums' OR $app == 'members' ) )
{
/* Skip forums and members and just count core for now */
continue;
}
/* Grab version numbers */
$numbers = IPSSetUp::fetchAppVersionNumbers( $app );
$apps[ $type ][ $app ]['_vnumbers'] = $numbers;
}
}
/* If it's lower than 3.0.0, then remove some apps and make them part of 'core' */
if ( IPSSetUp::is300plus() !== TRUE )
{
unset( $apps['ips']['calendar'] );
unset( $apps['ips']['chat'] );
unset( $apps['ips']['portal'] );
unset( $apps['other']['subscriptions'] );
}
/* Page Output */
$this->registry->output->setTitle( "Приложения" );
$this->registry->output->setNextAction( 'apps&do=check' );
//$this->registry->output->setHideButton( TRUE );
$this->registry->output->addContent( $this->registry->output->template()->upgrade_apps( $apps ) );
$this->registry->output->sendOutput();
}
}
@@ -0,0 +1,101 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.0
* Upgrader: Database Convertion
*
* @author Tony
* @copyright (c) 2009 IBResource.ru
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
*
*/
class upgrade_convert extends ipsCommand
{
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute( ipsRegistry $registry ) {
// uncomment to skip this step
//$this->registry->autoLoadNextAction( 'apps' );
if( strtolower( $this->settings['sql_driver'] ) == 'mysql' ) {
$utf8_ok = FALSE;
$table_prefix = $this->registry->dbFunctions()->getPrefix(); // PREFIX CAN BE EMPTY !
$this->DB->return_die = 1;
$this->DB->allow_sub_select = 1;
$this->DB->error = '';
if( substr( $this->DB->getSqlVersion(), 0, 1 ) >= 5 ) {
$query = "SELECT table_collation FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = '{$this->settings['sql_database']}' AND table_name LIKE '{$table_prefix}%'";
$this->DB->query( $query );
if ( $this->DB->error ) {
$this->registry->output->addError( nl2br( $query ) . '<br /><br />' . $this->DB->error );
}
else {
$utf8_ok = TRUE;
while( $r = $this->DB->fetch() ) {
if ( strpos( $r['table_collation'], 'utf8' ) !== 0 ) {
$utf8_ok = FALSE;
break;
}
}
}
}
else {
$tables = Array( 'posts', 'forums' );
foreach( $tables as $table ) {
$table = $table_prefix . $table;
$query = 'SHOW CREATE TABLE ' . $table;
$this->DB->query( $query );
if ( $this->DB->error ) {
$this->registry->output->addError( nl2br( $query ) . '<br /><br />' . $this->DB->error );
$utf8_ok = FALSE;
break;
}
$code = $this->DB->fetch();
if ( preg_match( '/ DEFAULT CHARSET=utf8/', $code['Create Table'] )) {
$utf8_ok = TRUE;
}
else {
$utf8_ok = FALSE;
}
}
}
if( $utf8_ok ) {
$this->registry->autoLoadNextAction( 'apps' );
}
else {
$this->registry->output->setNextAction( '' );
$this->registry->output->setHideButton( TRUE );
$this->registry->output->setTitle( 'Конвертация базы данных' );
$this->registry->output->addContent( $this->registry->output->template()->page_convert() );
$this->registry->output->sendOutput();
}
}
else {
$this->registry->autoLoadNextAction( 'apps' );
}
}
}
@@ -0,0 +1,93 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Installer: DONE file
* Last Updated: $LastChangedDate: 2009-02-04 20:03:59 +0000 (Wed, 04 Feb 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 3887 $
*
*/
class upgrade_done extends ipsCommand
{
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
/* Remove the FURL cache */
@unlink( IPS_CACHE_PATH . 'cache/furlCache.php' );
/* Got anything to show? */
$apps = explode( ',', IPSSetUp::getSavedData('install_apps') );
$vNums = IPSSetUp::getSavedData('version_numbers');
$output = array();
if ( is_array( $apps ) and count( $apps ) )
{
foreach( $apps as $app )
{
/* Grab version numbers */
$numbers = IPSSetUp::fetchAppVersionNumbers( $app );
/* Grab all numbers */
$nums[ $app ] = IPSSetUp::fetchXmlAppVersions( $app );
/* Grab app data */
$appData[ $app ] = IPSSetUp::fetchXmlAppInformation( $app );
$appClasses[ $app ] = IPSSetUp::fetchVersionClasses( $app, $vNums[ $app ], $numbers['latest'][0] );
}
/* Got anything? */
if ( count( $appClasses ) )
{
foreach( $appClasses as $app => $data )
{
foreach( $data as $num )
{
if ( file_exists( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' ) )
{
$_class = 'version_class_' . $num;
require_once( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' );
$_tmp = new $_class( $this->registry );
if ( method_exists( $_tmp, 'postInstallNotices' ) )
{
$_t = $_tmp->postInstallNotices();
if ( is_array( $_t ) AND count( $_t ) )
{
$output[ $app ][ $num ] = array( 'long' => $nums[ $app ][ $num ],
'app' => $appData[ $app ],
'out' => implode( "<br />", $_t ) );
}
}
}
}
}
}
}
/* Remove any SQL source files */
IPSSetUp::removeSqlSourceFiles();
/* Simply return the Done page */
$this->registry->output->setTitle( "Обновление завершено!" );
$this->registry->output->setHideButton( TRUE );
$this->registry->output->addContent( $this->registry->output->template()->upgrade_complete( $output ) );
$this->registry->output->sendOutput();
}
}
@@ -0,0 +1,76 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Upgrader: Index file - Shows log in page
* Last Updated: $LastChangedDate: 2009-01-14 08:31:37 +0000 (Wed, 14 Jan 2009) $
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 3671 $
*
*/
class upgrade_index extends ipsCommand
{
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
if ( ! $this->request['do'] OR $this->request['do'] == 'form' )
{
/* Simply return the log in page */
$this->_showForm();
}
else
{
/* Error: No input */
if ( ! $_POST['username'] OR ! $_POST['password'] )
{
$this->registry->output->addWarning( "Необходимо ввести имя пользователя и пароль" );
$this->_showForm();
}
/* Now authenticate against legacy file */
$result = $this->registry->legacy->authenticateLogIn( $this->request['username'], $this->request['password'] );
if ( $result !== TRUE )
{
/* .. then it contains an error message */
$this->registry->output->addWarning( $result );
$this->_showForm();
}
/* Still here? We're good to go. Create session and forward */
$this->request['s'] = $this->member->sessionClass()->createSession( $this->registry->legacy->fetchMemberData(), $this->registry->legacy->fetchAuthKey() );
$this->registry->autoLoadNextAction( 'overview' );
return;
}
}
/**
* Shows the log in form
*
* @access private
* @return void
*/
public function _showForm()
{
$this->registry->output->setTitle( "Авторизация" );
$this->registry->output->setNextAction( 'index&do=login' );
$this->registry->output->addContent( $this->registry->legacy->fetchLogInForm() );
$this->registry->output->sendOutput();
exit();
}
}
?>
@@ -0,0 +1,150 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Upgrader: Index file - Shows log in page
* Last Updated: $LastChangedDate: 2009-01-14 08:31:37 +0000 (Wed, 14 Jan 2009) $
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 3671 $
*
*/
class upgrade_overview extends ipsCommand
{
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
/* INIT */
$filesOK = NULL;
$extensions = get_loaded_extensions();
$extensionsOK = TRUE;
$extensionData = array();
/* Test Extensions */
include( IPS_ROOT_PATH . 'setup/xml/requiredextensions.php' );
if ( is_array( $INSTALLDATA ) )
{
foreach( $INSTALLDATA as $data )
{
if ( ! in_array( $data['testfor'], $extensions ) )
{
//-----------------------------------------
// Added 'nohault' key which will show a
// warning but not prohibit installation
//-----------------------------------------
if( $data['nohault'] )
{
$data['_ok'] = 1; // Anything but true or false
$extensionsOK = 1; // Anything but true or false
}
else
{
$extensionsOK = FALSE;
}
}
else
{
$data['_ok'] = TRUE;
}
$extensionData[] = $data;
}
}
/* All extensions loaded OK? */
if ( $extensionsOK == TRUE AND $filesOK === NULL )
{
$filesOK = FALSE;
/* Fetch core writeable files */
require_once( IPS_KERNEL_PATH . 'classXML.php' );
$xml = new classXML( IPSSetUp::charSet );
try
{
$xml->load( IPS_ROOT_PATH . 'setup/xml/writeablefiles.xml' );
foreach( $xml->fetchElements( 'file' ) as $xmlelement )
{
$data = $xml->fetchElementsFromRecord( $xmlelement );
if ( $data['path'] )
{
$_path = DOC_IPS_ROOT_PATH . $data['path'];
if ( ! file_exists( $_path ) )
{
if ( $data['dir'] )
{
if ( ! @mkdir( $_path, 0777, TRUE ) )
{
$this->registry->output->addError( 'Директория не существует: "' . $data['path'] . '". Пожалуйста, создайте ее' );
}
}
else
{
$this->registry->output->addError( 'Файл не существует: "' . $data['path'] . '". Пожалуйста, создайте его' );
}
}
if ( ! is_writeable( $_path ) )
{
if ( ! @chmod( $_path, 0777 ) )
{
if ( is_dir( $_path ) )
{
$this->registry->output->addError( 'Невозможна запись в директорию: "' . $data['path'] . '", измените права доступа к ней на 777' );
}
else
{
$this->registry->output->addError( 'Невозможна запись в файл: "' . $data['path'] . '", измените права доступа к нему на 777' );
}
}
}
}
}
if ( ! count( $this->registry->output->fetchErrors() ) )
{
$filesOK = TRUE;
}
}
catch( Exception $error )
{
$filesOK = FALSE;
$this->registry->output->addError( "Невозможно найти файл: " . IPS_ROOT_PATH . 'setup/xml/writeablefiles.xml' );
}
}
/* Set next action */
//$this->registry->output->setNextAction( 'apps' );
$this->registry->output->setNextAction( 'convert' );
/* Hide buttons? */
if ( $filesOK !== TRUE OR $extensionsOK != TRUE )
{
$this->registry->output->setNextAction( '' );
$this->registry->output->setHideButton( TRUE );
}
/* Simply return the requirements page */
$this->registry->output->setTitle( "Требования" );
$this->registry->output->addContent( $this->registry->output->template()->page_requirements( $filesOK, $extensionsOK, $extensionData, 'обновления' ) );
$this->registry->output->sendOutput();
}
}
?>
File diff suppressed because it is too large. Load diff