認証なしのゲストアクセスキャプティブポータル
42165
Created On 09/25/18 17:39 PM - Last Modified 06/14/23 07:16 AM
Resolution
この記事に添付されている "ゲストアクセス" 環境で使用するために変更キャプティブポータルコンフォートページの例です。 ここでの目的は、ユーザーがボタンをクリックするように強制することで、ネットワーク/インターネットへのアクセスを許可される前に、使用条件を確認します。 このポータルで使用するには、この記事で説明していない "ゲスト" ユーザーを1人作成する必要があります。
添付のページは、"ビルトイン" キャプティブポータルコンフォートページと同じです。 私はちょうどユーザーによって認証なしでキャプティブポータルを動作させるために必要な javascript を追加しました。 あなたは、あなたの "Guest" ユーザーに表示したい HTML/テキストをちょうど加える必要があるでしょう。
新しいキャプティブポータルのコンフォートページを使用するには、次の操作を行います。
1.) [デバイス] タブに移動し、左側の [応答ページ] をクリックします。
2.) 「キャプティブポータルコンフォートページ」をクリックしてください。
3) [インポート] ボタンをクリックして、編集したファイルを選択し、場所 (共有または VSYS) を選択し、[ok] をクリックします。
4.) 設定をコミットします。
添付ファイルの内容:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><META http-equiv="PRAGMA" content="NO-CACHE"><meta name="viewport" content="initial-scale=1.0"><title>ユーザー識別ポータル</title><style> html, body{ height: 99%; } body { color: #111; font-family: Verdana,Arial,Helvetica,sans-serif; background-color:#d2d6dA; vertical-align: middle; } #activearea { border-width: 2px; border-color: #c2c6cA; border-style: solid; border-radius: 15px; background-color: #ffffff; padding: 20px; max-width: 400px; margin-left: auto; margin-right: auto; } #heading { font-size: 1.1em; font-weight: bold; max-width: 400px; margin-left: auto; margin-right: auto; text-align: center; } #desc { font-size: 1em; margin: 15px; max-width: 400px; text-align: left; margin-left: auto; margin-right: auto; } form td span { font-size: 1em; font-weight: bold; } #formtable { height: 100%; width: 100%; } #taLogin { width: 250px; margin-left: auto; margin-right: auto; } .buttonFixed { font-size: 1em; } .msg { background-color: #ffff99; border-width: 2px; border-color: #ff0000; border-style: solid; border-radius: 5px; margin-top: 0.5em; padding: 0.5em; max-height: 150px; height: expression( this.scrollHeight > 150 ? "150px" : "auto" ); /* sets max-height for IE */ overflow: auto; font-size: 1em; }</style></head><!-- Changed LoadPage function to myLoadPage function for onload --><body onload="myLoadPage();"><table id="formtable"><tr><td>ユーザー識別ポータル<x 81=""><div id="desc">アクセスしようとしているリソースには、アクセス前に適切なユーザー id が必要です。</div></td></tr></table></body></html> 資格情報を入力してください。
<!-- This function hides the "pan_form", provides a new submit button and populates the username, password, escapeUser, and submit values used by the backend to process the form -->
<script>
function myLoadPage() {
//get the login form object
var my_form = document.getElementById("login_form");
//get the username form object
var my_user = document.getElementsByName("user")[0];
//populate the username form object with the configured "guest" user
my_user.setAttribute("value", "guestuser");
//get the password form object
var my_pass = document.getElementsByName("passwd")[0];
//populate the password object with the configured "guest" password
my_pass.setAttribute("value", "guestpass");
//get the escapeUser form object
var escape_user = document.getElementsByName("escapeUser")[0];
//populate the escapeUser object with the configured "guest" user
escape_user.setAttribute("value", "guestuser");
//remove the existing submit button from the DOM
document.getElementById("submit").remove();
//add a new custom button to the DOM with our own text on it
my_form.insertAdjacentHTML('beforeend', '<button class="buttonFixed" type="submit" id="submit" name="ok" onclick="submitClicked()" value="Login">Accept and Continue</button>');
//get the entire "original" login form object
var hide_form = document.getElementById("taLogin");
//hide the "original" login form object
//we need it to POST but not be visible
hide_form.style.visibility = "hidden";
hide_form.style.position = "absolute";
}
</script>
<pan_form>
</pan_form>