HI all
I am using NPM v9.0 SP2. I was lokking for some intresting things we can do with the new website of NPM. I was able to use the Login Text feature of the website to announce any change or plan outage to all the web users of NPM irrespective of the view restrictions.
I have added a small syntax in the HTML coding of the masterpage and now the users who log in to NPM will have a scrolling message just above their menu bar which the administrator can use as an announcement. This message is independent of the page they are visiting. So the same message which you can set on the Login Page will now keep on scrolling on all the pages.
Nice thing where you need to make an announcement to all the users and ensure they do not miss it. ;-)
Now i am looking ahead to somehow get the last login details of a web account just below the logout button. Can someone help me in getting the same done.
I have added the below syntax to my \InetPub\SolarWinds\Orion\MasterPage.master (only the syntax in BOLD)
<body runat="server" ID="Body"> <div id="container"> <div id="content"> <asp:ContentPlaceHolder runat="server" ID="pageHeaderPlaceholder"> <table id="pageHeader" width="100%" cellpadding="0" cellspacing="0"> <tr> <td align="left"> <img src="<%= SolarWinds.Orion.Web.DAL.WebSettingsDAL.SiteLogo %>" alt="Site Logo"/> </td> <td id="userName"> <asp:LoginView ID="LoginView1" runat="server"> <AnonymousTemplate /> <LoggedInTemplate> <span class="content"> <%=GetUsername()%> (<a href="/Orion/Logout.aspx">log out</a>) </span> </LoggedInTemplate> </asp:LoginView> </td> </tr>
</table> </asp:ContentPlaceHolder> <orion:EvalBanner runat="server" /> <asp:ContentPlaceHolder ID="menuBarPlaceholder" runat="server"> <orion:menubar ID="Menubar1" runat="server" /> </asp:ContentPlaceHolder><marquee id="SiteLoginText"><%=SolarWinds.Orion.Web.DAL.WebSettingsDAL.SiteLoginText %></marquee> <form runat="server" method="post" action="#" id="aspnetForm"> <asp:contentplaceholder id="ContentPlaceHolder1" runat="server"> </asp:contentplaceholder> </form> <asp:ContentPlaceHolder ID="outsideFormPlaceHolder" runat="server"></asp:ContentPlaceHolder>
<div runat="server" id="toolsetObject" style='position:absolute; left:0; visibility:hidden; height:0; width: 0'> <object classid='clsid:26700CD9-6157-4B72-B46F-EC93C952F19C' id='SWTool' name='SWTool' codebase='/SWToolset.exe#ver=7,6,0,86' style="height:0;width:0;"></object> </div> </div>
<asp:ContentPlaceHolder runat="server" ID="footerPlaceholder"> <div id="footer"><%=SolarWinds.NPM.Common.RegistrySettings.GetVersionDisplayString()%> © 1995-2008 All Rights Reserved</div> </asp:ContentPlaceHolder> </div></body>
This can come in handy. Thanks for posting.
One thing I would like to do is add an "If" statement that only displays the marquee if there is text in the SiteLoginText field, otherwise this consumes some space at the top of the page even if there is no message to relay. I could easily do this with classic ASP, but unfortunately I don't yet know enough about ASP.NET to do it myself.
Anyone wanna take a stab at it? :)
<%if (!string.IsNullOrEmpty(SolarWinds.Orion.Web.DAL.WebSettingsDAL.SiteLoginText)) { %> <marquee id="SiteLoginText"><%=SolarWinds.Orion.Web.DAL.WebSettingsDAL.SiteLoginText%></marquee> <% } %>
Well, POO!!! I had everything but the "!string"...
Thanks Tim. :)
Hi Tim
thanks for that update
can you help in in getting the last login details of a web account just below the logout button.
regards
Rajiv
This code will give you the date and time of the last login:
<%=Profile.LastLogin %>
Cool... So how about something like this:
<span class="content"> <%=GetUsername()%> (<a href="/Orion/Logout.aspx">log out</a>) <br> Logged in Since: <%=Profile.LastLogin %> </span>
Tim, you're the man... :)
Thanks Tim
It worked just the way i wanted it to .