Changeset 15448
- Timestamp:
- 2007/08/30 11:41:40 (16 years ago)
- Location:
- branches/feature-module-zeus/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-zeus/data/class/GC_MobileUserAgent.php
r11686 r15448 89 89 $objAgent =& Net_UserAgent_Mobile::singleton(); 90 90 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()); 91 93 return false; 92 94 } 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 } 94 108 } 95 109 } … … 117 131 return false; 118 132 } 119 133 120 134 if ($objAgent->isDoCoMo()) { 121 135 $arrUnsupportedSeries = array('501i', '502i', '209i', '210i'); -
branches/feature-module-zeus/data/include/mobile.inc
r15440 r15448 99 99 } 100 100 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 107 101 // ¥»¥Ã¥·¥ç¥óID¤Î¸ºß¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ 108 102 if (sfSessRead($sessionId) === null) { … … 110 104 return false; 111 105 } 112 106 113 107 return session_id($sessionId); 114 108 } … … 122 116 // ÇÛÎó mobile ¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£ 123 117 if (!is_array(@$_SESSION['mobile'])) { 124 gfprintlog(" ÇÛÎómobile¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¡£");118 gfprintlog("SESSIONüËö¾ðÊó¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£"); 125 119 return false; 126 120 } … … 160 154 // ¥Ñ¥é¥á¡¼¥¿¡¼¤«¤é͸ú¤Ê¥»¥Ã¥·¥ç¥óID¤ò¼èÆÀ¤¹¤ë¡£ 161 155 $sessionId = lfMobileGetSessionId(); 162 156 163 157 session_start(); 164 158 165 159 // ¿·µ¬¤Ë¥»¥Ã¥È¤µ¤ì¤ë¤¿¤álfMobileGetSessionId()¤«¤é¤ÎÌá¤ê¤Ï""¤È¤Ê¤ë¡£ 166 if($sessionId == "") { 167 gfprintlog("lfMobileInitSession()¡§¥»¥Ã¥·¥ç¥ó¥»¥Ã¥È -> OK"); 168 } else { 169 gfprintlog("lfMobileInitSession()¡§¥»¥Ã¥·¥ç¥ó¥»¥Ã¥È -> NG"); 160 if(!$sessionId == "") { 161 gfprintlog("lfMobileInitSession()¡§¥»¥Ã¥·¥ç¥ó¤¬Àµ¤·¤¯¥»¥Ã¥È¤µ¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£"); 170 162 $session_ok = false; 171 163 } 172 164 173 if(lfMobileValidateSession()) { 174 gfprintlog("lfMobileInitSession()¡§Í¸úÀ¥Á¥§¥Ã¥¯ -> OK"); 175 } else { 176 gfprintlog("lfMobileInitSession()¡§Í¸úÀ¥Á¥§¥Ã¥¯ -> NG"); 165 if(!lfMobileValidateSession()) { 177 166 $session_ok = false; 178 167 } 179 gfprintlog("lfMobileInitSession()¡§REQUEST_METHOD -> " . $_SERVER['REQUEST_METHOD']);180 gfprintlog("lfMobileInitSession()¡§session_id() -> " . session_id());181 gfprintlog("lfMobileInitSession()¡§GET PHPSESSID ---> " . $_GET["PHPSESSID"]);182 168 183 // ¥»¥Ã¥·¥ç¥óID¤Þ¤¿¤Ï¥»¥Ã¥·¥ç¥ó¥Ç¡¼¥¿¤¬Ìµ¸ú¤Ê¾ì¹ç¤Ï¡¢¥»¥Ã¥·¥ç¥óID¤òºÆÀ¸À® 184 // ¤·¡¢¥»¥Ã¥·¥ç¥ó¥Ç¡¼¥¿¤ò½é´ü²½¤¹¤ë¡£169 // ¥»¥Ã¥·¥ç¥óID¤Þ¤¿¤Ï¥»¥Ã¥·¥ç¥ó¥Ç¡¼¥¿¤¬Ìµ¸ú¤Ê¾ì¹ç¤Ï¡¢¥»¥Ã¥·¥ç¥óID¤òºÆÀ¸À®¤·¡¢ 170 // ¥»¥Ã¥·¥ç¥ó¥Ç¡¼¥¿¤ò½é´ü²½¤¹¤ë¡£ 185 171 if (!$session_ok) { 186 172 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; 190 176 191 177 // ¿·¤·¤¤¥»¥Ã¥·¥ç¥óID¤òÉղ䷤ƥê¥À¥¤¥ì¥¯¥È¤¹¤ë¡£ 192 if ($_ SERVER['REQUEST_METHOD'] == 'GET') {193 gfprintlog("GETÍ׵ᤠμèÆÀ:".$_GET['PHPSESSID']);178 if ($_GET['PHPSESSID'] != "") { 179 gfprintlog("GETÍ׵ᤢ¤ê:".$_GET['PHPSESSID']); 194 180 gfprintlog("¥ê¥À¥¤¥ì¥¯¥È:".gfAddSessionId()); 195 181 // GET ¤Î¾ì¹ç¤ÏƱ¤¸¥Ú¡¼¥¸¤Ë¥ê¥À¥¤¥ì¥¯¥È¤¹¤ë¡£ 196 182 header('Location: ' . gfAddSessionId()); 197 183 } else { 198 gfprintlog("GETÍ׵ᤠ¬¤Ê¤·");184 gfprintlog("GETÍ×µá¤Ê¤·"); 199 185 // GET °Ê³°¤Î¾ì¹ç¤Ï¥È¥Ã¥×¥Ú¡¼¥¸¤Ø¥ê¥À¥¤¥ì¥¯¥È¤¹¤ë¡£ 186 /* 187 Äê¿ôSID¡§PHPSESSID=<¥»¥Ã¥·¥ç¥óID> 188 */ 189 gfprintlog("¥ê¥À¥¤¥ì¥¯¥È:".URL_SITE_TOP . '?' . SID); 200 190 header('Location: ' . URL_SITE_TOP . '?' . SID); 201 191 } 202 192 exit; 203 193 } 204 205 // ·ÈÂÓüËöID¤ò¼èÆÀ¤Ç¤¤¿¾ì¹ç¤Ï¥»¥Ã¥·¥ç¥ó¥Ç¡¼¥¿¤ËÊݸ¤¹¤ë¡£206 $phoneId = GC_MobileUserAgent::getId();207 if ($phoneId !== false) {208 $_SESSION['mobile']['phone_id'] = $phoneId;209 }210 211 194 // ¥»¥Ã¥·¥ç¥ó¤Î͸ú´ü¸Â¤ò¹¹¿·¤¹¤ë¡£ 212 195 $_SESSION['mobile']['expires'] = time() + MOBILE_SESSION_LIFETIME;
Note: See TracChangeset
for help on using the changeset viewer.