Hello I am converting my Drupal 5.10 modules to Drupal 6.5.

What is the access callback for anonymous users? See Code below and please help me converting it.

D5

function sso_menu($may_cache) {
  $items = array();
  global $user;
  if ($may_cache) {
     $items[] = array(
      'path' => 'login.php',
      'title' => t('User login'),
      'callback' => '_sso_reg_check_login',
      'access' => !$user->uid,
      'type' => MENU_CALLBACK,
    );
  }
return $items;
}

Comments

vvanaparthy’s picture

D6

function sso_menu() {
  $items = array();
  $items['login.php'] = array(
    'title' => t('User login'),
    'page callback' => '_sso_check_login',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
  );
  return $items;
}

What is wrong? Why doesn't my call back work? I have truncated cache menu table as well.

Any Ideas? Thanks

mradcliffe’s picture

You need 'access callback' and I'm not sure if 'login.php' can be a path.

$items['myloginpath'] = array(
    'title' => t('User login'),
    'page callback' => '_sso_check_login',
    'access callback' => 'user_access',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK
);

http://mysite/myloginpath should be the path for that.

Are you sure you want to recreate drupal's login form? Do you just need to act when a user logs in? There are also single-sign on modules available.

vvanaparthy’s picture

Very true it does not accept login.php as a path. With a directory kind path it works fine for example login_action or some thing.

Thank you for the thoughts. By any chance do you know why this does not work only in Drupal 6. It was working in my Drupal 5.10 installation?

With regards to SSO modules, I need to really alter login form because Our SSO is quite complicated and it involves talking to many internal systems.

There are features like auto login and multi step form attached to the login work flow. Anyways I also need to change the default drupal login behavior to use email address instead of username.

I hope you understand.

Thanks