Integrate Moodle, LDAP and SIMS.net

Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 3.3. Up-to-date documentation for the latest stable version of Moodle is probably available here: Integrate Moodle, LDAP and SIMS.net.

Integrate SIMS.net and LDAP (SIMS2AD)

Introduction

For SIMS2AD and SIMS2MOODLE modules to work every student and teacher's LDAP account MUST have the employeeID field set. These need to be set to the following.

  1. Students = UPN
  2. Staff = SIMS.net Teacher Code

Please note that if the account that you configure under Bind Settings/Distinguished Name does NOT have admin privileges on the domain (as best practise suggests), you may need to perform the following changes on your domain as well:

  • Load Active Directory Users and Computers
  • Right click on the domain itself (domain.com), select 'Delegate Control...'
  • Click 'Next', and then select the LDAP user that is configured under Bind Settings/Distinguished Name
  • Under 'Delegate the following common tasks', click 'Read all user information'
  • Click 'Finish'

This will allow the user account to read the employeeID attribute, which by default can only be read by domain admins.

SIMS2AD - Account Creator (Unpublished)

Introduction


SIMS2AD - Account Creator is a moodle block that administers the process of LDAP account creation automatically.

IMPORTANT - Please Read


SIMS2AD Vbscript has been retired. It is in the process of being converted to a moodle block. The main aim of this is to improve configuration and quality.

SIMS2AD - Access Manager

Introduction


SIMS2AD - Access Manager allows non technical members of staff to control student access to an education establishments computer network via SIMS.net.

Script Usage Details

The Vbscript will run every 5 minutes, every day
A log file is created in the same folder as the script, this hold a log of all processed changes.

Add a new view to MS SQL Server


  1. Open SQL Server Management Studio
  2. Use the Object Explorer window to browse to the database and the folder called ‘Views’.
    • [Server]\[Instance] -> Database -> sims -> Views
  3. Right-click the ‘Views’ folder and select ‘New View’.
  4. Close the Add Table dialog box – Copy and Paste the query below into the Query box
  5. Save the View via File, Save [the temporary name of the view] .
  6. Enter the above name for the new ‘View’ and click ‘OK’.
  7. If you refresh the list of views by right-clicking the ‘Views’ folder you will see the new view near the top of the list.
  8. Close SQL Server management Studio.


MS SQL 2005 Server View


Name: vbs_admanager

Query to paste in:

SELECT     TOP (100) PERCENT sims.stud_via_student_browse.unique_pupil_no, sims.stud_via_student_browse.forename, 
                      sims.stud_via_student_browse.surname, sims.udf_field.description AS type, sims.udf_lookup_value.description
FROM         sims.udf_value INNER JOIN
                      sims.udf_field ON sims.udf_value.field_id = sims.udf_field.field_id INNER JOIN
                      sims.stud_via_student_browse ON sims.udf_value.entity_id = sims.stud_via_student_browse.person_id INNER JOIN
                      sims.udf_lookup_value ON sims.udf_value.lookup_value_id = sims.udf_lookup_value.lookup_value_id
WHERE     (sims.udf_field.active = 'T')

Script


The SIMS2AD Access Manager script needs to copied to D:\SIMS2AD on the SIMS Server.
The latest version of the script is available from:-

https://docs.moodle.org/en/SIMS2AD_access_manager.vbs


Setting Up a Scheduled Task


A scheduled task needs to be created to run the SIMS2AD Access Manager Script.
This Task will need to run every 5 minutes from 08:00 AM to 20:00 PM

  1. Open Control Panel
  2. Open Scheduled Tasks
    • This will open the Schedule Task Windows
  3. Add Scheduled Task
    • This will open the Schedule Task Wizard
  4. Click Next
  5. Click Browse and Navigate to D:\SIMS2AD Folder
  6. Select SIMS2AD_Access_Manager.vbs
  7. Give the the name "SIMS2AD Access Manager"
  8. Select Daily
  9. Click Next
  10. Click Next as these Settings will be modified later.
  11. Enter the user account details that will be used to run the script
  12. Click Next
  13. Tick the box
    • This will open Advance Properties Window
  14. Click Finish
  15. Click the Schedule Tab
  16. Set the Start Time 08:00 AM
  17. Click the Advance Button
    • This will open an Advance Settings Window
  18. Set a Start date
  19. Tick Repeat Task
  20. Set it to repeat every 5 minutes
  21. Select Duration and set at 12 hours
  22. Click OK
  23. Click Apply
  24. Click OK


Required Logon Script Changes


The below code needs to be added to the beginning of the Kixtart Logon Script.
This will check the current time and see if the user belongs to a group that has restricted computer access.
If the user has logged on during a restricted time a message box will be displayed informing of this and then forcefully log them off.

