From 2e8b958b5ad1e8717acd26200a47d9c8a1ae0ad3 Mon Sep 17 00:00:00 2001
From: Matt Porritt <mattp@catalyst-au.net>
Date: Mon, 2 Feb 2015 13:21:46 +1100
Subject: [PATCH] MDL-49034 add max length contstraints to name and password
 form fields to prevent database errors on overloaded fields

---
 enrol/self/edit_form.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/enrol/self/edit_form.php b/enrol/self/edit_form.php
index 69c7f2e..4c5f9b4 100644
--- a/enrol/self/edit_form.php
+++ b/enrol/self/edit_form.php
@@ -38,6 +38,7 @@ class enrol_self_edit_form extends moodleform {
 
         $mform->addElement('header', 'header', get_string('pluginname', 'enrol_self'));
 
+        $nameattribs = array('size' => '20', 'maxlength' => '255');
         $mform->addElement('text', 'name', get_string('custominstancename', 'enrol'));
         $mform->setType('name', PARAM_TEXT);
 
@@ -51,6 +52,7 @@ class enrol_self_edit_form extends moodleform {
         $mform->addHelpButton('customint6', 'newenrols', 'enrol_self');
         $mform->disabledIf('customint6', 'status', 'eq', ENROL_INSTANCE_DISABLED);
 
+        $passattribs = array('size' => '20', 'maxlength' => '50');
         $mform->addElement('passwordunmask', 'password', get_string('password', 'enrol_self'));
         $mform->addHelpButton('password', 'password', 'enrol_self');
         if (empty($instance->id) and $plugin->get_config('requirepassword')) {
-- 
1.9.1

