- Fixed #16160: Call to undefined function ezi18n()
[tinyz:tinyz.git] / kernel / setup / steps / ezstep_installer.php
1 <?php
2 //
3 // Definition of EZStepInstaller class
4 //
5 // Created on: <08-Aug-2003 14:46:44 kk>
6 //
7 // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
8 // SOFTWARE NAME: eZ Publish
9 // SOFTWARE RELEASE: 4.1.x
10 // COPYRIGHT NOTICE: Copyright (C) 1999-2010 eZ Systems AS
11 // SOFTWARE LICENSE: GNU General Public License v2.0
12 // NOTICE: >
13 //   This program is free software; you can redistribute it and/or
14 //   modify it under the terms of version 2.0  of the GNU General
15 //   Public License as published by the Free Software Foundation.
16 //
17 //   This program is distributed in the hope that it will be useful,
18 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 //   GNU General Public License for more details.
21 //
22 //   You should have received a copy of version 2.0 of the GNU General
23 //   Public License along with this program; if not, write to the Free
24 //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
25 //   MA 02110-1301, USA.
26 //
27 //
28 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
29 //
30
31 /*! \file
32 */
33
34 /*!
35   \class eZStepInstaller ezstep_class_definition.ph
36   \brief The class EZStepInstaller provide a framework for eZStep installer classes
37
38 */
39
40 class eZStepInstaller
41 {
42     const DB_ERROR_EMPTY_PASSWORD = 1;
43     const DB_ERROR_NONMATCH_PASSWORD = 2;
44     const DB_ERROR_CONNECTION_FAILED = 3;
45     const DB_ERROR_NOT_EMPTY = 4;
46     const DB_ERROR_NO_DATABASES = 5;
47     const DB_ERROR_NO_DIGEST_PROC = 6;
48     const DB_ERROR_VERSION_INVALID = 7;
49     const DB_ERROR_CHARSET_DIFFERS = 8;
50     const DB_ERROR_ALREADY_CHOSEN = 10;
51
52     const DB_DATA_APPEND = 1;
53     const DB_DATA_REMOVE = 2;
54     const DB_DATA_KEEP = 3;
55     const DB_DATA_CHOOSE = 4;
56
57     /*!
58      Default constructor for eZ Publish installer classes
59
60     \param template
61     \param http object
62     \param ini settings object
63     \param persistencelist, all previous posted data
64     */
65     function eZStepInstaller( $tpl, $http, $ini, &$persistenceList,
66                               $identifier, $name )
67     {
68         $this->Tpl = $tpl;
69         $this->Http = $http;
70         $this->Ini = $ini;
71         $this->PersistenceList =& $persistenceList;
72         $this->Identifier = $identifier;
73         $this->Name = $name;
74         $this->INI = eZINI::instance( 'kickstart.ini', '.' );
75         $this->KickstartData = false;
76
77         $this->PersistenceList['use_kickstart'][$identifier] = true;
78
79         // If we have read data for this step earlier we do not use kickstart
80         if ( isset( $this->PersistenceList['kickstart'][$identifier] ) and
81              $this->PersistenceList['kickstart'][$identifier] )
82         {
83             $this->PersistenceList['use_kickstart'][$identifier] = false;
84         }
85
86         if ( $this->INI->hasGroup( $this->Identifier ) )
87         {
88             $this->KickstartData = $this->INI->group( $this->Identifier );
89             $this->PersistenceList['kickstart'][$identifier] = true;
90         }
91     }
92
93     /*!
94      \virtual
95
96      Processespost data from this class.
97      \return  true if post data accepted, or false if post data is rejected.
98     */
99     function processPostData()
100     {
101     }
102
103     /*!
104      \virtual
105
106     Performs test needed by this class.
107
108     This class may access class variables to store data needed for viewing if output failed
109     \return true if all tests passed and continue with next default step,
110             number of next step if all tests passed and next step is "hard coded",
111            false if tests failed
112     */
113     function init()
114     {
115     }
116
117     /*!
118     \virtual
119
120     Display information and forms needed to pass this step.
121     \return result to use in template
122     */
123     function display()
124     {
125         $result = array();
126         return $result;
127     }
128
129     function findAppropriateCharset( $primaryLanguage, $allLanguages, $canUseUnicode )
130     {
131         $commonCharsets = array();
132
133         if ( is_array( $allLanguages ) and count( $allLanguages ) > 0 )
134         {
135
136             $language = $allLanguages[ 0 ];
137             $charsets = $language->allowedCharsets();
138             foreach ( $charsets as $charset )
139             {
140                 $commonCharsets[] = eZCharsetInfo::realCharsetCode( $charset );
141             }
142             $commonCharsets = array_unique( $commonCharsets );
143
144             for ( $i = 1; $i < count( $allLanguages ); ++$i )
145             {
146                 $language = $allLanguages[$i];
147                 $charsets = $language->allowedCharsets();
148                 $realCharsets = array();
149                 foreach ( $charsets as $charset )
150                 {
151                     $realCharsets[] = eZCharsetInfo::realCharsetCode( $charset );
152                 }
153                 $realCharsets = array_unique( $realCharsets );
154                 $commonCharsets = array_intersect( $commonCharsets, $realCharsets );
155             }
156         }
157         $usableCharsets = array_values( $commonCharsets );
158         $charset = false;
159         if ( count( $usableCharsets ) > 0 )
160         {
161             if ( in_array( eZCharsetInfo::realCharsetCode( $primaryLanguage->charset() ), $usableCharsets ) )
162                 $charset = eZCharsetInfo::realCharsetCode( $primaryLanguage->charset() );
163             else // Pick the first charset
164                 $charset = $usableCharsets[0];
165         }
166         else
167         {
168             if ( $canUseUnicode )
169             {
170                 $charset = eZCharsetInfo::realCharsetCode( 'utf-8' );
171             }
172 //          else
173 //          {
174 //              // Pick preferred primary language
175 //              $charset = $primaryLanguage->charset();
176 //          }
177         }
178         return $charset;
179     }
180
181     function findAppropriateCharsetsList( $primaryLanguage, $allLanguages, $canUseUnicode )
182     {
183         $commonCharsets = array();
184
185         if ( is_array( $allLanguages ) and count( $allLanguages ) > 0 )
186         {
187
188             $language = $allLanguages[ 0 ];
189             $charsets = $language->allowedCharsets();
190             foreach ( $charsets as $charset )
191             {
192                 $commonCharsets[] = eZCharsetInfo::realCharsetCode( $charset );
193             }
194             $commonCharsets = array_unique( $commonCharsets );
195
196             for ( $i = 1; $i < count( $allLanguages ); ++$i )
197             {
198                 $language = $allLanguages[$i];
199                 $charsets = $language->allowedCharsets();
200                 $realCharsets = array();
201                 foreach ( $charsets as $charset )
202                 {
203                     $realCharsets[] = eZCharsetInfo::realCharsetCode( $charset );
204                 }
205                 $realCharsets = array_unique( $realCharsets );
206                 $commonCharsets = array_intersect( $commonCharsets, $realCharsets );
207             }
208         }
209         $usableCharsets = array_values( $commonCharsets );
210
211         if ( count( $usableCharsets ) > 0 )
212         {
213             if ( in_array( $primaryLanguage->charset(), $usableCharsets ) )
214             {
215                 array_unshift( $usableCharsets, $primaryLanguage->charset() );
216                 $usableCharsets = array_unique( $usableCharsets );
217             }
218         }
219         else
220         {
221             if ( $canUseUnicode )
222             {
223                 $usableCharsets[] = eZCharsetInfo::realCharsetCode( 'utf-8' );
224             }
225         }
226
227         return $usableCharsets;
228     }
229
230     function availableSitePackages()
231     {
232         $packageList = eZPackage::fetchPackages( array(), array( 'type' => 'site' ) );
233
234         return $packageList;
235     }
236
237     function extraDataList()
238     {
239         return array( 'title', 'url', 'database',
240                       'access_type', 'access_type_value', 'admin_access_type_value',
241                       'existing_database' );
242     }
243
244     function chosenSitePackage()
245     {
246         if ( isset( $this->PersistenceList['chosen_site_package']['0'] ) )
247         {
248             return $this->PersistenceList['chosen_site_package']['0'];
249         }
250         else
251             return false;
252     }
253
254     function chosenSiteType()
255     {
256         if ( isset( $this->PersistenceList['chosen_site_package']['0'] ) )
257         {
258             $siteTypeIdentifier = $this->PersistenceList['chosen_site_package']['0'];
259             $chosenSiteType['identifier'] = $siteTypeIdentifier;
260             $extraList = $this->extraDataList();
261
262             foreach ( $extraList as $extraItem )
263             {
264                 if ( isset( $this->PersistenceList['site_extra_data_' . $extraItem][$siteTypeIdentifier] ) )
265                 {
266                     $chosenSiteType[$extraItem] = $this->PersistenceList['site_extra_data_' . $extraItem][$siteTypeIdentifier];
267                 }
268             }
269         }
270         return $chosenSiteType;
271     }
272
273     function selectSiteType( $sitePackageName )
274     {
275         $package = eZPackage::fetch( $sitePackageName );
276         if ( !$package )
277             return false;
278
279         $this->PersistenceList['chosen_site_package']['0'] = $sitePackageName;
280
281         $this->PersistenceList['site_extra_data_title'][$sitePackageName] = $package->attribute('summary');
282         return true;
283     }
284
285     function storeSiteType( $siteType )
286     {
287         $extraList = $this->extraDataList();
288         $siteIdentifier = $siteType['identifier'];
289         foreach ( $extraList as $extraItem )
290         {
291             if ( isset( $siteType[$extraItem] ) )
292             {
293                 $this->PersistenceList['site_extra_data_' . $extraItem][$siteIdentifier] = $siteType[$extraItem];
294             }
295         }
296         $this->PersistenceList['chosen_site_package']['0'] = $siteIdentifier;
297         if ( $this->hasKickstartData() )
298             $this->storePersistenceData();
299     }
300
301     function storePersistenceData()
302     {
303         foreach ( $this->PersistenceList as $key => $value )
304         {
305             eZSetupSetPersistencePostVariable( $key, $value );
306         }
307     }
308
309     function storeExtraSiteData( $siteIdentifier, $dataIdentifier, $value )
310     {
311         if ( !isset( $this->PersistenceList['site_extra_data_' . $dataIdentifier] ) )
312             $this->PersistenceList['site_extra_data_' . $dataIdentifier] = array();
313         $this->PersistenceList['site_extra_data_' . $dataIdentifier][$siteIdentifier] = $value;
314     }
315
316     function extraData( $dataIdentifier )
317     {
318         if ( isset( $this->PersistenceList['site_extra_data_' . $dataIdentifier] ) )
319             return $this->PersistenceList['site_extra_data_' . $dataIdentifier];
320         return false;
321     }
322
323     function extraSiteData( $siteIdentifier, $dataIdentifier )
324     {
325         if ( isset( $this->PersistenceList['site_extra_data_' . $dataIdentifier][$siteIdentifier] ) )
326             return $this->PersistenceList['site_extra_data_' . $dataIdentifier][$siteIdentifier];
327         return false;
328     }
329
330     function checkDatabaseRequirements( $dbCharset = false, $overrideDBParameters = array() )
331     {
332         $result = array( 'error_code' => false,
333                          'use_unicode' => false,
334                          'db_version' => false,
335                          'db_require_version' => false,
336                          'site_charset' => false,
337                          'status' => false );
338
339         $databaseMap = eZSetupDatabaseMap();
340         $databaseInfo = $this->PersistenceList['database_info'];
341         $databaseInfo['info'] = $databaseMap[$databaseInfo['type']];
342
343         $dbDriver = $databaseInfo['info']['driver'];
344
345         if ( $dbCharset === false )
346             $dbCharset = 'iso-8859-1';
347         $dbParameters = array( 'server' => $databaseInfo['server'],
348                                'port' => $databaseInfo['port'],
349                                'user' => $databaseInfo['user'],
350                                'password' => $databaseInfo['password'],
351                                'socket' => trim( $databaseInfo['socket'] ) == '' ? false : $databaseInfo['socket'],
352                                'database' => $databaseInfo['database'],
353                                'charset' => $dbCharset );
354         $dbParameters = array_merge( $dbParameters, $overrideDBParameters );
355
356         // PostgreSQL requires us to specify database name.
357         // We use template1 here since it exists on all PostgreSQL installations.
358         if( $dbParameters['database'] == '' and $this->PersistenceList['database_info']['type'] == 'pgsql' )
359             $dbParameters['database'] = 'template1';
360
361         try
362         {
363             $db = eZDB::instance( $dbDriver, $dbParameters, true );
364             $result['db_instance'] = $db;
365             $result['connected'] = $db->isConnected();
366         }
367
368         catch( eZDBNoConnectionException $e )
369         {
370             $result['error_code'] = self::DB_ERROR_CONNECTION_FAILED;
371             return $result;
372         }
373
374         // Check if the version of the database fits the minimum required
375         $dbVersion = $db->databaseServerVersion();
376         $result['db_version'] = $dbVersion['string'];
377         $result['db_required_version'] = $databaseInfo['info']['required_version'];
378         if ( $dbVersion != null )
379         {
380             if ( version_compare( $result['db_version'], $databaseInfo['info']['required_version'] ) == -1 )
381             {
382                 $result['connected'] = false;
383                 $result['error_code'] = self::DB_ERROR_VERSION_INVALID;
384                 return $result;
385             }
386         }
387
388         // If we have PostgreSQL we need to make sure we have the 'digest' procedure available.
389         if ( $db->databaseName() == 'postgresql' and $dbParameters['database'] != 'template1' )
390         {
391             $sql = "SELECT count(*) AS count FROM pg_proc WHERE proname='digest'";
392             $rows = $db->arrayQuery( $sql );
393             $count = $rows[0]['count'];
394             // If it is 0 we don't have it
395             if ( $count == 0 )
396             {
397                 $result['error_code'] = self::DB_ERROR_NO_DIGEST_PROC;
398                 return $result;
399             }
400         }
401
402         $result['use_unicode'] = false;
403         if ( $db->isCharsetSupported( 'utf-8' ) )
404         {
405             $result['use_unicode'] = true;
406         }
407
408         // If we regional info we can start checking the charset
409         if ( isset( $this->PersistenceList['regional_info'] ) )
410         {
411             if ( isset( $this->PersistenceList['regional_info']['site_charset'] ) and
412                  strlen( $this->PersistenceList['regional_info']['site_charset'] ) > 0 )
413             {
414                 $charsetsList = array( $this->PersistenceList['regional_info']['site_charset'] );
415             }
416             else
417             {
418                 // Figure out charset automatically if it is not set yet
419                 $primaryLanguage     = null;
420                 $allLanguages        = array();
421                 $allLanguageCodes    = array();
422                 $variationsLanguages = array();
423                 $primaryLanguageCode = $this->PersistenceList['regional_info']['primary_language'];
424                 $extraLanguageCodes  = isset( $this->PersistenceList['regional_info']['languages'] ) ? $this->PersistenceList['regional_info']['languages'] : array();
425                 $extraLanguageCodes  = array_diff( $extraLanguageCodes, array( $primaryLanguageCode ) );
426
427                 /*
428                 if ( isset( $this->PersistenceList['regional_info']['variations'] ) )
429                 {
430                     $variations = $this->PersistenceList['regional_info']['variations'];
431                     foreach ( $variations as $variation )
432                     {
433                         $locale = eZLocale::create( $variation );
434                         if ( $locale->localeCode() == $primaryLanguageCode )
435                         {
436                             $primaryLanguage = $locale;
437                         }
438                         else
439                         {
440                             $variationsLanguages[] = $locale;
441                         }
442                     }
443                 }
444                 */
445
446                 if ( $primaryLanguage === null )
447                     $primaryLanguage = eZLocale::create( $primaryLanguageCode );
448
449                 $allLanguages[] = $primaryLanguage;
450
451                 foreach ( $extraLanguageCodes as $extraLanguageCode )
452                 {
453                     $allLanguages[] = eZLocale::create( $extraLanguageCode );
454                     $allLanguageCodes[] = $extraLanguageCode;
455                 }
456
457                 $charsetsList = $this->findAppropriateCharsetsList( $primaryLanguage, $allLanguages, $result['use_unicode'] );
458             }
459
460             $checkedCharset = $db->checkCharset( $charsetsList, $currentCharset );
461             if ( $checkedCharset === false )
462             {
463                 // If the current charset is utf-8 we use that instead
464                 // since it can represent any character possible in the chosen languages
465                 if ( $currentCharset == 'utf-8' )
466                 {
467                     $charset = 'utf-8';
468                     $result['site_charset'] = $charset;
469                 }
470                 else
471                 {
472                     $result['connected'] = false;
473                     $this->PersistenceList['database_info']['requested_charset'] = implode( ", ", $charsetsList );
474                     $this->PersistenceList['database_info']['current_charset'] = $currentCharset;
475                     $result['error_code'] = self::DB_ERROR_CHARSET_DIFFERS;
476                     return $result;
477                 }
478             }
479             else if ( $checkedCharset === true )
480             {
481                 $result['site_charset'] = $charsetsList[ 0 ];
482             }
483             else
484             {
485                 $result['site_charset'] = $checkedCharset;
486             }
487         }
488
489         $result['status'] = true;
490         return $result;
491     }
492
493     function databaseErrorInfo( $errorInfo )
494     {
495         $code = $errorInfo['error_code'];
496         $dbError = false;
497
498         switch ( $code )
499         {
500             case self::DB_ERROR_CONNECTION_FAILED:
501             {
502                 if ( $errorInfo['database_info']['type'] == 'pgsql' )
503                 {
504                     $dbError = array( 'text' => ezpI18n::translate( 'design/standard/setup/init',
505                                                         'Please make sure that the username and the password is correct. Verify that your PostgreSQL database is configured correctly.'
506                                                         .'<br>See the PHP documentation for more information about this.'
507                                                         .'<br>Remember to start postmaster with the -i option.'
508                                                         .'<br>Note that PostgreSQL 7.2 is not supported.' ),
509                                       'url' => array( 'href' => 'http://www.php.net/manual/en/ref.pgsql.php',
510                                                       'text' => 'PHP documentation' ),
511                                       'number' => self::DB_ERROR_CONNECTION_FAILED );
512                 }
513                 else
514                 {
515                     $dbError = array( 'text' => ezpI18n::translate( 'design/standard/setup/init',
516                                                         'The database would not accept the connection, please review your settings and try again.' ),
517                                   'url' => false,
518                                       'number' => self::DB_ERROR_CONNECTION_FAILED );
519                 }
520
521                 break;
522             }
523             case self::DB_ERROR_NONMATCH_PASSWORD:
524             {
525                 $dbError = array( 'text' => ezpI18n::translate( 'design/standard/setup/init',
526                                                     'Password entries did not match.' ),
527                                   'url' => false,
528                                   'number' => self::DB_ERROR_NONMATCH_PASSWORD );
529                 break;
530             }
531             case self::DB_ERROR_NOT_EMPTY:
532             {
533                 $dbError = array( 'text' => ezpI18n::translate( 'design/standard/setup/init',
534                                                     'The selected database was not empty, please choose from the alternatives below.' ),
535                                   'url' => false,
536                                   'number' => self::DB_ERROR_NOT_EMPTY );
537                 $dbNotEmpty = 1;
538                 break;
539             }
540             case self::DB_ERROR_NO_DATABASES:
541             {
542                 $dbError = array( 'text' => ezpI18n::translate( 'design/standard/setup/init',
543                                                     'The selected user has not got access to any databases. Change user or create a database for the user.' ),
544                                   'url' => false,
545                                   'number' => self::DB_ERROR_NO_DATABASES );
546                 break;
547             }
548
549             case self::DB_ERROR_NO_DIGEST_PROC:
550             {
551                 $dbError = array( 'text' => ezpI18n::translate( 'design/standard/setup/init',
552                                                     "The 'digest' function is not available in your database, you cannot run eZ Publish without this. See the documentation for more information." ),
553                                   'url' => array( 'href' => 'http://ez.no/doc/ez_publish/technical_manual/current/installation/normal_installation/requirements_for_doing_a_normal_installation#digest_function',
554                                                   'text' => 'PostgreSQL digest FAQ' ),
555                                   'number' => self::DB_ERROR_NO_DATABASES );
556                 break;
557             }
558
559             case self::DB_ERROR_VERSION_INVALID:
560             {
561                 $dbError = array( 'text' => ezpI18n::translate( 'design/standard/setup/init',
562                                                     "Your database version %version does not fit the minimum requirement which is %req_version.
563 See the requirements page for more information.",
564                                                     null,
565                                                     array( '%version' => $errorInfo['database_info']['version'],
566                                                            '%req_version' => $errorInfo['database_info']['required_version'] ) ),
567                                   'url' => array( 'href' => 'http://ez.no/ez_publish/documentation/general_information/what_is_ez_publish/ez_publish_requirements',
568                                                   'text' => 'eZ Publish requirements' ),
569                                   'number' => self::DB_ERROR_NO_DATABASES );
570                 break;
571             }
572
573             case self::DB_ERROR_CHARSET_DIFFERS:
574             {
575                 $dbError = array( 'text' => ezpI18n::translate( 'design/standard/setup/init',
576                                                     "The database [%database_name] cannot be used, the setup wizard wants to create the site in [%req_charset] but the database has been created using character set [%charset]. You will have to choose a database having support for [%req_charset] or modify [%database_name] .",
577                                                     null,
578                                                     array( '%database_name' => $errorInfo['site_type']['database'],
579                                                            '%charset' => $errorInfo['database_info']['current_charset'],
580                                                            '%req_charset' => $errorInfo['database_info']['requested_charset'] ) ),
581                                   'url' => false,
582                                   'number' => self::DB_ERROR_CHARSET_DIFFERS );
583                 break;
584             }
585         }
586
587         return $dbError;
588     }
589
590     /*!
591      \return \c true if the step has kickstart data available.
592     */
593     function hasKickstartData()
594     {
595         if ( !$this->isKickstartAllowed() )
596             return false;
597         return $this->KickstartData !== false;
598     }
599
600     /*!
601      \return All kickstart data as an associative array
602     */
603     function kickstartData()
604     {
605         return $this->KickstartData;
606     }
607
608     /*!
609      \return \c true if kickstart functionality can be used.
610     */
611     function isKickstartAllowed()
612     {
613         $identifier = $this->Identifier;
614         if ( isset( $this->PersistenceList['use_kickstart'][$identifier] ) and
615              !$this->PersistenceList['use_kickstart'][$identifier] )
616             return false;
617
618         if ( isset( $GLOBALS['eZStepAllowKickstart'] ) )
619             return $GLOBALS['eZStepAllowKickstart'];
620
621         return true;
622     }
623
624     /*!
625      \return \c true if the kickstart functionality should continue to the next step.
626     */
627     function kickstartContinueNextStep()
628     {
629         if ( isset( $this->KickstartData['Continue'] ) and
630              $this->KickstartData['Continue'] == 'true' )
631             return true;
632         return false;
633     }
634
635     /*!
636      Sets whether kickstart data can be checked or not.
637     */
638     function setAllowKickstart( $allow )
639     {
640         $GLOBALS['eZStepAllowKickstart'] = $allow;
641     }
642
643     /*!
644      \return Urls to access user and admin siteaccesses
645     */
646     function siteaccessURLs()
647     {
648         $siteType = $this->chosenSiteType();
649
650         $url = $siteType['url'];
651         if ( !preg_match( "#^[a-zA-Z0-9]+://(.*)$#", $url ) )
652         {
653             $url = 'http://' . $url;
654         }
655         $currentURL = $url;
656         $adminURL = $url;
657
658         if ( $siteType['access_type'] == 'url' )
659         {
660             $ini = eZINI::instance();
661             if ( $ini->hasVariable( 'SiteSettings', 'DefaultAccess' ) )
662             {
663                 $siteType['access_type_value'] = $ini->variable( 'SiteSettings', 'DefaultAccess' );
664             }
665
666             $url .= '/' . $siteType['access_type_value'];
667             $adminURL .= '/' . $siteType['admin_access_type_value'];
668         }
669         else if ( $siteType['access_type'] == 'hostname' )
670         {
671             $url = $siteType['access_type_value'];
672             $adminURL = $siteType['admin_access_type_value'];
673             if ( !preg_match( "#^[a-zA-Z0-9]+://(.*)$#", $url ) )
674             {
675                 $url = 'http://' . $url;
676             }
677             if ( !preg_match( "#^[a-zA-Z0-9]+://(.*)$#", $adminURL ) )
678             {
679                 $adminURL = 'http://' . $adminURL;
680             }
681             $url .= eZSys::indexDir( false );
682             $adminURL .= eZSys::indexDir( false );
683         }
684         else if ( $siteType['access_type'] == 'port' )
685         {
686             $url = eZHTTPTool::createRedirectURL( $currentURL, array( 'override_port' => $siteType['access_type_value'] ) );
687             $adminURL = eZHTTPTool::createRedirectURL( $currentURL, array( 'override_port' => $siteType['admin_access_type_value'] ) );
688         }
689
690         $siteaccessURL = array( 'url' => $url,
691                                 'admin_url' => $adminURL );
692
693         return $siteaccessURL;
694     }
695
696     public $Tpl;
697     public $Http;
698     public $Ini;
699     public $PersistenceList;
700     // The identifier of the current step
701     public $Identifier;
702     // The name of the current step
703     public $Name;
704     /// Kickstart INI file, if one is found
705     public $INI;
706     /// The kickstart data as an associative array or \c false if no data available
707     public $KickstartData;
708 }
709
710 ?>