Automatic login?

NaSPA1 - January 29, 2005 - 02:46

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

I second this

Sergio Beristain - February 1, 2005 - 10:30

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

Search Engine Auto-Login

NaSPA1 - March 8, 2005 - 01:33

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

If your webserver supports

javanaut - March 8, 2005 - 01:46

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

htaccess does not allow user=ip address

Sergio Beristain - April 14, 2005 - 16:45

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.

Please let me know

Sergio Beristain - April 6, 2005 - 08:28

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

Why would you want search

videojunky - April 16, 2005 - 01:53

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.

Google News

Sergio Beristain - April 19, 2005 - 15:03

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.

Automatic login to give access to Google news

Sergio Beristain - June 16, 2005 - 08:26

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! ;-)

<?php
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;
}
?>

quite insecure

Bèr Kessels - June 16, 2005 - 08:39

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]

you /do/ nkow that letting in search engines and not others,

Bèr Kessels - June 16, 2005 - 08:36

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]

Google News

Sergio Beristain - September 21, 2005 - 15:36

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

Google News allows special access to crawlers

Sergio Beristain - October 5, 2005 - 09:42

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

ip_login module

davidwhthomas - June 1, 2008 - 04:19

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

Nice script

vinayras - October 6, 2008 - 20:17

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

 
 

Drupal is a registered trademark of Dries Buytaert.