Ignore:
Timestamp:
2013/05/20 14:54:22 (11 years ago)
Author:
m_uehara
Message:

#2249 ログイン処理修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/helper/SC_Helper_Session.php

    r22796 r22826  
    216216     */ 
    217217    function adminAuthorization() { 
    218         $masterData = new SC_DB_MasterData_Ex(); 
    219         $arrExcludes = $masterData->getMasterData('mtb_auth_excludes'); 
    220         if (preg_match('|^' . ROOT_URLPATH . ADMIN_DIR . '|', $_SERVER['SCRIPT_NAME'])) { 
    221             $is_auth = true; 
    222  
    223             foreach ($arrExcludes as $exclude) { 
    224                 if (preg_match('|^' . ROOT_URLPATH . ADMIN_DIR . $exclude . '|', $_SERVER['SCRIPT_NAME'])) { 
    225                     $is_auth = false; 
    226                     break; 
     218        if (($script_path = realpath($_SERVER['SCRIPT_FILENAME'])) !== FALSE) { 
     219            $arrScriptPath = explode('/', str_replace('\\', '/', $script_path)); 
     220            $arrAdminPath = explode('/', str_replace('\\', '/', substr(HTML_REALDIR . ADMIN_DIR, 0, -1))); 
     221            $arrDiff = array_diff_assoc($arrAdminPath, $arrScriptPath); 
     222            if (in_array(substr(ADMIN_DIR, 0, -1), $arrDiff)) { 
     223                return; 
     224            } else { 
     225                $masterData = new SC_DB_MasterData_Ex(); 
     226                $arrExcludes = $masterData->getMasterData('mtb_auth_excludes'); 
     227                foreach ($arrExcludes as $exclude) { 
     228                    $arrExcludesPath = explode('/', str_replace('\\', '/', HTML_REALDIR . ADMIN_DIR . $exclude)); 
     229                    $arrDiff = array_diff_assoc($arrExcludesPath, $arrScriptPath); 
     230                    if (count($arrDiff) === 0) { 
     231                        return; 
     232                    } 
    227233                } 
    228234            } 
    229             if ($is_auth) { 
    230                 SC_Utils_Ex::sfIsSuccess(new SC_Session_Ex()); 
    231             } 
    232         } 
     235        } 
     236        SC_Utils_Ex::sfIsSuccess(new SC_Session_Ex()); 
    233237    } 
    234238} 
Note: See TracChangeset for help on using the changeset viewer.