473,394 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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.ServerVariables("REMOTE_USER"))
UserName = Mid(uid,7)
Else
UserName = ""
End If
End Function

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

Function MemberOf(groupname)
Dim usr, objUser, retval
On Error Resume Next
If Session(groupname) <> "" Then
If Session(groupname) = "YES" Then
retval = True
Else
retval = False
End If
Else
Set objUser = GetObject("WinNT://" & domainname & "/" & UserName() &
",user")
If err.Number <> 0 Then
Session(groupname) = "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(groupname) = "YES"
Else
Session(groupname) = "NO"
End If
End If
End If
MemberOf = retval
End Function
Jul 23 '05 #1
2 2648
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*****@agricoreunited.com>
comp.lang.javascript 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
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...
32
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...
14
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...
8
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...
6
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...
8
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...
2
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...
5
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.