Forums / Developer / Getting Administration SiteAccess in PHP

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