F5SAMScript

From Swivel Knowledgebase
Jump to: navigation, search

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<title>%{session.server.network.name}</title>
<link rel="stylesheet" type="text/css" HREF="/public/include/css/main.css">
<script language="javascript">
<!--
/**
 * Place the focus and init the form fields
 */


var doNotAutoSubmit = false;

function maierrar() {
return true;
}
window.onerror=maierrar;

function OnLoad() {
  var form = document.forms[0];

	if(form == null)return;
	
	if (form.username != null && form.username.value.length=="" && form.username.type == "text" && form.username.style.display!="none"){
		form.username.focus();	
	}else{ 
		if (form.password != null) form.password.focus();	
	}
}

// support for autologon from Client API
function CheckExternal_AddCheckbox(checkbox_row_id,checkbox_txt) 
{
	var form = document.forms[0];
	if(form == null) return;
	
	try { 
		if(window.external)
		{  

			if(window.external.WebLogonUserName && form.username && form.username.value == "")
				form.username.value = window.external.WebLogonUserName;
			if(window.external.WebLogonPassword && form.password && form.password.value == "")
				form.password.value = window.external.WebLogonPassword;
			if(window.external.WebLogonSavePasswordAvailable)
        		{
        			if(window.document.all[checkbox_row_id])
        			{  
		 			var element = document.createElement("td");
   					element.innerHTML = '<img src="/public/images/my/tr.gif" width="16" height="1" alt="" border="0">';
					window.document.all[checkbox_row_id].appendChild(element);
        			element = document.createElement("td");
		        	str = '<input type=checkbox class=lp_input" name="save_pswd_checkbox" ';
    			    if(window.external.WebLogonSavePasswordChecked) str+= ' CHECKED ';
		           	str+='><span class=o>'+checkbox_txt+'</span>';
        		    element.innerHTML =  str;
					window.document.all[checkbox_row_id].appendChild(element);
				}
			}
			if(window.external.WebLogonAutoLogon && !doNotAutoSubmit)
			{
				doAutoSubmit = true;
      				form.submit();
      				return;
	    		}
		}
    } catch (e) { }    
}

function disableForm(theform) {
    if (document.all || document.getElementById) {
        for (i = 0; i < theform.length; i++) {
            var tempobj = theform.elements[i];
            if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
            tempobj.disabled = true;
        }
    }
    return true;
}

function OnSubmit() {
  var form = document.forms[0];
  if(form == null) {
    return;
  }
  try
  {
  	if(window.external)
  	{
  		if(undefined != window.external.WebLogonUserName && form.username)
				window.external.WebLogonUserName = form.username.value;
		if(undefined != window.external.WebLogonPassword)
			if(form.newpassword && form.newpassword.value != "")//substitute password in case of renew password form
				window.external.WebLogonPassword = form.newpassword.value ;
			else if(form.password)
				window.external.WebLogonPassword = form.password.value ;
		if(undefined != window.external.WebLogonSavePasswordChecked && form.save_pswd_checkbox)
			window.external.WebLogonSavePasswordChecked = form.save_pswd_checkbox.checked;
	}
  }catch(e) {};
  return false;
}

//-->
</script>
</head>

<body onload="OnLoad()">

<script>
	if(self != top) {
		top.location = self.location;
	}
</script>


<? customize_page("header", "header.inc"); ?>

<noscript>
<br>
<font color=red><b>
  JavaScript is not enabled. Please enable JavaScript in your browser or contact your system administrator for assistance. </b></font>
<br><br> 
  To open a new session, please <a href="/">click here</a>
</noscript>

<table class="main_table">
	<tr valign="top">
		<td>

<FORM name="e1" method="post" action="/my.policy" onsubmit="javascript:OnSubmit(); javascript:disableForm(this); return true;">
	<table BORDER="0" CELLPADDING="0" CELLSPACING="0" width="100%">


	<!-- logon form begin -->	
	<tr valign=top>
	    <td width=12><img src="/public/images/my/tr.gif" width="12" height="1" alt="" border="0"></td>
	    <td width=163 ><img src="/public/images/my/tr.gif" width="1" height="35" alt="" border="0" ><br>
	
	<table cellspacing="0" cellpadding="3" border="0" width=163  bgcolor="#EEEEEE">
	<tr >
	  <td bgcolor="#738495" colspan=2 align="left" valign="middle" height="23" class=whitebold>
	  <font color="#FFFFFF"> <? print('Secure Access Logon <br> for F5 Networks'); ?></font>
	  </td>
	</tr>
	</table>
	<table cellspacing="0" cellpadding="0" border="0" width=163  bgcolor="#EEEEEE">
	<tr valign=top>
	    <td><img src="/public/images/my/tr.gif" width="1" height="14" alt="" border="0"></td>
	    <td><img src="/public/images/my/tr.gif" width="1" height="1" alt="" border="0"></td>
	</tr>
	<tr valign=top>
        <td colspan=2 valign=top align=center>
