You are here

public static function MoAuthUtilities::mo2f_collect_device_attributes_handler in Google Authenticator / 2 Factor Authentication - 2FA 7

Collect system specific information using JS files

Parameters

$username:

1 call to MoAuthUtilities::mo2f_collect_device_attributes_handler()
mo_auth_form_alter_submit in ./mo_auth.module

File

classes/Utilities.php, line 313
This file is part of miniOrange 2FA module.

Class

MoAuthUtilities
@file This file is part of miniOrange 2FA module.

Code

public static function mo2f_collect_device_attributes_handler($username) {
  global $base_url;
  if (empty(session_id())) {
    session_start();
  }
  $session_id_encrypt = session_id();
  $module_path = drupal_get_path('module', 'mo_auth');
  ?>
    <!DOCTYPE html>
    <head>
      <?php

  echo '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>';
  echo '<script  src="' . $module_path . '/includes/js/rba/js/jquery-1.9.1.js" ></script>';
  echo '<script type="text/javascript" src="' . $base_url . '/' . $module_path . '/includes/js/rba/js/jquery.flash.js" ></script>';
  ?>
    </head>
    <body>
    <div>
      <form id="morba_loginform"  action="<?php

  echo $base_url . '/collectattributes';
  ?>" method="post">
        <h1 style="margin-left: 43%; margin-top: 5%;"><?php

  echo 'Please wait';
  ?>...</h1>
        <img style="margin-left: 44%; margin-top: 1%" src="<?php

  echo $base_url . '/' . $module_path;
  ?>/includes/images/ajax-loader-login.gif" />
        <?php

  ?>
          <p><input type="hidden" id="miniorange_rba_attributes" name="miniorange_rba_attributes" value=""/></p>
          <?php

  echo '<script type="application/javascript" src="' . $base_url . '/' . $module_path . '/includes/js/rba/js/ua-parser.js" ></script>';
  echo '<script type="application/javascript" src="' . $base_url . '/' . $module_path . '/includes/js/rba/js/client.js " ></script>';
  echo '<script type="application/javascript" src="' . $base_url . '/' . $module_path . '/includes/js/rba/js/device_attributes.js" ></script>';
  echo '<script type="application/javascript" src="' . $base_url . '/' . $module_path . '/includes/js/rba/js/swfobject.js" ></script>';
  echo '<script type="application/javascript" src="' . $base_url . '/' . $module_path . '/includes/js/rba/js/fontdetect.js" ></script>';
  echo '<script type="application/javascript" src="' . $base_url . '/' . $module_path . '/includes/js/rba/js/murmurhash3.js" ></script>';
  echo '<script type="application/javascript" src="' . $base_url . '/' . $module_path . '/includes/js/rba/js/miniorange-fp.js" ></script>';
  ?>
        <input type="hidden" name="session_id" value="<?php

  echo $session_id_encrypt;
  ?>"/>
        <input type="hidden" name="username" value="<?php

  echo $username;
  ?>"/>
      </form>
    </div>
    </body>
    </html>
    <?php

  exit;
}