Implement logout in Moss

Source: Internet
Author: User

Some customers once thought that the cancellation of the SharePoint site was not friendly enough. They wanted to click it to log out. They checked out the cancellation of the SharePoint site in singout under _ layouts. the ASPX page is a short JavaScript code, as shown in the following figure. When you click logout, it will be transferred to this page:
Function _ spbodyonload ()
{
Try
{
Document.exe ccommand ("clearauthenticationcache ");
}
Catch (e ){}
Window. Close ();
}
I once saw a webpart written by a buddy on OTEC, which is actually a piece of JS. In fact, if I only want to implement this script, there is no need to create a webpart.

<Script language = "JavaScript" type = "text/JavaScript">
<! --
VaR onerror = stoperror;
Function stoperror ()
{
Return true;
}

If (navigator. appversion. indexof ("MSIE")> 0)
{
Try
{
VaR oelement = Document. getelementbyid ("idbuttonlogoff ");

Alert ('strike' + oelement. innerhtml );

// Oelement. style. Display = "Block ";
}
Catch (e ){}
}

Function logoff ()
{
Try
{
If (navigator. appversion. indexof ("MSIE 6.0")> 0)
{
Document.exe ccommand ("clearauthenticationcache", "false ");
Alert ('you have been logged off from this Web site. note that if you run Internet Explorer 6.0 without Service Pack 1 you need to close all browser windows in order to complete the log off process. ');
Self. Location. href = ".";
}
Else if (navigator. appversion. indexof ("MSIE 6.0")> 0 | navigator. appversion. indexof ("MSIE 5.0")> 0 | navigator. appversion. indexof ("MSIE 5.5")> 0 ))
{
Alert ('note that if you run Internet Explorer 5.x you need to close all browser windows in order to complete the log off process .');
}
Else
{
Alert ("this feature requires Internet Explorer 6.0 Service Pack 1 or above .");
}
}
Catch (E)
{
Alert ("this feature requires Internet Explorer 6.0 Service Pack 1 or above .");
}
}
// -->
</SCRIPT>

& nbsp;





if you are interested, study it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.