[ トップ | 一覧 | 編集 | 差分 | 単語検索 | 最終更新 | ]
int BadAccess()
機能:ブラウザが正当かをチェックする 引き値:なし 戻値:USER_AGENT が正当であれば1、不正であれば0
/****************************************************************/ /* BadAccess */ /****************************************************************/ #if oldcode int BadAccess?() { if(strstr(zz_http_user_agent,"DreamPassport")) return 0; if(strstr(zz_http_user_agent,"DoCoMo")) return 0; if(strstr(zz_http_user_agent,"J-PHONE")) return 0; if(strstr(zz_http_user_agent,"ASTEL")) return 0; if(strstr(zz_http_user_agent,"[ja]")) return 0; if(strstr(zz_http_user_agent,"iCab")) return 0; /* MAC */ if(strstr(zz_http_user_agent,"iBOX")) return 0; /* MAC */ if(strstr(zz_http_user_agent,"WannaBe")) return 0; /* MAC */ if(strstr(zz_http_user_agent,"Macintosh; I;")) return 0; /* MAC */
if(strstr(zz_http_user_agent,"Mozilla/3.0N")) return 0; /* small? */ if(strstr(zz_http_user_agent,"CBBoard")) return 0; /* small? */ if(strstr(zz_http_user_agent,"PersonaWare")) return 0; /* small? */ if(strstr(zz_http_user_agent,"Sharp")) return 0; /* small? */
if(strstr(zz_http_user_agent,"95")) return 0; /* win95 */ if(strstr(zz_http_user_agent,"NT 4.0")) return 0; /* winNT */ if(strstr(zz_http_user_agent,"WinNT")) return 0; /* winNT */
if(!*zz_http_user_agent && !*zz_http_language) return 1; /* if(!*zz_http_user_agent) return 1;*/ #ifdef Katjusha_Beta_kisei if(strstr(zz_http_user_agent,"Katjusha")) return 1; #endif if(strstr(zz_http_user_agent,"WebFetch")) return 1; if(strstr(zz_http_user_agent,"origin")) return 1; if(strstr(zz_http_user_agent,"Nozilla")) return 1; if(strstr(zz_http_user_agent,"WWWD")) return 1;
/* if(!*zz_http_language) return 1;*/
return 0; } #else /* !oldcode */
int BadAccess?() {
char *agent_accept[] = { "DreamPassport", "DoCoMo", "J-PHONE", "ASTEL", "[ja]", "iCab", "iBOX", "WannaBe", "Macintosh; I;", "Mozilla/3.0N", "CBBoard", "PersonaWare", "Sharp", "95", "NT 4.0", "WinNT", };
char *agent_kick[] = { "WebFetch", "origin", "Nozilla", "WWWD", };
int i;
if(!*zz_http_user_agent && !*zz_http_language) { return 1; }
for (i=0; i<sizeof(agent_accept)/sizeof(char*); i++) { if (strstr(zz_http_user_agent, agent_accept[i])) { return 0; } }
for (i=0; i<sizeof(agent_kick)/sizeof(char*); i++) { if (strstr(zz_http_user_agent, agent_kick[i])) { return 1; } }
return 0; }
/* 改良版BadAccess kickのみ */ int BadAccess?() { char *agent_kick[] = { "WebFetch?", "origin", "Nozilla", "WWWD", }; int i; if(!*zz_http_user_agent && !*zz_http_language) return 1; for (i=0; i<sizeof(agent_kick)/sizeof(char*); i++) { if (strstr(zz_http_user_agent, agent_kick[i])) return 1; return 0; }
#endif /* !oldcode */
YukiWiki 1.6.2 Copyright (C) 2000,2001 by Hiroshi Yuki.
Modified by aki.