eZSESSID in ezhttptool::sendHTTPRequest()

Author Message

Michael Lee

Sunday 04 November 2007 7:12:19 am

Is it possible to support eZSESSID in ezhttptool::sendHTTPRequest?

Can we add another parameter to sendHTTPRequest() as the following?

function sendHTTPRequest($uri,$port,$postParameters, $userAgent, $passthrough, $ezsessionid)

And change the request header as the following?

...
"Cookie : eZSESSID=$ezsessionid".
...

In this way, we can do internal forward with authenticated session on server side.

Or maybe we can add an array parameter named "$cookies" to allow the user to supply additional cookies when invoking sendHTTPRequest() as the following?

function sendHTTPRequest($uri,$port,$postParameters, $userAgent, $passthrough, $cookies)

Please advise.

Michael Lee | Managing Director | ZerusTech Ltd | www.zerustech.com

Skype: zerustech

Kåre Køhler Høvik

Sunday 04 November 2007 12:55:13 pm

Hi

This is a hack, but if you can add custom HTTP headers using the <i>$userAgent</i> parameter. Example:

$userAgent = 'eZ Publish ' . "\r\n" .
                   'Cookie: ' . $mySessionVar;
eZHTTPTool::sendHTTPRequest( 'http://ez.no', 80, false, $userAgent );

Best regards
Kåre

Kåre Høvik

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 10:24:02
Script start
Timing: Jan 18 2025 10:24:02
Module start 'layout'
Timing: Jan 18 2025 10:24:02
Module start 'content'
Timing: Jan 18 2025 10:24:03
Module end 'content'
Timing: Jan 18 2025 10:24:03
Script end

Main resources:

Total runtime0.4203 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 588.0313152.6406
Module start 'layout' 0.00630.0025 740.671939.4766
Module start 'content' 0.00890.4102 780.1484534.9063
Module end 'content' 0.41900.0013 1,315.05478.4375
Script end 0.4203  1,323.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.8043160.0002
Check MTime0.00140.3308160.0001
Mysql Total
Database connection0.00100.229110.0010
Mysqli_queries0.364486.6872540.0067
Looping result0.00050.1205520.0000
Template Total0.382891.120.1914
Template load0.00230.542420.0011
Template processing0.380590.515120.1902
Template load and register function0.00020.039010.0002
states
state_id_array0.00080.201810.0008
state_identifier_array0.00070.171520.0004
Override
Cache load0.00190.4594200.0001
Sytem overhead
Fetch class attribute can translate value0.00050.127120.0003
Fetch class attribute name0.00120.288340.0003
XML
Image XML parsing0.00290.690020.0015
class_abstraction
Instantiating content class attribute0.00000.001940.0000
General
dbfile0.00841.9943220.0004
String conversion0.00000.001940.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs