Version 3.4.6
This commit is contained in:
1 parent
e4478369d8
commit
b45ea0dffb
1568 files changed
+155104
-161665
No files matched your search
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,92 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Installer: EULA file
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_address extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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( 'license' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Guess at directory */
|
||||
|
||||
if( !defined('CP_DIRECTORY') )
|
||||
{
|
||||
define( 'CP_DIRECTORY', 'admin' );
|
||||
}
|
||||
|
||||
$dir = str_replace( CP_DIRECTORY . '/install' , '' , getcwd() );
|
||||
$dir = str_replace( CP_DIRECTORY . '\install' , '' , $dir ); // Windows
|
||||
$dir = str_replace( '\\' , '/', $dir );
|
||||
|
||||
/* Guess at URL */
|
||||
$url = str_replace( "/" . CP_DIRECTORY . "/installer/index.php" , "", $_SERVER['HTTP_REFERER'] );
|
||||
$url = str_replace( "/" . CP_DIRECTORY . "/installer/" , "", $url);
|
||||
$url = str_replace( "/" . CP_DIRECTORY . "/installer" , "", $url);
|
||||
$url = str_replace( "/" . CP_DIRECTORY . "/install/index.php" , "", $_SERVER['HTTP_REFERER'] );
|
||||
$url = str_replace( "/" . CP_DIRECTORY . "/install/" , "", $url);
|
||||
$url = str_replace( "/" . CP_DIRECTORY . "/install" , "", $url);
|
||||
$url = str_replace( "/" . CP_DIRECTORY , "", $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();
|
||||
}
|
||||
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Installer: EULA file
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_address extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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( 'The specified directory does not exist' );
|
||||
}
|
||||
|
||||
/* Check URL */
|
||||
if ( ! $this->request['install_dir'] )
|
||||
{
|
||||
$error = true;
|
||||
$this->registry->output->addWarning( 'You did not specify a 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( 'license' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Guess at directory */
|
||||
|
||||
if( !defined('CP_DIRECTORY') )
|
||||
{
|
||||
define( 'CP_DIRECTORY', 'admin' );
|
||||
}
|
||||
|
||||
$dir = str_replace( CP_DIRECTORY . '/install' , '' , getcwd() );
|
||||
$dir = str_replace( CP_DIRECTORY . '\install' , '' , $dir ); // Windows
|
||||
$dir = str_replace( '\\' , '/', $dir );
|
||||
|
||||
/* Guess at URL */
|
||||
$url = str_replace( "/" . CP_DIRECTORY . "/installer/index.php" , "", $_SERVER['HTTP_REFERER'] );
|
||||
$url = str_replace( "/" . CP_DIRECTORY . "/installer/" , "", $url);
|
||||
$url = str_replace( "/" . CP_DIRECTORY . "/installer" , "", $url);
|
||||
$url = str_replace( "/" . CP_DIRECTORY . "/install/index.php" , "", $_SERVER['HTTP_REFERER'] );
|
||||
$url = str_replace( "/" . CP_DIRECTORY . "/install/" , "", $url);
|
||||
$url = str_replace( "/" . CP_DIRECTORY . "/install" , "", $url);
|
||||
$url = str_replace( "/" . CP_DIRECTORY , "", $url);
|
||||
$url = str_replace( "index.php" , "", $url);
|
||||
$url = preg_replace( "!\?(.+?)*!" , "", $url );
|
||||
$url = "{$url}/";
|
||||
|
||||
/* Page Output */
|
||||
$this->registry->output->setTitle( "Paths and URLs" );
|
||||
$this->registry->output->setNextAction( "address&do=check" );
|
||||
$this->registry->output->addContent( $this->registry->output->template()->page_address( $dir, $url ) );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,88 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Installer: ADMIN file
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_admin extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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'] OR IPSText::checkEmailAddress( $this->request['email'] ) !== TRUE )
|
||||
{
|
||||
$_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();
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Installer: ADMIN file
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_admin extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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( 'You must specify a display name for the admin account' );
|
||||
}
|
||||
|
||||
if( ! $this->request['password'] )
|
||||
{
|
||||
$_e = 1;
|
||||
$this->registry->output->addWarning( 'You must specify a password for the admin account' );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( $this->request['password'] != $this->request['confirm_password'] )
|
||||
{
|
||||
$_e = 1;
|
||||
$this->registry->output->addWarning( 'The admin passwords did not match' );
|
||||
}
|
||||
}
|
||||
|
||||
if( ! $this->request['email'] OR IPSText::checkEmailAddress( $this->request['email'] ) !== TRUE )
|
||||
{
|
||||
$_e = 1;
|
||||
$this->registry->output->addWarning( 'You must specify an email address for the admin account' );
|
||||
}
|
||||
|
||||
if ( $_e )
|
||||
{
|
||||
$this->registry->output->setTitle( "Admin: Errors" );
|
||||
$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( "Admin Account Creation" );
|
||||
$this->registry->output->setNextAction( 'admin&do=check' );
|
||||
$this->registry->output->addContent( $this->registry->output->template()->page_admin() );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
}
|
||||
@@ -1,156 +1,156 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Installer: EULA file
|
||||
* Last Updated: $LastChangedDate: 2013-01-31 18:11:00 -0500 (Thu, 31 Jan 2013) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: AndyMillne $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 11926 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_apps extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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 ( ! is_file( IPS_ROOT_PATH . $_pBit . '/' . $file . '/xml/information.xml' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $file, $this->settings['gb_char_set'] );
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Installer: EULA file
|
||||
* Last Updated: $LastChangedDate: 2013-01-31 18:11:00 -0500 (Thu, 31 Jan 2013) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: AndyMillne $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 11926 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_apps extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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( 'You must select to install at least one application' );
|
||||
}
|
||||
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( 'File or directory does not exist: "' . $path . '", please create it via FTP' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $info['notwrite'] ) )
|
||||
{
|
||||
foreach( $info['notwrite'] as $path )
|
||||
{
|
||||
$this->registry->output->addWarning( 'File or directory is not writeable: "' . $path . '", please CHMOD via FTP' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ( ! is_file( IPS_ROOT_PATH . $_pBit . '/' . $file . '/xml/information.xml' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $file, $this->settings['gb_char_set'] );
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
/* We don't want IP.SEO to be installed on future versions. Bad things happen. */
|
||||
unset( $apps['ips'][ 'ipseo' ] );
|
||||
unset( $apps['other'][ 'ipseo' ] );
|
||||
|
||||
/* 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();
|
||||
}
|
||||
unset( $apps['ips'][ 'ipseo' ] );
|
||||
unset( $apps['other'][ 'ipseo' ] );
|
||||
|
||||
/* 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( "Applications" );
|
||||
$this->registry->output->setNextAction( 'apps&do=check' );
|
||||
$this->registry->output->addContent( $this->registry->output->template()->page_apps( $apps ) );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
}
|
||||
@@ -1,281 +1,281 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Installer: EULA file
|
||||
* Last Updated: $LastChangedDate: 2012-11-02 08:18:10 -0400 (Fri, 02 Nov 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mark $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 11548 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_db extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Quick basic check for extensions
|
||||
//-----------------------------------------
|
||||
|
||||
if( strtolower(IPSSetUp::getSavedData('sql_driver')) == 'mysql' )
|
||||
{
|
||||
if( !function_exists('mysqli_connect') AND !function_exists('mysql_connect') )
|
||||
{
|
||||
$this->registry->output->setTitle( "Databases: Error" );
|
||||
$this->registry->output->setNextAction( 'db&do=check' );
|
||||
$this->registry->output->addWarning( "You do not have the mysql or mysqli PHP extension installed. You must install one of these PHP extensions before you can continue." );
|
||||
$this->registry->output->addContent( $this->fetchContent() );
|
||||
$this->registry->output->sendOutput();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load DB driver..
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classDb' . ucwords( IPSSetUp::getSavedData('sql_driver') ) . '.php' );/*noLibHook*/
|
||||
|
||||
$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 ( is_file( IPS_ROOT_PATH . 'setup/sql/'.IPSSetUp::getSavedData('sql_driver').'_install.php' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'setup/sql/'.IPSSetUp::getSavedData('sql_driver').'_install.php' );/*noLibHook*/
|
||||
|
||||
$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', $_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',
|
||||
'where' => "upgrade_app='core'",
|
||||
'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 ( is_file( IPS_ROOT_PATH . 'setup/sql/'.IPSSetUp::getSavedData('sql_driver').'_install.php' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'setup/sql/'.IPSSetUp::getSavedData('sql_driver').'_install.php' );/*noLibHook*/
|
||||
$extra_install = new install_extra( $this->registry );
|
||||
|
||||
$content = str_replace( '<!--{EXTRA.SQL}-->', $extra_install->install_form_extra(), $content );
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Installer: EULA file
|
||||
* Last Updated: $LastChangedDate: 2012-11-02 08:18:10 -0400 (Fri, 02 Nov 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mark $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 11548 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_db extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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( 'You must fill out the form completely' );
|
||||
}
|
||||
/* No special characters */
|
||||
else if( preg_match( "/[^a-zA-Z0-9_]/", $this->request['db_pre'] ) )
|
||||
{
|
||||
$this->registry->output->addWarning( 'You cannot use special characters in the database prefix' );
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Quick basic check for extensions
|
||||
//-----------------------------------------
|
||||
|
||||
if( strtolower(IPSSetUp::getSavedData('sql_driver')) == 'mysql' )
|
||||
{
|
||||
if( !function_exists('mysqli_connect') AND !function_exists('mysql_connect') )
|
||||
{
|
||||
$this->registry->output->setTitle( "Databases: Error" );
|
||||
$this->registry->output->setNextAction( 'db&do=check' );
|
||||
$this->registry->output->addWarning( "You do not have the mysql or mysqli PHP extension installed. You must install one of these PHP extensions before you can continue." );
|
||||
$this->registry->output->addContent( $this->fetchContent() );
|
||||
$this->registry->output->sendOutput();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load DB driver..
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classDb' . ucwords( IPSSetUp::getSavedData('sql_driver') ) . '.php' );/*noLibHook*/
|
||||
|
||||
$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 ( is_file( IPS_ROOT_PATH . 'setup/sql/'.IPSSetUp::getSavedData('sql_driver').'_install.php' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'setup/sql/'.IPSSetUp::getSavedData('sql_driver').'_install.php' );/*noLibHook*/
|
||||
|
||||
$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( "Databases: Error" );
|
||||
$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( "Databases: Error" );
|
||||
$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', $_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',
|
||||
'where' => "upgrade_app='core'",
|
||||
'order' => 'upgrade_version_id DESC',
|
||||
'limit' => array( 0, 1 ) ) );
|
||||
|
||||
if ( is_array( $latest ) )
|
||||
{
|
||||
$this->registry->output->setTitle( "Databases: Error" );
|
||||
$this->registry->output->setNextAction( 'db&do=check' );
|
||||
$this->registry->output->addWarning( "Existing IP.Board " . $latest['upgrade_version_human'] . " Detected" );
|
||||
$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( "Databases" );
|
||||
$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( "Databases" );
|
||||
$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 ( is_file( IPS_ROOT_PATH . 'setup/sql/'.IPSSetUp::getSavedData('sql_driver').'_install.php' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'setup/sql/'.IPSSetUp::getSavedData('sql_driver').'_install.php' );/*noLibHook*/
|
||||
$extra_install = new install_extra( $this->registry );
|
||||
|
||||
$content = str_replace( '<!--{EXTRA.SQL}-->', $extra_install->install_form_extra(), $content );
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
@@ -1,48 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Installer: EULA file
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_done extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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 );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Installer: EULA file
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_done extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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( "Complete!" );
|
||||
$this->registry->output->setHideButton( TRUE );
|
||||
$this->registry->output->addContent( $this->registry->output->template()->page_installComplete( $installLocked ) );
|
||||
$this->registry->output->sendOutput( FALSE );
|
||||
}
|
||||
}
|
||||
@@ -1,36 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Installer: EULA file
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_eula extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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();
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Installer: EULA file
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_eula extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Simply return the EULA page */
|
||||
$this->registry->output->setTitle( "EULA" );
|
||||
$this->registry->output->addContent( $this->registry->output->template()->page_eula() );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,159 +1,159 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Installer: Index file
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_index extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* INIT */
|
||||
$filesOK = NULL;
|
||||
$extensions = get_loaded_extensions();
|
||||
$extensionsOK = TRUE;
|
||||
$extensionData = array();
|
||||
|
||||
/* Test Extensions */
|
||||
$INSTALLDATA = array();
|
||||
include( IPS_ROOT_PATH . 'setup/xml/requiredextensions.php' );/*noLibHook*/
|
||||
|
||||
if ( is_array( $INSTALLDATA ) && count( $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 ( is_file( DOC_IPS_ROOT_PATH . 'conf_global.dist.php') AND ! is_file( 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' );/*noLibHook*/
|
||||
$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, IPS_FOLDER_PERMISSION, TRUE ) )
|
||||
{
|
||||
$this->registry->output->addError( 'Директория "' . $data['path'] . '" не существует, создайте ее' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->addError( 'Файл "' . $data['path'] . '" не существует, создайте его' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! is_writeable( $_path ) )
|
||||
{
|
||||
if ( ! @chmod( $_path, is_dir( $_path ) ? IPS_FOLDER_PERMISSION : IPS_FILE_PERMISSION ) )
|
||||
{
|
||||
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();
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Installer: Index file
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_index extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* INIT */
|
||||
$filesOK = NULL;
|
||||
$extensions = get_loaded_extensions();
|
||||
$extensionsOK = TRUE;
|
||||
$extensionData = array();
|
||||
|
||||
/* Test Extensions */
|
||||
$INSTALLDATA = array();
|
||||
include( IPS_ROOT_PATH . 'setup/xml/requiredextensions.php' );/*noLibHook*/
|
||||
|
||||
if ( is_array( $INSTALLDATA ) && count( $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 ( is_file( DOC_IPS_ROOT_PATH . 'conf_global.dist.php') AND ! is_file( 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>You MUST rename the file 'conf_global.<b style='color:red'>dist.php</b>' TO 'conf_global.<b style='color:red'>php</b>' before continuing.</strong>
|
||||
This file can be found in the 'root' directory on your IP.Board install." );
|
||||
}
|
||||
}
|
||||
|
||||
/* All extensions loaded OK? */
|
||||
if ( $extensionsOK == TRUE AND $filesOK === NULL )
|
||||
{
|
||||
$filesOK = FALSE;
|
||||
|
||||
/* Fetch core writeable files */
|
||||
require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/
|
||||
$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, IPS_FOLDER_PERMISSION, TRUE ) )
|
||||
{
|
||||
$this->registry->output->addError( 'Directory does not exist: "' . $data['path'] . '", please create it via FTP' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->addError( 'File does not exist: "' . $data['path'] . '", please create it via FTP' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! is_writeable( $_path ) )
|
||||
{
|
||||
if ( ! @chmod( $_path, is_dir( $_path ) ? IPS_FOLDER_PERMISSION : IPS_FILE_PERMISSION ) )
|
||||
{
|
||||
if ( is_dir( $_path ) )
|
||||
{
|
||||
$this->registry->output->addError( 'Can not write to directory: "' . $data['path'] . '", please CHMOD to 777' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->addError( 'Can not write to file: "' . $data['path'] . '", please CHMOD to 777' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! count( $this->registry->output->fetchErrors() ) )
|
||||
{
|
||||
$filesOK = TRUE;
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$filesOK = FALSE;
|
||||
$this->registry->output->addError( "Cannot locate: " . 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( "Requirements" );
|
||||
$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
@@ -1,36 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Installer: License Key
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_license extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
IPSSetup::setSavedData( 'lkey', darkLAE::getLicenseKey() );
|
||||
|
||||
$this->registry->autoLoadNextAction( 'db' );
|
||||
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Installer: License Key
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class install_license extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->autoLoadNextAction( 'db' );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,379 +1,379 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Installer: EULA file
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class upgrade_apps extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Delete sessions and continue */
|
||||
if ( $this->request['do'] == 'rsessions' )
|
||||
{
|
||||
IPSSetUp::removePreviousSession();
|
||||
}
|
||||
|
||||
/* Rebuild from last session and continue */
|
||||
if ( $this->request['do'] == 'rcontinue' )
|
||||
{
|
||||
$oldSession = IPSSetUp::checkForPreviousSessions();
|
||||
|
||||
if ( count( $oldSession ) AND $oldSession['_session_get']['section'] AND $oldSession['_sd']['install_apps'] )
|
||||
{
|
||||
IPSSetUp::restorePreviousSession( $oldSession );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for failed upgrade */
|
||||
if ( ! $this->request['do'] OR ( $this->request['do'] != 'rsessions' ) )
|
||||
{
|
||||
$oldSession = IPSSetUp::checkForPreviousSessions();
|
||||
|
||||
if ( count( $oldSession ) AND $oldSession['_session_get']['section'] AND $oldSession['_sd']['install_apps'] )
|
||||
{
|
||||
/* Page Output */
|
||||
$this->registry->output->setTitle( "Applications" );
|
||||
$this->registry->output->setNextAction( 'apps&do=rsessions' );
|
||||
//$this->registry->output->setHideButton( TRUE );
|
||||
$this->registry->output->addContent( $this->registry->output->template()->upgrade_previousSession( $oldSession ) );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
}
|
||||
|
||||
/* 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, $this->settings['gb_char_set'] );
|
||||
|
||||
$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 ( is_file( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' ) )
|
||||
{
|
||||
$_class = 'version_class_' . $app . '_' . $num;
|
||||
require_once( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' );/*noLibHook*/
|
||||
|
||||
$_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( 'license' );
|
||||
}
|
||||
/* Check input? */
|
||||
else if ( $this->request['do'] == 'check' )
|
||||
{
|
||||
/* Check Directory */
|
||||
if ( ! is_array( $_POST['apps'] ) OR ! count( $_POST['apps'] ) )
|
||||
{
|
||||
/* We use 'warning' because it has same effect but does not block the 'next' button (which they'll want to use after selecting an app when page reloads) */
|
||||
$this->registry->output->addWarning( 'Необходмо выбрать приложения для обновления.' );
|
||||
}
|
||||
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;
|
||||
}
|
||||
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, $this->settings['gb_char_set'] );
|
||||
|
||||
$appClasses[ $app ] = IPSSetUp::fetchVersionClasses( $app, $numbers['current'][0], $numbers['latest'][0] );
|
||||
}
|
||||
|
||||
/* Got anything? */
|
||||
$error = FALSE;
|
||||
if ( count( $appClasses ) )
|
||||
{
|
||||
foreach( $appClasses as $app => $data )
|
||||
{
|
||||
if ( is_file( IPSLib::getAppDir( $app ) . '/setup/upgradeCheck.php' ) )
|
||||
{
|
||||
$_class = $app . '_upgradeCheck';
|
||||
require_once( IPSLib::getAppDir( $app ) . '/setup/upgradeCheck.php' );/*noLibHook*/
|
||||
$requirements_class = new $_class();
|
||||
|
||||
if ( method_exists( $requirements_class, 'checkForProblems' ) )
|
||||
{
|
||||
$check = $requirements_class->checkForProblems( $appClasses );
|
||||
if ( $check !== TRUE )
|
||||
{
|
||||
$error = TRUE;
|
||||
$this->registry->output->addError( $check );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach( $data as $num )
|
||||
{
|
||||
if ( is_file( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' ) )
|
||||
{
|
||||
$_class = 'version_class_' . $app . '_' . $num;
|
||||
require_once( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' );/*noLibHook*/
|
||||
|
||||
$_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 ) or $error === TRUE )
|
||||
{
|
||||
$this->registry->output->setTitle( "Приложения" );
|
||||
$this->registry->output->setNextAction( 'apps&do=save' );
|
||||
//$this->registry->output->setHideButton( TRUE );
|
||||
if ( !$error )
|
||||
{
|
||||
$this->registry->output->addContent( $this->registry->output->template()->upgrade_appsOptions( $output ) );
|
||||
}
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Next Action */
|
||||
$this->registry->autoLoadNextAction( 'license' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 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 ( ! is_file( IPS_ROOT_PATH . $_pBit . '/' . $file . '/xml/information.xml' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $file, $this->settings['gb_char_set'] );
|
||||
|
||||
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 );
|
||||
|
||||
$appClasses[ $app ] = IPSSetUp::fetchVersionClasses( $app, $numbers['current'][0], $numbers['latest'][0] );
|
||||
|
||||
$apps[ $type ][ $app ]['_vnumbers'] = $numbers;
|
||||
}
|
||||
}
|
||||
|
||||
/* Any notices? */
|
||||
$notices = array();
|
||||
if ( count( $appClasses ) )
|
||||
{
|
||||
foreach( $appClasses as $app => $data )
|
||||
{
|
||||
$notices[ $app ] = array();
|
||||
|
||||
foreach( $data as $num )
|
||||
{
|
||||
if ( is_file( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' ) )
|
||||
{
|
||||
$_class = 'version_class_' . $app . '_' . $num;
|
||||
require_once( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' );/*noLibHook*/
|
||||
|
||||
$_tmp = new $_class( $this->registry );
|
||||
|
||||
if ( method_exists( $_tmp, 'preInstallNotices' ) )
|
||||
{
|
||||
$_t = $_tmp->preInstallNotices();
|
||||
|
||||
if ( $_t )
|
||||
{
|
||||
$notices[ $app ] = array_merge( $_t, $notices[ $app ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 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'] );
|
||||
}
|
||||
|
||||
/* Page Output */
|
||||
$this->registry->output->setTitle( "Applications" );
|
||||
$this->registry->output->setNextAction( 'apps&do=check' );
|
||||
//$this->registry->output->setHideButton( TRUE );
|
||||
$this->registry->output->addContent( $this->registry->output->template()->upgrade_apps( $apps, $notices ) );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Installer: EULA file
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class upgrade_apps extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Delete sessions and continue */
|
||||
if ( $this->request['do'] == 'rsessions' )
|
||||
{
|
||||
IPSSetUp::removePreviousSession();
|
||||
}
|
||||
|
||||
/* Rebuild from last session and continue */
|
||||
if ( $this->request['do'] == 'rcontinue' )
|
||||
{
|
||||
$oldSession = IPSSetUp::checkForPreviousSessions();
|
||||
|
||||
if ( count( $oldSession ) AND $oldSession['_session_get']['section'] AND $oldSession['_sd']['install_apps'] )
|
||||
{
|
||||
IPSSetUp::restorePreviousSession( $oldSession );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for failed upgrade */
|
||||
if ( ! $this->request['do'] OR ( $this->request['do'] != 'rsessions' ) )
|
||||
{
|
||||
$oldSession = IPSSetUp::checkForPreviousSessions();
|
||||
|
||||
if ( count( $oldSession ) AND $oldSession['_session_get']['section'] AND $oldSession['_sd']['install_apps'] )
|
||||
{
|
||||
/* Page Output */
|
||||
$this->registry->output->setTitle( "Applications" );
|
||||
$this->registry->output->setNextAction( 'apps&do=rsessions' );
|
||||
//$this->registry->output->setHideButton( TRUE );
|
||||
$this->registry->output->addContent( $this->registry->output->template()->upgrade_previousSession( $oldSession ) );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
}
|
||||
|
||||
/* 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, $this->settings['gb_char_set'] );
|
||||
|
||||
$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 ( is_file( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' ) )
|
||||
{
|
||||
$_class = 'version_class_' . $app . '_' . $num;
|
||||
require_once( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' );/*noLibHook*/
|
||||
|
||||
$_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( 'license' );
|
||||
}
|
||||
/* Check input? */
|
||||
else if ( $this->request['do'] == 'check' )
|
||||
{
|
||||
/* Check Directory */
|
||||
if ( ! is_array( $_POST['apps'] ) OR ! count( $_POST['apps'] ) )
|
||||
{
|
||||
/* We use 'warning' because it has same effect but does not block the 'next' button (which they'll want to use after selecting an app when page reloads) */
|
||||
$this->registry->output->addWarning( 'You must select to upgrade at least one application' );
|
||||
}
|
||||
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;
|
||||
}
|
||||
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, $this->settings['gb_char_set'] );
|
||||
|
||||
$appClasses[ $app ] = IPSSetUp::fetchVersionClasses( $app, $numbers['current'][0], $numbers['latest'][0] );
|
||||
}
|
||||
|
||||
/* Got anything? */
|
||||
$error = FALSE;
|
||||
if ( count( $appClasses ) )
|
||||
{
|
||||
foreach( $appClasses as $app => $data )
|
||||
{
|
||||
if ( is_file( IPSLib::getAppDir( $app ) . '/setup/upgradeCheck.php' ) )
|
||||
{
|
||||
$_class = $app . '_upgradeCheck';
|
||||
require_once( IPSLib::getAppDir( $app ) . '/setup/upgradeCheck.php' );/*noLibHook*/
|
||||
$requirements_class = new $_class();
|
||||
|
||||
if ( method_exists( $requirements_class, 'checkForProblems' ) )
|
||||
{
|
||||
$check = $requirements_class->checkForProblems( $appClasses );
|
||||
if ( $check !== TRUE )
|
||||
{
|
||||
$error = TRUE;
|
||||
$this->registry->output->addError( $check );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach( $data as $num )
|
||||
{
|
||||
if ( is_file( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' ) )
|
||||
{
|
||||
$_class = 'version_class_' . $app . '_' . $num;
|
||||
require_once( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' );/*noLibHook*/
|
||||
|
||||
$_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 ) or $error === TRUE )
|
||||
{
|
||||
$this->registry->output->setTitle( "Applications" );
|
||||
$this->registry->output->setNextAction( 'apps&do=save' );
|
||||
//$this->registry->output->setHideButton( TRUE );
|
||||
if ( !$error )
|
||||
{
|
||||
$this->registry->output->addContent( $this->registry->output->template()->upgrade_appsOptions( $output ) );
|
||||
}
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Next Action */
|
||||
$this->registry->autoLoadNextAction( 'license' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 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 ( ! is_file( IPS_ROOT_PATH . $_pBit . '/' . $file . '/xml/information.xml' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $file, $this->settings['gb_char_set'] );
|
||||
|
||||
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 );
|
||||
|
||||
$appClasses[ $app ] = IPSSetUp::fetchVersionClasses( $app, $numbers['current'][0], $numbers['latest'][0] );
|
||||
|
||||
$apps[ $type ][ $app ]['_vnumbers'] = $numbers;
|
||||
}
|
||||
}
|
||||
|
||||
/* Any notices? */
|
||||
$notices = array();
|
||||
if ( count( $appClasses ) )
|
||||
{
|
||||
foreach( $appClasses as $app => $data )
|
||||
{
|
||||
$notices[ $app ] = array();
|
||||
|
||||
foreach( $data as $num )
|
||||
{
|
||||
if ( is_file( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' ) )
|
||||
{
|
||||
$_class = 'version_class_' . $app . '_' . $num;
|
||||
require_once( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' );/*noLibHook*/
|
||||
|
||||
$_tmp = new $_class( $this->registry );
|
||||
|
||||
if ( method_exists( $_tmp, 'preInstallNotices' ) )
|
||||
{
|
||||
$_t = $_tmp->preInstallNotices();
|
||||
|
||||
if ( $_t )
|
||||
{
|
||||
$notices[ $app ] = array_merge( $_t, $notices[ $app ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 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'] );
|
||||
}
|
||||
|
||||
/* Page Output */
|
||||
$this->registry->output->setTitle( "Applications" );
|
||||
$this->registry->output->setNextAction( 'apps&do=check' );
|
||||
//$this->registry->output->setHideButton( TRUE );
|
||||
$this->registry->output->addContent( $this->registry->output->template()->upgrade_apps( $apps, $notices ) );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.0
|
||||
* Upgrader: Database Convertion
|
||||
*
|
||||
* @author Tony
|
||||
* @copyright (c) 2009 IBResource.ru
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @link http://www.invisionpower.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' );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,95 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Installer: DONE file
|
||||
* Last Updated: $LastChangedDate: 2013-05-08 13:47:21 -0400 (Wed, 08 May 2013) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 12238 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class upgrade_done extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Remove the FURL cache */
|
||||
@unlink( FURL_CACHE_PATH );
|
||||
|
||||
/* 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, $this->settings['gb_char_set'] );
|
||||
|
||||
$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 ( is_file( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' ) )
|
||||
{
|
||||
$_class = 'version_class_' . $app . '_' . $num;
|
||||
require_once( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' );/*noLibHook*/
|
||||
|
||||
$_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();
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Installer: DONE file
|
||||
* Last Updated: $LastChangedDate: 2013-05-08 13:47:21 -0400 (Wed, 08 May 2013) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 12238 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class upgrade_done extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Remove the FURL cache */
|
||||
@unlink( FURL_CACHE_PATH );
|
||||
|
||||
/* 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, $this->settings['gb_char_set'] );
|
||||
|
||||
$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 ( is_file( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' ) )
|
||||
{
|
||||
$_class = 'version_class_' . $app . '_' . $num;
|
||||
require_once( IPSLib::getAppDir( $app ) . '/setup/versions/upg_' . $num . '/version_class.php' );/*noLibHook*/
|
||||
|
||||
$_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( "Complete!" );
|
||||
$this->registry->output->setHideButton( TRUE );
|
||||
$this->registry->output->addContent( $this->registry->output->template()->upgrade_complete( $output ) );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,76 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Upgrader: Index file - Shows log in page
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
class upgrade_index extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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();
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Upgrader: Index file - Shows log in page
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
class upgrade_index extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e 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( "You must enter a valid account to login" );
|
||||
$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( "Log In" );
|
||||
$this->registry->output->setNextAction( 'index&do=login' );
|
||||
$this->registry->output->addContent( $this->registry->legacy->fetchLogInForm() );
|
||||
$this->registry->output->sendOutput();
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Installer: License Key
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class upgrade_license extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
IPSLib::updateSettings( array( 'ipb_reg_number' => darkLAE::getLicenseKey() ) );
|
||||
$this->registry->autoLoadNextAction( 'upgrade' );
|
||||
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Installer: License Key
|
||||
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class upgrade_license extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->autoLoadNextAction( 'upgrade' );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,178 +1,177 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Upgrader: Index file - Shows log in page
|
||||
* Last Updated: $LastChangedDate: 2013-04-18 21:11:00 -0400 (Thu, 18 Apr 2013) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 12188 $
|
||||
*
|
||||
*/
|
||||
|
||||
class upgrade_overview extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* INIT */
|
||||
$filesOK = NULL;
|
||||
$extensions = get_loaded_extensions();
|
||||
$extensionsOK = TRUE;
|
||||
$extensionData = array();
|
||||
|
||||
/* Test to make sure core.php is up-to-date. Large file may not always upload cleanly */
|
||||
if ( ! method_exists( 'IPSLib', 'loadLibrary' ) )
|
||||
{
|
||||
$filesOK = false;
|
||||
$this->registry->output->addError( 'Please ensure that "' . CP_DIRECTORY . '/sources/base/core.php" is up-to-date. Re-upload via FTP if necessary' );
|
||||
}
|
||||
|
||||
/* Test Extensions */
|
||||
$INSTALLDATA = array();
|
||||
include( IPS_ROOT_PATH . 'setup/xml/requiredextensions.php' );/*noLibHook*/
|
||||
|
||||
if ( is_array( $INSTALLDATA ) && count( $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' );/*noLibHook*/
|
||||
$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'] )
|
||||
{
|
||||
/* If we overrode hooks path in constants.php, check that instead */
|
||||
if( $data['path'] == 'hooks' )
|
||||
{
|
||||
$_path = IPS_HOOKS_PATH;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_path = DOC_IPS_ROOT_PATH . $data['path'];
|
||||
}
|
||||
|
||||
if ( ! file_exists( $_path ) )
|
||||
{
|
||||
if ( $data['dir'] )
|
||||
{
|
||||
if ( ! @mkdir( $_path, IPS_FOLDER_PERMISSION, TRUE ) )
|
||||
{
|
||||
$this->registry->output->addError( 'Директория не существует: "' . $data['path'] . '". Пожалуйста, создайте ее' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->addError( 'Файл не существует: "' . $data['path'] . '". Пожалуйста, создайте его' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! is_writeable( $_path ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// If we're upgrading, don't do this to conf_global
|
||||
// @link http://community.invisionpower.com/tracker/issue-20478-config-file-premission/
|
||||
//-----------------------------------------
|
||||
|
||||
if( strpos( $_path, 'conf_global.php' ) !== false )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! @chmod( $_path, is_dir( $_path ) ? IPS_FOLDER_PERMISSION : IPS_FILE_PERMISSION ) )
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Upgrader: Index file - Shows log in page
|
||||
* Last Updated: $LastChangedDate: 2013-04-18 21:11:00 -0400 (Thu, 18 Apr 2013) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 12188 $
|
||||
*
|
||||
*/
|
||||
|
||||
class upgrade_overview extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* INIT */
|
||||
$filesOK = NULL;
|
||||
$extensions = get_loaded_extensions();
|
||||
$extensionsOK = TRUE;
|
||||
$extensionData = array();
|
||||
|
||||
/* Test to make sure core.php is up-to-date. Large file may not always upload cleanly */
|
||||
if ( ! method_exists( 'IPSLib', 'loadLibrary' ) )
|
||||
{
|
||||
$filesOK = false;
|
||||
$this->registry->output->addError( 'Please ensure that "' . CP_DIRECTORY . '/sources/base/core.php" is up-to-date. Re-upload via FTP if necessary' );
|
||||
}
|
||||
|
||||
/* Test Extensions */
|
||||
$INSTALLDATA = array();
|
||||
include( IPS_ROOT_PATH . 'setup/xml/requiredextensions.php' );/*noLibHook*/
|
||||
|
||||
if ( is_array( $INSTALLDATA ) && count( $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' );/*noLibHook*/
|
||||
$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'] )
|
||||
{
|
||||
/* If we overrode hooks path in constants.php, check that instead */
|
||||
if( $data['path'] == 'hooks' )
|
||||
{
|
||||
$_path = IPS_HOOKS_PATH;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_path = DOC_IPS_ROOT_PATH . $data['path'];
|
||||
}
|
||||
|
||||
if ( ! file_exists( $_path ) )
|
||||
{
|
||||
if ( $data['dir'] )
|
||||
{
|
||||
if ( ! @mkdir( $_path, IPS_FOLDER_PERMISSION, TRUE ) )
|
||||
{
|
||||
$this->registry->output->addError( 'Directory does not exist: "' . $data['path'] . '", please create it via FTP' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->addError( 'File does not exist: "' . $data['path'] . '", please create it via FTP' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! is_writeable( $_path ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// If we're upgrading, don't do this to conf_global
|
||||
// @link http://community.invisionpower.com/tracker/issue-20478-config-file-premission/
|
||||
//-----------------------------------------
|
||||
|
||||
if( strpos( $_path, 'conf_global.php' ) !== false )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! @chmod( $_path, is_dir( $_path ) ? IPS_FOLDER_PERMISSION : IPS_FILE_PERMISSION ) )
|
||||
{
|
||||
if ( is_dir( $_path ) )
|
||||
{
|
||||
$this->registry->output->addError( 'Can not write to directory: "' . $data['path'] . '", please CHMOD to 777' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->addError( 'Can not write to file: "' . $data['path'] . '", please CHMOD to 777' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! count( $this->registry->output->fetchErrors() ) )
|
||||
{
|
||||
$filesOK = TRUE;
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$filesOK = FALSE;
|
||||
$this->registry->output->addError( "Cannot locate: " . IPS_ROOT_PATH . 'setup/xml/writeablefiles.xml' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Set next action */
|
||||
$this->registry->output->setNextAction( 'apps' );
|
||||
|
||||
/* 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( "Requirements" );
|
||||
$this->registry->output->addContent( $this->registry->output->template()->page_requirements( $filesOK, $extensionsOK, $extensionData, 'upgrade' ) );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com/">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* IP.Board v3.4.6
|
||||
* Installer CLI Script
|
||||
* Last Updated: $LastChangedDate: 2012-11-14 07:43:29 -0500 (Wed, 14 Nov 2012) $
|
||||
* </pre>
|
||||
@@ -105,7 +105,6 @@ IPSInstall::writeConfiguration();
|
||||
// Install
|
||||
//-----------------------------------------
|
||||
|
||||
file_get_contents( "http://license.invisionpower.com/?a=activate&key={$_SERVER['argv'][4]}&url={$_SERVER['argv'][3]}" );
|
||||
file_put_contents( "../../../cache/installer_lock.php", "AUTOINSTALLED" );
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'setup/applications/install/sections/install.php' );/*noLibHook*/
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* IP.Board v3.4.6
|
||||
* Setup CLI Script Overrider
|
||||
* Last Updated: $LastChangedDate: 2012-05-16 05:59:33 -0400 (Wed, 16 May 2012) $
|
||||
* </pre>
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +1 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://www.invisionpower.com">Invision Power Board</a>␍</body>␍</html>␍
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍Invision Power Board␍</body>␍</html>␍
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,223 +1,223 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Static SETUP Classes for IP.Board 3
|
||||
*
|
||||
* These classes are not required as objects.
|
||||
* Last Updated: $Date: 2012-06-29 10:12:14 -0400 (Fri, 29 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 11007 $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Collection of methods to for installation alone
|
||||
*
|
||||
* @author Matt
|
||||
*/
|
||||
class IPSInstall
|
||||
{
|
||||
/**
|
||||
* Create admin account
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
static public function createAdminAccount()
|
||||
{
|
||||
/* Build Entry */
|
||||
$_mke_time = ( ipsRegistry::$settings['login_key_expire'] ) ? ( time() + ( intval( ipsRegistry::$settings['login_key_expire'] ) * 86400 ) ) : 0;
|
||||
$salt = IPSMember::generatePasswordSalt( 5 );
|
||||
$passhash = IPSMember::generateCompiledPasshash( $salt, md5( IPSSetUp::getSavedData('admin_pass') ) );
|
||||
$_dname = IPSSetUp::getSavedData('admin_user');
|
||||
|
||||
$member = array(
|
||||
'name' => $_dname,
|
||||
'members_l_username' => mb_strtolower( $_dname ),
|
||||
'members_display_name' => $_dname,
|
||||
'members_l_display_name' => mb_strtolower( $_dname ),
|
||||
'members_seo_name' => IPSText::makeSeoTitle( $_dname ),
|
||||
'member_login_key' => IPSMember::generateAutoLoginKey(),
|
||||
'member_login_key_expire' => $_mke_time,
|
||||
'title' => 'Администратор',
|
||||
'email' => IPSSetUp::getSavedData('admin_email') ,
|
||||
'member_group_id' => 4,
|
||||
'posts' => 1,
|
||||
'joined' => time(),
|
||||
'last_visit' => time(),
|
||||
'last_activity' => time(),
|
||||
'ip_address' => my_getenv('REMOTE_ADDR'),
|
||||
'view_sigs' => 1,
|
||||
'restrict_post' => 0,
|
||||
'msg_show_notification' => 1,
|
||||
'msg_count_total' => 0,
|
||||
'msg_count_new' => 0,
|
||||
'coppa_user' => 0,
|
||||
'language' => IPSLib::getDefaultLanguage(),
|
||||
'members_auto_dst' => 1,
|
||||
'member_uploader' => 'flash',
|
||||
'allow_admin_mails' => 0,
|
||||
'members_pass_hash' => $passhash,
|
||||
'members_pass_salt' => $salt,
|
||||
'has_blog' => '',
|
||||
'fb_token' => '',
|
||||
'ignored_users' => '',
|
||||
'members_cache' => '',
|
||||
'failed_logins' => '',
|
||||
'bday_day' => 0,
|
||||
'bday_month' => 0,
|
||||
'bday_year' => 0
|
||||
);
|
||||
|
||||
/* Insert: MEMBERS */
|
||||
ipsRegistry::DB()->setDataType( array( 'name', 'members_display_name', 'members_l_username', 'members_l_display_name' ), 'string' );
|
||||
|
||||
ipsRegistry::DB()->insert( 'members', $member );
|
||||
|
||||
$member_id = ipsRegistry::DB()->getInsertId();
|
||||
$member['member_id'] = $member_id;
|
||||
|
||||
/* Insert into the custom profile fields DB */
|
||||
ipsRegistry::DB()->insert( 'pfields_content', array( 'member_id' => $member_id ) );
|
||||
|
||||
/* Insert into pp */
|
||||
ipsRegistry::DB()->insert( 'profile_portal', array(
|
||||
'pp_member_id' => $member_id,
|
||||
'pp_setting_count_friends' => 1,
|
||||
'signature' => '',
|
||||
'pconversation_filters' => '',
|
||||
'pp_setting_count_comments' => 1,
|
||||
'pp_setting_count_visitors' => 1 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes out conf_global
|
||||
*
|
||||
* @access public
|
||||
* @return bool File written successfully
|
||||
*/
|
||||
static public function writeConfiguration()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Safe mode?
|
||||
//-----------------------------------------
|
||||
|
||||
$safe_mode = 0;
|
||||
|
||||
if ( @get_cfg_var('safe_mode') )
|
||||
{
|
||||
$safe_mode = @get_cfg_var('safe_mode');
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set info array
|
||||
//-----------------------------------------
|
||||
|
||||
$INFO = array(
|
||||
'sql_driver' => IPSSetUp::getSavedData('sql_driver'),
|
||||
'sql_host' => IPSSetUp::getSavedData('db_host'),
|
||||
'sql_database' => IPSSetUp::getSavedData('db_name'),
|
||||
'sql_user' => IPSSetUp::getSavedData('db_user'),
|
||||
'sql_pass' => str_replace( '\'', '\\\'', IPSSetUp::getSavedData('db_pass') ),
|
||||
'sql_tbl_prefix' => IPSSetUp::getSavedData('db_pre'),
|
||||
'sql_debug' => 0,
|
||||
'sql_charset' => 'utf8',
|
||||
|
||||
'board_start' => time(),
|
||||
'installed' => 1,
|
||||
|
||||
'php_ext' => 'php',
|
||||
'safe_mode' => $safe_mode,
|
||||
|
||||
//'base_url' => IPSSetUp::getSavedData('install_url'),
|
||||
'board_url' => IPSSetUp::getSavedData('install_url'),
|
||||
'banned_group' => '5',
|
||||
'admin_group' => '4',
|
||||
'guest_group' => '2',
|
||||
'member_group' => '3',
|
||||
'auth_group' => '1',
|
||||
'use_friendly_urls' => 1,
|
||||
'_jsDebug' => 0
|
||||
);
|
||||
|
||||
//---------------------------------------------
|
||||
// Any "extra" configs required for this driver?
|
||||
//---------------------------------------------
|
||||
|
||||
foreach( IPSSetUp::getSavedDataAsArray() as $k => $v )
|
||||
{
|
||||
if ( preg_match( "#^__sql__#", $k ) )
|
||||
{
|
||||
$k = str_replace( "__sql__", "", $k );
|
||||
|
||||
$INFO[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------
|
||||
// Write to disk
|
||||
//---------------------------------------------
|
||||
|
||||
$core_conf = "<"."?php\n";
|
||||
|
||||
foreach( $INFO as $k => $v )
|
||||
{
|
||||
$core_conf .= '$INFO['."'".$k."'".']'."\t\t\t=\t'".$v."';\n";
|
||||
}
|
||||
|
||||
$core_conf .= "\ndefine('IN_DEV', 0);";
|
||||
|
||||
/* Remote archive stuff */
|
||||
$core_conf .= "\n/* Remote archive DB - complete these details if you\'re using a remote DB for the post archive.\n If content has already been archived in the local DB, this will need transferring and will not be done automatically. */\n";
|
||||
|
||||
foreach( array( 'archive_remote_sql_host', 'archive_remote_sql_database', 'archive_remote_sql_user', 'archive_remote_sql_pass', 'archive_remote_sql_charset' ) as $k )
|
||||
{
|
||||
$core_conf .= '$INFO['."'".$k."'".']'."\t\t\t=\t'';\n";
|
||||
}
|
||||
|
||||
$core_conf .= "\n".'?'.'>';
|
||||
|
||||
/* Write Configuration Files */
|
||||
$output[] = 'Запись файлов настройки<br />';
|
||||
|
||||
$ret = IPSSetUp::writeFile( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' , $core_conf );
|
||||
|
||||
/* Now freeze data */
|
||||
IPSSetUp::freezeSavedData();
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up conf global
|
||||
* Removes data variables
|
||||
*
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
static public function cleanConfGlobal()
|
||||
{
|
||||
if ( $contents = @file_get_contents( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' ) )
|
||||
{
|
||||
if ( $contents )
|
||||
{
|
||||
$contents = preg_replace( "#/\*~~DATA~~\*/(.+?)\n/\*\*/#s", "", $contents );
|
||||
|
||||
return IPSSetUp::writeFile( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' , $contents );
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Static SETUP Classes for IP.Board 3
|
||||
*
|
||||
* These classes are not required as objects.
|
||||
* Last Updated: $Date: 2012-06-29 10:12:14 -0400 (Fri, 29 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 11007 $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Collection of methods to for installation alone
|
||||
*
|
||||
* @author Matt
|
||||
*/
|
||||
class IPSInstall
|
||||
{
|
||||
/**
|
||||
* Create admin account
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
static public function createAdminAccount()
|
||||
{
|
||||
/* Build Entry */
|
||||
$_mke_time = ( ipsRegistry::$settings['login_key_expire'] ) ? ( time() + ( intval( ipsRegistry::$settings['login_key_expire'] ) * 86400 ) ) : 0;
|
||||
$salt = IPSMember::generatePasswordSalt( 5 );
|
||||
$passhash = IPSMember::generateCompiledPasshash( $salt, md5( IPSSetUp::getSavedData('admin_pass') ) );
|
||||
$_dname = IPSSetUp::getSavedData('admin_user');
|
||||
|
||||
$member = array(
|
||||
'name' => $_dname,
|
||||
'members_l_username' => strtolower( $_dname ),
|
||||
'members_display_name' => $_dname,
|
||||
'members_l_display_name' => strtolower( $_dname ),
|
||||
'members_seo_name' => IPSText::makeSeoTitle( $_dname ),
|
||||
'member_login_key' => IPSMember::generateAutoLoginKey(),
|
||||
'member_login_key_expire' => $_mke_time,
|
||||
'title' => 'Administrator',
|
||||
'email' => IPSSetUp::getSavedData('admin_email') ,
|
||||
'member_group_id' => 4,
|
||||
'posts' => 1,
|
||||
'joined' => time(),
|
||||
'last_visit' => time(),
|
||||
'last_activity' => time(),
|
||||
'ip_address' => my_getenv('REMOTE_ADDR'),
|
||||
'view_sigs' => 1,
|
||||
'restrict_post' => 0,
|
||||
'msg_show_notification' => 1,
|
||||
'msg_count_total' => 0,
|
||||
'msg_count_new' => 0,
|
||||
'coppa_user' => 0,
|
||||
'language' => IPSLib::getDefaultLanguage(),
|
||||
'members_auto_dst' => 1,
|
||||
'member_uploader' => 'flash',
|
||||
'allow_admin_mails' => 0,
|
||||
'members_pass_hash' => $passhash,
|
||||
'members_pass_salt' => $salt,
|
||||
'has_blog' => '',
|
||||
'fb_token' => '',
|
||||
'ignored_users' => '',
|
||||
'members_cache' => '',
|
||||
'failed_logins' => '',
|
||||
'bday_day' => 0,
|
||||
'bday_month' => 0,
|
||||
'bday_year' => 0
|
||||
);
|
||||
|
||||
/* Insert: MEMBERS */
|
||||
ipsRegistry::DB()->setDataType( array( 'name', 'members_display_name', 'members_l_username', 'members_l_display_name' ), 'string' );
|
||||
|
||||
ipsRegistry::DB()->insert( 'members', $member );
|
||||
|
||||
$member_id = ipsRegistry::DB()->getInsertId();
|
||||
$member['member_id'] = $member_id;
|
||||
|
||||
/* Insert into the custom profile fields DB */
|
||||
ipsRegistry::DB()->insert( 'pfields_content', array( 'member_id' => $member_id ) );
|
||||
|
||||
/* Insert into pp */
|
||||
ipsRegistry::DB()->insert( 'profile_portal', array(
|
||||
'pp_member_id' => $member_id,
|
||||
'pp_setting_count_friends' => 1,
|
||||
'signature' => '',
|
||||
'pconversation_filters' => '',
|
||||
'pp_setting_count_comments' => 1,
|
||||
'pp_setting_count_visitors' => 1 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes out conf_global
|
||||
*
|
||||
* @access public
|
||||
* @return bool File written successfully
|
||||
*/
|
||||
static public function writeConfiguration()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Safe mode?
|
||||
//-----------------------------------------
|
||||
|
||||
$safe_mode = 0;
|
||||
|
||||
if ( @get_cfg_var('safe_mode') )
|
||||
{
|
||||
$safe_mode = @get_cfg_var('safe_mode');
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set info array
|
||||
//-----------------------------------------
|
||||
|
||||
$INFO = array(
|
||||
'sql_driver' => IPSSetUp::getSavedData('sql_driver'),
|
||||
'sql_host' => IPSSetUp::getSavedData('db_host'),
|
||||
'sql_database' => IPSSetUp::getSavedData('db_name'),
|
||||
'sql_user' => IPSSetUp::getSavedData('db_user'),
|
||||
'sql_pass' => str_replace( '\'', '\\\'', IPSSetUp::getSavedData('db_pass') ),
|
||||
'sql_tbl_prefix' => IPSSetUp::getSavedData('db_pre'),
|
||||
'sql_debug' => 0,
|
||||
'sql_charset' => '',
|
||||
|
||||
'board_start' => time(),
|
||||
'installed' => 1,
|
||||
|
||||
'php_ext' => 'php',
|
||||
'safe_mode' => $safe_mode,
|
||||
|
||||
//'base_url' => IPSSetUp::getSavedData('install_url'),
|
||||
'board_url' => IPSSetUp::getSavedData('install_url'),
|
||||
'banned_group' => '5',
|
||||
'admin_group' => '4',
|
||||
'guest_group' => '2',
|
||||
'member_group' => '3',
|
||||
'auth_group' => '1',
|
||||
'use_friendly_urls' => 1,
|
||||
'_jsDebug' => 0
|
||||
);
|
||||
|
||||
//---------------------------------------------
|
||||
// Any "extra" configs required for this driver?
|
||||
//---------------------------------------------
|
||||
|
||||
foreach( IPSSetUp::getSavedDataAsArray() as $k => $v )
|
||||
{
|
||||
if ( preg_match( "#^__sql__#", $k ) )
|
||||
{
|
||||
$k = str_replace( "__sql__", "", $k );
|
||||
|
||||
$INFO[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------
|
||||
// Write to disk
|
||||
//---------------------------------------------
|
||||
|
||||
$core_conf = "<"."?php\n";
|
||||
|
||||
foreach( $INFO as $k => $v )
|
||||
{
|
||||
$core_conf .= '$INFO['."'".$k."'".']'."\t\t\t=\t'".$v."';\n";
|
||||
}
|
||||
|
||||
$core_conf .= "\ndefine('IN_DEV', 0);";
|
||||
|
||||
/* Remote archive stuff */
|
||||
$core_conf .= "\n/* Remote archive DB - complete these details if you\'re using a remote DB for the post archive.\n If content has already been archived in the local DB, this will need transferring and will not be done automatically. */\n";
|
||||
|
||||
foreach( array( 'archive_remote_sql_host', 'archive_remote_sql_database', 'archive_remote_sql_user', 'archive_remote_sql_pass', 'archive_remote_sql_charset' ) as $k )
|
||||
{
|
||||
$core_conf .= '$INFO['."'".$k."'".']'."\t\t\t=\t'';\n";
|
||||
}
|
||||
|
||||
$core_conf .= "\n".'?'.'>';
|
||||
|
||||
/* Write Configuration Files */
|
||||
$output[] = 'Writing configuration files...<br />';
|
||||
|
||||
$ret = IPSSetUp::writeFile( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' , $core_conf );
|
||||
|
||||
/* Now freeze data */
|
||||
IPSSetUp::freezeSavedData();
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up conf global
|
||||
* Removes data variables
|
||||
*
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
static public function cleanConfGlobal()
|
||||
{
|
||||
if ( $contents = @file_get_contents( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' ) )
|
||||
{
|
||||
if ( $contents )
|
||||
{
|
||||
$contents = preg_replace( "#/\*~~DATA~~\*/(.+?)\n/\*\*/#s", "", $contents );
|
||||
|
||||
return IPSSetUp::writeFile( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' , $contents );
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,301 +1,301 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* ipsController for setup
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class "Controller"
|
||||
* A very simple public facing interface to resolve incoming data into
|
||||
* a command class
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @since Wednesday 14th May 2008
|
||||
* @package IP.Board
|
||||
* @ignore
|
||||
*/
|
||||
class ipsController
|
||||
{
|
||||
/**
|
||||
* Registry reference
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $registry;
|
||||
|
||||
/**
|
||||
* Current command
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
static public $cmd;
|
||||
|
||||
/**
|
||||
* Make us a singleton please
|
||||
*
|
||||
* @access private
|
||||
* @return @e void
|
||||
*/
|
||||
private function __construct() { }
|
||||
|
||||
/**
|
||||
* Public facing function to run the controller
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
static public function run()
|
||||
{
|
||||
$instance = new ipsController();
|
||||
$instance->init();
|
||||
$instance->handleRequest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize ipsRegistry and this class
|
||||
*
|
||||
* @access protected
|
||||
* @return @e void
|
||||
*/
|
||||
protected function init()
|
||||
{
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->registry->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the incoming request using the command resolver
|
||||
*
|
||||
* @access protected
|
||||
* @return @e void
|
||||
*/
|
||||
protected function handleRequest()
|
||||
{
|
||||
$cmd_r = new ipsController_CommandResolver();
|
||||
self::$cmd = $cmd_r->getCommand( $this->registry );
|
||||
self::$cmd->execute( $this->registry );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class "Command Resolver"
|
||||
* Resolves the incoming data
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @since Wednesday 14th May 2008
|
||||
* @package IP.Board
|
||||
*/
|
||||
class ipsController_CommandResolver
|
||||
{
|
||||
/**
|
||||
* Base command
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $base_cmd;
|
||||
|
||||
/**
|
||||
* AJAX command
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $ajax_cmd;
|
||||
|
||||
/**
|
||||
* Default command
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $default_cmd;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ( ! self::$base_cmd )
|
||||
{
|
||||
self::$base_cmd = new ReflectionClass( 'ipsCommand' );
|
||||
self::$default_cmd = new ipsCommand_default();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the command
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return object Command object
|
||||
*/
|
||||
public function getCommand( ipsRegistry $registry )
|
||||
{
|
||||
$module = ipsRegistry::$current_module;
|
||||
$section = ipsRegistry::$current_section;
|
||||
$filepath = ( IPS_IS_UPGRADER ) ? IPS_ROOT_PATH . 'setup/applications/upgrade/sections/' : IPS_ROOT_PATH . 'setup/applications/install/sections/';
|
||||
|
||||
/* Got a section? */
|
||||
if ( ! $section )
|
||||
{
|
||||
if ( is_file( $filepath . 'index.php' ) )
|
||||
{
|
||||
$section = 'index';
|
||||
}
|
||||
}
|
||||
|
||||
$classname = IPS_APP_COMPONENT . '_' . $section;
|
||||
|
||||
if ( is_file( $filepath . 'manualResolver.php' ) )
|
||||
{
|
||||
require_once( $filepath . 'manualResolver.php' );/*noLibHook*/
|
||||
$classname = IPS_APP_COMPONENT . '_' . $module . '_manualResolver';
|
||||
}
|
||||
else if ( is_file( $filepath . $section . '.php' ) )
|
||||
{
|
||||
require_once( $filepath . $section . '.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
if ( class_exists( $classname ) )
|
||||
{
|
||||
$cmd_class = new ReflectionClass( $classname );
|
||||
|
||||
if ( $cmd_class->isSubClassOf( self::$base_cmd ) )
|
||||
{
|
||||
return $cmd_class->newInstance();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception( "{$section} в модуле {$module} не существует!" );
|
||||
}
|
||||
}
|
||||
|
||||
# Fudge it to return just the default object
|
||||
return clone self::$default_cmd;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
abstract class ipsCommand
|
||||
{
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
public $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor override
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
final public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Create registry shortcuts
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function makeRegistryShortcuts( ipsRegistry $registry )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the commands
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function execute( ipsRegistry $registry )
|
||||
{
|
||||
$this->makeRegistryShortcuts( $registry );
|
||||
$this->doExecute( $registry );
|
||||
}
|
||||
|
||||
/**
|
||||
* doExecute, most be override
|
||||
*
|
||||
* @access protected
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
protected abstract function doExecute( ipsRegistry $registry );
|
||||
}
|
||||
|
||||
|
||||
class ipsCommand_default extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main execution method
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
protected function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$filepath = IPSLib::getAppDir( IPS_APP_COMPONENT ) . '/modules/' . ipsRegistry::$current_module . '/' . ipsRegistry::$current_section . '.php';
|
||||
$filepath = str_replace( DOC_IPS_ROOT_PATH, '', $filepath );
|
||||
|
||||
//-----------------------------------------
|
||||
// Uh oh, this is a big one.. (no forums app)
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_file( $filepath ) )
|
||||
{
|
||||
print "Command File " . ipsRegistry::$current_module . " missing";
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Nothing to do!";
|
||||
exit();
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* ipsController for setup
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class "Controller"
|
||||
* A very simple public facing interface to resolve incoming data into
|
||||
* a command class
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @since Wednesday 14th May 2008
|
||||
* @package IP.Board
|
||||
* @ignore
|
||||
*/
|
||||
class ipsController
|
||||
{
|
||||
/**
|
||||
* Registry reference
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $registry;
|
||||
|
||||
/**
|
||||
* Current command
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
static public $cmd;
|
||||
|
||||
/**
|
||||
* Make us a singleton please
|
||||
*
|
||||
* @access private
|
||||
* @return @e void
|
||||
*/
|
||||
private function __construct() { }
|
||||
|
||||
/**
|
||||
* Public facing function to run the controller
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
static public function run()
|
||||
{
|
||||
$instance = new ipsController();
|
||||
$instance->init();
|
||||
$instance->handleRequest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize ipsRegistry and this class
|
||||
*
|
||||
* @access protected
|
||||
* @return @e void
|
||||
*/
|
||||
protected function init()
|
||||
{
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->registry->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the incoming request using the command resolver
|
||||
*
|
||||
* @access protected
|
||||
* @return @e void
|
||||
*/
|
||||
protected function handleRequest()
|
||||
{
|
||||
$cmd_r = new ipsController_CommandResolver();
|
||||
self::$cmd = $cmd_r->getCommand( $this->registry );
|
||||
self::$cmd->execute( $this->registry );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class "Command Resolver"
|
||||
* Resolves the incoming data
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @since Wednesday 14th May 2008
|
||||
* @package IP.Board
|
||||
*/
|
||||
class ipsController_CommandResolver
|
||||
{
|
||||
/**
|
||||
* Base command
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $base_cmd;
|
||||
|
||||
/**
|
||||
* AJAX command
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $ajax_cmd;
|
||||
|
||||
/**
|
||||
* Default command
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $default_cmd;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ( ! self::$base_cmd )
|
||||
{
|
||||
self::$base_cmd = new ReflectionClass( 'ipsCommand' );
|
||||
self::$default_cmd = new ipsCommand_default();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the command
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return object Command object
|
||||
*/
|
||||
public function getCommand( ipsRegistry $registry )
|
||||
{
|
||||
$module = ipsRegistry::$current_module;
|
||||
$section = ipsRegistry::$current_section;
|
||||
$filepath = ( IPS_IS_UPGRADER ) ? IPS_ROOT_PATH . 'setup/applications/upgrade/sections/' : IPS_ROOT_PATH . 'setup/applications/install/sections/';
|
||||
|
||||
/* Got a section? */
|
||||
if ( ! $section )
|
||||
{
|
||||
if ( is_file( $filepath . 'index.php' ) )
|
||||
{
|
||||
$section = 'index';
|
||||
}
|
||||
}
|
||||
|
||||
$classname = IPS_APP_COMPONENT . '_' . $section;
|
||||
|
||||
if ( is_file( $filepath . 'manualResolver.php' ) )
|
||||
{
|
||||
require_once( $filepath . 'manualResolver.php' );/*noLibHook*/
|
||||
$classname = IPS_APP_COMPONENT . '_' . $module . '_manualResolver';
|
||||
}
|
||||
else if ( is_file( $filepath . $section . '.php' ) )
|
||||
{
|
||||
require_once( $filepath . $section . '.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
if ( class_exists( $classname ) )
|
||||
{
|
||||
$cmd_class = new ReflectionClass( $classname );
|
||||
|
||||
if ( $cmd_class->isSubClassOf( self::$base_cmd ) )
|
||||
{
|
||||
return $cmd_class->newInstance();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception( "{$section} in {$module} does not exist!" );
|
||||
}
|
||||
}
|
||||
|
||||
# Fudge it to return just the default object
|
||||
return clone self::$default_cmd;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
abstract class ipsCommand
|
||||
{
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
public $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor override
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
final public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Create registry shortcuts
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function makeRegistryShortcuts( ipsRegistry $registry )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the commands
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function execute( ipsRegistry $registry )
|
||||
{
|
||||
$this->makeRegistryShortcuts( $registry );
|
||||
$this->doExecute( $registry );
|
||||
}
|
||||
|
||||
/**
|
||||
* doExecute, most be override
|
||||
*
|
||||
* @access protected
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
protected abstract function doExecute( ipsRegistry $registry );
|
||||
}
|
||||
|
||||
|
||||
class ipsCommand_default extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main execution method
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
protected function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$filepath = IPSLib::getAppDir( IPS_APP_COMPONENT ) . '/modules/' . ipsRegistry::$current_module . '/' . ipsRegistry::$current_section . '.php';
|
||||
$filepath = str_replace( DOC_IPS_ROOT_PATH, '', $filepath );
|
||||
|
||||
//-----------------------------------------
|
||||
// Uh oh, this is a big one.. (no forums app)
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_file( $filepath ) )
|
||||
{
|
||||
print "Command File " . ipsRegistry::$current_module . " missing";
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Nothing to do!";
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* IP.Board v3.4.6
|
||||
* Static SETUP Classes for IP.Board 3
|
||||
*
|
||||
* These classes are not required as objects.
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,264 +1,264 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Setup sessions class
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
define( 'IPB_UPGRADER_IP_MATCH', FALSE );
|
||||
|
||||
/**
|
||||
* Sessions class for setup
|
||||
* @ignore
|
||||
*/
|
||||
class sessions extends ips_MemberRegistry
|
||||
{
|
||||
/**
|
||||
* Variable for session validated
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
private $_data = array();
|
||||
|
||||
/**
|
||||
* Time out seconds
|
||||
*
|
||||
* @access private
|
||||
* @var int
|
||||
*/
|
||||
private $_time_out_secs = 86400;
|
||||
|
||||
/**
|
||||
* ACP session id
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $_adsess = '';
|
||||
|
||||
/**
|
||||
* Validated?
|
||||
*
|
||||
* @access private
|
||||
* @var bool
|
||||
*/
|
||||
private $_validated = false;
|
||||
|
||||
/**
|
||||
* Message to pass
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $_message;
|
||||
|
||||
/**
|
||||
* Authorize
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
|
||||
/* Grab session */
|
||||
$_s = IPSText::md5Clean( $this->request['s'] );
|
||||
|
||||
/* Got a session? */
|
||||
if ( ! $_s )
|
||||
{
|
||||
return $this->_response( 0, '' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'upgrade_sessions',
|
||||
'where' => "session_id='" . $_s . "'" ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$_data = $this->DB->fetch();
|
||||
|
||||
if ( ! $_data['session_id'] )
|
||||
{
|
||||
/* No record found */
|
||||
return $this->_response( 0, '' );
|
||||
}
|
||||
else if ( ! $_data['session_member_id'] )
|
||||
{
|
||||
/* No member ID found */
|
||||
return $this->_response( 0, 'Невозможно получить корректный ID пользователя' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Load member */
|
||||
self::instance()->data_store = $this->registry->getClass('legacy')->loadMemberData( $_data['session_member_id'] );
|
||||
|
||||
/* Member exists? */
|
||||
if ( ! self::instance()->data_store['email'] )
|
||||
{
|
||||
return $this->_response( 0, 'Неверный Email пользователя' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Authenticate */
|
||||
if ( $_data['session_member_key'] != $this->registry->getClass('legacy')->fetchAuthKey() )
|
||||
{
|
||||
return $this->_response( 0, 'Неверный ключ сессии' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* ACP access? */
|
||||
if ( self::instance()->data_store['g_access_cp'] != 1)
|
||||
{
|
||||
return $this->_response( 0, 'У вас нет доступа к администраторским функциям' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_validated = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// If we're here, we're valid...
|
||||
//--------------------------------------------
|
||||
|
||||
if ( $this->_validated === TRUE )
|
||||
{
|
||||
self::setUpMember();
|
||||
|
||||
if ( $_data['session_current_time'] < ( time() - $this->_time_out_secs ) )
|
||||
{
|
||||
return $this->_response( 0, '' );
|
||||
}
|
||||
|
||||
/* Check IPs? */
|
||||
else if ( IPB_UPGRADER_IP_MATCH )
|
||||
{
|
||||
$first_ip = preg_replace( "/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/", "\\1.\\2.\\3", $_data['session_ip_address'] );
|
||||
$second_ip = preg_replace( "/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/", "\\1.\\2.\\3", self::instance()->ip_address );
|
||||
|
||||
if ( $first_ip != $second_ip )
|
||||
{
|
||||
return $this->_response( 0, 'Ваш IP адрес не совпадает ни с одной из наших записей' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Still here? Lets update the session, then */
|
||||
$this->DB->update( 'upgrade_sessions', array( 'session_current_time' => time(),
|
||||
'session_section' => $this->request['section'],
|
||||
'session_post' => serialize( $_POST ),
|
||||
'session_get' => serialize( $_GET ) ), 'session_id=\'' . $this->request['s'] . '\'' );
|
||||
|
||||
|
||||
/* If we're hitting the index and we have a valid session, go right to overview */
|
||||
if ( ! $this->request['section'] OR $this->request['section'] == 'index' )
|
||||
{
|
||||
$this->request['section'] = 'overview';
|
||||
}
|
||||
|
||||
return $this->_response( 1, '' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a session
|
||||
*
|
||||
* @access public
|
||||
* @param array Array of member Data
|
||||
* @param string Auth Key
|
||||
* @return nufink
|
||||
*/
|
||||
public function createSession( $member, $authKey )
|
||||
{
|
||||
$_bash = time() - $this->_time_out_secs;
|
||||
$_s = md5( uniqid( microtime(), true ) . self::instance()->ip_address );
|
||||
|
||||
if ( $member['member_id'] AND $authKey )
|
||||
{
|
||||
$this->DB->delete( 'upgrade_sessions', 'session_current_time < ' . $_bash . ' AND session_section=\'done\'' );
|
||||
$this->DB->insert( 'upgrade_sessions', array( 'session_id' => $_s,
|
||||
'session_member_id' => $member['member_id'],
|
||||
'session_member_key' => $authKey,
|
||||
'session_start_time' => time(),
|
||||
'session_current_time' => time(),
|
||||
'session_ip_address' => self::instance()->ip_address,
|
||||
'session_section' => 'index',
|
||||
'session_post' => serialize( array() ),
|
||||
'session_get' => serialize( array() ),
|
||||
'session_data' => serialize( array() ),
|
||||
'session_extra' => '' ) );
|
||||
|
||||
return $_s;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation code
|
||||
*
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->_validated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation message
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->_message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the response
|
||||
*
|
||||
* @access protected
|
||||
* @param bool Validated
|
||||
* @param string Message
|
||||
* @return mixed
|
||||
*/
|
||||
protected function _response( $validated, $message )
|
||||
{
|
||||
$this->_validated = $validated;
|
||||
$this->_message = $message;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Setup sessions class
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
define( 'IPB_UPGRADER_IP_MATCH', FALSE );
|
||||
|
||||
/**
|
||||
* Sessions class for setup
|
||||
* @ignore
|
||||
*/
|
||||
class sessions extends ips_MemberRegistry
|
||||
{
|
||||
/**
|
||||
* Variable for session validated
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
private $_data = array();
|
||||
|
||||
/**
|
||||
* Time out seconds
|
||||
*
|
||||
* @access private
|
||||
* @var int
|
||||
*/
|
||||
private $_time_out_secs = 86400;
|
||||
|
||||
/**
|
||||
* ACP session id
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $_adsess = '';
|
||||
|
||||
/**
|
||||
* Validated?
|
||||
*
|
||||
* @access private
|
||||
* @var bool
|
||||
*/
|
||||
private $_validated = false;
|
||||
|
||||
/**
|
||||
* Message to pass
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $_message;
|
||||
|
||||
/**
|
||||
* Authorize
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
|
||||
/* Grab session */
|
||||
$_s = IPSText::md5Clean( $this->request['s'] );
|
||||
|
||||
/* Got a session? */
|
||||
if ( ! $_s )
|
||||
{
|
||||
return $this->_response( 0, '' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'upgrade_sessions',
|
||||
'where' => "session_id='" . $_s . "'" ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$_data = $this->DB->fetch();
|
||||
|
||||
if ( ! $_data['session_id'] )
|
||||
{
|
||||
/* No record found */
|
||||
return $this->_response( 0, '' );
|
||||
}
|
||||
else if ( ! $_data['session_member_id'] )
|
||||
{
|
||||
/* No member ID found */
|
||||
return $this->_response( 0, 'Could not retrieve a valid member id' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Load member */
|
||||
self::instance()->data_store = $this->registry->getClass('legacy')->loadMemberData( $_data['session_member_id'] );
|
||||
|
||||
/* Member exists? */
|
||||
if ( ! self::instance()->data_store['email'] )
|
||||
{
|
||||
return $this->_response( 0, 'Member Email invalid' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Authenticate */
|
||||
if ( $_data['session_member_key'] != $this->registry->getClass('legacy')->fetchAuthKey() )
|
||||
{
|
||||
return $this->_response( 0, 'Session not authenticated' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* ACP access? */
|
||||
if ( self::instance()->data_store['g_access_cp'] != 1)
|
||||
{
|
||||
return $this->_response( 0, 'You do not have access to the administrative CP' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_validated = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// If we're here, we're valid...
|
||||
//--------------------------------------------
|
||||
|
||||
if ( $this->_validated === TRUE )
|
||||
{
|
||||
self::setUpMember();
|
||||
|
||||
if ( $_data['session_current_time'] < ( time() - $this->_time_out_secs ) )
|
||||
{
|
||||
return $this->_response( 0, '' );
|
||||
}
|
||||
|
||||
/* Check IPs? */
|
||||
else if ( IPB_UPGRADER_IP_MATCH )
|
||||
{
|
||||
$first_ip = preg_replace( "/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/", "\\1.\\2.\\3", $_data['session_ip_address'] );
|
||||
$second_ip = preg_replace( "/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/", "\\1.\\2.\\3", self::instance()->ip_address );
|
||||
|
||||
if ( $first_ip != $second_ip )
|
||||
{
|
||||
return $this->_response( 0, 'Your current IP address does not match the one in our records' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Still here? Lets update the session, then */
|
||||
$this->DB->update( 'upgrade_sessions', array( 'session_current_time' => time(),
|
||||
'session_section' => $this->request['section'],
|
||||
'session_post' => serialize( $_POST ),
|
||||
'session_get' => serialize( $_GET ) ), 'session_id=\'' . $this->request['s'] . '\'' );
|
||||
|
||||
|
||||
/* If we're hitting the index and we have a valid session, go right to overview */
|
||||
if ( ! $this->request['section'] OR $this->request['section'] == 'index' )
|
||||
{
|
||||
$this->request['section'] = 'overview';
|
||||
}
|
||||
|
||||
return $this->_response( 1, '' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a session
|
||||
*
|
||||
* @access public
|
||||
* @param array Array of member Data
|
||||
* @param string Auth Key
|
||||
* @return nufink
|
||||
*/
|
||||
public function createSession( $member, $authKey )
|
||||
{
|
||||
$_bash = time() - $this->_time_out_secs;
|
||||
$_s = md5( uniqid( microtime(), true ) . self::instance()->ip_address );
|
||||
|
||||
if ( $member['member_id'] AND $authKey )
|
||||
{
|
||||
$this->DB->delete( 'upgrade_sessions', 'session_current_time < ' . $_bash . ' AND session_section=\'done\'' );
|
||||
$this->DB->insert( 'upgrade_sessions', array( 'session_id' => $_s,
|
||||
'session_member_id' => $member['member_id'],
|
||||
'session_member_key' => $authKey,
|
||||
'session_start_time' => time(),
|
||||
'session_current_time' => time(),
|
||||
'session_ip_address' => self::instance()->ip_address,
|
||||
'session_section' => 'index',
|
||||
'session_post' => serialize( array() ),
|
||||
'session_get' => serialize( array() ),
|
||||
'session_data' => serialize( array() ),
|
||||
'session_extra' => '' ) );
|
||||
|
||||
return $_s;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation code
|
||||
*
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->_validated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation message
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->_message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the response
|
||||
*
|
||||
* @access protected
|
||||
* @param bool Validated
|
||||
* @param string Message
|
||||
* @return mixed
|
||||
*/
|
||||
protected function _response( $validated, $message )
|
||||
{
|
||||
$this->_validated = $validated;
|
||||
$this->_message = $message;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,222 +1,222 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Version Specific Upgrade Functions
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
class upgradeLegacy
|
||||
{
|
||||
/**
|
||||
* Member data
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
private $_member;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
//* Make sure tables exist that won't in pre 3.0 versions */
|
||||
if ( is_file( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' ) )
|
||||
{
|
||||
/* Init vars */
|
||||
$UPGRADE_HISTORY_TABLE = '';
|
||||
$UPGRADE_TABLE_FIELD = '';
|
||||
$UPGRADE_SESSION_TABLE = '';
|
||||
$UPGRADE_CSS_PREVIOUS = '';
|
||||
$UPGRADE_TEMPLATE_PREVIOUS = '';
|
||||
|
||||
require( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' );/*noLibHook*/
|
||||
|
||||
$prefix = $this->registry->dbFunctions()->getPrefix();
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'upgrade_history' ) )
|
||||
{
|
||||
if ( $UPGRADE_HISTORY_TABLE )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_HISTORY_TABLE, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForField( 'upgrade_app', 'upgrade_history' ) )
|
||||
{
|
||||
if ( $UPGRADE_TABLE_FIELD )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TABLE_FIELD, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'upgrade_sessions' ) )
|
||||
{
|
||||
if ( $UPGRADE_SESSION_TABLE )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_SESSION_TABLE, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'skin_css_previous' ) )
|
||||
{
|
||||
if ( $UPGRADE_CSS_PREVIOUS )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_CSS_PREVIOUS, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'skin_templates_previous' ) )
|
||||
{
|
||||
if ( $UPGRADE_TEMPLATE_PREVIOUS )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TEMPLATE_PREVIOUS, $prefix ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch auth key
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function fetchAuthKey()
|
||||
{
|
||||
if ( ! $this->_member['id'] AND ! $this->_member['member_id'] )
|
||||
{
|
||||
throw new Exception( "MEMBER NOT SET" );
|
||||
}
|
||||
else
|
||||
{
|
||||
return ( $this->_member['password'] ) ? md5( $this->_member['password'] ) : md5( $this->_member['legacy_password'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch member data
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function fetchMemberData()
|
||||
{
|
||||
return ( is_array( $this->_member ) ) ? $this->_member : array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and return member data
|
||||
*
|
||||
* @access public
|
||||
* @param int Member ID to load
|
||||
* @return array
|
||||
*/
|
||||
public function loadMemberData( $memberId )
|
||||
{
|
||||
/* Attempt to load member */
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.id=' . intval( $memberId ),
|
||||
'add_join' => array( array( 'select' => 'g.*',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.mgroup' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$this->_member = $this->DB->fetch();
|
||||
|
||||
/* Fix up pre-3 stuffs */
|
||||
$this->_member['member_id'] = $this->_member['id'];
|
||||
$this->_member['member_group_id'] = $this->_member['mgroup'];
|
||||
|
||||
/* Occasionally 1.x installs do not have an email address. Most likey an InvisionFree issue */
|
||||
if ( ! $this->_member['email'] )
|
||||
{
|
||||
$this->DB->update( 'members', array( 'email' => 'email_' . $this->_member['id'] . '_@changeMe.com' ), 'id=' . $memberId );
|
||||
}
|
||||
|
||||
return $this->fetchMemberData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate log in
|
||||
*
|
||||
* @access public
|
||||
* @param string Username (from $this->request)
|
||||
* @param string Password (from $this->request)
|
||||
* @return mixed TRUE if successful, string (message) if not
|
||||
*/
|
||||
public function authenticateLogIn( $username, $password )
|
||||
{
|
||||
/* Attempt to load member */
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => $this->DB->buildLower('m.name') . "='" . mb_strtolower( $username ) . "'",
|
||||
'add_join' => array( array( 'select' => 'g.*',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.mgroup' ) ) ) );
|
||||
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$mem = $this->DB->fetch();
|
||||
$pass = md5( $password );
|
||||
|
||||
/* Check it out */
|
||||
if ( ! $mem['id'] )
|
||||
{
|
||||
return 'Пользователь с таким именем не найден';
|
||||
}
|
||||
|
||||
if ( $pass != $mem['password'] AND $pass != $mem['legacy_password'] )
|
||||
{
|
||||
return 'Неверный пароль';
|
||||
}
|
||||
|
||||
if ( $mem['g_access_cp'] != 1 )
|
||||
{
|
||||
return 'У вас нет доступа к системе обновления';
|
||||
}
|
||||
|
||||
/* Set up _member */
|
||||
$this->loadMemberData( $mem['id'] );
|
||||
|
||||
/* Still here? */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return log in form HTML
|
||||
*
|
||||
* @access public
|
||||
* @return string HTML
|
||||
*/
|
||||
public function fetchLogInForm()
|
||||
{
|
||||
return $this->registry->output->template()->upgrade_login_200plus( 'username' );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Version Specific Upgrade Functions
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
class upgradeLegacy
|
||||
{
|
||||
/**
|
||||
* Member data
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
private $_member;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
//* Make sure tables exist that won't in pre 3.0 versions */
|
||||
if ( is_file( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' ) )
|
||||
{
|
||||
/* Init vars */
|
||||
$UPGRADE_HISTORY_TABLE = '';
|
||||
$UPGRADE_TABLE_FIELD = '';
|
||||
$UPGRADE_SESSION_TABLE = '';
|
||||
$UPGRADE_CSS_PREVIOUS = '';
|
||||
$UPGRADE_TEMPLATE_PREVIOUS = '';
|
||||
|
||||
require( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' );/*noLibHook*/
|
||||
|
||||
$prefix = $this->registry->dbFunctions()->getPrefix();
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'upgrade_history' ) )
|
||||
{
|
||||
if ( $UPGRADE_HISTORY_TABLE )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_HISTORY_TABLE, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForField( 'upgrade_app', 'upgrade_history' ) )
|
||||
{
|
||||
if ( $UPGRADE_TABLE_FIELD )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TABLE_FIELD, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'upgrade_sessions' ) )
|
||||
{
|
||||
if ( $UPGRADE_SESSION_TABLE )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_SESSION_TABLE, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'skin_css_previous' ) )
|
||||
{
|
||||
if ( $UPGRADE_CSS_PREVIOUS )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_CSS_PREVIOUS, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'skin_templates_previous' ) )
|
||||
{
|
||||
if ( $UPGRADE_TEMPLATE_PREVIOUS )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TEMPLATE_PREVIOUS, $prefix ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch auth key
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function fetchAuthKey()
|
||||
{
|
||||
if ( ! $this->_member['id'] AND ! $this->_member['member_id'] )
|
||||
{
|
||||
throw new Exception( "MEMBER NOT SET" );
|
||||
}
|
||||
else
|
||||
{
|
||||
return ( $this->_member['password'] ) ? md5( $this->_member['password'] ) : md5( $this->_member['legacy_password'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch member data
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function fetchMemberData()
|
||||
{
|
||||
return ( is_array( $this->_member ) ) ? $this->_member : array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and return member data
|
||||
*
|
||||
* @access public
|
||||
* @param int Member ID to load
|
||||
* @return array
|
||||
*/
|
||||
public function loadMemberData( $memberId )
|
||||
{
|
||||
/* Attempt to load member */
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.id=' . intval( $memberId ),
|
||||
'add_join' => array( array( 'select' => 'g.*',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.mgroup' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$this->_member = $this->DB->fetch();
|
||||
|
||||
/* Fix up pre-3 stuffs */
|
||||
$this->_member['member_id'] = $this->_member['id'];
|
||||
$this->_member['member_group_id'] = $this->_member['mgroup'];
|
||||
|
||||
/* Occasionally 1.x installs do not have an email address. Most likey an InvisionFree issue */
|
||||
if ( ! $this->_member['email'] )
|
||||
{
|
||||
$this->DB->update( 'members', array( 'email' => 'email_' . $this->_member['id'] . '_@changeMe.com' ), 'id=' . $memberId );
|
||||
}
|
||||
|
||||
return $this->fetchMemberData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate log in
|
||||
*
|
||||
* @access public
|
||||
* @param string Username (from $this->request)
|
||||
* @param string Password (from $this->request)
|
||||
* @return mixed TRUE if successful, string (message) if not
|
||||
*/
|
||||
public function authenticateLogIn( $username, $password )
|
||||
{
|
||||
/* Attempt to load member */
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => $this->DB->buildLower('m.name') . "='" . strtolower( $username ) . "'",
|
||||
'add_join' => array( array( 'select' => 'g.*',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.mgroup' ) ) ) );
|
||||
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$mem = $this->DB->fetch();
|
||||
$pass = md5( $password );
|
||||
|
||||
/* Check it out */
|
||||
if ( ! $mem['id'] )
|
||||
{
|
||||
return 'No user found by that username';
|
||||
}
|
||||
|
||||
if ( $pass != $mem['password'] AND $pass != $mem['legacy_password'] )
|
||||
{
|
||||
return 'Password incorrect';
|
||||
}
|
||||
|
||||
if ( $mem['g_access_cp'] != 1 )
|
||||
{
|
||||
return 'You do not have access to the upgrade system';
|
||||
}
|
||||
|
||||
/* Set up _member */
|
||||
$this->loadMemberData( $mem['id'] );
|
||||
|
||||
/* Still here? */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return log in form HTML
|
||||
*
|
||||
* @access public
|
||||
* @return string HTML
|
||||
*/
|
||||
public function fetchLogInForm()
|
||||
{
|
||||
return $this->registry->output->template()->upgrade_login_200plus( 'username' );
|
||||
}
|
||||
}
|
||||
@@ -1,265 +1,265 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Version Specific Upgrade Functions
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
class upgradeLegacy
|
||||
{
|
||||
/**
|
||||
* Member data
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
private $_member;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
/* Make sure tables exist that won't in pre 3.0 versions */
|
||||
if ( is_file( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' ) )
|
||||
{
|
||||
/* Init vars */
|
||||
$UPGRADE_TABLE_FIELD = '';
|
||||
$UPGRADE_SESSION_TABLE = '';
|
||||
$UPGRADE_CSS_PREVIOUS = '';
|
||||
$UPGRADE_TEMPLATE_PREVIOUS = '';
|
||||
|
||||
require( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' );/*noLibHook*/
|
||||
|
||||
$prefix = $this->registry->dbFunctions()->getPrefix();
|
||||
|
||||
if ( ! $this->DB->checkForField( 'upgrade_app', 'upgrade_history' ) )
|
||||
{
|
||||
if ( $UPGRADE_TABLE_FIELD )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TABLE_FIELD, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'upgrade_sessions' ) )
|
||||
{
|
||||
if ( $UPGRADE_SESSION_TABLE )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_SESSION_TABLE, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'skin_css_previous' ) )
|
||||
{
|
||||
if ( $UPGRADE_CSS_PREVIOUS )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_CSS_PREVIOUS, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'skin_templates_previous' ) )
|
||||
{
|
||||
if ( $UPGRADE_TEMPLATE_PREVIOUS )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TEMPLATE_PREVIOUS, $prefix ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch auth key
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function fetchAuthKey()
|
||||
{
|
||||
if ( ! $this->_member['id'] AND ! $this->_member['member_id'] )
|
||||
{
|
||||
throw new Exception( "MEMBER NOT SET" );
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_member['member_login_key'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch member data
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function fetchMemberData()
|
||||
{
|
||||
return ( is_array( $this->_member ) ) ? $this->_member : array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and return member data
|
||||
*
|
||||
* @access public
|
||||
* @param int Member ID to load
|
||||
* @return array
|
||||
*/
|
||||
public function loadMemberData( $memberId )
|
||||
{
|
||||
/* At this point, we could be either using 2.3 or 3.0 */
|
||||
if ( $this->DB->checkForField( 'member_id', 'members' ) )
|
||||
{
|
||||
/* Attempt to load member */
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=' . intval( $memberId ),
|
||||
'add_join' => array( array( 'select' => 'g.*',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.member_group_id' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$this->_member = $this->DB->fetch();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Attempt to load member */
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.id=' . intval( $memberId ),
|
||||
'add_join' => array( array( 'select' => 'g.*',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.mgroup' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$this->_member = $this->DB->fetch();
|
||||
|
||||
/* Fix up pre-3 stuffs */
|
||||
$this->_member['member_id'] = $this->_member['id'];
|
||||
$this->_member['member_group_id'] = $this->_member['mgroup'];
|
||||
}
|
||||
|
||||
/* Set up seconday groups */
|
||||
$this->_member = ips_MemberRegistry::setUpSecondaryGroups( $this->_member );
|
||||
|
||||
return $this->fetchMemberData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate log in
|
||||
*
|
||||
* @access public
|
||||
* @param string Username (from $this->request)
|
||||
* @param string Password (from $this->request)
|
||||
* @return mixed TRUE if successful, string (message) if not
|
||||
*/
|
||||
public function authenticateLogIn( $username, $password )
|
||||
{
|
||||
/* Log in type */
|
||||
$loginType = $this->_fetchLogInType();
|
||||
$where = ( $loginType == 'username' ) ? $this->DB->buildLower('m.name'). "='" . mb_strtolower( $username ) . "'" : "m.email='" . mb_strtolower( $username ) . "'";
|
||||
|
||||
/* Attempt to load member */
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => $where,
|
||||
'add_join' => array( array( 'select' => 'g.*',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.mgroup' ),
|
||||
array( 'select' => 'c.*',
|
||||
'from' => array( 'members_converge' => 'c' ),
|
||||
'where' => 'c.converge_email=m.email' ) ) ) );
|
||||
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$mem = $this->DB->fetch();
|
||||
|
||||
/* Check it out */
|
||||
if ( ! $mem['id'] OR ! $mem['converge_pass_hash'] )
|
||||
{
|
||||
return 'Пользователь не найден';
|
||||
}
|
||||
|
||||
if ( $mem['converge_pass_hash'] != md5( md5( $mem['converge_pass_salt'] ) . md5( $password ) ) )
|
||||
{
|
||||
return 'Неверный пароль';
|
||||
}
|
||||
|
||||
/* Test seconday groups */
|
||||
$mem = ipsRegistry::member()->setUpSecondaryGroups( $mem );
|
||||
|
||||
if ( $mem['g_access_cp'] != 1 )
|
||||
{
|
||||
return 'У вас нет доступа к системе обновления';
|
||||
}
|
||||
|
||||
/* Set up _member */
|
||||
$this->loadMemberData( $mem['id'] );
|
||||
|
||||
/* Still here? */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return log in form HTML
|
||||
*
|
||||
* @access public
|
||||
* @return string HTML
|
||||
*/
|
||||
public function fetchLogInForm()
|
||||
{
|
||||
$loginType = $this->_fetchLogInType();
|
||||
|
||||
return $this->registry->output->template()->upgrade_login_200plus( $loginType );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the log in type
|
||||
*
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
public function _fetchLoginType()
|
||||
{
|
||||
$loginType = 'username';
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'conf_settings', 'where' => "conf_key IN('ipbli_usertype','converge_login_method')", 'order' => 'conf_key ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['conf_value'] = $r['conf_value'] ? $r['conf_value'] : $r['conf_default'];
|
||||
|
||||
if ( $r['conf_value'] )
|
||||
{
|
||||
$loginType = $r['conf_value'];
|
||||
}
|
||||
}
|
||||
|
||||
return $loginType;
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Version Specific Upgrade Functions
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
class upgradeLegacy
|
||||
{
|
||||
/**
|
||||
* Member data
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
private $_member;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
/* Make sure tables exist that won't in pre 3.0 versions */
|
||||
if ( is_file( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' ) )
|
||||
{
|
||||
/* Init vars */
|
||||
$UPGRADE_TABLE_FIELD = '';
|
||||
$UPGRADE_SESSION_TABLE = '';
|
||||
$UPGRADE_CSS_PREVIOUS = '';
|
||||
$UPGRADE_TEMPLATE_PREVIOUS = '';
|
||||
|
||||
require( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' );/*noLibHook*/
|
||||
|
||||
$prefix = $this->registry->dbFunctions()->getPrefix();
|
||||
|
||||
if ( ! $this->DB->checkForField( 'upgrade_app', 'upgrade_history' ) )
|
||||
{
|
||||
if ( $UPGRADE_TABLE_FIELD )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TABLE_FIELD, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'upgrade_sessions' ) )
|
||||
{
|
||||
if ( $UPGRADE_SESSION_TABLE )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_SESSION_TABLE, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'skin_css_previous' ) )
|
||||
{
|
||||
if ( $UPGRADE_CSS_PREVIOUS )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_CSS_PREVIOUS, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'skin_templates_previous' ) )
|
||||
{
|
||||
if ( $UPGRADE_TEMPLATE_PREVIOUS )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TEMPLATE_PREVIOUS, $prefix ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch auth key
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function fetchAuthKey()
|
||||
{
|
||||
if ( ! $this->_member['id'] AND ! $this->_member['member_id'] )
|
||||
{
|
||||
throw new Exception( "MEMBER NOT SET" );
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_member['member_login_key'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch member data
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function fetchMemberData()
|
||||
{
|
||||
return ( is_array( $this->_member ) ) ? $this->_member : array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and return member data
|
||||
*
|
||||
* @access public
|
||||
* @param int Member ID to load
|
||||
* @return array
|
||||
*/
|
||||
public function loadMemberData( $memberId )
|
||||
{
|
||||
/* At this point, we could be either using 2.3 or 3.0 */
|
||||
if ( $this->DB->checkForField( 'member_id', 'members' ) )
|
||||
{
|
||||
/* Attempt to load member */
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=' . intval( $memberId ),
|
||||
'add_join' => array( array( 'select' => 'g.*',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.member_group_id' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$this->_member = $this->DB->fetch();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Attempt to load member */
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.id=' . intval( $memberId ),
|
||||
'add_join' => array( array( 'select' => 'g.*',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.mgroup' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$this->_member = $this->DB->fetch();
|
||||
|
||||
/* Fix up pre-3 stuffs */
|
||||
$this->_member['member_id'] = $this->_member['id'];
|
||||
$this->_member['member_group_id'] = $this->_member['mgroup'];
|
||||
}
|
||||
|
||||
/* Set up seconday groups */
|
||||
$this->_member = ips_MemberRegistry::setUpSecondaryGroups( $this->_member );
|
||||
|
||||
return $this->fetchMemberData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate log in
|
||||
*
|
||||
* @access public
|
||||
* @param string Username (from $this->request)
|
||||
* @param string Password (from $this->request)
|
||||
* @return mixed TRUE if successful, string (message) if not
|
||||
*/
|
||||
public function authenticateLogIn( $username, $password )
|
||||
{
|
||||
/* Log in type */
|
||||
$loginType = $this->_fetchLogInType();
|
||||
$where = ( $loginType == 'username' ) ? $this->DB->buildLower('m.name') . "='" . strtolower( $username ) . "'" : "m.email='" . strtolower( $username ) . "'";
|
||||
|
||||
/* Attempt to load member */
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => $where,
|
||||
'add_join' => array( array( 'select' => 'g.*',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.mgroup' ),
|
||||
array( 'select' => 'c.*',
|
||||
'from' => array( 'members_converge' => 'c' ),
|
||||
'where' => 'c.converge_email=m.email' ) ) ) );
|
||||
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$mem = $this->DB->fetch();
|
||||
|
||||
/* Check it out */
|
||||
if ( ! $mem['id'] OR ! $mem['converge_pass_hash'] )
|
||||
{
|
||||
return 'No user found by that username';
|
||||
}
|
||||
|
||||
if ( $mem['converge_pass_hash'] != md5( md5( $mem['converge_pass_salt'] ) . md5( $password ) ) )
|
||||
{
|
||||
return 'Password incorrect';
|
||||
}
|
||||
|
||||
/* Test seconday groups */
|
||||
$mem = ipsRegistry::member()->setUpSecondaryGroups( $mem );
|
||||
|
||||
if ( $mem['g_access_cp'] != 1 )
|
||||
{
|
||||
return 'You do not have access to the upgrade system';
|
||||
}
|
||||
|
||||
/* Set up _member */
|
||||
$this->loadMemberData( $mem['id'] );
|
||||
|
||||
/* Still here? */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return log in form HTML
|
||||
*
|
||||
* @access public
|
||||
* @return string HTML
|
||||
*/
|
||||
public function fetchLogInForm()
|
||||
{
|
||||
$loginType = $this->_fetchLogInType();
|
||||
|
||||
return $this->registry->output->template()->upgrade_login_200plus( $loginType );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the log in type
|
||||
*
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
public function _fetchLoginType()
|
||||
{
|
||||
$loginType = 'username';
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'conf_settings', 'where' => "conf_key IN('ipbli_usertype','converge_login_method')", 'order' => 'conf_key ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['conf_value'] = $r['conf_value'] ? $r['conf_value'] : $r['conf_default'];
|
||||
|
||||
if ( $r['conf_value'] )
|
||||
{
|
||||
$loginType = $r['conf_value'];
|
||||
}
|
||||
}
|
||||
|
||||
return $loginType;
|
||||
}
|
||||
}
|
||||
@@ -1,256 +1,256 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Version Specific Upgrade Functions
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
class upgradeLegacy
|
||||
{
|
||||
/**
|
||||
* Member data
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
private $_member;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
/* Make sure tables exist that won't in pre 3.0 versions */
|
||||
if ( is_file( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' ) )
|
||||
{
|
||||
/* Init vars */
|
||||
$UPGRADE_TABLE_FIELD = '';
|
||||
$UPGRADE_SESSION_TABLE = '';
|
||||
$UPGRADE_CSS_PREVIOUS = '';
|
||||
$UPGRADE_TEMPLATE_PREVIOUS = '';
|
||||
|
||||
require( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' );/*noLibHook*/
|
||||
|
||||
$prefix = $this->registry->dbFunctions()->getPrefix();
|
||||
|
||||
if ( ! $this->DB->checkForField( 'upgrade_app', 'upgrade_history' ) )
|
||||
{
|
||||
if ( $UPGRADE_TABLE_FIELD )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TABLE_FIELD, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'upgrade_sessions' ) )
|
||||
{
|
||||
if ( $UPGRADE_SESSION_TABLE )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_SESSION_TABLE, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'skin_css_previous' ) )
|
||||
{
|
||||
if ( $UPGRADE_CSS_PREVIOUS )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_CSS_PREVIOUS, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'skin_templates_previous' ) )
|
||||
{
|
||||
if ( $UPGRADE_TEMPLATE_PREVIOUS )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TEMPLATE_PREVIOUS, $prefix ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch auth key
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function fetchAuthKey()
|
||||
{
|
||||
if ( ! $this->_member['member_id'] )
|
||||
{
|
||||
throw new Exception( "MEMBER NOT SET" );
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_member['member_login_key'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch member data
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function fetchMemberData()
|
||||
{
|
||||
return ( is_array( $this->_member ) ) ? $this->_member : array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and return member data
|
||||
*
|
||||
* @access public
|
||||
* @param int Member ID to load
|
||||
* @return array
|
||||
*/
|
||||
public function loadMemberData( $memberId )
|
||||
{
|
||||
/* Attempt to load member */
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=' . intval( $memberId ),
|
||||
'add_join' => array( array( 'select' => 'g.*',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.member_group_id' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Set up seconday groups */
|
||||
$this->_member = ips_MemberRegistry::setUpSecondaryGroups( $this->DB->fetch() );
|
||||
|
||||
return $this->fetchMemberData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate log in
|
||||
*
|
||||
* @access public
|
||||
* @param string Username (from $this->request)
|
||||
* @param string Password (from $this->request)
|
||||
* @return mixed TRUE if successful, string (message) if not
|
||||
*/
|
||||
public function authenticateLogIn( $username, $password )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );/*noLibHook*/
|
||||
$han_login = new han_login( $this->registry );
|
||||
$han_login->is_admin_auth = 1;
|
||||
$han_login->init();
|
||||
|
||||
$email = '';
|
||||
|
||||
/* Is this a username or email address? */
|
||||
if ( IPSText::checkEmailAddress( $username ) )
|
||||
{
|
||||
$email = $username;
|
||||
$username = '';
|
||||
}
|
||||
|
||||
$han_login->loginAuthenticate( $username, $email, $password );
|
||||
|
||||
$mem = $han_login->member_data;
|
||||
|
||||
if ( ( ! $mem['member_id'] ) or ( $han_login->return_code == 'NO_USER' ) )
|
||||
{
|
||||
return 'Пользователь не найден';
|
||||
}
|
||||
|
||||
if ( $han_login->return_code == 'NO_ACCESS' )
|
||||
{
|
||||
return 'У вас нет доступа к системе обновления';
|
||||
}
|
||||
else if ( $han_login->return_code != 'SUCCESS' )
|
||||
{
|
||||
return 'Имя пользователя или пароль неверны';
|
||||
}
|
||||
|
||||
/* Test seconday groups */
|
||||
$mem = ipsRegistry::member()->setUpSecondaryGroups( $mem );
|
||||
|
||||
if ( $mem['g_access_cp'] != 1 )
|
||||
{
|
||||
return 'У вас нет доступа к системе обновления';
|
||||
}
|
||||
|
||||
/* Set up _member */
|
||||
$this->loadMemberData( $mem['member_id'] );
|
||||
|
||||
/* Still here? */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return log in form HTML
|
||||
*
|
||||
* @access public
|
||||
* @return string HTML
|
||||
*/
|
||||
public function fetchLogInForm()
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );/*noLibHook*/
|
||||
$han_login = new han_login( $this->registry );
|
||||
$han_login->is_admin_auth = 1;
|
||||
$han_login->init();
|
||||
|
||||
$additional_data = ''; //$han_login->additionalFormHTML();
|
||||
$replace = false;
|
||||
$data = array();
|
||||
|
||||
if( !is_null($additional_data) AND is_array($additional_data) AND count($additional_data) )
|
||||
{
|
||||
$replace = $additional_data[0];
|
||||
$data = $additional_data[1];
|
||||
}
|
||||
|
||||
/* Check login type */
|
||||
$uses_name = false;
|
||||
$uses_email = false;
|
||||
$loginType = 'username';
|
||||
|
||||
foreach( $this->cache->getCache('login_methods') as $method )
|
||||
{
|
||||
if ( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' )
|
||||
{
|
||||
$uses_name = true;
|
||||
}
|
||||
|
||||
if ( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' )
|
||||
{
|
||||
$uses_email = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $uses_name AND $uses_email )
|
||||
{
|
||||
$loginType = 'either';
|
||||
}
|
||||
elseif ( $uses_email )
|
||||
{
|
||||
$loginType = 'email';
|
||||
}
|
||||
|
||||
return $this->registry->output->template()->upgrade_login_300plus( $data, ( $replace == 'replace' ? true : false ), $loginType );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* Version Specific Upgrade Functions
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
class upgradeLegacy
|
||||
{
|
||||
/**
|
||||
* Member data
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
private $_member;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
/* Make sure tables exist that won't in pre 3.0 versions */
|
||||
if ( is_file( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' ) )
|
||||
{
|
||||
/* Init vars */
|
||||
$UPGRADE_TABLE_FIELD = '';
|
||||
$UPGRADE_SESSION_TABLE = '';
|
||||
$UPGRADE_CSS_PREVIOUS = '';
|
||||
$UPGRADE_TEMPLATE_PREVIOUS = '';
|
||||
|
||||
require( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' );/*noLibHook*/
|
||||
|
||||
$prefix = $this->registry->dbFunctions()->getPrefix();
|
||||
|
||||
if ( ! $this->DB->checkForField( 'upgrade_app', 'upgrade_history' ) )
|
||||
{
|
||||
if ( $UPGRADE_TABLE_FIELD )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TABLE_FIELD, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'upgrade_sessions' ) )
|
||||
{
|
||||
if ( $UPGRADE_SESSION_TABLE )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_SESSION_TABLE, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'skin_css_previous' ) )
|
||||
{
|
||||
if ( $UPGRADE_CSS_PREVIOUS )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_CSS_PREVIOUS, $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->DB->checkForTable( 'skin_templates_previous' ) )
|
||||
{
|
||||
if ( $UPGRADE_TEMPLATE_PREVIOUS )
|
||||
{
|
||||
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TEMPLATE_PREVIOUS, $prefix ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch auth key
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function fetchAuthKey()
|
||||
{
|
||||
if ( ! $this->_member['member_id'] )
|
||||
{
|
||||
throw new Exception( "MEMBER NOT SET" );
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_member['member_login_key'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch member data
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function fetchMemberData()
|
||||
{
|
||||
return ( is_array( $this->_member ) ) ? $this->_member : array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and return member data
|
||||
*
|
||||
* @access public
|
||||
* @param int Member ID to load
|
||||
* @return array
|
||||
*/
|
||||
public function loadMemberData( $memberId )
|
||||
{
|
||||
/* Attempt to load member */
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=' . intval( $memberId ),
|
||||
'add_join' => array( array( 'select' => 'g.*',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.member_group_id' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Set up seconday groups */
|
||||
$this->_member = ips_MemberRegistry::setUpSecondaryGroups( $this->DB->fetch() );
|
||||
|
||||
return $this->fetchMemberData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate log in
|
||||
*
|
||||
* @access public
|
||||
* @param string Username (from $this->request)
|
||||
* @param string Password (from $this->request)
|
||||
* @return mixed TRUE if successful, string (message) if not
|
||||
*/
|
||||
public function authenticateLogIn( $username, $password )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );/*noLibHook*/
|
||||
$han_login = new han_login( $this->registry );
|
||||
$han_login->is_admin_auth = 1;
|
||||
$han_login->init();
|
||||
|
||||
$email = '';
|
||||
|
||||
/* Is this a username or email address? */
|
||||
if ( IPSText::checkEmailAddress( $username ) )
|
||||
{
|
||||
$email = $username;
|
||||
$username = '';
|
||||
}
|
||||
|
||||
$han_login->loginAuthenticate( $username, $email, $password );
|
||||
|
||||
$mem = $han_login->member_data;
|
||||
|
||||
if ( ( ! $mem['member_id'] ) or ( $han_login->return_code == 'NO_USER' ) )
|
||||
{
|
||||
return 'No user found by that username';
|
||||
}
|
||||
|
||||
if ( $han_login->return_code == 'NO_ACCESS' )
|
||||
{
|
||||
return 'You do not have access to the upgrade system';
|
||||
}
|
||||
else if ( $han_login->return_code != 'SUCCESS' )
|
||||
{
|
||||
return 'Password or username incorrect';
|
||||
}
|
||||
|
||||
/* Test seconday groups */
|
||||
$mem = ipsRegistry::member()->setUpSecondaryGroups( $mem );
|
||||
|
||||
if ( $mem['g_access_cp'] != 1 )
|
||||
{
|
||||
return 'You do not have access to the upgrade system';
|
||||
}
|
||||
|
||||
/* Set up _member */
|
||||
$this->loadMemberData( $mem['member_id'] );
|
||||
|
||||
/* Still here? */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return log in form HTML
|
||||
*
|
||||
* @access public
|
||||
* @return string HTML
|
||||
*/
|
||||
public function fetchLogInForm()
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );/*noLibHook*/
|
||||
$han_login = new han_login( $this->registry );
|
||||
$han_login->is_admin_auth = 1;
|
||||
$han_login->init();
|
||||
|
||||
$additional_data = ''; //$han_login->additionalFormHTML();
|
||||
$replace = false;
|
||||
$data = array();
|
||||
|
||||
if( !is_null($additional_data) AND is_array($additional_data) AND count($additional_data) )
|
||||
{
|
||||
$replace = $additional_data[0];
|
||||
$data = $additional_data[1];
|
||||
}
|
||||
|
||||
/* Check login type */
|
||||
$uses_name = false;
|
||||
$uses_email = false;
|
||||
$loginType = 'username';
|
||||
|
||||
foreach( $this->cache->getCache('login_methods') as $method )
|
||||
{
|
||||
if ( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' )
|
||||
{
|
||||
$uses_name = true;
|
||||
}
|
||||
|
||||
if ( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' )
|
||||
{
|
||||
$uses_email = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $uses_name AND $uses_email )
|
||||
{
|
||||
$loginType = 'either';
|
||||
}
|
||||
elseif ( $uses_email )
|
||||
{
|
||||
$loginType = 'email';
|
||||
}
|
||||
|
||||
return $this->registry->output->template()->upgrade_login_300plus( $data, ( $replace == 'replace' ? true : false ), $loginType );
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +1 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://www.invisionpower.com">Invision Power Board</a>␍</body>␍</html>␍
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍Invision Power Board␍</body>␍</html>␍
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* IP.Board v3.4.6
|
||||
* SQL for upgrader
|
||||
* Last Updated: $Date: 2012-08-28 17:56:22 -0400 (Tue, 28 Aug 2012) $
|
||||
* </pre>
|
||||
|
||||
@@ -1,285 +1,285 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* SQL installation methods
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
class install_extra
|
||||
{
|
||||
/**
|
||||
* Errors
|
||||
*
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
/**
|
||||
* Extra info
|
||||
*
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $info_extra = array();
|
||||
|
||||
/**
|
||||
* Set Prefix
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $prefix = '';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set db prefix
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function setDbPrefix( $prefix='' )
|
||||
{
|
||||
if( $prefix )
|
||||
{
|
||||
$this->prefix = $prefix;
|
||||
return;
|
||||
}
|
||||
else if( class_exists( 'IPSSetUp' ) )
|
||||
{
|
||||
if ( IPSSetUp::getSavedData('db_pre') )
|
||||
{
|
||||
$this->prefix = IPSSetUp::getSavedData('db_pre');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Still 'ere? */
|
||||
$this->prefix = $this->settings['sql_tbl_prefix'];
|
||||
}
|
||||
|
||||
/**
|
||||
* before_inserts_run
|
||||
* Allows one to run SQL commands before any inserts are run
|
||||
*
|
||||
* Use ipsRegistry::DB()->query("") to run queries
|
||||
*
|
||||
* @access public
|
||||
* @param string Type of inserts to run
|
||||
* @return @e void
|
||||
*/
|
||||
public function before_inserts_run( $type )
|
||||
{
|
||||
switch( $type )
|
||||
{
|
||||
case 'applications':
|
||||
case 'modules':
|
||||
case 'settings':
|
||||
case 'system_templates':
|
||||
case 'content_templates':
|
||||
case 'tasks':
|
||||
case 'bbcode':
|
||||
case 'media':
|
||||
case 'languages':
|
||||
case 'login':
|
||||
case 'groups':
|
||||
case 'staff_roles':
|
||||
case 'attachments':
|
||||
case 'skinset':
|
||||
case 'email_templates':
|
||||
case 'caches':
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* after_inserts_run
|
||||
* Allows one to run SQL commands AFTER any inserts are run
|
||||
*
|
||||
* Use ipsRegistry::DB()->query("") to run queries
|
||||
*
|
||||
* @access public
|
||||
* @param string Type of inserts to run
|
||||
* @return @e void
|
||||
*/
|
||||
public function after_inserts_run( $type )
|
||||
{
|
||||
switch( $type )
|
||||
{
|
||||
case 'applications':
|
||||
case 'modules':
|
||||
case 'settings':
|
||||
case 'system_templates':
|
||||
case 'content_templates':
|
||||
case 'tasks':
|
||||
case 'bbcode':
|
||||
case 'media':
|
||||
case 'languages':
|
||||
case 'login':
|
||||
case 'groups':
|
||||
case 'staff_roles':
|
||||
case 'attachments':
|
||||
case 'skinset':
|
||||
case 'email_templates':
|
||||
case 'caches':
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alter create table statements before being run
|
||||
*
|
||||
* @access public
|
||||
* @param string Query
|
||||
* @return string Query
|
||||
*/
|
||||
public function process_query_create( $query )
|
||||
{
|
||||
$this->setDbPrefix();
|
||||
|
||||
//-----------------------------------------
|
||||
// Tack on the end the chosen table type
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->prefix )
|
||||
{
|
||||
$query = preg_replace( "#^(CREATE TABLE\s+(?:IF NOT EXISTS\s+)?)(\S+?)#s", "\\1 " . $this->prefix."\\2", $query );
|
||||
$query = preg_replace( "#^INSERT INTO(?:\s+?)?(\S+?)#s" , "INSERT INTO " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^REPLACE INTO(?:\s+?)?(\S+?)#s", "REPLACE INTO " . $this->prefix."\\1", $query );
|
||||
$query = preg_replace( "#^ALTER TABLE(?:\s+?)?(\S+?)#s" , "ALTER TABLE " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^DELETE FROM(?:\s+?)?(\S+?)#s" , "DELETE FROM " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^UPDATE(?:\s+?)?(\S+?)#s" , "UPDATE " . $this->prefix."\\1" , $query );
|
||||
}
|
||||
|
||||
$table_type = $this->settings['mysql_tbl_type'] ? $this->settings['mysql_tbl_type'] : 'MyISAM';
|
||||
|
||||
return preg_replace( "#\);$#", ") ENGINE=".$table_type.";", $query );
|
||||
}
|
||||
|
||||
/**
|
||||
* Alter create index statements before being run
|
||||
*
|
||||
* @access public
|
||||
* @param string Query
|
||||
* @return string Query
|
||||
*/
|
||||
public function process_query_index( $query )
|
||||
{
|
||||
$this->setDbPrefix();
|
||||
|
||||
//-----------------------------------------
|
||||
// Tack on the end the chosen table type
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->prefix )
|
||||
{
|
||||
$query = preg_replace( "#^(CREATE TABLE\s+(?:IF NOT EXISTS\s+)?)(\S+?)#s", "\\1 " . $this->prefix."\\2", $query );
|
||||
$query = preg_replace( "#^INSERT INTO(?:\s+?)?(\S+?)#s" , "INSERT INTO " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^REPLACE INTO(?:\s+?)?(\S+?)#s", "REPLACE INTO " . $this->prefix."\\1", $query );
|
||||
$query = preg_replace( "#^ALTER TABLE(?:\s+?)?(\S+?)#s" , "ALTER TABLE " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^DELETE FROM(?:\s+?)?(\S+?)#s" , "DELETE FROM " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^UPDATE(?:\s+?)?(\S+?)#s" , "UPDATE " . $this->prefix."\\1" , $query );
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alter insert statements before being run
|
||||
*
|
||||
* @access public
|
||||
* @param string Query
|
||||
* @return string Query
|
||||
*/
|
||||
public function process_query_insert( $query )
|
||||
{
|
||||
$this->setDbPrefix();
|
||||
|
||||
//-----------------------------------------
|
||||
// Tack on the end the chosen table type
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->prefix )
|
||||
{
|
||||
$query = preg_replace( "#^(CREATE TABLE\s+(?:IF NOT EXISTS\s+)?)(\S+?)#s", "\\1 " . $this->prefix."\\2", $query );
|
||||
$query = preg_replace( "#^INSERT INTO(?:\s+?)?(\S+?)#s" , "INSERT INTO " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^REPLACE INTO(?:\s+?)?(\S+?)#s", "REPLACE INTO " . $this->prefix."\\1", $query );
|
||||
$query = preg_replace( "#^ALTER TABLE(?:\s+?)?(\S+?)#s" , "ALTER TABLE " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^DELETE FROM(?:\s+?)?(\S+?)#s" , "DELETE FROM " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^UPDATE(?:\s+?)?(\S+?)#s" , "UPDATE " . $this->prefix."\\1" , $query );
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return additional HTML to show on install form
|
||||
*
|
||||
* @access public
|
||||
* @return string HTML
|
||||
*/
|
||||
public function install_form_extra()
|
||||
{
|
||||
$extra = "<tr>
|
||||
<td class='title'><b>Тип таблиц MySQL</b><div style='color:gray'>Используйте MyISAM если не уверены</div></td>
|
||||
<td class='content'><select name='mysql_tbl_type' class='sql_form'><option value='MyISAM'>MYISAM</option><option value='INNODB'>INNODB</option></td>
|
||||
</tr>";
|
||||
|
||||
return $extra;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Save additional info from install form
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function install_form_process()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// When processed, return all vars to save
|
||||
// in conf_global in the array $this->info_extra
|
||||
// This will also be saved into $INFO[] for
|
||||
// the installer
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $_REQUEST['mysql_tbl_type'] )
|
||||
{
|
||||
$this->errors[] = 'Вы должны заполнить все необходимые поля!';
|
||||
return;
|
||||
}
|
||||
|
||||
$this->info_extra['mysql_tbl_type'] = $_REQUEST['mysql_tbl_type'];
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* SQL installation methods
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
class install_extra
|
||||
{
|
||||
/**
|
||||
* Errors
|
||||
*
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
/**
|
||||
* Extra info
|
||||
*
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $info_extra = array();
|
||||
|
||||
/**
|
||||
* Set Prefix
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $prefix = '';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set db prefix
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function setDbPrefix( $prefix='' )
|
||||
{
|
||||
if( $prefix )
|
||||
{
|
||||
$this->prefix = $prefix;
|
||||
return;
|
||||
}
|
||||
else if( class_exists( 'IPSSetUp' ) )
|
||||
{
|
||||
if ( IPSSetUp::getSavedData('db_pre') )
|
||||
{
|
||||
$this->prefix = IPSSetUp::getSavedData('db_pre');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Still 'ere? */
|
||||
$this->prefix = $this->settings['sql_tbl_prefix'];
|
||||
}
|
||||
|
||||
/**
|
||||
* before_inserts_run
|
||||
* Allows one to run SQL commands before any inserts are run
|
||||
*
|
||||
* Use ipsRegistry::DB()->query("") to run queries
|
||||
*
|
||||
* @access public
|
||||
* @param string Type of inserts to run
|
||||
* @return @e void
|
||||
*/
|
||||
public function before_inserts_run( $type )
|
||||
{
|
||||
switch( $type )
|
||||
{
|
||||
case 'applications':
|
||||
case 'modules':
|
||||
case 'settings':
|
||||
case 'system_templates':
|
||||
case 'content_templates':
|
||||
case 'tasks':
|
||||
case 'bbcode':
|
||||
case 'media':
|
||||
case 'languages':
|
||||
case 'login':
|
||||
case 'groups':
|
||||
case 'staff_roles':
|
||||
case 'attachments':
|
||||
case 'skinset':
|
||||
case 'email_templates':
|
||||
case 'caches':
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* after_inserts_run
|
||||
* Allows one to run SQL commands AFTER any inserts are run
|
||||
*
|
||||
* Use ipsRegistry::DB()->query("") to run queries
|
||||
*
|
||||
* @access public
|
||||
* @param string Type of inserts to run
|
||||
* @return @e void
|
||||
*/
|
||||
public function after_inserts_run( $type )
|
||||
{
|
||||
switch( $type )
|
||||
{
|
||||
case 'applications':
|
||||
case 'modules':
|
||||
case 'settings':
|
||||
case 'system_templates':
|
||||
case 'content_templates':
|
||||
case 'tasks':
|
||||
case 'bbcode':
|
||||
case 'media':
|
||||
case 'languages':
|
||||
case 'login':
|
||||
case 'groups':
|
||||
case 'staff_roles':
|
||||
case 'attachments':
|
||||
case 'skinset':
|
||||
case 'email_templates':
|
||||
case 'caches':
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alter create table statements before being run
|
||||
*
|
||||
* @access public
|
||||
* @param string Query
|
||||
* @return string Query
|
||||
*/
|
||||
public function process_query_create( $query )
|
||||
{
|
||||
$this->setDbPrefix();
|
||||
|
||||
//-----------------------------------------
|
||||
// Tack on the end the chosen table type
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->prefix )
|
||||
{
|
||||
$query = preg_replace( "#^(CREATE TABLE\s+(?:IF NOT EXISTS\s+)?)(\S+?)#s", "\\1 " . $this->prefix."\\2", $query );
|
||||
$query = preg_replace( "#^INSERT INTO(?:\s+?)?(\S+?)#s" , "INSERT INTO " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^REPLACE INTO(?:\s+?)?(\S+?)#s", "REPLACE INTO " . $this->prefix."\\1", $query );
|
||||
$query = preg_replace( "#^ALTER TABLE(?:\s+?)?(\S+?)#s" , "ALTER TABLE " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^DELETE FROM(?:\s+?)?(\S+?)#s" , "DELETE FROM " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^UPDATE(?:\s+?)?(\S+?)#s" , "UPDATE " . $this->prefix."\\1" , $query );
|
||||
}
|
||||
|
||||
$table_type = $this->settings['mysql_tbl_type'] ? $this->settings['mysql_tbl_type'] : 'MyISAM';
|
||||
|
||||
return preg_replace( "#\);$#", ") ENGINE=".$table_type.";", $query );
|
||||
}
|
||||
|
||||
/**
|
||||
* Alter create index statements before being run
|
||||
*
|
||||
* @access public
|
||||
* @param string Query
|
||||
* @return string Query
|
||||
*/
|
||||
public function process_query_index( $query )
|
||||
{
|
||||
$this->setDbPrefix();
|
||||
|
||||
//-----------------------------------------
|
||||
// Tack on the end the chosen table type
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->prefix )
|
||||
{
|
||||
$query = preg_replace( "#^(CREATE TABLE\s+(?:IF NOT EXISTS\s+)?)(\S+?)#s", "\\1 " . $this->prefix."\\2", $query );
|
||||
$query = preg_replace( "#^INSERT INTO(?:\s+?)?(\S+?)#s" , "INSERT INTO " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^REPLACE INTO(?:\s+?)?(\S+?)#s", "REPLACE INTO " . $this->prefix."\\1", $query );
|
||||
$query = preg_replace( "#^ALTER TABLE(?:\s+?)?(\S+?)#s" , "ALTER TABLE " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^DELETE FROM(?:\s+?)?(\S+?)#s" , "DELETE FROM " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^UPDATE(?:\s+?)?(\S+?)#s" , "UPDATE " . $this->prefix."\\1" , $query );
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alter insert statements before being run
|
||||
*
|
||||
* @access public
|
||||
* @param string Query
|
||||
* @return string Query
|
||||
*/
|
||||
public function process_query_insert( $query )
|
||||
{
|
||||
$this->setDbPrefix();
|
||||
|
||||
//-----------------------------------------
|
||||
// Tack on the end the chosen table type
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->prefix )
|
||||
{
|
||||
$query = preg_replace( "#^(CREATE TABLE\s+(?:IF NOT EXISTS\s+)?)(\S+?)#s", "\\1 " . $this->prefix."\\2", $query );
|
||||
$query = preg_replace( "#^INSERT INTO(?:\s+?)?(\S+?)#s" , "INSERT INTO " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^REPLACE INTO(?:\s+?)?(\S+?)#s", "REPLACE INTO " . $this->prefix."\\1", $query );
|
||||
$query = preg_replace( "#^ALTER TABLE(?:\s+?)?(\S+?)#s" , "ALTER TABLE " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^DELETE FROM(?:\s+?)?(\S+?)#s" , "DELETE FROM " . $this->prefix."\\1" , $query );
|
||||
$query = preg_replace( "#^UPDATE(?:\s+?)?(\S+?)#s" , "UPDATE " . $this->prefix."\\1" , $query );
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return additional HTML to show on install form
|
||||
*
|
||||
* @access public
|
||||
* @return string HTML
|
||||
*/
|
||||
public function install_form_extra()
|
||||
{
|
||||
$extra = "<tr>
|
||||
<td class='title'><b>MySQL Table Type</b><div style='color:gray'>Use MyISAM if unsure</div></td>
|
||||
<td class='content'><select name='mysql_tbl_type' class='sql_form'><option value='MyISAM'>MYISAM</option><option value='INNODB'>INNODB</option></td>
|
||||
</tr>";
|
||||
|
||||
return $extra;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Save additional info from install form
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function install_form_process()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// When processed, return all vars to save
|
||||
// in conf_global in the array $this->info_extra
|
||||
// This will also be saved into $INFO[] for
|
||||
// the installer
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $_REQUEST['mysql_tbl_type'] )
|
||||
{
|
||||
$this->errors[] = 'You must complete the required SQL section!';
|
||||
return;
|
||||
}
|
||||
|
||||
$this->info_extra['mysql_tbl_type'] = $_REQUEST['mysql_tbl_type'];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
+1799
-1874
File diff suppressed because it is too large.
Load diff
@@ -20,7 +20,7 @@
|
||||
<g_use_pm>0</g_use_pm>
|
||||
<g_is_supmod>0</g_is_supmod>
|
||||
<g_access_cp>0</g_access_cp>
|
||||
<g_title>Неактивированные</g_title>
|
||||
<g_title>Validating</g_title>
|
||||
<g_append_edit>1</g_append_edit>
|
||||
<g_access_offline>0</g_access_offline>
|
||||
<g_avoid_q>0</g_avoid_q>
|
||||
@@ -83,7 +83,7 @@
|
||||
<g_use_pm>0</g_use_pm>
|
||||
<g_is_supmod>0</g_is_supmod>
|
||||
<g_access_cp>0</g_access_cp>
|
||||
<g_title>Гости</g_title>
|
||||
<g_title>Guests</g_title>
|
||||
<g_append_edit>0</g_append_edit>
|
||||
<g_access_offline>0</g_access_offline>
|
||||
<g_avoid_q>0</g_avoid_q>
|
||||
@@ -145,7 +145,7 @@
|
||||
<g_use_pm>1</g_use_pm>
|
||||
<g_is_supmod>0</g_is_supmod>
|
||||
<g_access_cp>0</g_access_cp>
|
||||
<g_title>Пользователи</g_title>
|
||||
<g_title>Members</g_title>
|
||||
<g_append_edit>1</g_append_edit>
|
||||
<g_access_offline>0</g_access_offline>
|
||||
<g_avoid_q>0</g_avoid_q>
|
||||
@@ -207,7 +207,7 @@
|
||||
<g_use_pm>1</g_use_pm>
|
||||
<g_is_supmod>1</g_is_supmod>
|
||||
<g_access_cp>1</g_access_cp>
|
||||
<g_title>Администраторы</g_title>
|
||||
<g_title>Administrators</g_title>
|
||||
<g_append_edit>1</g_append_edit>
|
||||
<g_access_offline>1</g_access_offline>
|
||||
<g_avoid_q>1</g_avoid_q>
|
||||
@@ -269,7 +269,7 @@
|
||||
<g_use_pm>0</g_use_pm>
|
||||
<g_is_supmod>0</g_is_supmod>
|
||||
<g_access_cp>0</g_access_cp>
|
||||
<g_title>Заблокированные</g_title>
|
||||
<g_title>Banned</g_title>
|
||||
<g_append_edit>0</g_append_edit>
|
||||
<g_access_offline>0</g_access_offline>
|
||||
<g_avoid_q>0</g_avoid_q>
|
||||
@@ -331,7 +331,7 @@
|
||||
<g_use_pm>1</g_use_pm>
|
||||
<g_is_supmod>1</g_is_supmod>
|
||||
<g_access_cp>0</g_access_cp>
|
||||
<g_title>Модераторы</g_title>
|
||||
<g_title>Moderators</g_title>
|
||||
<g_append_edit>1</g_append_edit>
|
||||
<g_access_offline>0</g_access_offline>
|
||||
<g_avoid_q>0</g_avoid_q>
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,8 +3,8 @@
|
||||
<group>
|
||||
<login_methods>
|
||||
<login_id>1</login_id>
|
||||
<login_title>Внутренняя авторизация</login_title>
|
||||
<login_description>Стандартный метод авторизации</login_description>
|
||||
<login_title>IPB Internal</login_title>
|
||||
<login_description>The standard method of authentication</login_description>
|
||||
<login_folder_name>internal</login_folder_name>
|
||||
<login_maintain_url></login_maintain_url>
|
||||
<login_register_url></login_register_url>
|
||||
@@ -22,7 +22,7 @@
|
||||
<login_methods>
|
||||
<login_id>7</login_id>
|
||||
<login_title>IPS Connect</login_title>
|
||||
<login_description>Интегрированная авторизация на нескольких форумах, поддерживающих IPS Connect</login_description>
|
||||
<login_description/>
|
||||
<login_folder_name>ipsconnect</login_folder_name>
|
||||
<login_maintain_url/>
|
||||
<login_register_url/>
|
||||
@@ -39,8 +39,8 @@
|
||||
</login_methods>
|
||||
<login_methods>
|
||||
<login_id>2</login_id>
|
||||
<login_title>LDAP Авторизация</login_title>
|
||||
<login_description>LDAP / Active Directory Авторизация</login_description>
|
||||
<login_title>LDAP Authentication</login_title>
|
||||
<login_description>LDAP / Active Directory Authentication</login_description>
|
||||
<login_folder_name>ldap</login_folder_name>
|
||||
<login_maintain_url></login_maintain_url>
|
||||
<login_register_url></login_register_url>
|
||||
@@ -56,8 +56,8 @@
|
||||
</login_methods>
|
||||
<login_methods>
|
||||
<login_id>6</login_id>
|
||||
<login_title>Внешняя База Данных</login_title>
|
||||
<login_description>Авторизация с использованием внешней базы данных</login_description>
|
||||
<login_title>External Database</login_title>
|
||||
<login_description>Authentication via an external database</login_description>
|
||||
<login_folder_name>external</login_folder_name>
|
||||
<login_maintain_url></login_maintain_url>
|
||||
<login_register_url></login_register_url>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* IP.Board v3.4.6
|
||||
* Some required extensions to check for
|
||||
* Last Updated: $Date: 2013-03-11 10:53:28 -0400 (Mon, 11 Mar 2013) $
|
||||
* </pre>
|
||||
@@ -19,13 +19,13 @@
|
||||
|
||||
$INSTALLDATA = array(
|
||||
|
||||
array( 'prettyname' => "Поддержка DOM XML",
|
||||
array( 'prettyname' => "DOM XML Handling",
|
||||
'extensionname' => "libxml2",
|
||||
'helpurl' => "http://www.php.net/manual/en/dom.setup.php",
|
||||
'testfor' => 'dom',
|
||||
'nohault' => false ),
|
||||
|
||||
array( 'prettyname' => "Библиотека GD",
|
||||
array( 'prettyname' => "GD Library",
|
||||
'extensionname' => "gd",
|
||||
'helpurl' => "http://www.php.net/manual/en/image.setup.php",
|
||||
'testfor' => 'gd',
|
||||
|
||||
@@ -1,48 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<installdata>
|
||||
<action>
|
||||
<file>index</file>
|
||||
<menu>Требования</menu>
|
||||
<position>0</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>eula</file>
|
||||
<menu>Cоглашение</menu>
|
||||
<position>1</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>apps</file>
|
||||
<menu>Приложения</menu>
|
||||
<position>2</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>address</file>
|
||||
<menu>Адреса</menu>
|
||||
<position>3</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>license</file>
|
||||
<menu>Лицензия</menu>
|
||||
<position>4</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>db</file>
|
||||
<menu>Данные БД</menu>
|
||||
<position>5</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>admin</file>
|
||||
<menu>Администратор</menu>
|
||||
<position>6</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>install</file>
|
||||
<menu>Установка</menu>
|
||||
<position>7</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>done</file>
|
||||
<menu>Завершение</menu>
|
||||
<position>8</position>
|
||||
</action>
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<installdata>
|
||||
<action>
|
||||
<file>index</file>
|
||||
<menu>Requirements</menu>
|
||||
<position>0</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>eula</file>
|
||||
<menu>EULA</menu>
|
||||
<position>1</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>apps</file>
|
||||
<menu>Applications</menu>
|
||||
<position>2</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>address</file>
|
||||
<menu>Addresses</menu>
|
||||
<position>3</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>db</file>
|
||||
<menu>DB Details</menu>
|
||||
<position>4</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>admin</file>
|
||||
<menu>Admin Account</menu>
|
||||
<position>5</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>install</file>
|
||||
<menu>Installation</menu>
|
||||
<position>6</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>done</file>
|
||||
<menu>Finished</menu>
|
||||
<position>7</position>
|
||||
</action>
|
||||
</installdata>
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
IP.Board
|
||||
</body>
|
||||
</html>
|
||||
@@ -252,12 +252,6 @@
|
||||
<replacement_set_id>0</replacement_set_id>
|
||||
<replacement_master_key>root</replacement_master_key>
|
||||
</replacement>
|
||||
<replacement>
|
||||
<replacement_key>lim_vkontakte</replacement_key>
|
||||
<replacement_content><![CDATA[<img src='{style_image_url}/loginmethods/vkontakte.png' alt='{lang:lim_vkontakte}' />]]></replacement_content>
|
||||
<replacement_set_id>0</replacement_set_id>
|
||||
<replacement_master_key>root</replacement_master_key>
|
||||
</replacement>
|
||||
<replacement>
|
||||
<replacement_key>live_large</replacement_key>
|
||||
<replacement_content><![CDATA[<img src='{style_image_url}/live.gif' alt='{lang:macro__liveicon}' />]]></replacement_content>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<set_permissions>*</set_permissions>
|
||||
<set_is_default>1</set_is_default>
|
||||
<set_author_name>Invision Power Services, Inc</set_author_name>
|
||||
<set_author_url>http://www.invisionpower.com</set_author_url>
|
||||
<set_author_url/>
|
||||
<set_image_dir>master</set_image_dir>
|
||||
<set_emo_dir>default</set_emo_dir>
|
||||
<set_css_inline>1</set_css_inline>
|
||||
@@ -32,7 +32,7 @@
|
||||
<set_permissions>*</set_permissions>
|
||||
<set_is_default>0</set_is_default>
|
||||
<set_author_name>Invision Power Services, Inc</set_author_name>
|
||||
<set_author_url>http://www.invisionpower.com</set_author_url>
|
||||
<set_author_url/>
|
||||
<set_image_dir>master</set_image_dir>
|
||||
<set_emo_dir>default</set_emo_dir>
|
||||
<set_css_inline>1</set_css_inline>
|
||||
@@ -54,7 +54,7 @@
|
||||
<set_permissions>*</set_permissions>
|
||||
<set_is_default>0</set_is_default>
|
||||
<set_author_name>Invision Power Services, Inc</set_author_name>
|
||||
<set_author_url>http://www.invisionpower.com</set_author_url>
|
||||
<set_author_url/>
|
||||
<set_image_dir>mobile</set_image_dir>
|
||||
<set_emo_dir>default</set_emo_dir>
|
||||
<set_css_inline>1</set_css_inline>
|
||||
|
||||
@@ -1,38 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<installdata>
|
||||
<action>
|
||||
<file>index</file>
|
||||
<menu>Авторизация</menu>
|
||||
<position>0</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>overview</file>
|
||||
<menu>Информация</menu>
|
||||
<position>2</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>convert</file>
|
||||
<menu>Конвертация</menu>
|
||||
<position>3</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>apps</file>
|
||||
<menu>Приложения</menu>
|
||||
<position>4</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>license</file>
|
||||
<menu>Лицензия</menu>
|
||||
<position>5</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>upgrade</file>
|
||||
<menu>Обновление</menu>
|
||||
<position>6</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>done</file>
|
||||
<menu>Завершение</menu>
|
||||
<position>7</position>
|
||||
</action>
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<installdata>
|
||||
<action>
|
||||
<file>index</file>
|
||||
<menu>Log In</menu>
|
||||
<position>0</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>overview</file>
|
||||
<menu>Overview</menu>
|
||||
<position>2</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>apps</file>
|
||||
<menu>Applications</menu>
|
||||
<position>3</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>upgrade</file>
|
||||
<menu>Upgrade</menu>
|
||||
<position>4</position>
|
||||
</action>
|
||||
<action>
|
||||
<file>done</file>
|
||||
<menu>Finished</menu>
|
||||
<position>5</position>
|
||||
</action>
|
||||
</installdata>
|
||||
Reference in new issue
Block a user