Getting Administration SiteAccess in PHP

Author Message

John Smith

Wednesday 09 December 2009 2:37:58 am

Hi Guys,

In php what is best way to know that I am in the Administration SiteAccess. I know it is possible to fetch the current sitaccess by $GLOBALS['eZCurrentAccess']['name']. I dont want to hard code or compare the variable mentioned above with xx_admin

Please suggest:

if ( $GLOBALS['eZCurrentAccess']['name'] == <siteaccess> . '_admin' )

or

something else???

Mark Simon

Wednesday 09 December 2009 3:09:21 am

for an easy way I would suggest to use ezini to read entries from the site.ini(.append.php)

that are set in the siteaccess site.ini like

[DesignSettings]
SiteDesign=admin

or

an own 'SiteName' in [SiteSettings]

www.all2e.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 05:16:17
Script start
Timing: Jan 18 2025 05:16:17
Module start 'layout'
Timing: Jan 18 2025 05:16:17
Module start 'content'
Timing: Jan 18 2025 05:16:18
Module end 'content'
Timing: Jan 18 2025 05:16:18
Script end

Main resources:

Total runtime1.2747 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.0056 589.1641152.6406
Module start 'layout' 0.00560.0023 741.804739.4766
Module start 'content' 0.00791.2652 781.2813521.7109
Module end 'content' 1.27310.0015 1,302.99228.2813
Script end 1.2746  1,311.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2654160.0002
Check MTime0.00140.1099160.0001
Mysql Total
Database connection0.00090.070310.0009
Mysqli_queries1.227296.2758540.0227
Looping result0.00050.0376520.0000
Template Total1.246597.820.6233
Template load0.00210.168220.0011
Template processing1.244397.621720.6222
Template load and register function0.00010.010710.0001
states
state_id_array0.00110.087010.0011
state_identifier_array0.00150.116420.0007
Override
Cache load0.00170.1355170.0001
Sytem overhead
Fetch class attribute can translate value0.00090.067420.0004
Fetch class attribute name0.00110.084930.0004
XML
Image XML parsing0.00070.052620.0003
class_abstraction
Instantiating content class attribute0.00000.000730.0000
General
dbfile0.00090.0699160.0001
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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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: 9
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs