Tuesday 19 August 2008 9:44:21 am
I found the solution, I execute my script with
php runcronjobs.php toto
And I have to be a eZ user to have the right to remove objects :
// Get user creator
$ini = eZINI::instance();
// Get user's ID who can remove subtrees. (Admin by default with userID = 14)
$userCreatorID = $ini->variable( "UserSettings", "UserCreatorID" );
$user = eZUser::fetch( $userCreatorID );
if ( !$user )
{
error_log("Subtree remove Error!\nCannot get user object by userID = '$userCreatorID'.\n(See site.ini[UserSettings].UserCreatorID");
}
eZUser::setCurrentlyLoggedInUser( $user, $userCreatorID );
http://www.acidre.com
|