Skip to content

Instantly share code, notes, and snippets.

@JakeAustwick
Created January 27, 2012 23:01
Show Gist options
  • Save JakeAustwick/1691429 to your computer and use it in GitHub Desktop.
Save JakeAustwick/1691429 to your computer and use it in GitHub Desktop.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
' define found as public (required for findGroup)
PUBLIC found, oDomain
' set domain ou to search for groups
Set oDomain=GetObject("LDAP://ou=Groups,ou=Curriculum,DC=HGS,DC=LOCAL")
' set root path for my docs
userRootPath = "https://mydocs.heckgrammar.co.uk/MyWork/"
' root path for shares
shareRootPath = "https://mydocs.heckgrammar.co.uk/MyWork/shares/"
'ON ERROR RESUME NEXT
' Get user name
userName = ucase(Mid(request.servervariables("LOGON_USER"),(InStr(request.servervariables("LOGON_USER"),"\")+1)))
' show links to web design and tools
show_admin_links = false
' get full name
Set userObj = GetObject("WinNT://hgs.local/" & userName & ",user")
IF userObj.Fullname = nul Then
fullName = "Not Available"
ELSE
fullName = userObj.Fullname
END IF
set userObj = nothing
' check if user is a student
if isMember ("G Students",userName) Then
' check if is a test account
if isMember ("G Test Accounts",userName) Then
userPath = "TestAccounts/"
' check for 00 users
elseif isMember ("G 00 Students",userName) Then
userPath = "00Students/"
' check if 01 student
elseif isMember ("G 01 Students",userName) Then
userPath = "01Students/"
' check if 02 student
elseif isMember ("G 02 Students",userName) Then
userPath = "02Students/"
' check if 03 student
elseif isMember ("G 03 Students",userName) Then
userPath = "03Students/"
' check if 04 student
elseif isMember ("G 04 Students",userName) Then
userPath = "04Students/"
' check if 05 student
elseif isMember ("G 05 Students",userName) Then
userPath = "05Students/"
' check if 06 student
elseif isMember ("G 06 Students",userName) Then
userPath = "06Students/"
' check if 07 student
elseif isMember ("G 07 Students",userName) Then
userPath = "07Students/"
' check if 08 student
elseif isMember ("G 08 Students",userName) Then
userPath = "08Students/"
' check if 09 student
elseif isMember ("G 09 Students",userName) Then
userPath = "09Students/"
' check if 10 student
elseif isMember ("G 10 Students",userName) Then
userPath = "10Students/"
' check if 11 student
elseif isMember ("G 11 Students",userName) Then
userPath = "11Students/"
' check if 98 student
elseif isMember ("G 98 Students",userName) Then
userPath = "98Students/"
' check if 99 student
elseif isMember ("G 99 Students",userName) Then
userPath = "99Students/"
' set error membeship not found
else
groupError = true
End If
' check if a teacher
elseif isMember ("G Teaching Staff",userName) Then
' check if test account
if isMember ("G Test Accounts",userName) Then
userPath = "Test Accounts/"
' other wise set folder to teachers area
else
userPath = "Staff/"
End If
elseif isMember ("G Non Teaching Staff",userName) Then
userPath = "Staff/"
elseif isMember ("G Curriculum Support Assistants",userName) Then
userPath = "Staff/"
elseif isMember ("G IT Technicians",userName) Then
userPath = "ITTechnicians/"
show_admin_links = true
elseif isMember ("G Edutech Users",userName) Then
userPath = "Edutech/"
End IF
if userPath = "" Then
groupError = true
Else
userFullPath = userRootPath & userPath & userName & "/My Documents/"
End IF
' bring together user path elements to make absolute path
Function isMember (strGroup, strUserName)
' check for exisitance of group
found = false
findGroup oDomain, strGroup
if found Then
Set GroupAD=GetObject("WinNT://hgs.local/" & strGroup)
isMember=GroupAD.IsMember("WinNT://hgs.local/" & strUserName)
else
isMember = False
End If
End Function
function findGroup(oContainer,check)
For Each oGroup In oContainer
if lcase(oGroup.class) = "group" Then
if lcase(oGroup.name) = lcase("cn=" & check) Then
found = True
Exit Function
end if
elseif lcase(oGroup.class) = "organizationalunit" and found <> True Then
findGroup oGroup,check
end if
Next
End function
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Heckmondwike Grammar School's Work From Home Facility</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="cPanel Home Page" />
<meta name="keywords" content="heckmondwike,grammar,schoool,cPanel,Home,Page" />
<link href="styles/internet.css" rel="stylesheet" type="text/css" />
<link href="styles/print.css" rel="stylesheet" type="text/css" media="print" />
<link href="styles/wysiwyg.css" rel="stylesheet" type="text/css" />
<STYLE>
A {behavior: url(#default#AnchorClick);}
</STYLE>
</head>
<body>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="container-outer">
<table border="0" cellpadding="0" cellspacing="0" id="container-inner">
<tr>
<td bgcolor="#F2F9FD" id="header"><img src="images/hgs-logo.jpg" alt="Heckmondwike Grammar School web site logo" class='hgs_logo' /></td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" id="breadcrumbs">
<tr><td><ol id="breadcrumbsol"><li class='active'><a class='active' href='index.php?p=1' title='Title: HGS Work From Home Facility
Description: Access your My Documents and the Shared areas from anywhere in the world'>HGS Work From Home Facility</a></li></ol></td><td class='align-right' id="news-ticker" style="padding-right:5px"></td>
</tr></table>
</td>
</tr>
<tr>
<td class='spacer-height'></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" id="content-sidebar">
<ul id='menu'><li class='activeLeaf'><img src='images/default/menu-leaf.gif' class='activeLeaf' align='left' /><%
if not groupError Then
response.write "<a href='" & (userFullPath) & "' folder='" & (userFullPath) & "' title='Title: Access your My Documents'>My Documents</a>"
Else
response.write "Error Contact Administrator My Documents not Available"
End If
%>
</li>
<li class='activeLeaf'><img src='images/default/menu-leaf.gif' class='activeLeaf' align='left' /><a href='<% response.write (shareRootPath) %>' folder='<% response.write (shareRootPath) %>' title='Title: Access the Shared Areas'>Shared Areas</a></li>
<%
if show_admin_links Then
response.write "<li class='activeLeaf'><img src='images/default/menu-leaf.gif' class='activeLeaf' align='left' /><a href='" & (userRootPath & "WebDesign/") & "' folder='" & (userRootPath & "WebDesign/") & "' title='Title: Access The Web Design Folder'>Web Design</a></li>"
response.write "<li class='activeLeaf'><img src='images/default/menu-leaf.gif' class='activeLeaf' align='left' /><a href='" & (userRootPath & "Tools/") & "' folder='" & (userRootPath & "Tools/") & "' title='Title: Access The Tools Folder'>Tools</a></li>"
response.write "<li class='activeLeaf'><img src='images/default/menu-leaf.gif' class='activeLeaf' align='left' /><a href='" & (userRootPath & "www") & "' folder='" & (userRootPath & "www") & "' title='Title: Access The Live Web Site'>Live Web Site</a></li>"
end if
%>
</ul>
</td>
<td width="100%" valign="top" id='content-inner'><h1 class='title'>HGS Work From Home Facility</h1>
<p>Welcome <% response.write (fullName) %> to the HGS Work from From Home Facility.
This service allows users of the HGS network to access their files and also
the
Shared Areas from anywhere in the world.
As these areas can be accessed from anywhere in the world it is important
to keep your username and password secure.</p>
<br /><p>Please read the requirements below and then use
the buttons on the left to access the necessary areas.</p>
<br /><p><span class="Sub-Title">Requirements:</span><br>
For full functionality this site requires Internert Explorer
Web Folders to be installed. This is normally installed
automatically if you are using Internet Explorer Version 5.5 or higher.</p>
<br /><p align='center'>
<script>
/*Displaying a user's browser type script
By Website Abstration (wsabstract.com)
Visit Wsabstract.com or Java-Scripts.net for this script
*/
if (document.all)
var version=/MSIE \d+.\d+/
if (!document.all)
document.write("You appear to be using: <b>"+navigator.appName+" "+navigator.userAgent)
else
document.write("You appear to be using: <b>"+navigator.appName+" "+navigator.appVersion.match(version))
</script>
</b></p><br />
<p>If you have Internet Explorer Web Folders installed
then you will be able to access your HGS My Documents and
the Departmental Shared Areas just like you're in
school. You will be able to download your work, edit it and then
upload (or save) your work back to the HGS servers.</p>
<p>If you don't have Internet Explorer Web Folders
installed then you will only be able to download your work to home.
You will not be able to save your work back to the
servers.</p>
<br /><p><span class="Sub-Title">Note:</span><br />
To logoff you must close all your browser windows.</p>
</td>
</tr>
<tr>
<td height='10' id='spacer-footer-left'></td>
<td height='10'></td>
</tr>
<tr>
<td id="footer-left">&nbsp;</td>
<td id="footer-right">Site Design &copy; Heckmondwike Grammar School</td>
</tr>
<tr>
<td id='copyright-footer-left'></td>
<td id='copyright-footer-right' class='align-center'><a href='http://www.schoolsnetwork.org.uk'><img src='/MyWork/web_files/general/Image/tech_college.gif' alt='Awarded Technology College Status 1995' vspace='5' hspace='5' /></a><a href="http://validator.w3.org/check/referer"><img src="/MyWork/web_files/general/Image/valid-xhtml10.png" alt="Valid XHTML 1.0 Transitional" width="88" height="31" vspace='5' hspace='5' border="0" /></a><a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="/MyWork/web_files/general/Image/vcss.gif" alt="Valid CSS!" vspace='5' hspace='5' border="0" /></a><a href='http://www.schoolsnetwork.org.uk'><img src='/MyWork/web_files/general/Image/lang_college.gif' alt='Awarded Language College Status 2006' vspace='5' hspace='5' /></a></td>
</tr>
<tr>
<td id='update-time-left'></td>
<td id='update-time-right' align='center' class='update-time'>Designed for 1024 x 768 screen resolution</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment