[218] | 1 | <?php |
---|
[354] | 2 | // +-----------------------------------------------------------------------+ |
---|
[2297] | 3 | // | Piwigo - a PHP based picture gallery | |
---|
| 4 | // +-----------------------------------------------------------------------+ |
---|
[3049] | 5 | // | Copyright(C) 2008-2009 Piwigo Team http://piwigo.org | |
---|
[2297] | 6 | // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | |
---|
| 7 | // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | |
---|
| 8 | // +-----------------------------------------------------------------------+ |
---|
| 9 | // | This program is free software; you can redistribute it and/or modify | |
---|
| 10 | // | it under the terms of the GNU General Public License as published by | |
---|
| 11 | // | the Free Software Foundation | |
---|
| 12 | // | | |
---|
| 13 | // | This program is distributed in the hope that it will be useful, but | |
---|
| 14 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
| 15 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
| 16 | // | General Public License for more details. | |
---|
| 17 | // | | |
---|
| 18 | // | You should have received a copy of the GNU General Public License | |
---|
| 19 | // | along with this program; if not, write to the Free Software | |
---|
| 20 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
| 21 | // | USA. | |
---|
| 22 | // +-----------------------------------------------------------------------+ |
---|
[218] | 23 | |
---|
[367] | 24 | //----------------------------------------------------------- include |
---|
| 25 | define('PHPWG_ROOT_PATH','./'); |
---|
[345] | 26 | |
---|
[529] | 27 | /** |
---|
| 28 | * loads an sql file and executes all queries |
---|
| 29 | * |
---|
| 30 | * Before executing a query, $replaced is... replaced by $replacing. This is |
---|
| 31 | * useful when the SQL file contains generic words. Drop table queries are |
---|
| 32 | * not executed. |
---|
| 33 | * |
---|
| 34 | * @param string filepath |
---|
| 35 | * @param string replaced |
---|
| 36 | * @param string replacing |
---|
| 37 | * @return void |
---|
| 38 | */ |
---|
| 39 | function execute_sqlfile($filepath, $replaced, $replacing) |
---|
[382] | 40 | { |
---|
[529] | 41 | $sql_lines = file($filepath); |
---|
[382] | 42 | $query = ''; |
---|
[529] | 43 | foreach ($sql_lines as $sql_line) |
---|
| 44 | { |
---|
| 45 | $sql_line = trim($sql_line); |
---|
| 46 | if (preg_match('/(^--|^$)/', $sql_line)) |
---|
| 47 | { |
---|
| 48 | continue; |
---|
| 49 | } |
---|
[382] | 50 | $query.= ' '.$sql_line; |
---|
| 51 | // if we reached the end of query, we execute it and reinitialize the |
---|
| 52 | // variable "query" |
---|
[529] | 53 | if (preg_match('/;$/', $sql_line)) |
---|
[382] | 54 | { |
---|
[529] | 55 | $query = trim($query); |
---|
| 56 | $query = str_replace($replaced, $replacing, $query); |
---|
[382] | 57 | // we don't execute "DROP TABLE" queries |
---|
[529] | 58 | if (!preg_match('/^DROP TABLE/i', $query)) |
---|
| 59 | { |
---|
[2127] | 60 | global $install_charset_collate; |
---|
| 61 | if ( !empty($install_charset_collate) ) |
---|
| 62 | { |
---|
| 63 | if ( preg_match('/^(CREATE TABLE .*)[\s]*;[\s]*/im', $query, $matches) ) |
---|
| 64 | { |
---|
| 65 | $query = $matches[1].' '.$install_charset_collate.';'; |
---|
| 66 | } |
---|
| 67 | } |
---|
[2884] | 68 | pwg_query($query); |
---|
[529] | 69 | } |
---|
[382] | 70 | $query = ''; |
---|
| 71 | } |
---|
| 72 | } |
---|
| 73 | } |
---|
| 74 | |
---|
[3747] | 75 | @set_magic_quotes_runtime(0); // Disable magic_quotes_runtime |
---|
[367] | 76 | // |
---|
| 77 | // addslashes to vars if magic_quotes_gpc is off this is a security |
---|
| 78 | // precaution to prevent someone trying to break out of a SQL statement. |
---|
| 79 | // |
---|
[4006] | 80 | if( !@get_magic_quotes_gpc() ) |
---|
[218] | 81 | { |
---|
[367] | 82 | if( is_array($_POST) ) |
---|
[218] | 83 | { |
---|
[367] | 84 | while( list($k, $v) = each($_POST) ) |
---|
[218] | 85 | { |
---|
[367] | 86 | if( is_array($_POST[$k]) ) |
---|
[218] | 87 | { |
---|
[367] | 88 | while( list($k2, $v2) = each($_POST[$k]) ) |
---|
| 89 | { |
---|
| 90 | $_POST[$k][$k2] = addslashes($v2); |
---|
| 91 | } |
---|
| 92 | @reset($_POST[$k]); |
---|
[218] | 93 | } |
---|
| 94 | else |
---|
| 95 | { |
---|
[367] | 96 | $_POST[$k] = addslashes($v); |
---|
[218] | 97 | } |
---|
| 98 | } |
---|
[367] | 99 | @reset($_POST); |
---|
| 100 | } |
---|
| 101 | |
---|
[1855] | 102 | if( is_array($_GET) ) |
---|
| 103 | { |
---|
| 104 | while( list($k, $v) = each($_GET) ) |
---|
| 105 | { |
---|
| 106 | if( is_array($_GET[$k]) ) |
---|
| 107 | { |
---|
| 108 | while( list($k2, $v2) = each($_GET[$k]) ) |
---|
| 109 | { |
---|
| 110 | $_GET[$k][$k2] = addslashes($v2); |
---|
| 111 | } |
---|
| 112 | @reset($_GET[$k]); |
---|
| 113 | } |
---|
| 114 | else |
---|
| 115 | { |
---|
| 116 | $_GET[$k] = addslashes($v); |
---|
| 117 | } |
---|
| 118 | } |
---|
| 119 | @reset($_GET); |
---|
| 120 | } |
---|
| 121 | |
---|
[367] | 122 | if( is_array($_COOKIE) ) |
---|
| 123 | { |
---|
| 124 | while( list($k, $v) = each($_COOKIE) ) |
---|
[218] | 125 | { |
---|
[367] | 126 | if( is_array($_COOKIE[$k]) ) |
---|
[218] | 127 | { |
---|
[367] | 128 | while( list($k2, $v2) = each($_COOKIE[$k]) ) |
---|
| 129 | { |
---|
| 130 | $_COOKIE[$k][$k2] = addslashes($v2); |
---|
| 131 | } |
---|
| 132 | @reset($_COOKIE[$k]); |
---|
[218] | 133 | } |
---|
| 134 | else |
---|
| 135 | { |
---|
[367] | 136 | $_COOKIE[$k] = addslashes($v); |
---|
[218] | 137 | } |
---|
| 138 | } |
---|
[367] | 139 | @reset($_COOKIE); |
---|
[218] | 140 | } |
---|
[367] | 141 | } |
---|
[218] | 142 | |
---|
[367] | 143 | //----------------------------------------------------- variable initialization |
---|
[1147] | 144 | |
---|
[2339] | 145 | define('DEFAULT_PREFIX_TABLE', 'piwigo_'); |
---|
[1147] | 146 | |
---|
[367] | 147 | // Obtain various vars |
---|
| 148 | $dbhost = (!empty($_POST['dbhost'])) ? $_POST['dbhost'] : 'localhost'; |
---|
| 149 | $dbuser = (!empty($_POST['dbuser'])) ? $_POST['dbuser'] : ''; |
---|
| 150 | $dbpasswd = (!empty($_POST['dbpasswd'])) ? $_POST['dbpasswd'] : ''; |
---|
| 151 | $dbname = (!empty($_POST['dbname'])) ? $_POST['dbname'] : ''; |
---|
| 152 | |
---|
[1147] | 153 | if (isset($_POST['install'])) |
---|
| 154 | { |
---|
| 155 | $table_prefix = $_POST['prefix']; |
---|
| 156 | } |
---|
| 157 | else |
---|
| 158 | { |
---|
| 159 | $table_prefix = DEFAULT_PREFIX_TABLE; |
---|
| 160 | } |
---|
[367] | 161 | |
---|
| 162 | $admin_name = (!empty($_POST['admin_name'])) ? $_POST['admin_name'] : ''; |
---|
| 163 | $admin_pass1 = (!empty($_POST['admin_pass1'])) ? $_POST['admin_pass1'] : ''; |
---|
| 164 | $admin_pass2 = (!empty($_POST['admin_pass2'])) ? $_POST['admin_pass2'] : ''; |
---|
| 165 | $admin_mail = (!empty($_POST['admin_mail'])) ? $_POST['admin_mail'] : ''; |
---|
| 166 | |
---|
| 167 | $infos = array(); |
---|
| 168 | $errors = array(); |
---|
| 169 | |
---|
| 170 | // Open config.php ... if it exists |
---|
| 171 | $config_file = PHPWG_ROOT_PATH.'include/mysql.inc.php'; |
---|
| 172 | if (@file_exists($config_file)) |
---|
| 173 | { |
---|
[529] | 174 | include($config_file); |
---|
[2339] | 175 | // Is Piwigo already installed ? |
---|
[529] | 176 | if (defined("PHPWG_INSTALLED")) |
---|
| 177 | { |
---|
[2339] | 178 | die('Piwigo is already installed'); |
---|
[529] | 179 | } |
---|
[367] | 180 | } |
---|
| 181 | |
---|
[682] | 182 | $prefixeTable = $table_prefix; |
---|
[819] | 183 | include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); |
---|
[1079] | 184 | @include(PHPWG_ROOT_PATH. 'include/config_local.inc.php'); |
---|
[529] | 185 | include(PHPWG_ROOT_PATH . 'include/constants.php'); |
---|
| 186 | include(PHPWG_ROOT_PATH . 'include/functions.inc.php'); |
---|
[1221] | 187 | include(PHPWG_ROOT_PATH . 'admin/include/functions.php'); |
---|
[2102] | 188 | include(PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php'); |
---|
[529] | 189 | |
---|
[2248] | 190 | if (isset($_GET['language'])) |
---|
[405] | 191 | { |
---|
[2248] | 192 | $language = strip_tags($_GET['language']); |
---|
[367] | 193 | } |
---|
[2127] | 194 | else |
---|
[1855] | 195 | { |
---|
[2127] | 196 | $language = 'en_UK'; |
---|
[2248] | 197 | // Try to get browser language |
---|
| 198 | foreach (get_languages('utf-8') as $language_code => $language_name) |
---|
| 199 | { |
---|
| 200 | if (substr($language_code,0,2) == @substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2)) |
---|
| 201 | { |
---|
| 202 | $language = $language_code; |
---|
| 203 | break; |
---|
| 204 | } |
---|
| 205 | } |
---|
[1855] | 206 | } |
---|
[367] | 207 | |
---|
[3197] | 208 | if ('fr_FR' == $language) { |
---|
| 209 | define('PHPWG_DOMAIN', 'fr.piwigo.org'); |
---|
| 210 | } |
---|
[4047] | 211 | else if ('de_DE' == $language) { |
---|
| 212 | define('PHPWG_DOMAIN', 'de.piwigo.org'); |
---|
| 213 | } |
---|
| 214 | else if ('es_ES' == $language) { |
---|
| 215 | define('PHPWG_DOMAIN', 'es.piwigo.org'); |
---|
| 216 | } |
---|
[3197] | 217 | else { |
---|
| 218 | define('PHPWG_DOMAIN', 'piwigo.org'); |
---|
| 219 | } |
---|
| 220 | define('PHPWG_URL', 'http://'.PHPWG_DOMAIN); |
---|
| 221 | |
---|
[2479] | 222 | load_language( 'common.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') ); |
---|
| 223 | load_language( 'admin.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') ); |
---|
| 224 | load_language( 'install.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') ); |
---|
[529] | 225 | |
---|
[3203] | 226 | //------------------------------------------------- check php version |
---|
| 227 | if (version_compare(PHP_VERSION, REQUIRED_PHP_VERSION, '<')) |
---|
| 228 | { |
---|
| 229 | include(PHPWG_ROOT_PATH.'install/php5_apache_configuration.php'); |
---|
| 230 | } |
---|
| 231 | |
---|
[367] | 232 | //----------------------------------------------------- template initialization |
---|
[3203] | 233 | include( PHPWG_ROOT_PATH .'include/template.class.php'); |
---|
[2747] | 234 | $template=new Template(PHPWG_ROOT_PATH.'admin/template/goto', 'roma'); |
---|
[367] | 235 | $template->set_filenames( array('install'=>'install.tpl') ); |
---|
| 236 | $step = 1; |
---|
[529] | 237 | //---------------------------------------------------------------- form analyze |
---|
[367] | 238 | if ( isset( $_POST['install'] )) |
---|
| 239 | { |
---|
[382] | 240 | if ( @mysql_connect( $_POST['dbhost'], |
---|
| 241 | $_POST['dbuser'], |
---|
| 242 | $_POST['dbpasswd'] ) ) |
---|
| 243 | { |
---|
| 244 | if ( @mysql_select_db($_POST['dbname'] ) ) |
---|
[367] | 245 | { |
---|
[2201] | 246 | array_push( $infos, l10n('step1_confirmation') ); |
---|
[218] | 247 | } |
---|
[367] | 248 | else |
---|
| 249 | { |
---|
[2201] | 250 | array_push( $errors, l10n('step1_err_db') ); |
---|
[367] | 251 | } |
---|
[2127] | 252 | if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) |
---|
| 253 | { |
---|
| 254 | $pwg_charset='utf-8'; |
---|
| 255 | $pwg_db_charset='utf8'; |
---|
| 256 | $install_charset_collate = "DEFAULT CHARACTER SET $pwg_db_charset"; |
---|
| 257 | } |
---|
| 258 | else |
---|
| 259 | { |
---|
| 260 | $pwg_charset='iso-8859-1'; |
---|
| 261 | $pwg_db_charset='latin1'; |
---|
| 262 | $install_charset_collate = ''; |
---|
| 263 | if ( !array_key_exists($language, get_languages($pwg_charset) ) ) |
---|
| 264 | { |
---|
| 265 | $language='en_UK'; |
---|
| 266 | } |
---|
| 267 | } |
---|
[382] | 268 | } |
---|
| 269 | else |
---|
| 270 | { |
---|
[2201] | 271 | array_push( $errors, l10n('step1_err_server') ); |
---|
[382] | 272 | } |
---|
[2127] | 273 | |
---|
[382] | 274 | $webmaster = trim(preg_replace( '/\s{2,}/', ' ', $admin_name )); |
---|
| 275 | if ( empty($webmaster)) |
---|
[2201] | 276 | array_push( $errors, l10n('step2_err_login1') ); |
---|
[382] | 277 | else if ( preg_match( '/[\'"]/', $webmaster ) ) |
---|
[2201] | 278 | array_push( $errors, l10n('step2_err_login3') ); |
---|
[382] | 279 | if ( $admin_pass1 != $admin_pass2 || empty($admin_pass1) ) |
---|
[2201] | 280 | array_push( $errors, l10n('step2_err_pass') ); |
---|
[382] | 281 | if ( empty($admin_mail)) |
---|
[2201] | 282 | array_push( $errors, l10n('reg_err_mail_address') ); |
---|
[2127] | 283 | else |
---|
[382] | 284 | { |
---|
[2124] | 285 | $error_mail_address = validate_mail_address(null, $admin_mail); |
---|
[382] | 286 | if (!empty($error_mail_address)) |
---|
| 287 | array_push( $errors, $error_mail_address ); |
---|
| 288 | } |
---|
[2127] | 289 | |
---|
[382] | 290 | if ( count( $errors ) == 0 ) |
---|
| 291 | { |
---|
| 292 | $step = 2; |
---|
[1147] | 293 | $file_content = '<?php |
---|
| 294 | $cfgBase = \''.$dbname.'\'; |
---|
| 295 | $cfgUser = \''.$dbuser.'\'; |
---|
| 296 | $cfgPassword = \''.$dbpasswd.'\'; |
---|
| 297 | $cfgHote = \''.$dbhost.'\'; |
---|
| 298 | |
---|
| 299 | $prefixeTable = \''.$table_prefix.'\'; |
---|
| 300 | |
---|
| 301 | define(\'PHPWG_INSTALLED\', true); |
---|
[2127] | 302 | define(\'PWG_CHARSET\', \''.$pwg_charset.'\'); |
---|
| 303 | define(\'DB_CHARSET\', \''.$pwg_db_charset.'\'); |
---|
| 304 | define(\'DB_COLLATE\', \'\'); |
---|
| 305 | |
---|
[1147] | 306 | ?'.'>'; |
---|
[2127] | 307 | |
---|
[382] | 308 | @umask(0111); |
---|
| 309 | // writing the configuration file |
---|
| 310 | if ( !($fp = @fopen( $config_file, 'w' ))) |
---|
[367] | 311 | { |
---|
[382] | 312 | $html_content = htmlentities( $file_content, ENT_QUOTES ); |
---|
| 313 | $html_content = nl2br( $html_content ); |
---|
[2747] | 314 | $error_copy = l10n('step1_err_copy'); |
---|
[3185] | 315 | $error_copy .= '<br>--------------------------------------------------------------------<br>'; |
---|
[2747] | 316 | $error_copy .= '<span class="sql_content">' . $html_content . '</span>'; |
---|
[3185] | 317 | $error_copy .= '<br>--------------------------------------------------------------------<br>'; |
---|
[382] | 318 | } |
---|
| 319 | @fputs($fp, $file_content, strlen($file_content)); |
---|
| 320 | @fclose($fp); |
---|
[2127] | 321 | |
---|
[2189] | 322 | // Create empty local files to avoid log errors |
---|
| 323 | create_empty_local_files(); |
---|
| 324 | |
---|
[2339] | 325 | // tables creation, based on piwigo_structure.sql |
---|
[1147] | 326 | execute_sqlfile( |
---|
[2339] | 327 | PHPWG_ROOT_PATH.'install/piwigo_structure.sql', |
---|
[1147] | 328 | DEFAULT_PREFIX_TABLE, |
---|
| 329 | $table_prefix |
---|
| 330 | ); |
---|
[382] | 331 | // We fill the tables with basic informations |
---|
[1147] | 332 | execute_sqlfile( |
---|
| 333 | PHPWG_ROOT_PATH.'install/config.sql', |
---|
| 334 | DEFAULT_PREFIX_TABLE, |
---|
| 335 | $table_prefix |
---|
| 336 | ); |
---|
[218] | 337 | |
---|
[1284] | 338 | // fill $conf global array |
---|
| 339 | load_conf_from_db(); |
---|
| 340 | |
---|
| 341 | $insert = array( |
---|
| 342 | 'id' => 1, |
---|
| 343 | 'galleries_url' => PHPWG_ROOT_PATH.'galleries/', |
---|
| 344 | ); |
---|
| 345 | mass_inserts(SITES_TABLE, array_keys($insert), array($insert)); |
---|
[2127] | 346 | |
---|
[382] | 347 | // webmaster admin user |
---|
[1284] | 348 | $inserts = array( |
---|
| 349 | array( |
---|
| 350 | 'id' => 1, |
---|
| 351 | 'username' => $admin_name, |
---|
| 352 | 'password' => md5($admin_pass1), |
---|
| 353 | 'mail_address' => $admin_mail, |
---|
| 354 | ), |
---|
| 355 | array( |
---|
| 356 | 'id' => 2, |
---|
| 357 | 'username' => 'guest', |
---|
| 358 | ), |
---|
| 359 | ); |
---|
| 360 | mass_inserts(USERS_TABLE, array_keys($inserts[0]), $inserts); |
---|
[801] | 361 | |
---|
[1930] | 362 | create_user_infos(array(1,2), array('language' => $language)); |
---|
[808] | 363 | |
---|
[1027] | 364 | // Available upgrades must be ignored after a fresh installation. To |
---|
| 365 | // make PWG avoid upgrading, we must tell it upgrades have already been |
---|
| 366 | // made. |
---|
[1221] | 367 | list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); |
---|
| 368 | define('CURRENT_DATE', $dbnow); |
---|
| 369 | $datas = array(); |
---|
[1027] | 370 | foreach (get_available_upgrade_ids() as $upgrade_id) |
---|
| 371 | { |
---|
[1221] | 372 | array_push( |
---|
| 373 | $datas, |
---|
| 374 | array( |
---|
| 375 | 'id' => $upgrade_id, |
---|
| 376 | 'applied' => CURRENT_DATE, |
---|
| 377 | 'description' => 'upgrade included in installation', |
---|
| 378 | ) |
---|
| 379 | ); |
---|
[1027] | 380 | } |
---|
[1221] | 381 | mass_inserts( |
---|
| 382 | UPGRADE_TABLE, |
---|
| 383 | array_keys($datas[0]), |
---|
| 384 | $datas |
---|
| 385 | ); |
---|
[382] | 386 | } |
---|
[367] | 387 | } |
---|
[218] | 388 | |
---|
[2248] | 389 | //------------------------------------------------------ start template output |
---|
| 390 | foreach (get_languages('utf-8') as $language_code => $language_name) |
---|
| 391 | { |
---|
| 392 | if ($language == $language_code) |
---|
| 393 | { |
---|
| 394 | $template->assign('language_selection', $language_code); |
---|
| 395 | } |
---|
| 396 | $languages_options[$language_code] = $language_name; |
---|
| 397 | } |
---|
| 398 | $template->assign('language_options', $languages_options); |
---|
| 399 | |
---|
| 400 | $template->assign( |
---|
[529] | 401 | array( |
---|
[2248] | 402 | 'T_CONTENT_ENCODING' => 'utf-8', |
---|
[529] | 403 | 'RELEASE'=>PHPWG_VERSION, |
---|
[2248] | 404 | 'F_ACTION' => 'install.php?language=' . $language, |
---|
[529] | 405 | 'F_DB_HOST'=>$dbhost, |
---|
| 406 | 'F_DB_USER'=>$dbuser, |
---|
| 407 | 'F_DB_NAME'=>$dbname, |
---|
[2248] | 408 | 'F_DB_PREFIX' => $table_prefix, |
---|
[529] | 409 | 'F_ADMIN'=>$admin_name, |
---|
| 410 | 'F_ADMIN_EMAIL'=>$admin_mail, |
---|
[3197] | 411 | 'L_INSTALL_HELP'=>sprintf(l10n('install_help'), PHPWG_URL.'/forum'), |
---|
[529] | 412 | )); |
---|
| 413 | |
---|
| 414 | //------------------------------------------------------ errors & infos display |
---|
[2747] | 415 | if ($step == 1) |
---|
| 416 | { |
---|
| 417 | $template->assign('install', true); |
---|
| 418 | } |
---|
| 419 | else |
---|
| 420 | { |
---|
| 421 | array_push($infos, l10n('install_end_message')); |
---|
| 422 | |
---|
| 423 | if (isset($error_copy)) |
---|
| 424 | { |
---|
| 425 | array_push($errors, $error_copy); |
---|
| 426 | } |
---|
[3715] | 427 | else |
---|
| 428 | { |
---|
| 429 | session_set_save_handler('pwg_session_open', |
---|
| 430 | 'pwg_session_close', |
---|
| 431 | 'pwg_session_read', |
---|
| 432 | 'pwg_session_write', |
---|
| 433 | 'pwg_session_destroy', |
---|
| 434 | 'pwg_session_gc' |
---|
| 435 | ); |
---|
| 436 | if ( function_exists('ini_set') ) |
---|
| 437 | { |
---|
| 438 | ini_set('session.use_cookies', $conf['session_use_cookies']); |
---|
| 439 | ini_set('session.use_only_cookies', $conf['session_use_only_cookies']); |
---|
| 440 | ini_set('session.use_trans_sid', intval($conf['session_use_trans_sid'])); |
---|
| 441 | ini_set('session.cookie_httponly', 1); |
---|
| 442 | } |
---|
| 443 | session_name($conf['session_name']); |
---|
| 444 | session_set_cookie_params(0, cookie_path()); |
---|
| 445 | $user = build_user(1, true); |
---|
| 446 | log_user($user['id'], false); |
---|
| 447 | } |
---|
[3382] | 448 | |
---|
| 449 | $template->assign( |
---|
| 450 | 'SUBSCRIBE_BASE_URL', |
---|
| 451 | get_newsletter_subscribe_base_url($language) |
---|
| 452 | ); |
---|
[2747] | 453 | } |
---|
[2248] | 454 | if (count($errors) != 0) |
---|
[367] | 455 | { |
---|
[2248] | 456 | $template->assign('errors', $errors); |
---|
[367] | 457 | } |
---|
[218] | 458 | |
---|
[2248] | 459 | if (count($infos) != 0 ) |
---|
[367] | 460 | { |
---|
[2248] | 461 | $template->assign('infos', $infos); |
---|
[367] | 462 | } |
---|
[218] | 463 | |
---|
| 464 | //----------------------------------------------------------- html code display |
---|
[367] | 465 | $template->pparse('install'); |
---|
[3203] | 466 | ?> |
---|