IF ((@time > "20:00:00") AND (@time < "08:50:00"))
	If InGroup("SIMS2AD_LessonOnly_E4") or InGroup("SIMS2AD_LessonOnly_L4") or InGroup("SIMS2AD_Lesson_Evening_Only_E4") 
        or InGroup("SIMS2AD_Lesson_Evening_Only_L4")
	
                MESSAGEBOX ("Your Computer Access Been Restricted, For More Information Please Speak To Your Director Of Year", 
                "IT SERVICES", 16, 15)
                $RC = LogOff(0)
	endif
endif
IF ((@time > "11:15:00") AND (@time < "11:35:00"))
	If InGroup("SIMS2AD_LessonOnly_E4") or InGroup("SIMS2AD_LessonOnly_L4") or InGroup("SIMS2AD_Lesson_Evening_Only_E4") 
        or InGroup("SIMS2AD_Lesson_Evening_Only_L4")
		
                MESSAGEBOX ("Your Computer Access Been Restricted, For More Information Please Speak To Your Director Of Year",
                "IT SERVICES", 16, 15)
                $RC = LogOff(0)
	endif
endif
IF ((@time > "12:35:00") AND (@time < "13:35:00"))
	If InGroup("SIMS2AD_LessonOnly_E4")  or InGroup("SIMS2AD_Lesson_Evening_Only_E4") 

                MESSAGEBOX ("Your Computer Access Been Restricted, For More Information Please Speak To Your Director Of Year", 
                "IT SERVICES", 16, 15)
                $RC = LogOff(0)
	endif
endif
IF ((@time > "13:35:00") AND (@time < "14:35:00"))
	If InGroup("SIMS2AD_LessonOnly_L4") or InGroup("SIMS2AD_Lesson_Evening_Only_L4")

		MESSAGEBOX ("Your Computer Access Been Restricted, For More Information Please Speak To Your Director Of Year", 
                "IT SERVICES", 16, 15)
		$RC = LogOff(0)
	endif
endif
IF ((@time > "16:35:00") AND (@time < "18:00:00"))
	If InGroup("SIMS2AD_LessonOnly_E4") or InGroup("SIMS2AD_LessonOnly_L4") or InGroup("SIMS2AD_Lesson_Evening_Only_E4") 
        or InGroup("SIMS2AD_Lesson_Evening_Only_L4")

		MESSAGEBOX ("Your Computer Access Been Restricted, For More Information Please Speak To Your Director Of Year", 
                "IT SERVICES", 16, 15)
		$RC = LogOff(0)
	endif
endif
IF ((@time > "18:00:00") AND (@time < "20:00:00"))
	If InGroup("SIMS2AD_LessonOnly_E4") or InGroup("SIMS2AD_LessonOnly_L4")

		MESSAGEBOX ("Your Computer Access Been Restricted, For More Information Please Speak To Your Director Of Year", 
                "IT SERVICES", 16, 15)
		$RC = LogOff(0)
	endif
endif


Integrate Moodle and LDAP (MOODLE2LDAP)

Introduction

MOODLE2LDAP is the process of linking moodle to LDAP, this will allow users to authenticate and underpin SIMS2AD - Account Creator Moodle Block.

Setting up LDAP Authentication

  1. Login to moodle as the admin user.
  2. Under Site Administration
    • Users - > Authentication -> LDAP Server
  3. Set the Following Fields as follows
    • LDAP server settings
      • Host Url = ldap://server.domain.com/
      • Version = 3
      • LDAP encoding = utf-8
    • Bind settings
      • Hide passwords = Yes
      • Distinguished Name = cn=LDAP Guest,cn=Users,dc=domain,dc=com
      • Password = Password of LDAP Guest Account
    • User lookup settings
      • User type = MS Active Directory
      • Contexts = cn=LDAP Guest,cn=Users,dc=domain,dc=com
      • Search subcontexts = Yes
      • Dereference aliases = Yes
      • User attribute = sAMAccountName
      • Member attribute = member
    • Force change password
      • Force change password = No
      • Use standard Change Password Page = No
    • LDAP password expiration settings
      • Expiration = No
    • Enable user creation
      • Create users externally = No
    • Data Mapping
      • First Name = givenName
      • Surname = sn
      • Email address = mail
      • Description = description
      • ID number = employeeID
      • Department = department
  4. Click Save


Integrate Moodle and SIMS.net (SIMS2MOODLE)

Prerequisite

Moodle requires FreeTDS to be installed for it to work with MS SQL 2005.

  1. Install FreeTDS on Linux
  2. Install FreeTDS on Windows

SIMS2Moodle - Enrolment Plug-in

Introduction

