Files
IPB/upload/install/core/actions/address.php
T
2025-12-19 00:24:35 -08:00

101 lines
3.5 KiB
PHP

<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.2.2
| Invision Power Board INSTALLER
| ========================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Monday 05th of March 2007 10:10:55 PM
| Release: e3790216629e5a2aaf37070b32237f06
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+----------------------------------------------------------------------------
| Action controller for Adresses page
+----------------------------------------------------------------------------
*/
/**
* Invision Power Board
* Action controller for Adresses page
*/
class action_address
{
var $install;
function action_address( & $install )
{
$this->install =& $install;
}
function run()
{
/* Check input? */
if( $this->install->ipsclass->input['sub'] == 'check' )
{
/* Check Directory */
if( ! $this->install->ipsclass->input['install_dir'] OR ! ( is_dir( $this->install->ipsclass->input['install_dir'] ) ) )
{
$errors[] = 'Óêàçàííûé ïóòü íå ñóùåñòâóåò â ñèñòåìå';
}
/* Check URL */
if( ! $this->install->ipsclass->input['install_url'] )
{
$errors[] = 'Àäðåñ óñòàíîâêè íå óêàçàí';
}
if( is_array( $errors ) )
{
$this->install->template->warning( $errors );
}
else
{
/* Save Form Data */
$this->install->saved_data['install_dir'] = preg_replace( "#(//)$#", "", str_replace( '\\', '/', $this->install->ipsclass->input['install_dir'] ) . '/' );
$this->install->saved_data['install_url'] = preg_replace( "#(//)$#", "", str_replace( '\\', '/', $this->install->ipsclass->input['install_url'] ) . '/' );
/* Next Action */
$this->install->template->page_current = 'db';
$this->install->ipsclass->input['sub'] = '';
require_once( INS_ROOT_PATH . 'core/actions/db.php' );
$action = new action_db( &$this->install );
$action->run();
return;
}
}
/* Guess at directory */
$dir = str_replace( 'installer', '' , getcwd() );
$dir = str_replace( 'install' , '' , getcwd() );
$dir = str_replace( '\\' , '/', $dir );
/* Guess at URL */
$url = str_replace( "/installer/index.php" , "", $this->install->ipsclass->my_getenv('HTTP_REFERER') );
$url = str_replace( "/installer/" , "", $url);
$url = str_replace( "/installer" , "", $url);
$url = str_replace( "/install/index.php" , "", $this->install->ipsclass->my_getenv('HTTP_REFERER') );
$url = str_replace( "/install/" , "", $url);
$url = str_replace( "/installr" , "", $url);
$url = str_replace( "index.php" , "", $url);
$url = preg_replace( "!\?(.+?)*!" , "", $url );
$url = "{$url}/";
/* Page Output */
$this->install->template->append( $this->install->template->address_page( $dir, $url ) );
$this->install->template->next_action = '?p=address&sub=check';
}
}
?>