发新话题
打印

MDaemon 自定义登陆网页。

263shanghai

MDaemon 自定义登陆网页。

将下面的代码保存为一个HTM文件:





WorldClient Login JavaScript Plugin Script Read Me File






WorldClient Login JavaScript Plugin Script ReadMe File



This WorldClient Login JavaScript Plugin script is made available 'as is,'
it implies no warranties and in no way removes the responsiblity of
using such scripts from the administrator of the site using it.



That being said, this script is



  • Light weight

  • Cross Platform

  • Customizable

  • Intuitive

  • Should be showing up below this on the page



Features



The WorldClient Login JavaScript Plugin script allows you to add to any page a login to your WorldClient server.
It also allows the user, through the use of cookies to login with the click of a link after they have set the cookie.
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.


Set up


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.
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.





Script Setting Variables


wcURL - The URL to the WorldClient server and its DLL.


Example: 'http:\/\/localhost:3000/WorldClient.dll?View=Main'


Note Remember to escape the correct characters and to add the "?View=Main" to the URL or you will get errors.


WCDate - The number of days until the cookie should expire.
For example 30 would set the cookie for 30 days from the point of logging into the account.


WCpath - Setting the path limits the directories that the cookie will be accessible to on your web server.


WCdomain - The domain to which this cookie belongs, i.e. '.altn.com'


WCsecure - Set to true to require a secure connection



WorldClient Login Plug-in CSS variables



WCtableWidth - The Cascading Stylesheet setting for the width of the WorldClient table.

Examples: '120px','20%' or '5cm'


WCFont - The name of the font that you wish to use in the login panel.

Example: 'tahoma'


WCborder - The CSS Border setting for the login panel.

Example: '2px dotted navy', '0px none' or '5px inset'


WCBannerColor - The color of the header that says 'WorldClient'.

Example:'gold'


WCBannerTextColor - The color of the text for the header that says 'WorldClient'.

Example:'black'





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

re:[FLY]好帖子2我就顶[/FLY]

好帖子2我就顶

re:唉!这不是官方提供的登录,我看过,感觉不...

唉!这不是官方提供的登录,我看过,感觉不好控制其样式
·只有敢于攀登顶峰的人,才能把顶峰踩在脚下。
·不怕失败,超越自我。
·在努力,再努力。
http://forum.maytide.net
http://forum.hamstc.org
http://mdaemon.maytide.net
http://goxia.maytide.net

re:有理

有理
我还是先学会基本的吧,,这些以后有机会再弄吧,谢谢楼主的无私共享呀
老大,现在我也正在做这个功能,就是我们这个邮件服务器有10几个公司用着了,我想每个公司一登陆他们的油箱,就出现我给他们做的那个页面(当然不同的公司有不同的页面),所以我想你把你做的那个功能能说具体点吗????让我参考参考

TOP

谢谢了,我试试

TOP

看不懂啊,能具体点吗?我很想要的,谢了!!!1

TOP

发新话题
  清除 Cookies - 联系我们 - 邮件技术资讯网 - Archiver - WAP - 繁體中文
当前时区 GMT+8, 现在时间是 2008-9-8 18:04

本论坛为非盈利中立机构,论坛所有言论纯属发表者个人意见,与《 邮件技术资讯网》论坛立场无关。内容所涉及的版权和法律相关事宜请参考各自所有者的条款。
如果认定侵犯了您的权利,请联系我们尽快处理。本论坛原创内容请联系本站后再行转载并务必保留我站信息。此声明修改不再另行通知,本论坛保留最终解释权。
*本论坛QQ群:1#群2233231(已满) 2#群2598254(推荐) 3#群15974064(推荐) 4#群14173252(推荐)*
* 建议使用 1024×768 模式查看本论坛 *
Powered by Discuz! 6.1.0