SIMS2Moodle - Enrolment Plug-in is a part preconfigured version of moodle's external database plug-in tailored for use with SIMS.net.

Create Moodle SIMS.net Course Template


Before the plug-in is installed it is best to create a template from which moodle will create any new SIMS.net courses

  1. Login to moodle as the admin user.
  2. Under Site Administration
    • Courses - > Add/Edit Courses
  3. Click Miscellaneous
  4. Click New Course Button
  5. Set the Following Fields as follows
    • General
      • Full name = SIMS Template Course
      • Short name = simstemplate
      • Course ID number = simstemplate
      • Format = Topics Format
      • Number of weeks/topics = 10
      • Course Start Date = 1st Sept
      • Hidden sections = Hidden sections are shown in collapsed form
      • News Items to show = 5
      • Show gradebook to students = Yes
      • Show activity reports = No
      • Maximum upload size = [Maximum Size Allowed]
      • Is this a meta course? = No
    • Enrolments
      • Enrolment Plugins = Site Default (Internal Enrolment)
      • Default role = Site Default (Student)
      • Course enrollable = Yes
      • Start date = Disabled
      • End date = Disabled
      • Enrolment duration = Unlimited
    • Enrolment expiry notification
      • Notify = No
      • Notify Students = No
      • Threshold = 10 days
    • Groups
      • Group mode = No Groups
      • Force = No
      • Default grouping = No
    • Availability
      • Availability = This course is avaliable to students
      • Enrolment key = [Blank]
      • Guest access = Do Not Allow Guest In
    • Language
      • Force language = No
    • Role renaming
      • [All Fields are Blank]

Download


The SIMS.net Enrolment Plug-in files needs to copied to the 'moodle\enrol' folder on the Moodle server.
The latest version of the files are available from:-

http://www.uctc.e-sussex.sch.uk/moodle_sims.net_enrolment_plugin.zip

Moodle Settings


On the plug-in have been downloaded and installed.

  1. Login to moodle as the admin user.
  2. Under Site Administration
    • Courses - > Add/Edit Courses
  3. Click Add New Category
    • Parent Category = Top
    • Category Name = SIMS Courses
  4. Click Save
  5. Under Site Administration
    • Courses - > Enrolments
  6. Enable SIMS.net
  7. Click Edit
  8. Set the Following Fields as follows
    • SIMS.net Server Settings
      • enrol_dbtype = mssql
      • enrol_dbhost = sims.school.lan
      • enrol_dbport = 1427 (1427 is default for MS SQL 2005)
      • enrol_dbuser = sa
      • enrol_dbpass = [SA Password]
    • Academic Setting
      • enrol_dbacyear = 2009 (or current academic year)
  1. Click Save

SIMS2MOODLE - SIMS.net Timetable Block

Introduction


SIMS2MOODLE - SIMS.net Timetable Block V1.2 now has ability to auto install, upgrade and remove views on Microsoft SQL Server 2005.

Prerequisite


SIMS2MOODLE - Timetable block requires SIMS2MOODLE - Enrolment Plug-in to be installed and configured. SIMS2MOODLE - Enrolment Plug-in does not have to be enabled if auto enrolment is not needed.

IMPORTANT: IF UPGRADING


If you are upgrading from a version before the release of 1.0, please do the following:-

  1. Uninstall the SIMS.net Timetable block from moodle.
  2. Delete the folders \blocks\simstimetable and \mod\simstimtable
  3. Delete the view mdl_student_timetable from SQL Server Management Studio

If you are upgrading from release of 1.1, please do the following:-

  1. Please install SIMS.net Enrolment Plug-in.

Download the Block


The SIMS.net Timetable Block files needs to copied to the 'moodle\blocks' folder on the Moodle server.
The latest version of the files are available from:-

http://www.uctc.e-sussex.sch.uk/moodle_sims.net_timetable_block.zip

Install SIMS.net Timetable Block for Moodle


  1. Copy simstimetable folder to the blocks folder in moodle
  2. Login to moodle as the admin account
  3. Click on Notifications
    • A message should state that the block has been successfully installed.
  4. Click Modules -> Blocks -> SIMS.net Timetable to configure the block. (You will have to configure the 'Lesson Labels' field at the very least for your school's timetable).

Configure SIMS.net Timetable Block for Moodle


Every schools timetable is slightly different, so the block will need to be configured.

Block Title: This text will be displayed as the block title.
Link Text: This is the text of the timetable url.
No. Weeks: Number of weeks timetabled in SIMS.net. (Only 1 or 2 supported)
Seperator: The separator is the character using in the SIMS.net to separate the day from the period name eg Fri:1, so the separator will be ":"
Lesson Labels: These are the names all there periods that are timetabled in SIMS.net seperated with a ","