You are here

public static function MoAuthUtilities::get_Existing_Drupal_Roles in Google Authenticator / 2 Factor Authentication - 2FA 8

Same name and namespace in other branches
  1. 8.2 src/MoAuthUtilities.php \Drupal\miniorange_2fa\MoAuthUtilities::get_Existing_Drupal_Roles()
2 calls to MoAuthUtilities::get_Existing_Drupal_Roles()
MoAuthLoginSettings::buildForm in src/Form/MoAuthLoginSettings.php
Form constructor.
MoAuthLoginSettings::submitForm in src/Form/MoAuthLoginSettings.php
Form submission handler.

File

src/MoAuthUtilities.php, line 241
This file is part of miniOrange 2FA module.

Class

MoAuthUtilities

Namespace

Drupal\miniorange_2fa

Code

public static function get_Existing_Drupal_Roles() {
  $roles = Role::loadMultiple();
  $roles_arr = array();
  foreach ($roles as $key => $value) {
    $roles_arr[$key] = $value
      ->label();
  }
  return $roles_arr;
}