<?
if ($retry == 1) {
    print('<font color=red> Username or Password does not match. Please try again. </font>');
} elseif ($retry == 2) {
    print("%{session.logon.page.username.desc}");
}
?>
<input type=hidden name="rsa_port" value=''>
<input type=hidden name="vhost" value="standard">
        </td>
    </tr>

	<tr valign=top>
	    <td><img src="/public/images/my/tr.gif" width="16" height="1" alt="" border="0"></td>
            <td align=left><span style="display:%{session.logon.page.username.display}" class=o><? print('Username:'); ?></span><br></td>
	</tr>
	<tr valign=top>
	    <td><img src="/public/images/my/tr.gif" width="16" height="1" alt="" border="0"></td>
            <td align=left><input style="display:%{session.logon.page.username.display}" type=text  class=lp_input size="13" name="username"  value="" autocomplete="off"><br></td>
	</tr>
	<tr valign=top>
	    <td><img src="/public/images/my/tr.gif" width="16" height="1" alt="" border="0"></td>
            <td align=left><span style="display:%{session.logon.page.password.display}" class=o>
<?
if ($challenge == 1) {
    print("%{session.logon.page.password.desc}");
} else {
    print('Password:');
}
?>
</span><br></td>
	</tr>
	<tr valign=top>
	    <td><img src="/public/images/my/tr.gif" width="16" height="1" alt="" border="0"></td>
            <td align=left><input style="display:%{session.logon.page.password.display}" type=password  class=lp_input size="13" name="password" autocomplete="off" 
		onfocus="javascript:ShowTuring();"> 
            <br></td>
	</tr>
	
	<tr valign=top id="save_pswd_checkbox"></tr>
		<script><!--//
			CheckExternal_AddCheckbox('save_pswd_checkbox','Save Password');
	--></script>

	<tr valign=top>
	    <td><img src="/public/images/my/tr.gif" width="16" height="1" alt="" border="0"></td>
	    <td align=left><img src="/public/images/my/tr.gif" width="1" height="6" alt="" border="0"></td>
	</tr>
	<tr valign=top>
	    <td><img src="/public/images/my/tr.gif" width="16" height="1" alt="" border="0"></td>
	    <td align=right><input name=login type=submit class=o value='Logon'>       </td>
	</tr>
	<tr valign=top>
	    <td><img src="/public/images/my/tr.gif" width="1" height="6" alt="" border="0"></td>
	    <td align=left><img src="/public/images/my/tr.gif" width="1" height="6" alt="" border="0"></td>
	</tr>
	<tr valign=top>
<!-- ************************************************************ -->
		<td colspan="2" align=middle>
<!-- <img src="/public/images/my/tr.gif" width="1" height="15" alt="" border="0">-->
<input name="btnTuring" type="button" value=" New OTC Image " class="o" onclick="ShowTuring()" />
<!-- ************************************************************ -->
	    </td>
	</tr>
	</table>
	<img src="/public/images/my/tr.gif" width="1" height="31" alt="" border="0"><br>
	</td>
<!-- ************************************************************ -->
    <td nowrap style="vertical-align:middle">

<img name="imgTuring" id="imgTuring" style="visibility:hidden;"/>
<!-- ************************************************************ -->

<img src="/public/images/my/tr.gif" width="21" height="1" alt="" border="0"></td>
    <td  valign="top"  align="right"><br> </td><td></td>
    <td>  
  </td>
	</tr>
</table>
</form>

<!-- ************************************************************ -->
<script language="JavaScript">
<!--

//getElementById("uname") works in IE even though name=uname and ID is not specified. But not in Mozilla.
//eval("document.extraweb.uname") works in IE only.

//See if we're on the right 'page', ie. username field (username) is present...
var bExists = (document.getElementsByName("username") != null);

function ShowTuring() {

if (bExists) {
 sUser=document.getElementsByName("username")[0].value;

 if (sUser=="") {
  alert ("Please enter your username first!");
  document.getElementsByName("username")[0].focus()
 }else{
	document.cookie="user=" + escape(sUser);

        //The IP address below must be the IP of the PINsafe server. This is for v3.1 of Swivel PINsafe Server.
        sUrl="https://62.244.95.223:8080/pinsafe/SCImage?username=";
        //sUrl="https://62.244.95.223:443/public/advanced/images/Swivel_Conf_Test2/image02.gif?username=";
        //sUrl="https://10.100.1.131:8080/pinsafe/SCImage?username=";
                       //If you are using a PINsafe appliance, this url may need to reflect the use of the image proxy
    //        sUrl="https://192.168.0.150:8443/proxySCImage?username=";


  //Find the image using Mozilla compatible pproach...
  varImg = document.getElementById("imgTuring");

  //Set the image SRC and make it visible
  varImg.src = sUrl + sUser;
  varImg.style.visibility = "visible";

  //Alternative approach - show image in Popup
  //window.showModalDialog(sUrl + sUser,null,"dialogWidth=305px;dialogHeight=110px;status:no;scroll:no;help:no;")

  //Set focus to the OTC input
  document.getElementsByName("password")[0].focus()
 }
}
}
-->
</script>
<br />


<!-- ************************************************************ -->

		</td>
	</tr>
</table>
<? customize_page("footer", "footer.inc"); ?>

</body>
</html>