From d79710afdeb0f497a55357aefaa4b01c9c455c16 Mon Sep 17 00:00:00 2001 From: James Henestofel Date: Wed, 9 Oct 2013 11:44:57 -0400 Subject: [PATCH] MDL-42231 auth: custom profile fields to support numbers at the end. For data mapping LDAP or CAS. Change order of fieldname display checks to verify custom profile fields first to allow custom field shortname to contain number at the end. --- admin/auth_config.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/auth_config.php b/admin/auth_config.php index ed5fb413be9..e1a0fb08c8c 100644 --- a/admin/auth_config.php +++ b/admin/auth_config.php @@ -142,14 +142,14 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts, $fieldname = $field; if ($fieldname === 'lang') { $fieldname = get_string('language'); - } elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) { - $fieldname = get_string($matches[1]) . ' ' . $matches[2]; - } elseif ($fieldname == 'url') { - $fieldname = get_string('webpage'); } elseif (!empty($customfields) && in_array($field, $customfields)) { // If custom field then pick name from database. $fieldshortname = str_replace('profile_field_', '', $fieldname); $fieldname = $customfieldname[$fieldshortname]->name; + } elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) { + $fieldname = get_string($matches[1]) . ' ' . $matches[2]; + } elseif ($fieldname == 'url') { + $fieldname = get_string('webpage'); } else { $fieldname = get_string($fieldname); }