Problem with authentication and i18n

Author Message

Sergei Chusmah

Friday 24 August 2007 4:59:26 am

I have a site in several languages, with a host method for selecting the language (i.e. example.com, fr.example.com, de.example.com) the version os 3.6
The problem is when a user logs in to example.com, and then switches the language, it redirects him to the user login page again. Maybe the stored cookies are valid only for a host name...

How can I solve this?

Also, the language code is not available to all my templates, is there a way to include it somehere so it is available to all templates?

One last question, is there a common variable which stores the current host url (i.e. en.example.com). Maybe in the ·site array? Is there a doc where its contents are described?

Thanks a lot!

Christophe Condomines

Friday 24 August 2007 6:28:21 am

> Maybe the stored cookies are valid only for a host name

Yes, by default, a cookie is limited to the hostname. You may change your siteaccess selection to something like www.example.com/fr www.example.com/de to be able to share the session between the different siteaccess.
You should also have a look to the session configuration:
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/configuration_files/site_ini/session

> the language code is not available to all my templates
I'm not sure to understand your question. May be getting the settings with the ezini operator is sufficient: ezini('RegionalSettings','locale') or something similar.

> Is there a common variable which stores the current host url
Yes, ezsys is the operator you are looking for. Have a look to the documentation:
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_operators/data_and_information_extraction/ezsys

Good luck,

Microblau SL
http://www.microblau.net

Sergei Chusmah

Tuesday 28 August 2007 2:36:10 am

Thanks for your reply, it has been very useful!

Regarding cookies, I think they can be set to a whole domain (i.e. *.example.com) with the syntax ".example.com", don't know if that would work in ez...

ezsys and ezini solved my other problems, thanks :)

Christophe Condomines

Tuesday 28 August 2007 3:10:51 am

> <i>Thanks for your reply, it has been very useful!</i>
You're welcome.

> <i>Regarding cookies, I think they can be set to a whole domain (i.e. *.example.com) with the syntax ".example.com", don't know if that would work in ez...</i>

You're right, a cookie on "example.com" should work for every sub-domain. The main problem here is that you can not configure this in eZPublish. If you really want this, you have to hack the session's library. You also may send a request for enhancement for this feature at http://issues.ez.no

Regards.

Microblau SL
http://www.microblau.net

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 00:12:36
Script start
Timing: Jan 19 2025 00:12:36
Module start 'layout'
Timing: Jan 19 2025 00:12:36
Module start 'content'
Timing: Jan 19 2025 00:12:37
Module end 'content'
Timing: Jan 19 2025 00:12:37
Script end

Main resources:

Total runtime1.4362 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 587.9141152.6250
Module start 'layout' 0.00620.0034 740.539139.4609
Module start 'content' 0.00961.4252 780.0000550.2188
Module end 'content' 1.43480.0013 1,330.218812.1563
Script end 1.4361  1,342.3750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2297160.0002
Check MTime0.00130.0911160.0001
Mysql Total
Database connection0.00070.051010.0007
Mysqli_queries1.379296.0341600.0230
Looping result0.00060.0438580.0000
Template Total1.398297.420.6991
Template load0.00200.137720.0010
Template processing1.396297.216620.6981
Template load and register function0.00020.017110.0002
states
state_id_array0.00090.059710.0009
state_identifier_array0.00110.075920.0005
Override
Cache load0.00170.1156320.0001
Sytem overhead
Fetch class attribute can translate value0.00060.044720.0003
Fetch class attribute name0.00130.089950.0003
XML
Image XML parsing0.00330.228620.0016
class_abstraction
Instantiating content class attribute0.00000.001560.0000
General
dbfile0.00330.2313160.0002
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs