Changeset 18482 for branches


Ignore:
Timestamp:
2010/01/08 15:02:01 (14 years ago)
Author:
Yammy
Message:

http://svn.ec-cube.net/open_trac/ticket/348
インストール前に /admin/ にアクセスすると /admin/install/ にリダイレクトされる

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_4-dev/data/class/util/SC_Utils.php

    r18274 r18482  
    8383            if( !ereg('/install/', $_SERVER['PHP_SELF']) ) { 
    8484                // インストールページに遷移させる 
    85                 header('Location: ./install/'); 
     85 
     86                $script_filename = $_SERVER['SCRIPT_FILENAME']; 
     87                list($real_root, $tmp) = explode('/html/', $script_filename); 
     88                $real_root = $real_root . '/html/'; 
     89                $url_dir = $_SERVER['REQUEST_URI']; 
     90 
     91                if ($dh = opendir($real_root)) { 
     92                    $arrDir = array(); 
     93                    while ($entry = readdir($dh)) { 
     94                        if (is_dir($real_root.$entry) && !in_array($entry, array('.', '..', '.svn', 'install'))) { 
     95                            $url_dir = rtrim($url_dir, $entry.'/'); 
     96                        } 
     97                    } 
     98                    closedir($dh); 
     99                } 
     100 
     101                $location = $url_dir . '/install/'; 
     102                header('Location: ' . $location); 
    86103                exit; 
    87104            } 
Note: See TracChangeset for help on using the changeset viewer.