fix typo prefer(r)ed_username and support config-values with at least one underscore in it like "preferred_username"

This commit is contained in:
ralf 2024-07-19 15:15:09 +02:00
parent 1c0719cb7c
commit a2f1c8a67e
2 changed files with 9 additions and 4 deletions

View File

@ -183,6 +183,11 @@ foreach($vars as $value)
$newvals = explode(' ',$newval); $newvals = explode(' ',$newval);
$setting = array_pop($newvals); $setting = array_pop($newvals);
$config = implode('_',$newvals); $config = implode('_',$newvals);
if (!isset($current_config[$config]))
{
$setting = array_pop($newvals).'_'.$setting;
$config = implode('_', $newvals);
}
/* echo $config . '=' . $current_config[$config]; */ /* echo $config . '=' . $current_config[$config]; */
if($current_config[$config] == $setting) if($current_config[$config] == $setting)
{ {

View File

@ -497,10 +497,10 @@
<td>{lang_Name_of_JWT_payload_attribute_for_username}:</td> <td>{lang_Name_of_JWT_payload_attribute_for_username}:</td>
<td> <td>
<select name="newsettings[oic_username_attribute]"> <select name="newsettings[oic_username_attribute]">
<option value="sub"{selected_oic_username_sub}>sub ({lang_default})</option> <option value="sub"{selected_oic_username_attribute_sub}>sub ({lang_default})</option>
<option value="prefered_username"{selected_oic_username_prefered_username}>prefered_username</option> <option value="preferred_username"{selected_oic_username_attribute_preferred_username}>preferred_username</option>
<option value="email"{selected_oic_username_email}>email</option> <option value="email"{selected_oic_username_attribute_email}>email</option>
<option value="custom"{selected_oic_username_custom}>{lang_custom_attribute}</option> <option value="custom"{selected_oic_username_attribute_custom}>{lang_custom_attribute}</option>
</select> </select>
<input name="newsettings[oic_username_custom]" value="{value_oic_username_custom}" size="40" placeholder="{lang_custom_attribute}"/> <input name="newsettings[oic_username_custom]" value="{value_oic_username_custom}" size="40" placeholder="{lang_custom_attribute}"/>
</td> </td>