IceWeasel and konqueror are treated as search engines

Bug #1405672 reported by Patrick
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
webtrees
Fix Released
Low
fisharebest

Bug Description

Running debian wheezy, 64 bit.

Database is created but but the error "You do not have permission to view this page."

Also got this:

ERROR 2: date(): Invalid date.timezone value 'US/Detroit', we selected the timezone 'UTC' for now.
0 Error occurred on in function date
1 called from line 563 of file session.php in function require
2 called from line 30 of file login.php

Revision history for this message
Patrick (paerick) wrote :

webtrees version 1.6.2, mysql version 5.5.40-0+wheezy1, php version PHP 5.4.35-0+deb7u2

Revision history for this message
fisharebest (fisharebest) wrote :

The error suggests that your server is configured to have "US/Detroit" as its default timezone, but at the same time, it does not recognise this as a valid timezone!

IIRC, time zones in the US are specified by name ("US/Central"), rather than by city.

Check your server configuration.

Revision history for this message
Patrick (paerick) wrote :

I changed the timezone to US/Eastern. Same problem.

This is what my screen looks like.

webtrees (as an image)

webtrees (as text)

    "Home icon" "Lists icon"
    Home page Lists

You do not have permission to view this page.

Revision history for this message
fisharebest (fisharebest) wrote :

When you say "Same problem", do you mean you get exactly the same error message?

> ERROR 2: date(): Invalid date.timezone value 'US/Detroit'

If yes, then whatever you changed had no effect.

If you actually meant that you got a similar error message, but now saying that "US/Eastern"
is not a valid timezone, then I'd still suggest that your server's timezones are not configured.

What happens if you set the timezone to "UTC"

Revision history for this message
Patrick (paerick) wrote :

OK, I will explain again.

I changed the timezone to US/Eastern.

I deleted the webtrees files from the web server folder.

I deleted the webtrees mysql database.

I rebooted the computer.

I unzipped the webtrees-1.6.2.zip and installed into the web server folder.

I pointed my web browser to localhost/webtrees and got the setup script.

Language was selected as U.S. English, I clicked continue.

I entered a database user name and password and clicked continue.

I entered a database name and kept the table prefix wt_ and clicked continue.

I entered my anem, login id, password (twice) and email address and clicked continue.

The script processed for a while. The database was created and tables populated. I can see it via webmin. I am attaching a screen print of the returned page. If that attachment does not work the returned page looked like:

webtrees (as an image)

webtrees (as text)

    "Home icon" "Lists icon"
    Home page Lists

You do not have permission to view this page.

Revision history for this message
fisharebest (fisharebest) wrote :

OK, completely different problem to the one first described.

What happens if you try a different browser, say Chrome or Firefox

Revision history for this message
Patrick (paerick) wrote :

Looking at the session.php code I see the problem at this statement:

$rule = WT_DB::prepare(
 "SELECT SQL_CACHE rule FROM `##site_access_rule`" .
 " WHERE IFNULL(INET_ATON(?), 0) BETWEEN ip_address_start AND ip_address_end" .
 " AND ? LIKE user_agent_pattern" .
 " ORDER BY ip_address_end LIMIT 1"
)->execute(array($WT_REQUEST->getClientIp(), $_SERVER['HTTP_USER_AGENT']))->fetchOne();

The HTTP_USER_AGENT string being returned by iceweasel (debian's version of firefox) is "firefox" because I set it to that to resolve a problem at the www.chase.com website that did not like the original setting.

The konqueror web browser for wheezy returns:
Mozilla/5.0 (X11; Linux x86_64) KHTML/4.8.4 (like Gecko) Konqueror/4.8
which resolves as "unknown".

So I changed the rule for the iceweasel web browser (firefox) from "unknown" to "allow" in the database table wt_site_access_rule and it works for the initial login screen and I get sent to the Administration page to Create a new family tree.

I will test some more later.

Revision history for this message
fisharebest (fisharebest) wrote :

webtrees needs to block certain links to search engines. For example, the calendar page, otherwise robots would attempt to generate a page for every date in all of history.

The approach is to whitelist known browsers. (Yes, this sucks a bit. A better approach would be to use javascript on all links to non-robot content.)

New/unrecognised user-agent strings are assumed to be search-engines until told otherwise. (See admin -> site access rules).

You could whitelist 127.0.0.1, a UA string, or any combination.

I presume the default UA string for Konqueror works OK?

Revision history for this message
Patrick (paerick) wrote :

The default strings for both Iceweasel and Konqueror work on 32 bit and 64 bit wheezy.

Both report the browsers as type "unknown" but that does not seem to be a problem.

Revision history for this message
Patrick (paerick) wrote :

After further testing I wanted to report that Iceweasel works on debian wheezy for 32 bit and 64 bit processors. Konqueror does NOT work on debian wheezy for 32 bit and 64 bit processors.

Here are the user agent strings reported on debian wheezy:

Debian wheezy 32 bit

iceweasel allow: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20140925 Firefox/24.0 Iceweasel/24.8.1

konqueror unknown: Mozilla/5.0 (X11; Linux i686) KHTML/4.8.4 (like Gecko) Konqueror/4.8

Debian wheezy 64 bit

Iceweasel allow: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.3.0

Konqueror unknown: Mozilla/5.0 (X11; Linux x86_64) KHTML/4.8.4 (like Gecko) Konqueror/4.8

After reviewing the README.md again I do not see anything about what to do if you experience problems. In my case the message in red: "You do not have permission to view this page."

Perhaps something could be added to the README.md document in the Installation section about this message and what to do if you get it.

Thank you for you help.

summary: - After install and setup: You do not have permission to view this page.
+ IceWeasel and konqueror are treated as search engines
Revision history for this message
fisharebest (fisharebest) wrote :

We already have the following rule for Konqueror: Mozilla/5.0 (compatible; Konqueror/%

But it seems that the latest version has changed the UA string.
See http://www.useragentstring.com/pages/Konqueror

As for Iceweasel, it should be picked up by the existing "Gecko-based browser" rule.

Changed in webtrees:
status: New → Fix Committed
importance: Undecided → Low
assignee: nobody → fisharebest (fisharebest)
Revision history for this message
fisharebest (fisharebest) wrote :

Fix released in 1.7.0

Changed in webtrees:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.