3 function stemplala($fcontents,$arr)
5 foreach ($arr as $key => $value) {
6 $fcontents = str_replace($key,$value,$fcontents);
12 function langcheck(&$lang,$arrl = NULL)
17 /* se non specificato assegna il default */
19 $arrl = $G_main_langs;
21 /* cerca il valore della var $lang nell'array */
23 for ($i = 0 ; $i < $ct ; $i++) {
24 if ($lang == $arrl[$i]) {
32 if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
35 // break up string into pieces (languages and q factors)
36 preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse);
38 if (count($lang_parse[1])) {
39 // create a list like "en" => 0.8
40 $langs = array_combine($lang_parse[1], $lang_parse[4]);
42 // set default to 1 for any without q factor
43 foreach ($langs as $lang => $val) {
44 if ($val === '') $langs[$lang] = 1;
47 // sort list based on value
48 arsort($langs, SORT_NUMERIC);
50 foreach ($langs as $lang_cur => $val) {
51 for ($i = 0 ; $i < $ct ; $i++) {
52 if (strpos($lang_cur, $arrl[$i]) === 0) {
54 return(""); /* caso default */
56 return ("_".$arrl[$i]);
71 $lng = langcheck($lang, array("it", "en"));
73 $nazio = '<a href="index.php?lang=it"><img style="position: relative;" border=0 alt="next" src="/img/it.gif"></a> ';
74 $nazio .= '<a href="index.php?lang=en"><img style="position: relative;" border=0 alt="next" src="/img/uk.gif"></a>';
78 <script type="text/javascript"><!--
80 function $(id) { return document.getElementById(id); }
82 function createXMLHttpRequest() {
83 try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {}
84 try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {}
85 try { return new XMLHttpRequest(); } catch(e) {}
86 alert("XMLHttpRequest not supported");
90 function safestatus(a)
102 // console.log(xhr_rd.readyState);
104 if (xhr.readyState == 4) {
107 if ((ret = safestatus(xhr)) == 200) {
108 if (xhr.responseText == "CRGT_TRUE") {
109 document.location.assign("onlycrs/index.php?lang=#LANG#");
111 else if (xhr.responseText == "CRGT_RETRY") {
112 $(\'resp\').innerHTML = "#RESP_RETRY#";
114 else if (xhr.responseText == "CRGT_FALSE") {
115 $(\'resp\').innerHTML = "#RESP_FALSE#";
124 $(\'resp\').innerHTML = "#RESP_ERROR#";
130 window.onload = function() {
131 var xhr = createXMLHttpRequest();
134 xhr.open(\'GET\', \'onlycrs/gate.php\', true);
135 xhr.onreadystatechange = function() { xhr_cb(xhr); };
146 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
147 <link rel="stylesheet" type="text/css" href="threegates.css">
148 <link rel="stylesheet" type="text/css" href="room.css">
149 <title>#PAGE_TITLE#</title>
152 <body style="text-align: center;">
153 <div id="header" class="header">
154 <table width="100%" border="0" cols="3"><tr>
155 <td align="left"><div style="padding-left: 8px;"></div></td>
156 <td align="center"><div style="text-align: center;">
157 <h1>ThreeGates Example</h1>
159 <td align="right"><div style="padding-right: 8px;">
167 <div style="text-align: justify; width: 800px; margin: auto; padding: 4px; display: block;">#NAZIO#<br></div>
168 <div style="margin: auto; /* border: 1px solid red; */ width: 700px;">
169 <div style="border: 1px solid #bbbbbb; padding: 8px; text-align: center; background-color: #eeeeee;" id="resp"><br><br><b>Attendere prego ...</b><br><br><br></div>
174 $tmpl_page_tit = array ( 'it' => 'Brisk: auto-garanzia',
175 'en' => 'Brisk: self-guarantee' );
177 $tmpl_title = array ( 'it' => 'Procedura di auto-garanzia.',
178 'en' => 'Self-guarantee procedure.' );
180 $tmpl_hili = array ( 'it' => 'briscola chiamata in salsa ajax',
181 'en' => 'declaration briscola in ajax sauce' );
183 $resp_retry = array ( 'it' => 'La <b>lista dei certificati di revoca (CRL)</b> indicata nel suo certificato non era tra quelle monitorate dal server; è stata aggiunta ed entro qualche minuto verrà processata.<br><br><b>Riprovi più tardi.</b>',
184 'en' => 'The <b>certificate revocation list (CRL)</b> specified by your smartcard wasn\'t monitored by the server; it is added and will be processed within a few minutes.<br><br><b>Retry later.</b>' );
186 $resp_false = array ( 'it' => 'Spiacenti,<br><b>non siamo in possesso delle informazioni necessarie</b><br>alla verifica del suo certificato.<br><br>Se vuole segnalare il tipo di certificato che sta usando <a href=\'mailto:trustmaster@alternativeoutput.it\'><br><b>Contatti l\'amministratore</b></a>.',
187 'en' => 'Sorry,<br><b>we haven\'t the required information</b><br>to verify your certificate.<br>If you want to report your certificate\'s type <a href=\'mailto:trustmaster@alternativeoutput.it\'><br><b>please contact the administrator</b></a>.' );
189 $resp_error = array ( 'it' => 'Spiacenti, <b>non siamo in possesso delle informazioni necessarie alla verifica del suo certificato</b> o <br><b>è occorso un errore sul server</b>.<br><br>Se vuole segnalare il tipo di certificato che sta usando <a href=\'mailto:trustmaster@alternativeoutput.it\'><br><b>Contatti l\'amministratore</b></a>.<br>',
190 'en' => 'Sorry, <b>we haven\'t the information needed</b> to verify your certificate or<br> <b>an error occured on the server.<br><br>If you want to report your certificate\'s type <a href=\'mailto:trustmaster@alternativeoutput.it\'><br><b>please contact the administrator</b></a>.' );
193 '#PAGE_TITLE#' => $tmpl_page_tit[$lang],
194 '#HILI#' => $tmpl_hili[$lang],
195 '#TITLE#' => $tmpl_title[$lang],
198 '#RESP_RETRY#' => $resp_retry[$lang],
199 '#RESP_FALSE#' => $resp_false[$lang],
200 '#RESP_ERROR#' => $resp_error[$lang]
204 echo stemplala($tmpl_page, $page_vars);