You are here

function tfa_basic_update_7002 in TFA Basic plugins 7

Rename trusted device to trusted browser.

File

./tfa_basic.install, line 227

Code

function tfa_basic_update_7002() {

  // Rename DB table.
  db_rename_table('tfa_trusted_device', 'tfa_trusted_browser');

  // Rename login plugin.
  $plugins = variable_get('tfa_login_plugins');
  if (!empty($plugins)) {
    foreach ($plugins as $k => $plugin) {
      if ($plugin == 'tfa_basic_trusted_device') {
        $plugins[$k] = 'tfa_basic_trusted_browser';

        // Keep the legacy cookie name.
        variable_set('tfa_basic_cookie_name', 'TD');
      }
    }
    variable_set('tfa_login_plugins', $plugins);
  }
}