Advertisement
qaisjp

schoool.asp

Aug 28th, 2015
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 11.04 KB | None | 0 0
  1. ' mydocs.schoolgrammar.co.uk/MyWork/index.asp
  2.  
  3. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
  4. <%
  5. ' define found as public (required for findGroup)
  6. PUBLIC found, oDomain
  7. ' set domain ou to search for groups
  8. Set oDomain=GetObject("LDAP://ou=Groups,ou=Curriculum W7,DC=SGS,DC=LOCAL")
  9.  
  10. ' set root path for my docs
  11. userRootPath = "https://mydocs.schoolgrammar.co.uk/MyWork/"
  12. ' root path for shares
  13. shareRootPath = "https://mydocs.schoolgrammar.co.uk/MyWork/shares/"
  14.  
  15. 'ON ERROR RESUME NEXT
  16. ' Get user name
  17. userName = ucase(Mid(request.servervariables("LOGON_USER"),(InStr(request.servervariables("LOGON_USER"),"\")+1)))
  18.  
  19. ' show links to web design and tools
  20. show_admin_links = false
  21.  
  22. ' get full name
  23. Set userObj = GetObject("WinNT://SGS.local/" & userName & ",user")
  24. IF userObj.Fullname = nul Then
  25.     fullName = "Not Available"
  26. ELSE
  27.     fullName = userObj.Fullname
  28. END IF
  29. set userObj = nothing
  30.  
  31. ' check if user is a student
  32. if isMember ("G Students",userName) Then
  33.     ' check if is a test account
  34.     if isMember ("G Test Accounts",userName) Then
  35.         userPath = "TestAccounts/"
  36.     ' check for 00 users
  37.     elseif isMember ("G 00 Students",userName) Then
  38.         userPath = "00Students/"
  39.     ' check if 01 student
  40.     elseif isMember ("G 01 Students",userName) Then
  41.         userPath = "01Students/"
  42.     ' check if 02 student
  43.     elseif isMember ("G 02 Students",userName) Then
  44.         userPath = "02Students/"
  45.     ' check if 03 student
  46.     elseif isMember ("G 03 Students",userName) Then
  47.         userPath = "03Students/"
  48.     ' check if 04 student
  49.     elseif isMember ("G 04 Students",userName) Then
  50.         userPath = "04Students/"
  51.     ' check if 05 student
  52.     elseif isMember ("G 05 Students",userName) Then
  53.         userPath = "05Students/"
  54.     ' check if 06 student
  55.     elseif isMember ("G 06 Students",userName) Then
  56.         userPath = "06Students/"
  57.     ' check if 07 student
  58.     elseif isMember ("G 07 Students",userName) Then
  59.         userPath = "07Students/"
  60.     ' check if 08 student
  61.     elseif isMember ("G 08 Students",userName) Then
  62.         userPath = "08Students/"
  63.     ' check if 09 student
  64.     elseif isMember ("G 09 Students",userName) Then
  65.         userPath = "09Students/"
  66.     ' check if 10 student
  67.     elseif isMember ("G 10 Students",userName) Then
  68.         userPath = "10Students/"
  69.     ' check if 11 student
  70.     elseif isMember ("G 11 Students",userName) Then
  71.         userPath = "11Students/"
  72.     ' check if 12 student
  73.     elseif isMember ("G 12 Students",userName) Then
  74.         userPath = "12Students/"
  75.     ' check if 13 student
  76.     elseif isMember ("G 13 Students",userName) Then
  77.         userPath = "13Students/"
  78.     ' check if 14 student
  79.     elseif isMember ("G 14 Students",userName) Then
  80.         userPath = "14Students/"
  81.     ' check if 98 student
  82.     elseif isMember ("G 98 Students",userName) Then
  83.         userPath = "98Students/"
  84.     ' check if 99 student
  85.     elseif isMember ("G 99 Students",userName) Then
  86.         userPath = "99Students/"
  87.    
  88.     ' set error membeship not found
  89.     else
  90.         groupError = true
  91. End If
  92. ' check if a teacher
  93. elseif isMember ("G Teaching Staff",userName) Then
  94.     ' check if test account
  95.     if isMember ("G Test Accounts",userName) Then
  96.         userPath = "Test Accounts/"
  97.     ' other wise set folder to teachers area
  98.     else
  99.         userPath = "Staff/"
  100.     End If
  101.  
  102. elseif isMember ("G Non Teaching Staff",userName) Then
  103.     userPath = "Staff/"
  104. elseif isMember ("G Curriculum Support Assistants",userName) Then
  105.     userPath = "Staff/"
  106. elseif isMember ("G IT Technicians",userName) Then
  107.     userPath = "ITTechnicians/"
  108.     show_admin_links = true
  109. elseif isMember ("G Edutech Users",userName) Then
  110.     userPath = "Edutech/"
  111. End IF
  112.  
  113. if userPath = "" Then
  114.     groupError = true
  115. Else
  116.     userFullPath = userRootPath & userPath & userName & "/My Documents/"
  117. End IF
  118.  
  119. ' bring together user path elements to make absolute path
  120.  
  121.  
  122. Function isMember (strGroup, strUserName)
  123.     ' check for exisitance of group
  124.     found = false
  125.     findGroup oDomain, strGroup
  126.     if found Then
  127.         Set GroupAD=GetObject("WinNT://SGS.local/" & strGroup)
  128.         isMember=GroupAD.IsMember("WinNT://SGS.local/" & strUserName)
  129.     else
  130.         isMember = False
  131.     End If
  132.    
  133. End Function
  134.  
  135. function findGroup(oContainer,check)
  136.   For Each oGroup In oContainer
  137.     if lcase(oGroup.class) = "group" Then
  138.       if lcase(oGroup.name) = lcase("cn=" & check) Then
  139.             found = True
  140.         Exit Function
  141.       end if
  142.     elseif lcase(oGroup.class) = "organizationalunit" and found <> True Then
  143.         findGroup oGroup,check
  144.     end if
  145.   Next
  146. End function
  147.  
  148. %>
  149. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  150. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  151. <head>
  152. <title>Townname Grammar School's Work From Home Facility</title>
  153. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  154. <meta name="description" content="cPanel Home Page" />
  155. <meta name="keywords" content="Townname,grammar,schoool,cPanel,Home,Page" />
  156. <link href="styles/internet.css" rel="stylesheet" type="text/css" />
  157. <link href="styles/print.css" rel="stylesheet" type="text/css" media="print" />
  158. <link href="styles/wysiwyg.css" rel="stylesheet" type="text/css" />
  159. <STYLE>
  160. A {behavior: url(#default#AnchorClick);}
  161. </STYLE>
  162. </head>
  163. <body>
  164.     <table width='100%' border="0" cellpadding="0" cellspacing="0">
  165.         <tr>
  166.             <td id="container-outer">
  167.             <table border="0" cellpadding="0" cellspacing="0" id="container-inner">
  168.                 <tr>
  169.                     <td bgcolor="#F2F9FD" id="header"><img src="images/SGS-logo.jpg" alt="Townname Grammar School web site logo" class='SGS_logo' /></td>
  170.                 </tr>
  171.                 <tr>
  172.                     <td>
  173.                         <table border="0" cellpadding="0" cellspacing="0" id="breadcrumbs">
  174.                       <tr><td><ol id="breadcrumbsol"><li class='active'><a class='active' href='index.php?p=1' title='Title: SGS Work From Home Facility
  175. Description: Access your My Documents and the Shared areas from anywhere in the world'>SGS Work From Home Facility</a></li></ol></td><td class='align-right' id="news-ticker" style="padding-right:5px"></td>
  176.                       </tr></table>
  177.                     </td>
  178.                 </tr>
  179.                 <tr>
  180.                     <td class='spacer-height'></td>
  181.                 </tr>
  182.                 <tr>
  183.                     <td>
  184.                     <table width="100%" border="0" cellpadding="0" cellspacing="0">
  185.                         <tr>
  186.                           <td valign="top" id="content-sidebar">
  187.                           <ul id='menu'><li class='activeLeaf'><img src='images/default/menu-leaf.gif' class='activeLeaf' align='left' /><%
  188. if not groupError Then
  189.     response.write "<a href='" & (userFullPath) & "' folder='" & (userFullPath) & "' title='Title: Access your My Documents'>My Documents</a>"
  190. Else
  191.     response.write "Error Contact Administrator My Documents not Available"
  192. End If
  193. %>
  194. </li>
  195. <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>
  196. <%
  197. if show_admin_links Then
  198.     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>"
  199.     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>"
  200.     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>"
  201. end if
  202. %>
  203. </ul>
  204. </td>
  205.                                                   <td width="100%" valign="top" id='content-inner'><h1 class='title'>SGS Work From Home Facility</h1>
  206. <p>Welcome <% response.write (fullName) %> to the SGS Work from From Home Facility.
  207.   This service allows users of the SGS network to access their files and also
  208.   the
  209.             Shared Areas from anywhere in the world.
  210.             As these areas can be accessed from anywhere in the world it is important
  211.             to keep your username and password secure.</p>
  212.          <br /><p>Please read the requirements below and then use
  213.             the buttons on the left to access the necessary areas.</p>
  214.             <br /><p><span class="Sub-Title">Requirements:</span><br>
  215.             For full functionality this site requires Internert Explorer
  216.             Web Folders to be installed. This is normally installed
  217.             automatically if you are using Internet Explorer Version 5.5 or higher.</p>
  218.             <br /><p align='center'>
  219.           <script>
  220.         /*Displaying a user's browser type script
  221.         By Website Abstration (wsabstract.com)
  222.         Visit Wsabstract.com or Java-Scripts.net for this script
  223.         */
  224.        
  225.         if (document.all)
  226.         var version=/MSIE \d+.\d+/
  227.        
  228.         if (!document.all)
  229.         document.write("You appear to be using: <b>"+navigator.appName+" "+navigator.userAgent)
  230.         else
  231.         document.write("You appear to be using: <b>"+navigator.appName+" "+navigator.appVersion.match(version))
  232.        
  233.         </script>
  234.           </b></p><br />
  235.             <p>If you have Internet Explorer Web Folders installed
  236.             then you will be able to access your SGS My Documents and
  237.             the Departmental Shared Areas just like you're in
  238.             school. You will be able to download your work, edit it and then
  239.             upload (or save) your work back to the SGS servers.</p>
  240.             <p>If you don't have Internet Explorer Web Folders
  241.             installed then you will only be able to download your work to home.
  242.             You will not be able to save your work back to the
  243.             servers.</p>
  244.             <br /><p><span class="Sub-Title">Note:</span><br />
  245.             To logoff you must close all your browser windows.</p>
  246. </td>
  247.                         </tr>
  248.                         <tr>
  249.                             <td height='10' id='spacer-footer-left'></td>
  250.                             <td height='10'></td>
  251.                         </tr>
  252.                         <tr>
  253.                                                         <td id="footer-left">&nbsp;</td>
  254.                                                         <td id="footer-right">Site Design &copy; Townname Grammar School</td>
  255.                         </tr>
  256.                                                 <tr>
  257.                             <td id='copyright-footer-left'></td>
  258.                             <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>
  259.                         </tr>
  260.                         <tr>
  261.                             <td id='update-time-left'></td>
  262.                             <td id='update-time-right' align='center' class='update-time'>Designed for 1024 x 768 screen resolution</td>
  263.                         </tr>
  264.                                             </table>
  265.                     </td>
  266.                 </tr>                  
  267.             </table>
  268.             </td>
  269.         </tr>
  270. </table>   
  271. </body>
  272. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement