邮件服务器-邮件系统-邮件技术论坛(BBS)

标题: 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

/*WorldClient Login JScript Plug-in
Copyright 2002 Alt-n Technologies, LLC.

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");

var WCoutput = '[table][tr]'+
'[/tr][/table][table][tr]' +
'[td]WorldClient[/td][/tr]';
if(WCUser==null && WCPass==null){WCoutput += '[tr][td]Email Address[/td][/tr][tr][td][/td][/tr][tr][td]Password[/td][/tr][tr][td][/td][/tr][tr]' +
'[td]Remember Me[/td][/tr][tr][td]Go To Mailbox[/td][/tr][tr]' +
'[td][/td][/tr][/table]';
}else{WCoutput += '[tr][td]Go To Mailbox[/td][/tr][tr]' +
'[td]Forget Me[/td][/tr][/table]';}
document.write(WCoutput);
作者: midking    时间: 2004-12-25 08:11
标题: re:[FLY]好帖子2我就顶[/FLY]
<MARQUEE>好帖子2我就顶</MARQUEE>
作者: goxia    时间: 2004-12-25 08:48
标题: re:唉!这不是官方提供的登录,我看过,感觉不...
唉!这不是官方提供的登录,我看过,感觉不好控制其样式
作者: andycuong    时间: 2006-2-10 10:30
标题: re:有理
有理
作者: vincentlee    时间: 2007-2-2 17:44
我还是先学会基本的吧,,这些以后有机会再弄吧,谢谢楼主的无私共享呀
作者: yhb123846    时间: 2007-8-1 16:26
老大,现在我也正在做这个功能,就是我们这个邮件服务器有10几个公司用着了,我想每个公司一登陆他们的油箱,就出现我给他们做的那个页面(当然不同的公司有不同的页面),所以我想你把你做的那个功能能说具体点吗????让我参考参考
作者: heieye104    时间: 2007-8-9 17:08
谢谢了,我试试
作者: wyzzx    时间: 2007-8-15 22:17
标题: 看不懂啊,能具体点吗?我很想要的,谢了!!!1





欢迎光临 邮件服务器-邮件系统-邮件技术论坛(BBS) (http://bbs.5dmail.cn/) Powered by Discuz! X3.2