+ Post New Thread
Results 1 to 5 of 5
Scripts Thread, wegpages for controlling room internet access in isa 2004 in Coding and Web Development; this works if you have computer sets for rooms. (need static ip addresses this to work) been making these for ...
  1. #1
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,535
    Thank Post
    110
    Thanked 89 Times in 75 Posts
    Blog Entries
    47
    Rep Power
    41

    wegpages for controlling room internet access in isa 2004

    this works if you have computer sets for rooms. (need static ip addresses this to work)

    been making these for a while. just got them working. to combat lost time from taking phone calls to turn the internet on/off. The idea being the teachers do it themselves. You have to give them admin rights on the isa server. Not an ideal solution but as long as they dont go near the actual pc will be fine.

    NB: this applies to a rule called pupil access which only applies to individuals (pupils) which have restricted access.

    index.asp
    enumerates the names of all the possible computer sets into a form. if len(blag.name) < 6 then excludes the builtin sets. anything you dont want appearing on the form you can just make the name longer than 6 chars.
    Any set currently set to 'on' has a ticked box.

    Code:
    <%
    sub controlcomputers()
    
    	dim root
    	set root = CreateObject("FPC.Root")
    	
    	dim array
    	dim policyrules
    	dim computersets
    	dim pupilrule
    	
    	set array = root.GetContainingArray
    	set policyrules = array.ArrayPolicy.PolicyRules
      
    	set pupilrule = policyrules.item("Pupil Access")
    	
    	set computersets = array.RuleElements.ComputerSets
    	
    	dim onsets
    	set onsets = pupilrule.SourceSelectionIPs.ComputerSets
    	dim found,tmp
    	
    	for each blag in computersets
       if len(blag.name) < 6 then
       found = false	
       'tmp =      
          if setlookup(blag.name,onsets) then
          Response.write "<input type='checkbox' name='room' value='" & blag.Name & "' checked>" & blag.name & "
    "
        else   
           Response.write "<input type='checkbox' name='room' value='" & blag.Name & "'>" & blag.name & "
    "
           end if
       end if
    	next  
    	
    	pupilrule.save
    	CheckError
    	
    	'wscript.echo "Done!"
    	
    end sub
    
    sub CheckError()
    
    	if Err.Number <> 0  then
        Response.write "An error occurred: 0x" & hex(err.number) & " " & err.Description
        err.clear
    	end if
    	
    end sub 
    
    function setlookup(lookupname,lookinto)
             'response.write "function start" & lookupname & "
    
    "
       for each item in lookinto
         if item.name=lookupname then
          'response.write item.name & " true "
          setlookup = true
          exit function
         end if
         'response.write item.name & " false "
       next
       setlookup = false
    end function
    
    
    
    %>
    
    
    
    <style type="text/css">
    <!--
    .style6 {
    	font-size: 36px;
    	font-family: Arial, Helvetica, sans-serif;
    	color: #003300;
    	font-weight: bold;
    }
    .style7 {font-family: Arial, Helvetica, sans-serif}
    -->
    </style>
    <p class="style6">Internet Room Management </p>
    <hr noshade>
    <span class="style7">Ticked = Internet allowed in that room
    </span>
    <form action="process.asp" method="get">
      
    
    
        
       <% controlcomputers %>
      
      </p>
      
    
    </p>
      
    
    
        <input type="submit" name="Submit" value="Submit">
    </p>
    </form>

    process.asp

    removes everything and then adds the ticked boxes passed from the previous page.
    re-asks what is 'on' and lists the results.
    if you have a set that contains pcs that are always 'on' its easier to put it on a separate rule.

    Code:
    <%
    sub processform()
    
    	dim root
    	set root = CreateObject("FPC.Root")
    	
    	dim array
    	dim policyrules
    	dim computersets
    	dim pupilrule
    	
    	set array = root.GetContainingArray
    	set policyrules = array.ArrayPolicy.PolicyRules
      
    	set pupilrule = policyrules.item("Pupil Access")
    
    	set computersets = pupilrule.SourceSelectionIPs.ComputerSets
    	
    	for each blag in computersets
       'response.write blag.Name
       pupilrule.SourceSelectionIPs.computersets.removespecified blag.Name
    	next   
    
    
    
             
    for each itemx in request.querystring("room") 
    	pupilrule.SourceSelectionIPs.computersets.add itemx, fpcinclude
    	'response.write itemx
    next
    
    
    	pupilrule.save
    	CheckError
    	
    	
    	response.write "Validating...access allowed at: "
    	for each blagx in computersets
       response.write  blagx.Name & " "
    	next  
    
    end sub
    sub CheckError()
    
    	if Err.Number <> 0  then
        Response.write "An error occurred: 0x" & hex(err.number) & " " & err.Description
        err.clear
    	end if
    	
    end sub 
    
    
    
    	
    
    %>
    
    
    <style type="text/css">
    <!--
    .style6 {
    	font-size: 36px;
    	font-family: Arial, Helvetica, sans-serif;
    	color: #003300;
    	font-weight: bold;
    }
    .style7 {font-family: Arial, Helvetica, sans-serif}
    -->
    </style>
    <p class="style6">Internet Room Management Processed</p>
    <hr noshade>
    <span class="style7">Ticked = Internet allowed in that room
    
    
    </span>
    
    <% processform %>

  2. #2
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,535
    Thank Post
    110
    Thanked 89 Times in 75 Posts
    Blog Entries
    47
    Rep Power
    41

    Re: wegpages for controlling room internet access in isa 200

    also i have a scheduled vbs script that removes all the computer sets from the pupil rule at the end of lessons and after lunch


    Code:
    sub controlcomputers()
    
    	dim root
    	set root = CreateObject("FPC.Root")
    	
    	dim array
    	dim policyrules
    	dim computersets
    	dim pupilrule
    	
    	set array = root.GetContainingArray
    	set policyrules = array.ArrayPolicy.PolicyRules
      
    	set pupilrule = policyrules.item("Pupil Access")
    
    	set computersets = pupilrule.SourceSelectionIPs.ComputerSets
    	
    	for each blag in computersets
       wscript.echo blag.Name
       pupilrule.SourceSelectionIPs.computersets.removespecified blag.Name
    	next  
    	
    	pupilrule.save
    	CheckError
    	
    	wscript.echo "Done!"
    	
    end sub
    
    sub CheckError()
    
    	if Err.Number <> 0  then
        wscript.echo "An error occurred: 0x" & hex(err.number) & " " & err.Description
        err.clear
    	end if
    	
    end sub
    
    controlcomputers

  3. #3

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: wegpages for controlling room internet access in isa 200

    Shouldn't this be in the Scripts forum?

  4. #4
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,535
    Thank Post
    110
    Thanked 89 Times in 75 Posts
    Blog Entries
    47
    Rep Power
    41

    Re: wegpages for controlling room internet access in isa 200

    indeed. didnt notice that one here.

  5. #5
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,535
    Thank Post
    110
    Thanked 89 Times in 75 Posts
    Blog Entries
    47
    Rep Power
    41
    These scripts also work in ISA2006.



SHARE:
+ Post New Thread

Similar Threads

  1. Disabling internet in one room.
    By eejit in forum Network and Classroom Management
    Replies: 161
    Last Post: 4th August 2010, 03:21 PM
  2. Replies: 2
    Last Post: 7th September 2007, 03:13 PM
  3. ISA 2004 - web access intermittent problem
    By SimonC in forum Windows
    Replies: 11
    Last Post: 13th February 2007, 11:48 PM
  4. Replies: 38
    Last Post: 28th March 2006, 10:47 PM
  5. Controlling the Internet
    By neilenormal in forum Educational Software
    Replies: 8
    Last Post: 14th November 2005, 12:58 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •