Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
novicell/dds_editors / dds_editors.module
Size: Mime:
<?php

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;

/**
 * Implements hook_form_FORM_ID_alter().
 */
function dds_editors_form_user_login_form_alter(&$form, FormStateInterface $form_state) {
  $form['#submit'][] = 'dds_editors_user_login_submit';
}

/**
 * Form submission handler for user_login_form().
 *
 * Redirects the user to the dashboard after logging in.
 */
function dds_editors_user_login_submit(&$form, FormStateInterface $form_state) {
  $request = \Drupal::service('request_stack')->getCurrentRequest();
  if (!$request->request->has('destination')) {
    $url = Url::fromRoute('dds_content_hierarchy.content_overview');
    $form_state->setRedirectUrl($url);
  }
}