A A A Font Size

Pearls of MOSSy Wisdom

Site Actions Logout Feature

I was recently asked about adding a "Log out" button to the Site Actions menu.  As luck would have it, I had written a feature on it a good while back.  It's not all that complicated, but I figure that it can't hurt to share in case anyone out there wanted it and (most importantly) wanted it ready made.
 
I have posted the feature elements in my Downloads section.  Look for SiteActionsSignOut.zip.
 
Here's what you get:
 
Feature.xml: Nothing really special here except for the Description.  If you want it as something differnet, then feel free to change it. 
<?xml version="1.0" encoding="utf-8" ?>
<Feature
  Id="AA929AFF-4602-4d7f-A501-B80AC9A4BB52"
  Title="Site Actions Logout"
  Description="Adds a logout button to the Site Actions Menu"
  Scope="Site"
  xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="elements.xml" />
  </ElementManifests>
</Feature>
 
Elements.xml:  Here is there the details of the feature are set.  The GroupId puts the item on the Site Actions menu.  The Sequence makes it the bottom-most (well, the 2000th) item.  If you need it moved, play with this value.  RequireSiteAdministrator is important in that this means the item will only show up for Site Admins.  You may want to play with this.  But if you remove it, it will appear for everyone.  So for those of you with Anonymous Access setup, your Site Actions menu will appear for your anonymous users - but with only this item showing.  Finally, the UrlAction.  This is the link that's created.  I have included the SharePoint modified not to close the browser after loggin out.  Copy this file to the LAYOUTS folder if you'd prefer it.   
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
    Id="SignOutPage1"
    GroupId="SiteActions"
    Location="Microsoft.SharePoint.StandardMenu"
    Sequence="2000"
    Title="Sign Out"
    Rights="ManageWeb"
    RequireSiteAdministrator="True"
    Description="Logout of this site" >
    <UrlAction Url="~site/_layouts/signout.aspx"/>
  </CustomAction>
</Elements>
Signout.aspx:  This is the Microsoft signout.aspx page with the window.close() command commented out.  This logs you out, but doesn't close the browser.
You must sign in to rate content.
(Unrated)

Comments

Site Actions Logout Feature

Hello, I am new to customizing SP, so thanks for your patience. :) I would like to know if it is possible to imbed some type of timer with this logout feature. I need an easy way to have an automatic timeout/logout, and this seems like it may be a good starting point. Is is possible? Thanks, Jose
Jose Garcia at 11/11/2008 11:25 AM
You must sign in to rate content.
(Unrated)

Site Actions Logout Feature

Hello, I am new to customizing SP, so thanks for your patience. :) I would like to know if it is possible to imbed some type of timer with this logout feature. I need an easy way to have an automatic timeout/logout, and this seems like it may be a good starting point. Is is possible? Thanks, Jose
Jose Garcia at 11/11/2008 11:25 AM
You must sign in to rate content.
(Unrated)

Site Actions Logout Feature

Hello, I am new to customizing SP, so thanks for your patience. :) I would like to know if it is possible to imbed some type of timer with this logout feature. I need an easy way to have an automatic timeout/logout, and this seems like it may be a good starting point. Is is possible? Thanks, Jose
Jose Garcia at 11/11/2008 11:25 AM
You must sign in to rate content.
(Unrated)

Leave a Comment

You must be logged in to post a comment.
Superstar
Tim Dobrinski
Systems Analyst II
Birmingham, AL
Tim is currently not Twittering about updating his LinkedIn profile concerning FaceBooking his MySpace Page's Status.

Search This Blog

 

© 2012 SusQtech. All rights reserved.
Powered by SharePoint Server 2007 and using the MemberToMember SharePoint Add-On for social media capabilities.