From a8b9755fa7014b4b4ae275b19ff8cec16c0bd635 Mon Sep 17 00:00:00 2001 From: watanaby <> Date: Wed, 23 May 2007 07:47:15 +0000 Subject: [PATCH] Ver.1.4.19: Modify control of favicon.ico. --- opengate/doc/Changes.html | 5 +++++ opengate/javahtml/en/accept-http.html | 2 ++ opengate/javahtml/en/accept-java.html | 2 ++ opengate/javahtml/en/accept-time.html | 2 ++ opengate/javahtml/en/accept2.html | 2 ++ opengate/javahtml/en/deny-ssl.html | 2 ++ opengate/javahtml/en/deny.html | 2 ++ opengate/javahtml/en/httpkeep.html | 6 +++--- opengate/javahtml/en/index-ssl.html | 4 +++- opengate/javahtml/en/index.html | 4 +++- opengate/javahtml/en/retry.html | 2 ++ opengate/javahtml/ja/accept-http.html | 2 ++ opengate/javahtml/ja/accept-java.html | 2 ++ opengate/javahtml/ja/accept-time.html | 2 ++ opengate/javahtml/ja/accept2.html | 2 ++ opengate/javahtml/ja/deny-ssl.html | 2 ++ opengate/javahtml/ja/deny.html | 2 ++ opengate/javahtml/ja/httpkeep.html | 6 +++--- opengate/javahtml/ja/index-ssl.html | 5 ++++- opengate/javahtml/ja/index.html | 4 +++- opengate/javahtml/ja/retry.html | 2 ++ opengate/opengatesrv/Makefile | 5 ++--- opengate/opengatesrv/comm-cgi.c | 17 ++++++++++++++--- opengate/opengatesrv/opengateauth.c | 17 ++++++++++++----- opengate/opengatesrv/opengatefwd.c | 6 ++++++ opengate/opengatesrv/watch-client.c | 30 ++++++++++++------------------ 26 files changed, 98 insertions(+), 39 deletions(-) diff --git a/opengate/doc/Changes.html b/opengate/doc/Changes.html index 17db906..d8cf1de 100644 --- a/opengate/doc/Changes.html +++ b/opengate/doc/Changes.html @@ -573,6 +573,11 @@ Ver.1.4.18 at 2007.4.23
Add favicon.ico installation.
+
+Ver.1.4.19 at 2007.5.23
+
+Modify control of favicon.ico. +
Please see CVS in SourceForge.net to check the file difference between versions. diff --git a/opengate/javahtml/en/accept-http.html b/opengate/javahtml/en/accept-http.html index e78518a..c5a3aef 100644 --- a/opengate/javahtml/en/accept-http.html +++ b/opengate/javahtml/en/accept-http.html @@ -1,5 +1,7 @@ + + Opengatemain diff --git a/opengate/javahtml/en/accept-java.html b/opengate/javahtml/en/accept-java.html index b8b917e..74be579 100644 --- a/opengate/javahtml/en/accept-java.html +++ b/opengate/javahtml/en/accept-java.html @@ -1,5 +1,7 @@ + + Opengatemain diff --git a/opengate/javahtml/en/accept-time.html b/opengate/javahtml/en/accept-time.html index 97be857..2887d5f 100644 --- a/opengate/javahtml/en/accept-time.html +++ b/opengate/javahtml/en/accept-time.html @@ -1,5 +1,7 @@ + + Opengatemain diff --git a/opengate/javahtml/en/accept2.html b/opengate/javahtml/en/accept2.html index bb5ec88..33d65b3 100644 --- a/opengate/javahtml/en/accept2.html +++ b/opengate/javahtml/en/accept2.html @@ -1,4 +1,6 @@ + + Opengatemain diff --git a/opengate/javahtml/en/deny-ssl.html b/opengate/javahtml/en/deny-ssl.html index 576b934..1e8bc9a 100644 --- a/opengate/javahtml/en/deny-ssl.html +++ b/opengate/javahtml/en/deny-ssl.html @@ -1,4 +1,6 @@ + + Opengatedeny diff --git a/opengate/javahtml/en/deny.html b/opengate/javahtml/en/deny.html index ec1e92c..60f669f 100644 --- a/opengate/javahtml/en/deny.html +++ b/opengate/javahtml/en/deny.html @@ -1,4 +1,6 @@ + + Opengatedeny diff --git a/opengate/javahtml/en/httpkeep.html b/opengate/javahtml/en/httpkeep.html index e2c539e..23c43ba 100644 --- a/opengate/javahtml/en/httpkeep.html +++ b/opengate/javahtml/en/httpkeep.html @@ -1,7 +1,7 @@ - - + + Http Keep-Alive @@ -61,7 +61,7 @@ permited in the browser setting). window.open("%%STARTURL%%","window1"); applet =' + + @@ -43,10 +45,10 @@ SEND.
+Please set the following value when the network is closed unexpectedly.
Required Usage Duration: minutes(range: 1-%%DURATIONMAX%% minutes). -Please set the value when the network is closed unexpectedly. If set, the network can be used for the duration. In this case, to avoid hijacking, click the TERMINATE link on the accept page at premature usage end. diff --git a/opengate/javahtml/en/index.html b/opengate/javahtml/en/index.html index f8264e8..4474f8f 100644 --- a/opengate/javahtml/en/index.html +++ b/opengate/javahtml/en/index.html @@ -1,4 +1,6 @@ + + @@ -44,10 +46,10 @@ Please use SSL Authentication as far as possible to prevent wiretapping.
+Please set the following value when the network is closed unexpectedly.
Required Usage Duration: minutes(range: 1-%%DURATIONMAX%% minutes). -Please set the value when the network is closed unexpectedly. If set, the network can be used for the duration. In this case, to avoid hijacking, click the TERMINATE link on the accept page at premature usage end. diff --git a/opengate/javahtml/en/retry.html b/opengate/javahtml/en/retry.html index 8d0c251..e6e430a 100644 --- a/opengate/javahtml/en/retry.html +++ b/opengate/javahtml/en/retry.html @@ -1,4 +1,6 @@ + + OpengateRetry diff --git a/opengate/javahtml/ja/accept-http.html b/opengate/javahtml/ja/accept-http.html index 85c069e..3aed31f 100644 --- a/opengate/javahtml/ja/accept-http.html +++ b/opengate/javahtml/ja/accept-http.html @@ -1,5 +1,7 @@ + + Opengatemain diff --git a/opengate/javahtml/ja/accept-java.html b/opengate/javahtml/ja/accept-java.html index e4c83df..e03e1be 100644 --- a/opengate/javahtml/ja/accept-java.html +++ b/opengate/javahtml/ja/accept-java.html @@ -1,5 +1,7 @@ + + Opengatemain diff --git a/opengate/javahtml/ja/accept-time.html b/opengate/javahtml/ja/accept-time.html index 8c8a868..f6e94a5 100644 --- a/opengate/javahtml/ja/accept-time.html +++ b/opengate/javahtml/ja/accept-time.html @@ -1,5 +1,7 @@ + + Opengatemain diff --git a/opengate/javahtml/ja/accept2.html b/opengate/javahtml/ja/accept2.html index bf4c526..52fe33c 100644 --- a/opengate/javahtml/ja/accept2.html +++ b/opengate/javahtml/ja/accept2.html @@ -1,4 +1,6 @@ + + Opengatemain diff --git a/opengate/javahtml/ja/deny-ssl.html b/opengate/javahtml/ja/deny-ssl.html index 090bd92..0aac6a2 100644 --- a/opengate/javahtml/ja/deny-ssl.html +++ b/opengate/javahtml/ja/deny-ssl.html @@ -1,4 +1,6 @@ + + Opengatedeny diff --git a/opengate/javahtml/ja/deny.html b/opengate/javahtml/ja/deny.html index 6cfb870..c82833a 100644 --- a/opengate/javahtml/ja/deny.html +++ b/opengate/javahtml/ja/deny.html @@ -1,4 +1,6 @@ + + Opengatedeny diff --git a/opengate/javahtml/ja/httpkeep.html b/opengate/javahtml/ja/httpkeep.html index c788610..953c87c 100644 --- a/opengate/javahtml/ja/httpkeep.html +++ b/opengate/javahtml/ja/httpkeep.html @@ -1,7 +1,7 @@ - - + + Http Keep-Alive @@ -60,7 +60,7 @@ target="_blank">[スタートページ] window.open("%%STARTURL%%","window1"); applet =' + + @@ -40,9 +42,10 @@
+以下は突然の切断が起こる場合に設定して下さい。
必要とする利用継続時間: 分(指定可能:1〜%%DURATIONMAX%%分)。 -この値は突然の切断が起こる場合に設定して下さい。 + この時間だけネットワークを開放します。この場合、不正利用を防ぐために、 指定した時間より前に利用を終るには、許可ページにある「利用中断」の リンクをクリックして下さい。 diff --git a/opengate/javahtml/ja/index.html b/opengate/javahtml/ja/index.html index eb602f6..1e4913a 100644 --- a/opengate/javahtml/ja/index.html +++ b/opengate/javahtml/ja/index.html @@ -1,5 +1,7 @@ + + @@ -42,9 +44,9 @@
+この値は突然の切断が起こる場合に設定して下さい。
必要とする利用継続時間: 分(指定可能:1〜%%DURATIONMAX%%分)。 -この値は突然の切断が起こる場合に設定して下さい。 この時間だけネットワークを開放します。この場合、不正利用を防ぐために、 指定した時間より前に利用を終るには、許可ページにある「利用中断」の リンクをクリックして下さい。 diff --git a/opengate/javahtml/ja/retry.html b/opengate/javahtml/ja/retry.html index 737ec6e..da27781 100644 --- a/opengate/javahtml/ja/retry.html +++ b/opengate/javahtml/ja/retry.html @@ -1,4 +1,6 @@ + + OpengateRetry diff --git a/opengate/opengatesrv/Makefile b/opengate/opengatesrv/Makefile index 6b68852..bc8fa3d 100644 --- a/opengate/opengatesrv/Makefile +++ b/opengate/opengatesrv/Makefile @@ -88,11 +88,10 @@ install-html: .endif mv ${INSTALLDOCPATH}/index.html.var ${DOCUMENTROOT}/index.html.var # - # Replace favicon.ico -.if exists(${DOCUMENTROOT}/favicon.ico) && !exists(${DOCUMENTROOT}/favicon.ico.original) + # Remove favicon.ico +.if exists(${DOCUMENTROOT}/favicon.ico) mv ${DOCUMENTROOT}/favicon.ico ${DOCUMENTROOT}/favicon.ico.original .endif - mv ${INSTALLDOCPATH}/favicon.ico ${DOCUMENTROOT}/favicon.ico # # Remove index.html .if exists(${DOCUMENTROOT}/index.html) && !exists(${DOCUMENTROOT}/index.html.original) diff --git a/opengate/opengatesrv/comm-cgi.c b/opengate/opengatesrv/comm-cgi.c index d9da97a..b1018d1 100644 --- a/opengate/opengatesrv/comm-cgi.c +++ b/opengate/opengatesrv/comm-cgi.c @@ -165,11 +165,13 @@ void putClientDeny(char *clientAddr4) char denydoc[BUFFMAXLN]; char authCgiUrl[BUFFMAXLN]; char encodeAddr[ADDRMAXLN]; + char opengateDir[BUFFMAXLN]; /* keyword pairs */ /* the left key is replaced by the right value */ struct html_key keys[]= { + {"%%OPENGATEDIR%%", opengateDir}, {"%%AUTHCGIURL%%", authCgiUrl}, {"%%ADDR4%%", encodeAddr}, {"",""} /* DON'T REMOVE THIS LINE */ @@ -182,6 +184,9 @@ void putClientDeny(char *clientAddr4) GetConfValue("OpengateDir"), GetConfValue("AuthCgi")); + /* create opengate dir */ + snprintf(opengateDir, BUFFMAXLN, GetConfValue("OpengateDir")); + /* create encoded addr4 */ if(AddrEncode(encodeAddr, clientAddr4)==1){ encodeAddr[0]='\0'; @@ -210,15 +215,20 @@ void putClientRetry(char *lang) char retrydoc[BUFFMAXLN]; char externalUrl[BUFFMAXLN]; char authCgiUrl[BUFFMAXLN]; + char opengateDir[BUFFMAXLN]; /* keyword pairs */ /* the left key is replaced by the right value */ struct html_key keys[]= { + {"%%OPENGATEDIR%%", opengateDir}, {"%%EXTERNALURL%%", externalUrl}, {"%%AUTHCGIURL%%", authCgiUrl}, {"",""} /* DON'T REMOVE THIS LINE */ }; + + /* create opengate Dir */ + snprintf(opengateDir, BUFFMAXLN, GetConfValue("OpengateDir")); /* create external URL string */ strncpy(externalUrl, GetConfValue("ExternalUrl"), BUFFMAXLN); @@ -227,12 +237,12 @@ void putClientRetry(char *lang) snprintf(authCgiUrl, BUFFMAXLN, "%s%s%s/%s", GetConfValue("OpengateServerName"), GetConfValue("CgiDir"), - GetConfValue("OpengateDir"), + opengateDir, GetConfValue("AuthCgi")); /* make read in path to the retry document */ snprintf(retrydoc, BUFFMAXLN, "%s%s/%s/%s",GetConfValue("DocumentRoot"), - GetConfValue("OpengateDir"),lang,GetConfValue("RetryDoc")); + opengateDir,lang,GetConfValue("RetryDoc")); /* replace keyword and send out the file */ printf("Content-type: text/html\r\n\r\n\r\n"); @@ -272,6 +282,7 @@ void putClientAccept(char *userid, char *sessionId, int port, int pid, char *cli char *startPageUrl=GetConfValue("StartPage/Url"); int startPageType=atoi(GetConfValue("StartPage/Type")); char *opengateDir=GetConfValue("OpengateDir"); + char *opengateServerName=GetConfValue("OpengateServerName"); /* select proper accept doc */ switch(toupper(*GetConfValue("WatchMode"))){ @@ -308,7 +319,6 @@ void putClientAccept(char *userid, char *sessionId, int port, int pid, char *cli /* if positive value is set in duration, TIME watch mode is selected */ if(durationEntered) acceptDoc=GetConfValue("AcceptDocTime"); - /* create path to acceptdoc */ snprintf(acceptdoc, BUFFMAXLN, "%s%s/%s/%s",GetConfValue("DocumentRoot"), GetConfValue("OpengateDir"),language,acceptDoc); @@ -351,6 +361,7 @@ void putClientAccept(char *userid, char *sessionId, int port, int pid, char *cli } /* replace mark */ + htmlReplace(buff, "%%OPENGATESERVERNAME%%", opengateServerName); htmlReplace(buff, "%%OPENGATEDIR%%", opengateDir); htmlReplace(buff, "%%OPENGATEPORT%%", portStr); htmlReplace(buff, "%%DURATION%%", durationStr); diff --git a/opengate/opengatesrv/opengateauth.c b/opengate/opengatesrv/opengateauth.c index 0170042..1518402 100644 --- a/opengate/opengatesrv/opengateauth.c +++ b/opengate/opengatesrv/opengateauth.c @@ -39,11 +39,15 @@ int main(int argc, char **argv) char authCgiUrl[BUFFMAXLN]; /* url of opengateauth.cgi */ char mainCgiUrl[BUFFMAXLN]; /* url of opengatesrv.cgi */ char durationMax[WORDMAXLN]; /* usage duration maximum */ + char opengateServerName[BUFFMAXLN]; /* opengate server domain name */ + char opengateDir[BUFFMAXLN]; /* opengate doc directory in httpd doc */ /* keyword pairs */ /* the left key is replaced by the right value */ struct html_key keys[]= { + {"%%OPENGATESERVERNAME%%", opengateServerName}, + {"%%OPENGATEDIR%%", opengateDir}, {"%%AUTHCGIURL%%", authCgiUrl}, {"%%CGIURL%%", mainCgiUrl}, {"%%ADDR4%%", clientAddr}, @@ -63,16 +67,19 @@ int main(int argc, char **argv) if(debug>1) err_msg("DEBUG: started"); + snprintf(opengateServerName,BUFFMAXLN,GetConfValue("OpengateServerName")); + snprintf(opengateDir,BUFFMAXLN,GetConfValue("OpengateDir")); + /* create URL string */ snprintf(authCgiUrl, BUFFMAXLN, "%s%s%s/%s", - GetConfValue("OpengateServerName"), + opengateServerName, GetConfValue("CgiDir"), - GetConfValue("OpengateDir"), + opengateDir, GetConfValue("AuthCgi")); snprintf(mainCgiUrl, BUFFMAXLN, "%s%s%s/%s", - GetConfValue("OpengateServerName"), + opengateServerName, GetConfValue("CgiDir"), - GetConfValue("OpengateDir"), + opengateDir, GetConfValue("MainCgi")); /* setup usage duration maximum and default (saved as seconds) */ @@ -119,7 +126,7 @@ int main(int argc, char **argv) /* construct html file path */ sprintf(htmlFile, "%s%s/%s/", GetConfValue("DocumentRoot"), - GetConfValue("OpengateDir"), lang); + opengateDir, lang); /* ssl or non-ssl file */ if(!isNull(getenv("SERVER_PORT")) diff --git a/opengate/opengatesrv/opengatefwd.c b/opengate/opengatesrv/opengatefwd.c index 2d0d9ab..9386e6d 100644 --- a/opengate/opengatesrv/opengatefwd.c +++ b/opengate/opengatesrv/opengatefwd.c @@ -69,6 +69,12 @@ int main(int argc, char **argv) if(debug>1) err_msg("DEBUG: started"); + /* favicon.ico request is ignored */ + if(strcmp(getenv("REQUEST_URI"), "/favicon.ico")==0){ + PutClientMsg(""); + return 0; + } + /* create authcgi URL string */ snprintf(authCgiUrl, BUFFMAXLN, "%s%s%s/%s", GetConfValue("OpengateServerName"), diff --git a/opengate/opengatesrv/watch-client.c b/opengate/opengatesrv/watch-client.c index d234fe2..668f2ca 100644 --- a/opengate/opengatesrv/watch-client.c +++ b/opengate/opengatesrv/watch-client.c @@ -872,7 +872,7 @@ void sendHttpKeepPage(char *userid, char *sessionId, char *language, int port) { char buff[BUFFMAXLN]; /* read in buffer */ FILE *fp; - char opengateServerName[BUFFMAXLN]; + char httpKeepDoc[BUFFMAXLN]; char httpHelloUrl[BUFFMAXLN]; char terminateUrl[BUFFMAXLN]; @@ -881,48 +881,42 @@ void sendHttpKeepPage(char *userid, char *sessionId, char *language, int port) char md5JsUrl[BUFFMAXLN]; char *startPageUrl=GetConfValue("StartPage/Url"); int startPageType=atoi(GetConfValue("StartPage/Type")); - char opengateDir[BUFFMAXLN]; char portStr[WORDMAXLN]; + char *opengateServerName=GetConfValue("OpengateServerName"); + char *opengateDir=GetConfValue("OpengateDir"); - /* create opengate server name string */ - snprintf(opengateServerName, BUFFMAXLN, - "%s",GetConfValue("OpengateServerName")); /* create path to accept2 doc */ snprintf(acceptDoc2Url, BUFFMAXLN, - "http://%s%s/%s/%s",GetConfValue("OpengateServerName"), - GetConfValue("OpengateDir"),language,GetConfValue("AcceptDoc2")); + "http://%s%s/%s/%s",opengateServerName, + opengateDir,language,GetConfValue("AcceptDoc2")); /* create terminate url [http://:/terminate-] */ snprintf(terminateUrl, BUFFMAXLN, "http://%s:%d/terminate-%d", - GetConfValue("OpengateServerName"), port, getpid()); + opengateServerName, port, getpid()); /* create httphello url [http://:/hello] */ snprintf(httpHelloUrl, BUFFMAXLN, "http://%s:%d/hello", - GetConfValue("OpengateServerName"), port); + opengateServerName, port); /* create httpkeep.js url[http:///opengate/httpkeep.js] */ snprintf(httpkeepJsUrl, BUFFMAXLN, "http://%s%s/%s", - GetConfValue("OpengateServerName"), - GetConfValue("OpengateDir"),GetConfValue("HttpKeepJS")); + opengateServerName, + opengateDir,GetConfValue("HttpKeepJS")); /* create md5.js url[http:///opengate/md5.js] */ snprintf(md5JsUrl, BUFFMAXLN, "http://%s%s/%s", - GetConfValue("OpengateServerName"), - GetConfValue("OpengateDir"),GetConfValue("Md5JS")); + opengateServerName, + opengateDir,GetConfValue("Md5JS")); /* create path to httpkeep doc */ snprintf(httpKeepDoc,BUFFMAXLN, "%s%s/%s/%s",GetConfValue("DocumentRoot"), - GetConfValue("OpengateDir"),language,GetConfValue("HttpKeepDoc")); + opengateDir,language,GetConfValue("HttpKeepDoc")); /* create port string */ snprintf(portStr, WORDMAXLN, "%d", port); - /* create absolute url to opengateDir[http:///opengate] */ - snprintf(opengateDir, BUFFMAXLN, "http://%s%s", - GetConfValue("OpengateServerName"), GetConfValue("OpengateDir")); - /* open httpkeepdoc */ if((fp=fopen(httpKeepDoc, "r"))==NULL){ err_msg("ERR at %s#%d: cannot open %s",__FILE__,__LINE__,httpKeepDoc); -- 2.11.0