diff options
Diffstat (limited to 'sca-cpp/trunk/modules')
26 files changed, 332 insertions, 107 deletions
diff --git a/sca-cpp/trunk/modules/http/Makefile.am b/sca-cpp/trunk/modules/http/Makefile.am index 4fd7cc0818..a504adcda5 100644 --- a/sca-cpp/trunk/modules/http/Makefile.am +++ b/sca-cpp/trunk/modules/http/Makefile.am @@ -20,7 +20,7 @@ INCLUDES = -I${HTTPD_INCLUDE} incl_HEADERS = *.hpp incldir = $(prefix)/include/modules/http -dist_mod_SCRIPTS = httpd-conf httpd-addr httpd-start httpd-stop httpd-restart ssl-ca-conf ssl-cert-conf ssl-cert-find httpd-ssl-conf basic-auth-conf cert-auth-conf form-auth-conf open-auth-conf passwd-auth-conf group-auth-conf proxy-conf proxy-base-conf proxy-ssl-conf proxy-balancer-conf proxy-member-conf proxy-ssl-member-conf proxy-ssl-nossl-member-conf vhost-conf vhost-ssl-conf tunnel-ssl-conf httpd-worker-conf httpd-event-conf httpd-loglevel-conf minify-html minify-js minify-css +dist_mod_SCRIPTS = httpd-conf httpd-addr httpd-start httpd-stop httpd-restart ssl-ca-conf ssl-cert-conf ssl-cert-find httpd-ssl-conf basic-auth-conf cert-auth-conf form-auth-conf open-auth-conf passwd-auth-conf group-auth-conf cache-conf cache-ssl-conf cache-manifest proxy-conf proxy-base-conf proxy-ssl-conf proxy-balancer-conf proxy-member-conf proxy-ssl-member-conf proxy-ssl-nossl-member-conf alt-host-conf mass-host-conf mass-host-ssl-conf httpd-tunnel-ssl-conf tunnel-ssl-conf httpd-worker-conf httpd-event-conf httpd-loglevel-conf minify-html minify-js minify-css moddir = $(prefix)/modules/http curl_test_SOURCES = curl-test.cpp diff --git a/sca-cpp/trunk/modules/http/alt-host-conf b/sca-cpp/trunk/modules/http/alt-host-conf new file mode 100755 index 0000000000..f6148173b4 --- /dev/null +++ b/sca-cpp/trunk/modules/http/alt-host-conf @@ -0,0 +1,32 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Generate an alternate host name configuration +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +mkdir -p $1 +root=`echo "import os; print os.path.realpath('$1')" | python` + +host=$2 + +cat >>$root/conf/hostcond.conf <<EOF +# Generated by: alt-host-conf $* +RewriteCond %{HTTP_HOST} !^$host [NC] + +EOF + diff --git a/sca-cpp/trunk/modules/http/cache-conf b/sca-cpp/trunk/modules/http/cache-conf new file mode 100755 index 0000000000..09ad5dc444 --- /dev/null +++ b/sca-cpp/trunk/modules/http/cache-conf @@ -0,0 +1,41 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Generate a minimal HTTPD cache configuration +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +mkdir -p $1 +root=`echo "import os; print os.path.realpath('$1')" | python` + +mkdir -p $root/cache + +cat >>$root/conf/vhost.conf <<EOF +# Generated by: cache-conf $* + +# Enable caching +CacheEnable disk / +CacheQuickHandler Off +CacheRoot $root/cache +CacheHeader On +#CacheDetailHeader On +CacheIgnoreQueryString On +CacheIgnoreCacheControl On +CacheIgnoreHeaders Set-Cookie + +EOF + diff --git a/sca-cpp/trunk/modules/http/cache-manifest b/sca-cpp/trunk/modules/http/cache-manifest new file mode 100755 index 0000000000..3752a61dde --- /dev/null +++ b/sca-cpp/trunk/modules/http/cache-manifest @@ -0,0 +1,26 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Generate a cache-manifest.cmf file from a template and the list +# of files in the cached application +root=$1 +shift +sha=`cat $* | shasum | awk '{ print $1 }'` +cat $root/cache-template.cmf | sed -e "s/SHA1/$sha/" >$root/cache-manifest.cmf + diff --git a/sca-cpp/trunk/modules/http/cache-ssl-conf b/sca-cpp/trunk/modules/http/cache-ssl-conf new file mode 100755 index 0000000000..7a902c37eb --- /dev/null +++ b/sca-cpp/trunk/modules/http/cache-ssl-conf @@ -0,0 +1,41 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Generate a minimal HTTPD cache configuration +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +mkdir -p $1 +root=`echo "import os; print os.path.realpath('$1')" | python` + +mkdir -p $root/cache + +cat >>$root/conf/vhost-ssl.conf <<EOF +# Generated by: cache-conf $* + +# Enable caching +CacheEnable disk / +CacheQuickHandler Off +CacheRoot $root/cache +CacheHeader On +#CacheDetailHeader On +CacheIgnoreQueryString On +CacheIgnoreCacheControl On +CacheIgnoreHeaders Set-Cookie + +EOF + diff --git a/sca-cpp/trunk/modules/http/htdocs/index.html b/sca-cpp/trunk/modules/http/htdocs/index.html index da71ab20fa..236864edfb 100644 --- a/sca-cpp/trunk/modules/http/htdocs/index.html +++ b/sca-cpp/trunk/modules/http/htdocs/index.html @@ -22,7 +22,7 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> <title>It works</title> </head> <body> diff --git a/sca-cpp/trunk/modules/http/htdocs/login/index.html b/sca-cpp/trunk/modules/http/htdocs/login/index.html index 3936730553..fd3bc21889 100644 --- a/sca-cpp/trunk/modules/http/htdocs/login/index.html +++ b/sca-cpp/trunk/modules/http/htdocs/login/index.html @@ -22,8 +22,8 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> -<script type="text/javascript" src="/all.js"></script> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> +<script type="text/javascript" src="/all-min.js"></script> <title>Sign in</title> </head> <body> diff --git a/sca-cpp/trunk/modules/http/htdocs/logout/index.html b/sca-cpp/trunk/modules/http/htdocs/logout/index.html index 66f2893a1f..218dd5d52c 100644 --- a/sca-cpp/trunk/modules/http/htdocs/logout/index.html +++ b/sca-cpp/trunk/modules/http/htdocs/logout/index.html @@ -23,8 +23,8 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> -<script type="text/javascript" src="/all.js"></script> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> +<script type="text/javascript" src="/all-min.js"></script> <title>Sign out</title> </head> <h1>Sign out</h1> diff --git a/sca-cpp/trunk/modules/http/httpd-conf b/sca-cpp/trunk/modules/http/httpd-conf index 54154e119e..730775fa89 100755 --- a/sca-cpp/trunk/modules/http/httpd-conf +++ b/sca-cpp/trunk/modules/http/httpd-conf @@ -22,8 +22,6 @@ here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $h mkdir -p $1 root=`echo "import os; print os.path.realpath('$1')" | python` -jsprefix=`echo "import os; print os.path.realpath('$here/../js')" | python` - host=$2 port=`$here/httpd-addr port $3` pport=`$here/httpd-addr pport $3` @@ -44,8 +42,10 @@ group=`id -gn` uname=`uname -s` if [ $uname = "Darwin" ]; then libsuffix=".dylib" + sendfile=Off else libsuffix=".so" + sendfile=On fi modules_prefix=`cat $here/httpd-modules.prefix` @@ -76,6 +76,8 @@ Timeout 45 RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500 LimitRequestBody 1048576 HostNameLookups Off +#MaxKeepAliveRequests 25 +#MaxConnectionsPerChild 100 # Log HTTP requests # [timestamp] [access] remote-host remote-ident remote-user "request-line" @@ -92,9 +94,13 @@ AddCharset utf-8 .html .js .css # Configure cache control <Directory /> ExpiresActive On -ExpiresDefault M604800 +ExpiresDefault A604800 +Header onsuccess merge Cache-Control public env=!private-cache </Directory> +# Enable Linux Kernel sendfile +EnableSendFile $sendfile + # Configure auth modules Include conf/auth.conf @@ -133,7 +139,7 @@ ServerName http://$host$pportsuffix <Location /> RewriteEngine on -RewriteCond %{HTTP_HOST} !^$host [NC] +Include conf/hostcond.conf RewriteCond %{HTTP:X-Forwarded-Server} ^$ [NC] RewriteCond %{REQUEST_URI} !^/server-status [NC] RewriteCond %{REQUEST_URI} !^/balancer-manager [NC] @@ -166,11 +172,16 @@ cat >$root/conf/mpm.conf <<EOF # Generated by: httpd-conf $* LoadModule mpm_prefork_module ${modules_prefix}/modules/mod_mpm_prefork.so +EOF + +if [ $uname = "Darwin" ]; then + cat >>$root/conf/mpm.conf <<EOF # Generated by: httpd-conf $* # Set thread stack size ThreadStackSize 2097152 EOF +fi # Generate modules list cat >$root/conf/modules.conf <<EOF @@ -181,6 +192,7 @@ cat >$root/conf/modules.conf <<EOF LoadModule headers_module ${modules_prefix}/modules/mod_headers.so LoadModule alias_module ${modules_prefix}/modules/mod_alias.so LoadModule authn_file_module ${modules_prefix}/modules/mod_authn_file.so +LoadModule authn_socache_module ${modules_prefix}/modules/mod_authn_socache.so LoadModule authn_core_module ${modules_prefix}/modules/mod_authn_core.so LoadModule authz_host_module ${modules_prefix}/modules/mod_authz_host.so LoadModule authz_groupfile_module ${modules_prefix}/modules/mod_authz_groupfile.so @@ -197,8 +209,9 @@ LoadModule proxy_connect_module ${modules_prefix}/modules/mod_proxy_connect.so LoadModule proxy_http_module ${modules_prefix}/modules/mod_proxy_http.so LoadModule proxy_balancer_module ${modules_prefix}/modules/mod_proxy_balancer.so LoadModule lbmethod_byrequests_module ${modules_prefix}/modules/mod_lbmethod_byrequests.so -LoadModule ssl_module ${modules_prefix}/modules/mod_ssl.so LoadModule socache_shmcb_module ${modules_prefix}/modules/mod_socache_shmcb.so +LoadModule cache_module ${modules_prefix}/modules/mod_cache.so +LoadModule cache_disk_module ${modules_prefix}/modules/mod_cache_disk.so LoadModule rewrite_module ${modules_prefix}/modules/mod_rewrite.so LoadModule mime_module ${modules_prefix}/modules/mod_mime.so LoadModule status_module ${modules_prefix}/modules/mod_status.so @@ -218,12 +231,10 @@ LoadModule actions_module ${modules_prefix}/modules/mod_actions.so LoadModule unixd_module ${modules_prefix}/modules/mod_unixd.so LoadModule session_module ${modules_prefix}/modules/mod_session.so LoadModule session_crypto_module ${modules_prefix}/modules/mod_session_crypto.so -LoadModule session_cookie_module ${modules_prefix}/modules/mod_session_cookie.so LoadModule slotmem_shm_module ${modules_prefix}/modules/mod_slotmem_shm.so LoadModule ratelimit_module ${modules_prefix}/modules/mod_ratelimit.so LoadModule reqtimeout_module ${modules_prefix}/modules/mod_reqtimeout.so - -LoadModule mod_tuscany_ssltunnel $here/libmod_tuscany_ssltunnel$libsuffix +LoadModule ssl_module ${modules_prefix}/modules/mod_ssl.so EOF @@ -303,7 +314,6 @@ cat >$root/conf/httpd.groups <<EOF # Generated by: httpd-conf $* EOF - # Allow public access to server resources cat >$root/conf/noauth.conf <<EOF # Generated by: httpd-conf $* @@ -331,7 +341,7 @@ UseCanonicalName Off # Enable HTTP reverse proxy ProxyRequests Off -ProxyPreserveHost Off +ProxyPreserveHost On ProxyStatus On # Enable server status @@ -356,3 +366,10 @@ Include conf/vhost.conf EOF +# Generate host name check condition +cat >$root/conf/hostcond.conf <<EOF +# Generated by: httpd-conf $* +RewriteCond %{HTTP_HOST} !^$host [NC] + +EOF + diff --git a/sca-cpp/trunk/modules/http/httpd.hpp b/sca-cpp/trunk/modules/http/httpd.hpp index 7147e8839c..6470d6c587 100644 --- a/sca-cpp/trunk/modules/http/httpd.hpp +++ b/sca-cpp/trunk/modules/http/httpd.hpp @@ -26,6 +26,7 @@ * HTTPD module implementation functions. */ +extern "C" { #include <apr_strings.h> #include <apr_fnmatch.h> #include <apr_lib.h> @@ -72,6 +73,7 @@ #include <ap_provider.h> #include <mod_auth.h> #include <mod_session.h> +} #include "string.hpp" #include "stream.hpp" @@ -154,6 +156,14 @@ const string hostName(request_rec* r, const string& def = "localhost") { } /** + * Convert a host name to a realm. + */ +const string realm(const string& host) { + const string pre = substr(host, 0, 4); + return pre == "www." || pre == "ww1." || pre == "ww2." || pre == "ww3."? substr(host, 4) : host; +} + +/** * Return the protocol scheme for a server. */ const string scheme(const server_rec* s, const string& def = "http") { @@ -410,6 +420,7 @@ const failable<int> writeResult(const failable<list<string> >& ls, const string& // Make sure browsers come back and check for updated dynamic content apr_table_set(r->headers_out, "Cache-Control", "must-revalidate, max-age=0"); apr_table_set(r->headers_out, "Expires", "Tue, 01 Jan 1980 00:00:00 GMT"); + apr_table_set(r->subprocess_env, "private-cache", "1"); // Compute and return an Etag for the returned content const string etag(ap_md5_binary(r->pool, (const unsigned char*)c_str(ob), (int)length(ob))); @@ -474,9 +485,9 @@ const bool redirectFilters(ap_filter_t* f, request_rec* from, request_rec* to) { * Create an HTTPD internal redirect request. * Similar to httpd/modules/http/http_request.c::internal_internal_redirect. */ -const failable<request_rec*, int> internalRedirectRequest(const string& nr_uri, request_rec* r) { +const failable<request_rec*> internalRedirectRequest(const string& nr_uri, request_rec* r) { if (ap_is_recursion_limit_exceeded(r)) - return mkfailure<request_rec*, int>(HTTP_INTERNAL_SERVER_ERROR); + return mkfailure<request_rec*>("Redirect recursion limit exceeded", HTTP_INTERNAL_SERVER_ERROR); // Create a new request request_rec* nr = (request_rec*)apr_pcalloc(r->pool, sizeof(request_rec)); @@ -532,7 +543,7 @@ const failable<request_rec*, int> internalRedirectRequest(const string& nr_uri, redirectFilters(nr->output_filters, r, nr); const int rrc = ap_run_post_read_request(nr); if (rrc != OK && rrc != DECLINED) - return mkfailure<request_rec*, int>(rrc); + return mkfailure<request_rec*>("Error handling internal redirect", rrc); return nr; } @@ -561,9 +572,9 @@ const int internalRedirect(request_rec* nr) { */ const int internalRedirect(const string& uri, request_rec* r) { debug(uri, "httpd::internalRedirect"); - const failable<request_rec*, int> nr = httpd::internalRedirectRequest(uri, r); + const failable<request_rec*> nr = httpd::internalRedirectRequest(uri, r); if (!hasContent(nr)) - return reason(nr); + return rcode(nr); return httpd::internalRedirect(content(nr)); } @@ -571,9 +582,9 @@ const int internalRedirect(const string& uri, request_rec* r) { * Create an HTTPD sub request. * Similar to httpd/server/request.c::make_sub_request */ -const failable<request_rec*, int> internalSubRequest(const string& nr_uri, request_rec* r) { +const failable<request_rec*> internalSubRequest(const string& nr_uri, request_rec* r) { if (ap_is_recursion_limit_exceeded(r)) - return mkfailure<request_rec*, int>(HTTP_INTERNAL_SERVER_ERROR); + return mkfailure<request_rec*>("Redirect recursion limit exceeded", HTTP_INTERNAL_SERVER_ERROR); // Create a new sub pool apr_pool_t *nrp; @@ -640,7 +651,8 @@ const int externalRedirect(const string& uri, request_rec* r) { debug(uri, "httpd::externalRedirect"); r->status = HTTP_MOVED_TEMPORARILY; apr_table_setn(r->headers_out, "Location", apr_pstrdup(r->pool, c_str(uri))); - apr_table_setn(r->headers_out, "Cache-Control", "no-cache"); + apr_table_setn(r->headers_out, "Cache-Control", "no-store"); + apr_table_addn(r->err_headers_out, "Cache-Control", "no-store"); r->filename = apr_pstrdup(r->pool, c_str(string("/redirect:/") + uri)); return HTTP_MOVED_TEMPORARILY; } @@ -705,7 +717,7 @@ int debugNote(unused void* r, const char* key, const char* value) { * Log a request. */ const bool debugRequest(request_rec* r, const string& msg) { - gc_scoped_pool(); + gc_scoped_pool pool; cdebug << msg << ":" << endl; cdebug << " unparsed uri: " << debugOptional(r->unparsed_uri) << endl; cdebug << " uri: " << debugOptional(r->uri) << endl; diff --git a/sca-cpp/trunk/modules/http/vhost-conf b/sca-cpp/trunk/modules/http/mass-host-conf index 6d977eb1d5..2da8f4f836 100755 --- a/sca-cpp/trunk/modules/http/vhost-conf +++ b/sca-cpp/trunk/modules/http/mass-host-conf @@ -37,7 +37,7 @@ mkdir -p $htdocs htdocs=`echo "import os; print os.path.realpath('$htdocs')" | python` cat >>$root/conf/httpd.conf <<EOF -# Generated by: vhost-conf $* +# Generated by: mass-host-conf $* # Enable mass dynamic virtual hosting NameVirtualHost $vhost @@ -52,7 +52,7 @@ Include conf/dvhost.conf # Configure authentication Include conf/noauth.conf -Include conf/auth.conf +Include conf/locauth.conf Include conf/pubauth.conf Include conf/adminauth.conf diff --git a/sca-cpp/trunk/modules/http/vhost-ssl-conf b/sca-cpp/trunk/modules/http/mass-host-ssl-conf index 915137b51f..68bd5b4606 100755 --- a/sca-cpp/trunk/modules/http/vhost-ssl-conf +++ b/sca-cpp/trunk/modules/http/mass-host-ssl-conf @@ -31,7 +31,7 @@ sslport=`$here/httpd-addr port $ssladdr` sslpport=`$here/httpd-addr pport $ssladdr` sslvhost=`$here/httpd-addr vhost $ssladdr` -vhostconf=`cat $root/conf/httpd.conf | grep "# Generated by: vhost-conf"` +vhostconf=`cat $root/conf/httpd.conf | grep "# Generated by: mass-host-conf"` vroot=`echo $vhostconf | awk '{ print $6 }'`; vroot=`echo "import os; print os.path.realpath('$vroot')" | python` vhtdocs=`echo $vhostconf | awk '{ print $7 }'` @@ -40,7 +40,7 @@ mkdir -p $htdocs htdocs=`echo "import os; print os.path.realpath('$htdocs')" | python` cat >>$root/conf/httpd.conf <<EOF -# Generated by: vhost-ssl-conf $* +# Generated by: mass-host-ssl-conf $* # Enable mass dynamic virtual hosting over HTTPS SSLStrictSNIVHostCheck Off @@ -57,9 +57,12 @@ Include conf/dvhost-ssl.conf # Configure authentication Include conf/noauth-ssl.conf -Include conf/auth-ssl.conf +Include conf/locauth-ssl.conf Include conf/pubauth-ssl.conf Include conf/adminauth-ssl.conf +# Configure tracking +Include conf/tracking-ssl.conf + </VirtualHost> diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.css b/sca-cpp/trunk/modules/js/htdocs/ui.css index 3dde10a2c0..ddc21b2095 100644 --- a/sca-cpp/trunk/modules/js/htdocs/ui.css +++ b/sca-cpp/trunk/modules/js/htdocs/ui.css @@ -34,7 +34,7 @@ visibility: hidden; } .fixed { -position: absolute; +position: fixed; } .devicewidth { @@ -175,13 +175,95 @@ overflow: hidden; .viewheadbackground { position: absolute; left: 0px; top: 35px; height: 35px; line-height: 35px; width: 2500px; z-index: 7; -font-size: 110%; font-weight: bold; background-color: #f1f1f1; color: #000000; +background-color: #f1f1f1; border-top: 1px; border-bottom: 1px; border-left: 0px; border-right: 0px; border-style: solid; border-top-color: #e5e5e5; border-bottom-color: #e5e5e5; overflow: hidden; -webkit-backface-visibility: hidden; } +.viewfoot { +position: absolute; left: 0px; bottom: 0px; height: 25px; line-height: 25px; width: 100%; z-index: 8; +font-size: 12px; background-color: #ffffff; color: #404040; +border-top: 1px; border-bottom: 1px; border-left: 0px; border-right: 0px; +border-style: solid; border-top-color: #e5e5e5; border-bottom-color: #ffffff; +overflow: hidden; +-webkit-backface-visibility: hidden; +} + +.status { +position: absolute; left: 0px; bottom: 0px; height: 35px; line-height: 35px; width: 100%; z-index: 9; +font-size: 12px; background-color: #ffffff; color: #404040; +border-top: 0px; border-bottom: 0px; border-left: 0px; border-right: 0px; +border-style: solid; border-top-color: #e5e5e5; border-bottom-color: #ffffff; +overflow: hidden; +-webkit-transform: translate(0px, 0px); +-moz-transform: translate(0px, 0px); +-ms-transform: translate(0px, 0px); +-o-transform: translate(0px, 0px); +transform: translate(0px, 0px); +-webkit-backface-visibility: hidden; +} + +.statusout3 { +position: absolute; left: 0px; bottom: 0px; height: 35px; line-height: 35px; width: 100%; z-index: 9; +font-size: 12px; background-color: #ffffff; color: #404040; +border-top: 0px; border-bottom: 0px; border-left: 0px; border-right: 0px; +border-style: solid; border-top-color: #e5e5e5; border-bottom-color: #ffffff; +overflow: hidden; +-webkit-transition: -webkit-transform 0.4s ease-in-out 3s; +-moz-transition: -moz-transform 0.4s ease-in-out 3s; +-ms-transition: -ms-transform 0.4s ease-in-out 3s; +-o-transition: -o-transform 0.4s ease-in-out 3s; +transition: transform 0.4s ease-in-out 3s; +-webkit-transform: translate(0px, 35px); +-moz-transform: translate(0px, 35px); +-ms-transform: translate(0px, 35px); +-o-transform: translate(0px, 35px); +transform: translate(0px, 35px); +-webkit-backface-visibility: hidden; +} + +.statusout1 { +position: absolute; left: 0px; bottom: 0px; height: 35px; line-height: 35px; width: 100%; z-index: 9; +font-size: 12px; background-color: #ffffff; color: #404040; +border-top: 0px; border-bottom: 0px; border-left: 0px; border-right: 0px; +border-style: solid; border-top-color: #e5e5e5; border-bottom-color: #ffffff; +overflow: hidden; +-webkit-transition: -webkit-transform 0.4s ease-in-out 1s; +-moz-transition: -moz-transform 0.4s ease-in-out 1s; +-ms-transition: -ms-transform 0.4s ease-in-out 1s; +-o-transition: -o-transform 0.4s ease-in-out 1s; +transition: transform 0.4s ease-in-out 1s; +-webkit-transform: translate(0px, 35px); +-moz-transform: translate(0px, 35px); +-ms-transform: translate(0px, 35px); +-o-transform: translate(0px, 35px); +transform: translate(0px, 35px); +-webkit-backface-visibility: hidden; +} + +.okstatus { +font-size: 110%; font-weight: bold; padding-left: 6px; padding-right: 6px; white-space: nowrap; text-decoration: none; +background-color: #f1f1f1; color: #000000; +width: 100%; margin-left: auto; margin-right: auto; text-align: center; float: right; +} + +.errorstatus { +font-size: 110%; font-weight: bold; padding-left: 6px; padding-right: 6px; white-space: nowrap; text-decoration: none; +background-color: #d14836; color: #ffffff; +width: 100%; margin-left: auto; margin-right: auto; text-align: center; float: right; +} + +.viewfootbackground { +position: absolute; left: 0px; bottom: 0px; height: 25px; line-height: 25px; width: 2500px; z-index: 7; +background-color: #ffffff; +border-top: 1px; border-bottom: 1px; border-left: 0px; border-right: 0px; +border-style: solid; border-top-color: #e5e5e5; border-bottom-color: #ffffff; +overflow: hidden; +-webkit-backface-visibility: hidden; +} + .viewcontent { position: absolute; left: 0px; top: 38px; width: 100%; -webkit-backface-visibility: hidden; diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.js b/sca-cpp/trunk/modules/js/htdocs/ui.js index f200321ccd..fb53598390 100644 --- a/sca-cpp/trunk/modules/js/htdocs/ui.js +++ b/sca-cpp/trunk/modules/js/htdocs/ui.js @@ -178,28 +178,6 @@ ui.isMobile = function() { }; /** - * Convert a host name to a home page title. - */ -ui.hometitle = function(host) { - if (!isNil(window.top.config.hometitle)) - return window.top.config.hometitle; - var h = reverse(host.split('.')); - var d = isNil(cdr(h))? car(h) : cadr(h); - return d.substr(0, 1).toUpperCase() + d.substr(1); -}; - -/** - * Convert a host name to a window title. - */ -ui.windowtitle = function(host) { - if (!isNil(window.top.config.windowtitle)) - return window.top.config.windowtitle; - var h = reverse(host.split('.')); - var d = isNil(cdr(h))? car(h) : cadr(h); - return d.substr(0, 1).toUpperCase() + d.substr(1); -}; - -/** * Convert a CSS position to a numeric position. */ ui.numpos = function(p) { @@ -264,62 +242,75 @@ ui.navigate = function(url, win) { //log('navigate', url, win); // Open a new window - if (win == '_blank') - return window.top.open(url, win); + if (win == '_blank') { + window.top.open(url, win); + return false; + } // Open a new document in the current window - if (win == '_self') - return window.top.open(url, win); + if (win == '_self') { + window.top.open(url, win); + return false; + } // Reload the current window if (win == '_reload') { window.top.location = url; - return window.top.location.reload(); + window.top.location.reload(); + return false; } // Let the current top window handle the navigation if (win == '_view') { if (!window.top.onnavigate) return window.top.open(url, '_self'); - return window.top.onnavigate(url); + window.top.onnavigate(url); + return false; } - return window.top.open(url, win); + window.top.open(url, win); + return false; } /** * Build a portable <a href> tag. */ -ui.ahref = function(loc, target, html) { +ui.href = function(id, loc, target, html) { if (target == '_blank') - return '<a href="' + loc + '" target="_blank">' + html + '</a>'; - return '<a href="javascript:void(0)" onclick="ui.navigate(\'' + loc + '\', \'' + target + '\');">' + html + '</a>'; + return '<a id="' + id + '" href="' + loc + '" target="_blank">' + html + '</a>'; + return '<a id="' + id + '" href="' + loc + '" onclick="return ui.navigate(\'' + loc + '\', \'' + target + '\');">' + html + '</a>'; }; /** * Build a menu bar. */ -ui.menu = function(name, href, target, hilight) { +ui.menu = function(id, name, href, target, hilight) { function Menu() { this.content = function() { - if (hilight) - return ui.ahref(href, target, '<span class="tbarsmenu">' + name + '</span>'); - return ui.ahref(href, target, '<span class="tbaramenu">' + name + '</span>'); + if (hilight == true) + return ui.href(id, href, target, '<span class="tbarsmenu">' + name + '</span>'); + else if (hilight == false) + return ui.href(id, href, target, '<span class="tbaramenu">' + name + '</span>'); + else + return ui.href(id, href, target, '<span class="' + hilight + '">' + name + '</span>'); }; } return new Menu(); }; -ui.menufunc = function(name, fun, hilight) { +ui.menufunc = function(id, name, fun, hilight) { function Menu() { this.content = function() { - function href(fun, html) { - return '<a href="javascript:void(0)" onclick="' + fun + '">' + html + '</a>'; + function href(id, fun, html) { + return '<a id="' + id + '" href="/" onclick="' + fun + '">' + html + '</a>'; } - if (hilight) - return href(fun, '<span class="tbarsmenu">' + name + '</span>'); - return href(fun, '<span class="tbaramenu">' + name + '</span>'); + if (hilight == true) + return href(id, fun, '<span class="tbarsmenu">' + name + '</span>'); + else if (hilight == false) + return href(id, fun, '<span class="tbaramenu">' + name + '</span>'); + else + return href(id, fun, '<span class="' + hilight + '">' + name + '</span>'); }; } return new Menu(); diff --git a/sca-cpp/trunk/modules/js/js-conf b/sca-cpp/trunk/modules/js/js-conf index 09289a1899..aa29920619 100755 --- a/sca-cpp/trunk/modules/js/js-conf +++ b/sca-cpp/trunk/modules/js/js-conf @@ -25,47 +25,27 @@ root=`echo "import os; print os.path.realpath('$1')" | python` cat >>$root/conf/httpd.conf <<EOF # Generated by: js-conf $* # Serve JavaScript scripts and CSS -Alias /ui.css $here/htdocs/ui.css Alias /ui-min.css $here/htdocs/ui-min.css -Alias /all.js $here/htdocs/all.js Alias /all-min.js $here/htdocs/all-min.js -Alias /proxy/ui.css $here/htdocs/ui.css Alias /proxy/ui-min.css $here/htdocs/ui-min.css -Alias /proxy/all.js $here/htdocs/all.js Alias /proxy/all-min.js $here/htdocs/all-min.js EOF cat >>$root/conf/pubauth.conf <<EOF # Generated by: js-conf $* -<Location /ui.css> -AuthType None -Require all granted -</Location> <Location /ui-min.css> AuthType None Require all granted </Location> -<Location /all.js> -AuthType None -Require all granted -</Location> <Location /all-min.js> AuthType None Require all granted </Location> -<Location /proxy/ui.css> -AuthType None -Require all granted -</Location> <Location /proxy/ui-min.css> AuthType None Require all granted </Location> -<Location /proxy/all.js> -AuthType None -Require all granted -</Location> <Location /proxy/all-min.js> AuthType None Require all granted diff --git a/sca-cpp/trunk/modules/oauth/htdocs/index.html b/sca-cpp/trunk/modules/oauth/htdocs/index.html index 8fe4935a4e..006aade244 100644 --- a/sca-cpp/trunk/modules/oauth/htdocs/index.html +++ b/sca-cpp/trunk/modules/oauth/htdocs/index.html @@ -22,9 +22,9 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> -<script type="text/javascript" src="/all.js"></script> +<script type="text/javascript" src="/all-min.js"></script> <script type="text/javascript"> var protected = sca.component("Protected"); var userInfo = sca.defun(sca.reference(protected, "userInfo"), "getuser", "getemail", "getnickname", "getfullname", "getfirstname", "getlastname", "getrealm"); diff --git a/sca-cpp/trunk/modules/oauth/htdocs/login/index.html b/sca-cpp/trunk/modules/oauth/htdocs/login/index.html index 02439154e7..0740afd8b3 100644 --- a/sca-cpp/trunk/modules/oauth/htdocs/login/index.html +++ b/sca-cpp/trunk/modules/oauth/htdocs/login/index.html @@ -22,7 +22,7 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> <title>Sign in</title> </head> <body> diff --git a/sca-cpp/trunk/modules/oauth/htdocs/login/mixed.html b/sca-cpp/trunk/modules/oauth/htdocs/login/mixed.html index 50d70f04e4..fdf2b64a3f 100644 --- a/sca-cpp/trunk/modules/oauth/htdocs/login/mixed.html +++ b/sca-cpp/trunk/modules/oauth/htdocs/login/mixed.html @@ -22,7 +22,7 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> <title>Sign in</title> </head> <body> diff --git a/sca-cpp/trunk/modules/oauth/htdocs/logout/index.html b/sca-cpp/trunk/modules/oauth/htdocs/logout/index.html index a9d2e628d7..8cf786043b 100644 --- a/sca-cpp/trunk/modules/oauth/htdocs/logout/index.html +++ b/sca-cpp/trunk/modules/oauth/htdocs/logout/index.html @@ -22,7 +22,7 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> <title>Sign out</title> </head> <body> diff --git a/sca-cpp/trunk/modules/oauth/htdocs/public/index.html b/sca-cpp/trunk/modules/oauth/htdocs/public/index.html index af567246f3..24db147a0b 100644 --- a/sca-cpp/trunk/modules/oauth/htdocs/public/index.html +++ b/sca-cpp/trunk/modules/oauth/htdocs/public/index.html @@ -22,7 +22,7 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> <title>Unprotected area</title> </head> <body> diff --git a/sca-cpp/trunk/modules/openid/htdocs/index.html b/sca-cpp/trunk/modules/openid/htdocs/index.html index 760320feb1..e5b1618e3c 100644 --- a/sca-cpp/trunk/modules/openid/htdocs/index.html +++ b/sca-cpp/trunk/modules/openid/htdocs/index.html @@ -22,8 +22,8 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> -<script type="text/javascript" src="/all.js"></script> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> +<script type="text/javascript" src="/all-min.js"></script> <script type="text/javascript"> var protected = sca.component("Protected"); diff --git a/sca-cpp/trunk/modules/openid/htdocs/login/index.html b/sca-cpp/trunk/modules/openid/htdocs/login/index.html index 47fbb73204..00b0bfd038 100644 --- a/sca-cpp/trunk/modules/openid/htdocs/login/index.html +++ b/sca-cpp/trunk/modules/openid/htdocs/login/index.html @@ -22,7 +22,7 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> <title>Sign in</title> </head> <body> diff --git a/sca-cpp/trunk/modules/openid/htdocs/logout/index.html b/sca-cpp/trunk/modules/openid/htdocs/logout/index.html index a9d2e628d7..8cf786043b 100644 --- a/sca-cpp/trunk/modules/openid/htdocs/logout/index.html +++ b/sca-cpp/trunk/modules/openid/htdocs/logout/index.html @@ -22,7 +22,7 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> <title>Sign out</title> </head> <body> diff --git a/sca-cpp/trunk/modules/openid/htdocs/public/index.html b/sca-cpp/trunk/modules/openid/htdocs/public/index.html index af567246f3..24db147a0b 100644 --- a/sca-cpp/trunk/modules/openid/htdocs/public/index.html +++ b/sca-cpp/trunk/modules/openid/htdocs/public/index.html @@ -22,7 +22,7 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> <title>Unprotected area</title> </head> <body> diff --git a/sca-cpp/trunk/modules/server/htdocs/index.html b/sca-cpp/trunk/modules/server/htdocs/index.html index da71ab20fa..236864edfb 100644 --- a/sca-cpp/trunk/modules/server/htdocs/index.html +++ b/sca-cpp/trunk/modules/server/htdocs/index.html @@ -22,7 +22,7 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> <title>It works</title> </head> <body> diff --git a/sca-cpp/trunk/modules/wsgi/htdocs/index.html b/sca-cpp/trunk/modules/wsgi/htdocs/index.html index 5449f4ef89..cc7237b3f6 100644 --- a/sca-cpp/trunk/modules/wsgi/htdocs/index.html +++ b/sca-cpp/trunk/modules/wsgi/htdocs/index.html @@ -21,7 +21,7 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> -<link rel="stylesheet" type="text/css" href="/ui.css"/> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> <title>It works</title> </head> <body> |