Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By vvanaparthy on
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
I Converted it but doesnt work like before
D6
What is wrong? Why doesn't my call back work? I have truncated cache menu table as well.
Any Ideas? Thanks
A couple of things...
You need 'access callback' and I'm not sure if 'login.php' can be a path.
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.
Thank you Sir
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