Using LDAPS (Secure LDAP Binding) with Moodle for Sign-In running on IIS in a Windows Active Directory Domain

LDAP Server Settings in MoodleThe process for running LDAP queries via secure channel for Moodle is fairly straight forward. This method is not using a trusted certificate but is encrypting the traffic between Moodle and your Domain Controller to prevent snooping. The first thing you will want to do is install the latest OpenSSL binaries onto your Moodle Server. Once this is done, create a folder structure on the C drive like this C:\OpenLDAP\sysconf\ and create a new text file called ldap.conf, in its contents we can enter a single line;

TLS_REQCERT never

Now that OpenSSL is ready to go, restart IIS for good measure. Once things are back up we can enter Moodle, login as an Administrator and change the LDAP query from LDAP:// to LDAPS:// as well as the port from 389 to 636.

Backup MySQL Databases running on a Windows Server using Systems Center Data Protection Manager (DPM) 2012.

Running MySQL on a Windows machine is pretty straight forward.  One of the down sides though is that MySQL is not VSS aware and may mis-behave when back up software such as Data Protection Manager or ShadowProtect.  Data Protection Manager (DPM) has the ability (basically called Pre-Backup and Post-Backup Scripts) to perform actions before and after a backup run.

After installing the DPM Protection Agent onto the computer you want to run the protect (by default its %ProgramFiles%\Microsoft Data Protection Manager\DPM) You’ll find a Scripting Folder and inside a ScriptingConfig.xml file which should only contain XML Schema data, we will want to expand on this by adding the following lines inside ScriptConfiguration

   <DatasourceScriptConfig DataSourceName="Data source">
     ”Path\Script Parameters” 
     "Path\Script Parameters” 
     30

DataSourceName needs to be the name of the Data Source that you are protecting (matching in DPM Console) for example C:\MySQL_Backup and in our case we only want to use a PreBackupScript (ie C:\MySQL_Backup\BackupDB.cmd) which will dump a backup from our MySQL Databse into a single SQL file before the actual DPM Backup event.  As an example, the following will execute a backup for MySQL.  You will need to change -User -Password and the MaharaProd to something that suits your environment.

@echo off
set CurrentDate=%date:~-10,2%_%date:~7,2%_%date:~-4,4%
move /y C:\MySQL_Backup\Mahara-*.sql C:\MySQL_Backup\PreviousBackup.sql
mysqldump –user backupuser –password=changethis MaharaProd > C:\MySQL_Backup\Mahara-%CurrentDate%.sql

The above will output a Mahara-DD_MM_YYYY.sql file as well as make a Previous Backup before allowing DPM to go ahead and create the restore point.

Check out this TechNet article for more details on how to get this running.

Increase the number of visible users per page on group creation and user selection screen in Moodle 2.2

So we had a query come through our Help Desk recently to ask if we can increase the users in the user selection box as staff members were having difficulty managing their classes and creating groups as they couldn’t CTRL click and had to type in the names of their students. So I started having a dig around the code in Moodle to find out if we can change the default value.

After poking around the source code and looking at some search results on Google, I found the file that was needed and it can be found in user/selector/lib.php – Line: 740

So we want to go to line and change MAX_USERS_PER_PAGE to equal what we want (a higher value, and in this case we gave it 500). The following is an extract of what we are changing.

/**
 * User selector subclass for the list of users who are not in a certain group.
 * Used on the add group members page.
 */
class group_non_members_selector extends groups_user_selector_base {
    const MAX_USERS_PER_PAGE = 500;

Save the file and now reload your group creation page and you should now be able to select multiple users in a large user base list. Also, it is important to note that the MAX_USERS_PER_PAGE variable is in multiple places and affects different user selection boxes depending on where you edit it.