Changeset 15448


Ignore:
Timestamp:
2007/08/30 11:41:40 (17 years ago)
Author:
naka
Message:
 
Location:
branches/feature-module-zeus/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-zeus/data/class/GC_MobileUserAgent.php

    r11686 r15448  
    8989        $objAgent =& Net_UserAgent_Mobile::singleton(); 
    9090        if (Net_UserAgent_Mobile::isError($objAgent)) { 
     91            gfPrintLog("[isMobile:Error] " . $objAgent->getUserAgent()); 
     92            mb_send_mail(DB_ERROR_MAIL_TO, DB_ERROR_MAIL_SUBJECT, "[isMobile:Error] " . $objAgent->getUserAgent());             
    9193            return false; 
    9294        } else { 
    93             return $objAgent->isDoCoMo() || $objAgent->isEZweb() || $objAgent->isVodafone(); 
     95            if($objAgent->isDoCoMo()) { 
     96                gfPrintLog("[isMobile:Docomo] " . $objAgent->getUserAgent());             
     97                return true; 
     98            } elseif ($objAgent->isEZweb()) { 
     99                gfPrintLog("[isMobile:EZweb] " . $objAgent->getUserAgent());             
     100                return true; 
     101            } elseif ($objAgent->isVodafone()) { 
     102                gfPrintLog("[isMobile:Vodafone] " . $objAgent->getUserAgent());             
     103                return true; 
     104            } else { 
     105                gfPrintLog("[isMobile:UNKNOWN] " . $objAgent->getUserAgent()); 
     106                return false; 
     107            } 
    94108        } 
    95109    } 
     
    117131            return false; 
    118132        } 
    119  
     133         
    120134        if ($objAgent->isDoCoMo()) { 
    121135            $arrUnsupportedSeries = array('501i', '502i', '209i', '210i'); 
  • branches/feature-module-zeus/data/include/mobile.inc

    r15440 r15448  
    9999    } 
    100100 
    101     // ¥»¥Ã¥·¥ç¥óID¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ 
    102     if (preg_match('/^[0-9a-zA-Z,-]{32,}$/', $sessionId) < 1) { 
    103         gfPrintLog("Invalid session id : sid=$sessionId"); 
    104         return false; 
    105     } 
    106  
    107101    // ¥»¥Ã¥·¥ç¥óID¤Î¸ºß¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ 
    108102    if (sfSessRead($sessionId) === null) { 
     
    110104        return false; 
    111105    } 
    112  
     106     
    113107    return session_id($sessionId); 
    114108} 
     
    122116    // ÇÛÎó mobile ¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ 
    123117    if (!is_array(@$_SESSION['mobile'])) { 
    124         gfprintlog("ÇÛÎómobile¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¡£"); 
     118        gfprintlog("SESSIONüËö¾ðÊó¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£"); 
    125119        return false; 
    126120    } 
     
    160154    // ¥Ñ¥é¥á¡¼¥¿¡¼¤«¤éÍ­¸ú¤Ê¥»¥Ã¥·¥ç¥óID¤ò¼èÆÀ¤¹¤ë¡£ 
    161155    $sessionId = lfMobileGetSessionId(); 
    162  
     156     
    163157    session_start(); 
    164      
     158     
    165159    // ¿·µ¬¤Ë¥»¥Ã¥È¤µ¤ì¤ë¤¿¤álfMobileGetSessionId()¤«¤é¤ÎÌá¤ê¤Ï""¤È¤Ê¤ë¡£ 
    166     if($sessionId == "") { 
    167         gfprintlog("lfMobileInitSession()¡§¥»¥Ã¥·¥ç¥ó¥»¥Ã¥È -> OK"); 
    168     } else { 
    169         gfprintlog("lfMobileInitSession()¡§¥»¥Ã¥·¥ç¥ó¥»¥Ã¥È -> NG"); 
     160    if(!$sessionId == "") { 
     161        gfprintlog("lfMobileInitSession()¡§¥»¥Ã¥·¥ç¥ó¤¬Àµ¤·¤¯¥»¥Ã¥È¤µ¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£"); 
    170162        $session_ok = false;         
    171163    } 
    172164     
    173     if(lfMobileValidateSession()) { 
    174         gfprintlog("lfMobileInitSession()¡§Í­¸úÀ­¥Á¥§¥Ã¥¯ -> OK"); 
    175     } else { 
    176         gfprintlog("lfMobileInitSession()¡§Í­¸úÀ­¥Á¥§¥Ã¥¯ -> NG"); 
     165    if(!lfMobileValidateSession()) { 
    177166        $session_ok = false; 
    178167    } 
    179     gfprintlog("lfMobileInitSession()¡§REQUEST_METHOD -> " . $_SERVER['REQUEST_METHOD']); 
    180     gfprintlog("lfMobileInitSession()¡§session_id() -> " . session_id()); 
    181     gfprintlog("lfMobileInitSession()¡§GET PHPSESSID ---> " . $_GET["PHPSESSID"]); 
    182168     
    183     // ¥»¥Ã¥·¥ç¥óID¤Þ¤¿¤Ï¥»¥Ã¥·¥ç¥ó¥Ç¡¼¥¿¤¬Ìµ¸ú¤Ê¾ì¹ç¤Ï¡¢¥»¥Ã¥·¥ç¥óID¤òºÆÀ¸À® 
    184     // ¤·¡¢¥»¥Ã¥·¥ç¥ó¥Ç¡¼¥¿¤ò½é´ü²½¤¹¤ë¡£ 
     169    // ¥»¥Ã¥·¥ç¥óID¤Þ¤¿¤Ï¥»¥Ã¥·¥ç¥ó¥Ç¡¼¥¿¤¬Ìµ¸ú¤Ê¾ì¹ç¤Ï¡¢¥»¥Ã¥·¥ç¥óID¤òºÆÀ¸À®¤·¡¢ 
     170    // ¥»¥Ã¥·¥ç¥ó¥Ç¡¼¥¿¤ò½é´ü²½¤¹¤ë¡£ 
    185171    if (!$session_ok) { 
    186172        session_regenerate_id(); 
    187         $_SESSION = array('mobile' => array('model'    => GC_MobileUserAgent::getModel(), 
    188                                             'phone_id' => GC_MobileUserAgent::getId(), 
    189                                             'expires'  => time() + MOBILE_SESSION_LIFETIME)); 
     173        $_SESSION['mobile']['model'] = GC_MobileUserAgent::getModel(); 
     174        $_SESSION['mobile']['phone_id'] = GC_MobileUserAgent::getModel(); 
     175        $_SESSION['mobile']['expires'] =  time() + MOBILE_SESSION_LIFETIME; 
    190176 
    191177        // ¿·¤·¤¤¥»¥Ã¥·¥ç¥óID¤òÉղ䷤ƥê¥À¥¤¥ì¥¯¥È¤¹¤ë¡£ 
    192         if ($_SERVER['REQUEST_METHOD'] == 'GET') { 
    193             gfprintlog("GETÍ×µá¤Î¼èÆÀ:".$_GET['PHPSESSID']); 
     178        if ($_GET['PHPSESSID'] != "") { 
     179            gfprintlog("GETÍ׵ᤢ¤ê:".$_GET['PHPSESSID']); 
    194180            gfprintlog("¥ê¥À¥¤¥ì¥¯¥È:".gfAddSessionId()); 
    195181            // GET ¤Î¾ì¹ç¤ÏƱ¤¸¥Ú¡¼¥¸¤Ë¥ê¥À¥¤¥ì¥¯¥È¤¹¤ë¡£ 
    196182            header('Location: ' . gfAddSessionId()); 
    197183        } else { 
    198             gfprintlog("GETÍ׵᤬¤Ê¤·"); 
     184            gfprintlog("GETÍ×µá¤Ê¤·"); 
    199185            // GET °Ê³°¤Î¾ì¹ç¤Ï¥È¥Ã¥×¥Ú¡¼¥¸¤Ø¥ê¥À¥¤¥ì¥¯¥È¤¹¤ë¡£ 
     186            /* 
     187                Äê¿ôSID¡§PHPSESSID=<¥»¥Ã¥·¥ç¥óID> 
     188             */ 
     189            gfprintlog("¥ê¥À¥¤¥ì¥¯¥È:".URL_SITE_TOP . '?' . SID); 
    200190            header('Location: ' . URL_SITE_TOP . '?' . SID); 
    201191        } 
    202192        exit; 
    203193    } 
    204  
    205     // ·ÈÂÓüËöID¤ò¼èÆÀ¤Ç¤­¤¿¾ì¹ç¤Ï¥»¥Ã¥·¥ç¥ó¥Ç¡¼¥¿¤ËÊݸ¤¹¤ë¡£ 
    206     $phoneId = GC_MobileUserAgent::getId(); 
    207     if ($phoneId !== false) { 
    208         $_SESSION['mobile']['phone_id'] = $phoneId; 
    209     } 
    210  
    211194    // ¥»¥Ã¥·¥ç¥ó¤ÎÍ­¸ú´ü¸Â¤ò¹¹¿·¤¹¤ë¡£ 
    212195    $_SESSION['mobile']['expires'] = time() + MOBILE_SESSION_LIFETIME; 
Note: See TracChangeset for help on using the changeset viewer.