Hi all! Was wondering if anyone has worked out a way to provide an "automatic login" based on ip address, user-agent, etc. What I'm trying to do is provide a way for search engines to "login" to the site automatically so they can spider the "members" version of content.

Thanks!

Radi

Comments

Sergio Beristain’s picture

I second this! This is a basic feature needed urgently!
http://drupal.org/node/16544

NaSPA1’s picture

I have it working for the most part on my site. Just need to shake it down a bit more and will see about posting as a project here.

Radi Shourbaji
http://radi-shourbaji.profconnect.org

javanaut’s picture

If your webserver supports such a feature, you could use the webserver_auth module to identify the current user.

Sergio Beristain’s picture

I don't see how this will be possible.
The module you point out to allows me to add users who are part of my unix users (meaning that they have a .htpassword file). But they still need the password.
From what I have read so far the only way to allow an IP address to have access is through changing:

# Protect files and directories from prying eyes:
<Files ~ "(\.(conf|inc|module|pl|sh|sql|theme|engine|xtmpl)|Entries|Repositories|Root|scripts|updates)$">
  order deny,allow
  deny from all
  allow from <address> 
</Files>

This unfortunately will give complete access to the IP address which I do not want.

You see, for the Google News spider (which has no cookie system) to have access to my site I rather link their IPaddress to a user and set the permissions there.
If you have any ideas, they are welcome.

Sergio Beristain’s picture

Please let me know. Because I really want the guys at Google News to be able to have access to my website.
Regards,
Sergio

videojunky’s picture

Why would you want search engines indexing content thats only available when users register on your site. The average user would more likly be confused or disappointed than register to see the content. The only advantage i see from getting member only content indexed is the small amount of light search engines will shed onto your internet wide user base.

Sergio Beristain’s picture

Indeed restricting a first click is annoying. But you can allow content that is say one day old available in your site.
This is how for example the Financial Times does.
Users who are looking for specific information will see that they can get this news in your site. It's marketing to the right person who is looking for that specific content.

Sergio Beristain’s picture

Radi,
I finally found the answer to the problem, this module does the trick.
By inserting the IP address on the authmap table and refering it to a user number, example for uid 7 and IP address 123.34.234.21:
aid uid authname module

1 7 123.34.234.21 loginip

The IP address will be logged as the user you want to.
Hope this helps! ;-)

function loginip_init() {
  global $user;

  if ($user->uid) {
    //do nothing because user is already logged into Drupal
  }
  else {
{
      // user is logged into webserver.
      $user = user_external_load($_SERVER["REMOTE_ADDR"]);
  
  }
}

function loginip_help($section) {
  $output ="";

  switch ($section) {
    case 'admin/help#loginip_':
      break;
    case 'admin/modules#description':
      $output .= t("Login through IP address");
      break;
  }

  return $output;
}
Bèr Kessels’s picture

I will be ale to log into that site without any problems, by simply faking my IP. limiting only on IP is really not very secure.

---
Next time, please consider filing a support request.

[Bèr Kessels | Drupal services www.webschuur.com]

Bèr Kessels’s picture

violates a lot of conventions, most prominent of all the "convention of being honoust" ;) ?
http://www.google.be/intl/en/webmasters/guidelines.html , look near the bottom....

you can call me a purist if you want :)
---
Next time, please consider filing a support request.

[Bèr Kessels | Drupal services www.webschuur.com]

Sergio Beristain’s picture

Ber,
You have a point!
I should not want to decieve Google to get traffic. But why does Google News does not keep a cache while Google does?
Simply because other sites restrict the content to subscribed users at a specific point in time.

However, after some experience, I have decided to upgrade the node access accordingly so that there is open access only in a specific moment of the story instead of using the IP address.

Sergio

Sergio Beristain’s picture

Ber,
BTW this is what Google wrote back when they could not access my site:

In order to add your news articles to Google News, our crawler needs to be able to access the content on your site. Currently, crawlers cannot fill out registration forms, nor do they support cookies. Given that, in order
to successfully crawl your site, we need to be able to circumvent your registration page. The easiest way to do this is to configure your webservers to not serve the registration when our crawlers visit your pages (when the User-Agent is 'Googlebot'). You can verify that the
request is actually from our robot by making sure the IP address is within the range of XXXXXX. It is equally important that your robots.txt file allows access by Googlebot.
We are also committed to providing an excellent user experience.
Generally, encountering a registration page after following a link on Google News constitutes a poor user experience for our users (who may also become your users). There are two possible solutions to this problem:
1. First click free: ...
2. Subscription designation: If the above (preferred) solution is not feasible, our policy is to add a '(subscription)' tag to the publication name of all sources that greet our users with a subscription or registration form. This signals to our users that they may be required to register or subscribe on your site in order to access the article in question.

Regards,
The Google Team

davidwhthomas’s picture

Hi, I've made a module to allow login by IP Address.
See: http://drupal.org/project/ip_login
cheers,
DT

vinayras’s picture

hi,

Thanks for the script - though i am not using this script - but it gave me lots of idea. I needed something similar in my environment

Vinay Yadav
PHP / Drupal Developer
http://www.vinayras.com

www.eDrupal.com - Indian Drupal Community