Maintain style when badge and tooltip customised

This commit is contained in:
HadleySo
2026-03-18 18:02:43 -05:00
parent 127ed09345
commit 3018b8981a
3 changed files with 5 additions and 3 deletions

View File

@@ -78,7 +78,8 @@ $config['auth_header_hide_password_field'] = true;
* HTML snippet for a badge indicating that a field is locked and managed through the Identity Provider. This is shown next to fields in the user profile that are mapped to JWT claims and not allowed to be changed manually. * HTML snippet for a badge indicating that a field is locked and managed through the Identity Provider. This is shown next to fields in the user profile that are mapped to JWT claims and not allowed to be changed manually.
* You can customize the appearance and tooltip text as needed. Leave empty to use the default. * You can customize the appearance and tooltip text as needed. Leave empty to use the default.
*/ */
$config['auth_header_locked_data_batch'] = ""; $config['auth_header_locked_data_badge'] = "";
$config['auth_header_locked_data_tip'] = "";
/** /**

View File

@@ -456,7 +456,8 @@ class User extends CI_Controller {
} }
$data['auth_header_allow_direct_login'] = $this->config->item('auth_header_allow_direct_login', 'sso') ?? true; $data['auth_header_allow_direct_login'] = $this->config->item('auth_header_allow_direct_login', 'sso') ?? true;
$data['auth_header_hide_password_field'] = $this->config->item('auth_header_hide_password_field', 'sso') ?? false; $data['auth_header_hide_password_field'] = $this->config->item('auth_header_hide_password_field', 'sso') ?? false;
$data['auth_header_locked_data_batch'] = $this->config->item('auth_header_locked_data_batch', 'sso') ?: '<span class="badge bg-secondary ms-1" data-bs-toggle="tooltip" title="' . __("Can't be changed. Manage this through your Identity Provider.") . '"><i class="fa fa-lock"></i> IdP</span>'; $data['auth_header_locked_data_badge'] = $this->config->item('auth_header_locked_data_badge', 'sso') ?: 'IdP';
$data['auth_header_locked_data_tip'] = $this->config->item('auth_header_locked_data_tip', 'sso') ?: __("Can't be changed. Manage this through your Identity Provider.");
$data['sso_claim_config'] = $this->config->item('auth_headers_claim_config', 'sso') ?: []; $data['sso_claim_config'] = $this->config->item('auth_headers_claim_config', 'sso') ?: [];
$data['page_title'] = __("Edit User"); $data['page_title'] = __("Edit User");

View File

@@ -58,7 +58,7 @@
$idp_locked = function($field) use ($external_account, $sso_claim_config) { $idp_locked = function($field) use ($external_account, $sso_claim_config) {
return $external_account && isset($sso_claim_config[$field]) && empty($sso_claim_config[$field]['allow_manual_change']); return $external_account && isset($sso_claim_config[$field]) && empty($sso_claim_config[$field]['allow_manual_change']);
}; };
$idp_badge = $auth_header_locked_data_batch; $idp_badge = '<span class="badge bg-secondary ms-1" data-bs-toggle="tooltip" title="' . $auth_header_locked_data_tip . '"><i class="fa fa-lock"></i> ' . $auth_header_locked_data_badge . '</span>';
?> ?>
<div class="mb-3"> <div class="mb-3">