I'm very new to Drupal and I wonder if is it correct the custom module I wrote. I need a sort of autologon since I'm on an intranet environment (Windows, Active Directory, IIS6) totally isolated from web.
<?php
function autologon_init() {
global $user;
if($user->uid == 0)
user_external_login_register($_SERVER['AUTH_USER"], 'Autologon');
}
I know that with th开发者_开发问答e code above logoff will never works..
I used http://drupal.org/project/ip_login successfully to auto login in an intranet. Although there's no D7 version yet.
But maybe porting it to D7 would be more fun for you and more use full for the community as reinventing the wheel just for yourself.
Instead of trying to write code to automatically log users in, you could also simply adjust permissions so anonymous users have access to all the features you would want for this class of logged in users. Then it's irrelevant whether users are logged in or not.
精彩评论