473,587 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

display username in company's Intranet header

I've been going bonkers trying to find the answer to this question...
I'm hoping somebody out there can help me. Our network environment is
Active Directory and our web server is Windows 2003 IIS 6.

I've got an ASP page that we include into each of our pages to act as
our companywide header. We force users to authenticate into our
Intranet site, and we are able to display the following information
about them on each page:

Welcome (username)
Today is (whatever)

Can Javascript or Dhtml or something else get me this information? We
have thousands and thousands of webpages and I don't want to have to
use the .asp extension on every single one if I don't have to... but I
can't find a way to display the username in the header without it =|
Somebody mentioned using File System Objects, but I haven't yet
experimented in that arena.

This is what my function looks like now...

shortdate = FormatDateTime( Now,vbShortDate )
longdate = FormatDateTime( Now,vbLongDate)
Const domainname = "amsec"

Function CurrentTime()
CurrentTime = FormatDateTime( Now,vbLongTime)
End Function

Function UserName()
Dim uid, uname
If OnSiteUser() = True Then
uid = Lcase(Request.S erverVariables( "REMOTE_USE R"))
UserName = Mid(uid,7)
Else
UserName = ""
End If
End Function

'------------------------------------------------------
' Returns TRUE if current user is member of named domain group
'------------------------------------------------------

Function MemberOf(groupn ame)
Dim usr, objUser, retval
On Error Resume Next
If Session(groupna me) <> "" Then
If Session(groupna me) = "YES" Then
retval = True
Else
retval = False
End If
Else
Set objUser = GetObject("WinN T://" & domainname & "/" & UserName() &
",user")
If err.Number <> 0 Then
Session(groupna me) = "NO"
retval = False
Else
For each grp in objUser.Groups
If Ucase(groupname ) = Ucase(grp.Name) Then
retval = True
End If
Next
Set objUser = Nothing
If retval = True Then
Session(groupna me) = "YES"
Else
Session(groupna me) = "NO"
End If
End If
End If
MemberOf = retval
End Function
Jul 23 '05 #1
2 2672
Whitney wrote:
I've been going bonkers trying to find the answer to this question...
I'm hoping somebody out there can help me. Our network environment is
Active Directory and our web server is Windows 2003 IIS 6.

I've got an ASP page that we include into each of our pages to act as
our companywide header. We force users to authenticate into our
Intranet site, and we are able to display the following information
about them on each page:

Welcome (username)
Today is (whatever)

Can Javascript or Dhtml or something else get me this information? We
have thousands and thousands of webpages and I don't want to have to
use the .asp extension on every single one if I don't have to... but I
can't find a way to display the username in the header without it =|
Somebody mentioned using File System Objects, but I haven't yet
experimented in that arena.


No, there is no way to retrieve the information you want using client-side
JavaScript in the default security environment in a cross-browser way
(although that probably isn't an issue here).

Your solution of retrieving the information you want on the server is the
right one. I'd suggest you either reconfigure IIS to serve up .html files
as ASP, or see if you can server-side #include a file that will execute
the code you want in your static .html files. I don't know if IIS can
server-side #include an ASP file in a static .html file or not, but it's
something to look into.

--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq

Jul 23 '05 #2
On Wed, 28 Jul 2004 12:25:34 -0700, Whitney wrote:
I've got an ASP page that we include into each of our pages to act as our
companywide header. We force users to authenticate into our Intranet
site, and we are able to display the following information about them on
each page:

Welcome (username)
Today is (whatever)

Can Javascript or Dhtml or something else get me this information?
God no, thankfully.
We have thousands and thousands of webpages and I don't want to have to use
the .asp extension on every single one if I don't have to.


Why not pull the information once at login and stick it in a session
variable?

--
i.m.
The USA Patriot Act is the most unpatriotic act in American history.

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
11436
by: Bob Lin | last post by:
I would like to display the hostname (or computername) and username (or logonID) on our Intranet support page. I saved the following vbs code as asp file, but it doesn't display the username. No error also. Do I miss some thing? dim objNetwork Set objNetwork = WScript.CreateObject("WScript.Network") strUserDomain = objNetwork.UserDomain Wscript.Echo "User " & objNetwork.UserName
32
4137
by: Rich | last post by:
I'm sure it sounds kinda nutty to display 200 columns and 500,000 rows of data. But I have been pulling data from a Lotus Notes database into Sql Server for a while now, but Lotus Notes is starting to crack, columns getting corrupted. Can't handle the volume of data and number of columns. Sql Server has no problem. But displaying the data is the big deal. The end users want to be able to scroll acros a page to the colum of their...
14
2528
by: Brent Burkart | last post by:
I am trying to capture the Windows Authenticated username, but I want to be able to capture the login name that exists in IIS, not Windows. In order to enter my company's intranet through the internet, they have to login. I want to be able to capture that login versus their Windows login because I need to know who they are from any computer rather than only their computer. Any ideas? Thanks
8
3943
by: Raj Thakkar | last post by:
Hi, I am currenty working on a site for intranet. I have a user control in the header of every page that will be displayed only if people with certain username are surfing the site. These lists of usernames is stored on the server side in a xml based file So what I am doing at the moment is inside the user control pageload method, i get the username of the current person logged in using HttpContext.Current.User.Identity.Name and if the...
6
4592
by: John Dalberg | last post by:
I want to automate the process of logging into an intranet. I want to pull out the username of the Windows user logged into the machine running the browser and use the username in my app. How can I get the logged in username? Do I have to disable the anonymous access in IIS? I rather not because the site is running under a certain domain user which has access to certain folder and network shares and the site needs thsi access for reading...
8
16664
by: Bruno Barros | last post by:
Hey there. I'm currently working on an intranet, and would like to know how I can get the windows usernames of the visitors. You can get their IP with $_SERVER; But what about their Windows Username? Is there any way of doing so? Through the Intranet?
2
3254
by: wreed06 | last post by:
Hello, I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully validated my HTML and CSS code. 1. When I clear cache and refresh my webpage, it takes 3 tries before the popup window displays - I click on the button once, a white window the size of my webpage displays. I close it and click on the button again (for...
5
3541
by: greatjuli | last post by:
Hi, I am trying to develop intranet for my company as the new web admin. When users log in to the network with their username and password, they do not need to login again into the intranet; a single sign-on situation. The intranet will be PHP-MySql on Apache driven. Please does anyone know how i can get the username they used to log on to windows (Network) in my PHP scripts on the intranet. Thank you.
5
10219
by: Primoz Bradac | last post by:
I have a .ASP page I'd like to make accessible only to selected users who are logged on Windows workstations. The .ASP page is running under IIS on a Windows 2003 Server (intranet). Is there a way I could get to the username who requested the ASP page (in the script of the .ASP page)? TIA, Primoz
0
7924
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8219
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7978
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.