language paths

mansspams - September 30, 2008 - 00:43
Project:Path Access
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi,

I have D6 site with multiple language content and paths are built like mysite.com/en/node/2 or mysite.com/ru/node/2 where en is English content and ru is Russian content. Path Access works well with allowing and denying access to particular nodes like node/2 or all nodes like node/* but it does not seem to recognize en/ or ru/ part of url, since en or ru comes BEFORE root path of drupal installation. When I allow user to access only "en/*" parts user is actually denied access to ALL SITE, every page is not accessible, like if i just just * in rules.

Suggestions? Ideas?

#1

Frank Steiner - October 28, 2008 - 08:28

That's because the en/ and ru/ parts are *not* part of the path alias! Those prefixes are added by the locale module (I think) and they are just inserted before the path alias.

You cannot handle language aliases by just using $node->path, but you would also have to fetch the language and its prefix and consider those, too.

But it isn't so easy to find a good policy here, especially not with the i18n module. You can have e.g. a language neutral page which is shown regardless of the language, but once with /en/page and once with /ru/page, but every time it's the same page. I'm not sure you would want to deny access for one language and allow for the other, so just taking language prefixes into the path doesn't solve all problems.

#2

redben - October 14, 2009 - 13:37

May be if you use a "deny" approach, it would make it easier to get the job done ? Generally It's easier to enumerate restricted areas than unrestricted ones.

 
 

Drupal is a registered trademark of Dries Buytaert.