Commit e0265384 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie

Fix an invalid option for institution for login forms

parent 385573e4
......@@ -379,6 +379,11 @@ function auth_draw_login_page($message=null, Pieform $form=null) {
*/
function auth_get_login_form() {
$institutions = get_records_menu('institution', '', '', 'name, displayname');
$defaultinstitution = get_cookie('institution');
if (!$defaultinstitution) {
$defaultinstitution = 'mahara';
}
$elements = array(
'login' => array(
'type' => 'fieldset',
......@@ -387,7 +392,7 @@ function auth_get_login_form() {
'login_username' => array(
'type' => 'text',
'title' => get_string('username'),
'description' => get_string('usernamedescription'),
'description' => get_string('usernamedescription') . ':',
'rules' => array(
'required' => true
)
......@@ -395,17 +400,17 @@ function auth_get_login_form() {
'login_password' => array(
'type' => 'password',
'title' => get_string('password'),
'description' => get_string('passworddescription'),
'description' => get_string('passworddescription') . ':',
'value' => '',
'rules' => array(
'required' => true
)
),
'login_institution' => array(
'type' => 'select',
'title' => get_string('institution'),
'defaultvalue' => get_cookie('institution'),
'options' => $institutions,
'type' => 'select',
'title' => get_string('institution'). ':',
'defaultvalue' => $defaultinstitution,
'options' => $institutions,
'rules' => array(
'required' => true
),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment