in More Search Options

Getting Account user information on webpage

Last post 10-14-2008 7:12 by rajivbahl. 7 replies.
Page 1 of 1 (8 items)
Sort Posts:
  • 09-21-2008 1:41

    • rajivbahl
    • Top 100 Contributor
    • Joined on 05-15-2008
    • India
    • Posts 74
    • Points 375

    Getting Account user information on webpage

    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>

     

    Rajiv Bahl
    NPM SLX 9.1
    HS Poller
    Additional Poller 1 SLX
    • Post Points: 3
  • 10-10-2008 2:01 PM In reply to

    • vhcato
    • Top 25 Contributor
    • Joined on 01-07-2005
    • Atlanta, GA
    • Posts 378
    • Points 1,938

    Re: Getting Account user information on webpage

    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? :)

    Vic Cato
    Technical Lead - Network Operations
    Koch Business Solutions - Enterprise Technical Services
    • Post Points: 3
  • 10-10-2008 4:39 PM In reply to

    • tdanner
    • Top 10 Contributor
    • Joined on 06-19-2007
    • Posts 557
    • Points 1,415
    • SolarWinds Employee

    Re: Getting Account user information on webpage

                 <%if (!string.IsNullOrEmpty(SolarWinds.Orion.Web.DAL.WebSettingsDAL.SiteLoginText)) { %>
                    <marquee id="SiteLoginText"><%=SolarWinds.Orion.Web.DAL.WebSettingsDAL.SiteLoginText%></marquee>
                <% } %>

    Tim Danner
    SolarWinds Development Team
    • Post Points: 5
  • 10-10-2008 5:35 PM In reply to

    • vhcato
    • Top 25 Contributor
    • Joined on 01-07-2005
    • Atlanta, GA
    • Posts 378
    • Points 1,938

    Re: Getting Account user information on webpage

    Well, POO!!! I had everything but the "!string"...

    Thanks Tim. :)

    Vic Cato
    Technical Lead - Network Operations
    Koch Business Solutions - Enterprise Technical Services
    • Post Points: 1
  • 10-11-2008 6:38 In reply to

    • rajivbahl
    • Top 100 Contributor
    • Joined on 05-15-2008
    • India
    • Posts 74
    • Points 375

    Re: Getting Account user information on webpage

    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

    Rajiv Bahl
    NPM SLX 9.1
    HS Poller
    Additional Poller 1 SLX
    • Post Points: 3
  • 10-13-2008 1:44 PM In reply to

    • tdanner
    • Top 10 Contributor
    • Joined on 06-19-2007
    • Posts 557
    • Points 1,415
    • SolarWinds Employee

    Re: Getting Account user information on webpage

    This code will give you the date and time of the last login:

    <%=Profile.LastLogin %>

    Tim Danner
    SolarWinds Development Team
    • Post Points: 3
  • 10-13-2008 2:12 PM In reply to

    • vhcato
    • Top 25 Contributor
    • Joined on 01-07-2005
    • Atlanta, GA
    • Posts 378
    • Points 1,938

    Re: Getting Account user information on webpage

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

    Vic Cato
    Technical Lead - Network Operations
    Koch Business Solutions - Enterprise Technical Services
    • Post Points: 3
  • 10-14-2008 7:12 In reply to

    • rajivbahl
    • Top 100 Contributor
    • Joined on 05-15-2008
    • India
    • Posts 74
    • Points 375

    Re: Getting Account user information on webpage

    Thanks Tim

     

    It worked just the way i wanted it to .

    Rajiv Bahl
    NPM SLX 9.1
    HS Poller
    Additional Poller 1 SLX
    • Post Points: 1
Page 1 of 1 (8 items)