You are here

samlauth_user_fields.module in SAML Authentication 8.3

Same filename and directory in other branches
  1. 4.x modules/samlauth_user_fields/samlauth_user_fields.module

Hook implementations for the samlauth_user_fields module.

File

modules/samlauth_user_fields/samlauth_user_fields.module
View source
<?php

/**
 * @file
 * Hook implementations for the samlauth_user_fields module.
 */
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\samlauth\Controller\SamlController;

/**
 * Implements hook_help().
 */
function samlauth_user_fields_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {

    // We need substantial explanatory text on top of the list page.
    case 'samlauth_user_fields.list':
      $output = '';
      $output .= '<p>' . t('At this moment, you need to know all SAML attribute names in order to be able to input them in the "Add mapping" screen. This is possible, among others, by inspecting SAML messages logged in the "Recent log messages", after enabling "Log incoming SAML messages".') . '</p>';
      if (\Drupal::config(SamlController::CONFIG_OBJECT_NAME)
        ->get('map_users')) {
        $output .= '<p>' . t('Any number in the "Use for linking" column (including 0) represents an attempt to match the value(s) in the SAML attributes to an existing Drupal user, if they are not linked to a user yet. The values/fields for each number are matched, in increasing order; if multiple mappings have the same number, the combination of both values must match the corresponding fields. Matching is only done if all corresponding SAML attributes actually have a value.') . '</p>';
      }
      else {
        \Drupal::messenger()
          ->addStatus(t('Linking options will be available when enabled in the main settings.'));
      }
      return $output;
  }
}

Functions

Namesort descending Description
samlauth_user_fields_help Implements hook_help().