The settings page is not coming up under User Management

CommentFileSizeAuthor
#4 login_destination_6.4.patch460 bytesjeremdow

Comments

Rosamunda’s picture

Yup. Subscribing.

lauscherli’s picture

Same problem... When i use the url admin/user/login_destination i get an 'access denied' message.

joshmiller’s picture

Status: Active » Closed (duplicate)

Duplicate of #274869: Access admin settings - Patch for Drupal > 6.2

Simple answer: The maintainer of the plugin didn't add permissions to their module, thus the core doesn't recognize the settings page. You can use the following to patch the module until the maintainer releases a new version.

Add the following to login_destination.module at the top of the page:

<?php
// Permissions
define('LOGIN_DEST_PERM_ADMIN', 'administer login destination');

/**
* Implementation of hook_perm().
*/
function login_destination_perm() {
  return array(LOGIN_DEST_PERM_ADMIN);
}
?>

And updating the function login_destination_menu()...

<?php
function login_destination_menu() {

  $items['admin/user/login_destination'] = array(
    'title' => 'Login destination',
    'description' => 'Configure where user will go after login.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('login_destination_admin_settings'),
    'access arguments' => array(LOGIN_DEST_PERM_ADMIN),
    'type' => MENU_NORMAL_ITEM
  );

  $items['login_redirect'] = array(
    'page callback' => 'login_destination_redirect',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK
  );

  return $items;
}

?>
jeremdow’s picture

Status: Closed (duplicate) » Needs review
StatusFileSize
new460 bytes

Here's a patch - I just added the one required 'access arguments' line to the menu hook though -

<?php

/**
 * Implementation of hook_menu().
 */
function login_destination_menu() {

  $items['admin/user/login_destination'] = array(
    'title' => 'Login destination',
    'description' => 'Configure where user will go after login.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('login_destination_admin_settings'),
    //+
    'access arguments' => array('administer site configuration'),
    //+
  );

  $items['login_redirect'] = array(
    'page callback' => 'login_destination_redirect',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK
  );

  return $items;
}

?>

No need for a separate permission for this, I think.

marcp’s picture

Status: Needs review » Closed (duplicate)