Forums / General / Detect if url has https.

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/

eZ debug

Timing: Jan 31 2025 00:39:09
Script start
Timing: Jan 31 2025 00:39:09
Module start 'content'
Timing: Jan 31 2025 00:39:09
Module end 'content'
Timing: Jan 31 2025 00:39:10
Script end

Main resources:

Total runtime0.3956 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 587.8203370.3125
Module start 'content' 0.00730.0305 958.13281,009.5938
Module end 'content' 0.03780.3577 1,967.72663,897.6875
Script end 0.3955  5,865.4141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00461.1640200.0002
Check MTime0.00130.3376200.0001
Mysql Total
Database connection0.00060.153910.0006
Mysqli_queries0.261866.18191410.0019
Looping result0.00150.38871390.0000
Template Total0.357290.310.3572
Template load0.00110.273310.0011
Template processing0.356190.017810.3561
Override
Cache load0.00080.190110.0008
Sytem overhead
Fetch class attribute can translate value0.00220.546310.0022
XML
Image XML parsing0.00030.065710.0003
General
dbfile0.03639.1689200.0018
String conversion0.00000.001030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs