标题: MDaemon 自定义登陆网页。 [打印本页] 作者: U-Mail 时间: 2004-12-25 00:28 标题: MDaemon 自定义登陆网页。 将下面的代码保存为一个HTM文件:<br>
<br>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br>
<br>
<html><br>
<head><br>
<title>WorldClient Login JavaScript Plugin Script Read Me File</title><br>
<STYLE><br>
body,p{font-family:tahoma,arial,helvetica,sans-serif;}<br>
code{font-family:courier;background-color:lightgrey;}<br>
</STYLE><br>
<br>
</head><br>
<br>
<body><br>
<h2><br>
WorldClient Login JavaScript Plugin Script ReadMe File<br>
</h2><br>
<p><br>
This WorldClient Login JavaScript Plugin script is made available 'as is,'<br>
it implies no warranties and in no way removes the responsiblity of <br>
using such scripts from the administrator of the site using it. <br>
</p><br>
<p><br>
That being said, this script is<br>
</p><br>
<ul><br>
<li>Light weight</li><br>
<li>Cross Platform</li><br>
<li>Customizable</li><br>
<li>Intuitive</li><br>
<li>Should be showing up below this on the page</li><br>
</ul><br>
<SCRIPT LANGUAGE="javascript" TYPE="text/javascript" SRC="WC_Login.js"></SCRIPT><br>
<h2>Features</h2><br>
<p><br>
The WorldClient Login JavaScript Plugin script allows you to add to any page a login to your WorldClient server. <br>
It also allows the user, through the use of cookies to login with the click of a link after they have set the cookie.<br>
If the user is concerned with cookies, a cookie is not necasary, or the cookie can be removed by clicking on the "Forget Me" link once the cookie has been set.<br>
</p><br>
<H2>Set up</H2><br>
<p>Setting up the plug-in and using it is as simple as opening up the WC_Login.js file with a text editor and changing a few simple variables. <br>
Once those variables have been set you will need to add the following line of code to any page that you wish to add the login panel to.<br>
</p><br>
<code><br>
<script language="javascript 1.2" type="text/javascript" src="[path/]WC_Login.js"></script><br>
</code><br>
<H3>Script Setting Variables</H3><br>
<p><b>wcURL</b> - The URL to the WorldClient server and its DLL. <br>
<BR><br>
<I>Example:</I> <code>'http:\/\/localhost:3000/WorldClient.dll?View=Main'</code><br>
<BR><br>
<i><B>Note</B></i> Remember to escape the correct characters and to add the "?View=Main" to the URL or you will get errors.<br>
<p><br>
<B>WCDate</B> - The number of days until the cookie should expire.<br>
For example <code>30</code> would set the cookie for 30 days from the point of logging into the account.<br>
</p><br>
<p><B>WCpath</B> - Setting the path limits the directories that the cookie will be accessible to on your web server.</p><br>
<p><B>WCdomain</B> - The domain to which this cookie belongs, i.e. <code>'.altn.com'</code></p><br>
<p><B>WCsecure</B> - Set to <code>true</code> to require a secure connection</p><br>
<br>
<h3>WorldClient Login Plug-in CSS variables</h3><br>
<br>
<p><B>WCtableWidth</B> - The Cascading Stylesheet setting for the width of the WorldClient table. <br>
<br><i>Examples:</i> <code>'120px','20%' or '5cm'</code></p><br>
<p><B>WCFont</B> - The name of the font that you wish to use in the login panel. <br>
<BR><I>Example:</I> <code>'tahoma'</code></p><br>
<p><B>WCborder</B> - The CSS Border setting for the login panel.<br>
<BR><I>Example:</I> <code>'2px dotted navy'</code>, <code>'0px none'</code> or <code>'5px inset'</code></p><br>
<p><B>WCBannerColor</B> - The color of the header that says 'WorldClient'.<br>
<BR><I>Example:</I><code>'gold'</code></p><br>
<p><B>WCBannerTextColor</B> - The color of the text for the header that says 'WorldClient'.<br>
<BR><I>Example:</I><code>'black'</code></p><br>
</p><br>
</body><br>
</html><br> 作者: U-Mail 时间: 2004-12-25 00:29 标题: re:将下面代码保存为:WC_Login.js... 将下面代码保存为:WC_Login.js
LOGIN VARIABLES */
var wcURL = 'http:\/\/localhost:3000/WorldClient.dll?View=Main';// URL to your WorldClient application
var WCDate = 30;// Number of days until expiry
var WCpath;// Setting the path limits the directories that the cookie will be accessible to
var WCdomain;// The domain to which this cookie belongs, i.e. '.altn.com'
var WCsecure;// Set to 'true' to require a secure connection
// WORLDCLIENT LOGIN CSS ATTRIBUTES
var WCtableWidth = '120px';
var WCFont = 'tahoma';
var WCborder = '2px dashed navy';
var WCBannerColor = 'gold';
var WCBannerTextColor = 'black';
function WCLogin(formObj){if(formObj.setCookie.checked){WCsetCookie('myWCUserName',formObj.User.value);WCsetCookie('myWCPassword',formObj.Password.value);}if(formObj.goToMailbox.checked){formObj.submit();}else{document.location.href=document.location.href;}}
function WCgetCookie(str){var WCCookie = document.cookie.split("; ");for (var i=0; i < WCCookie.length; i++){var wcCookie = WCCookie.split("=");if (str == wcCookie[0]){return (wcCookie[1]);}}return null;}
function WCsetCookie(strKey, strVal){var WCexpiry = new Date();WCexpiry.setTime(WCexpiry.getTime()+(60*1000*60*24*WCDate));document.cookie=strKey+"="+strVal +";expires="+WCexpiry.toGMTString()+((WCpath)?";path="+WCpath:"")+((WCdomain)?";domain="+WCdomain:"")+((WCsecure)?";secure":"");}
function WCRmCookie(){WCsetCookie('myWCUserName','');WCsetCookie('myWCPassword','');document.location.href=document.location.href;}
var WCUser = WCgetCookie("myWCUserName");var WCPass = WCgetCookie("myWCPassword");