Detect if url has https.

Author Message

Guillaume R

Friday 02 March 2007 7:17:12 am

Hey, I was wondering if it was possible to detect http or https in an url address using an eZ Publish function.

The reason I'm looking for this kind of function is that in IE, when there is non-secured elements in a https page, we get a popup warning the user.. and with this function, I could make this non-secure content change when this is a secured page.

Thanks!

kracker (the)

Friday 02 March 2007 12:49:14 pm

I took a brief look for the related online ...
<i>http://ez.no/doc/content/advancedsearch?SearchText=SSL&PhraseSearchText=&SearchSectionID=10&SearchContentClassID=-1&isOnDocumentation=true&SubTreeArray%5B%5D=documentation&SearchPageLimit=4&SearchButton=Search</i>

I would comment that you would do well to learn the configuration settings (features) offered by the sslzonesettings block.

<i>http://ez.no/doc/ez_publish/technical_manual/3_8/reference/configuration_files/site_ini/sslzonesettings</i>

Ad while these settings are not as well documented (yet) in the latest eZ Publish 3.8 documentation manuals as you may like they are fairly simple in nature, I wager you could learn them by reviewing existing settings (global defaults in setting/site.ini).

There is also the new feature documentation txt file on this subject in svn,
<i>http://pubsvn.ez.no/nextgen/trunk/doc/features/3.8/ssl_zones.txt</i>

<i>//kracker

Home Movies : Hot Dog Music</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

kracker (the)

Friday 02 March 2007 1:14:11 pm

And from the 'stuff-you-see-but-always-forget-where-dept', there was a great article which covered this subject,
<i>http://ez.no/community/articles/new_features_in_ez_publish_3_8/applying_ssl_zones</i>

<i>//kracker

The Pink Panther Theme</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Guillaume R

Friday 02 March 2007 1:43:00 pm

Ok thank you very much, I will take a good look at it.

Karl Latiss

Saturday 03 March 2007 5:54:09 pm

I went another way and used the wrapper operator (http://ez.no/community/contribs/template_plugins/wrapper_operator) with a small user function getServerVariable.php:

<?php

    function getServerVariable($variable)
    {
        return $_SERVER[$variable];
    }

?>

Then in my template have

{def $https=wrap_user_func('getServerVariable', array('HTTPS'))}

and check with

{if eq($https, 'on')}

Atvert Systems
http://www.atvert.com.au

Saturday 03 March 2007 6:39:57 pm

Smart move Adjax ;D

A lot more of those lost, would do well to make the most from the wrap operator's simple ability to provide for simpler solutions, like tpl -> PHP -> (*anything*) -> PHP - > tpl -> user ...

<i>//darken
AntIcon - Music For The Advancement Of Hip Hop - Divine Disappointment- Alias</i>

kracker (the)

Sunday 04 March 2007 12:47:25 am

Added to example / available wrap_operator extension's stock function's available (not enabled by default). See the commit log message for more information, <i>http://pubsvn.ez.no/websvn/listing.php?repname=community&path=%2Ftrunk%2Fextension%2Fwrap_operator%2F&rev=1521&sc=1</i>

<i>//kracker</i>
<b>Sole : Bottle of Humans</b>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

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 18 2025 11:32:13
Script start
Timing: Jan 18 2025 11:32:13
Module start 'layout'
Timing: Jan 18 2025 11:32:13
Module start 'content'
Timing: Jan 18 2025 11:32:15
Module end 'content'
Timing: Jan 18 2025 11:32:15
Script end

Main resources:

Total runtime1.7414 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0089 587.8828152.6094
Module start 'layout' 0.00890.0073 740.492239.4141
Module start 'content' 0.01621.7238 779.9063660.5391
Module end 'content' 1.74000.0013 1,440.445316.1797
Script end 1.7413  1,456.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.2394160.0003
Check MTime0.00180.1024160.0001
Mysql Total
Database connection0.00190.106210.0019
Mysqli_queries1.666295.6866730.0228
Looping result0.00080.0443710.0000
Template Total1.633493.820.8167
Template load0.00250.145320.0013
Template processing1.630893.651420.8154
Template load and register function0.00030.015610.0003
states
state_id_array0.00450.259110.0045
state_identifier_array0.00600.346420.0030
Override
Cache load0.00210.1230430.0000
Sytem overhead
Fetch class attribute can translate value0.00050.029240.0001
Fetch class attribute name0.00290.166190.0003
XML
Image XML parsing0.00130.077440.0003
class_abstraction
Instantiating content class attribute0.00000.0015110.0000
General
dbfile0.00100.0602230.0000
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
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs