eZ Community » Forums » Developer » Changing siteaccess during script...
expandshrink

Changing siteaccess during script execution

Changing siteaccess during script execution

Tuesday 27 April 2010 2:17:55 pm - 5 replies

Hi all

I'd like to know if it was possible to switch from one siteaccess to another in a script (or cronjob) ?

Thanks happy.gif Emoticon

Tuesday 27 April 2010 2:25:46 pm

Try to use eZScript::setUseScriptAccess

http://pubsvn.ez.no/doxygen/4.2/h...ml#a8e1752784523828149496dd029079c4b

Phil

Tuesday 27 April 2010 2:29:59 pm

Yes but this has to be executed before $script->initialize(); thus you will not be able use it during the execution of a cronjob for exemple or a script launched with ezexec.php

Tuesday 27 April 2010 2:31:55 pm

Indeed, what I need to do is several tasks for every siteaccesses present in my conf. So unfortunately I won't be able to use this trick sad.gif Emoticon

Tuesday 27 April 2010 2:40:41 pm

hum during script execution, is it not possible to do something like that :

require_once( "access.php" );

$script->SiteAccess = "mySiteAccess";

$access = array( 'name' => 'mySiteAcess', type' => EZ_ACCESS_TYPE_STATIC );

$access = changeAccess( $access );

Wednesday 19 May 2010 10:56:56 am

Hi Philippe

Thanks for your reply. Indeed, it should work as this is the same code used in eZScript::initialize().

Thanks for your help !

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from