Wednesday 09 March 2011 8:14:51 am
A long time ago I wrote some code to remove users from user groups. Don't know if it is still useful. $groupID would be the nodeID of the assigned node.
$object = eZContentObject::fetch( $userObjectID );
if ($object)
{
$nodeID = $object->attribute('main_node_id');
$version = $object->currentVersion();
$versionNumber = $version->attribute('version');
$newVersion = $object->createNewVersion();
//TODO: make sure this is not the main node.
$newVersion->removeAssignment($groupID);
$newVersionNr = $newVersion->attribute( 'version' );
include_once( 'lib/ezutils/classes/ezoperationhandler.php' );
$operationResult = eZOperationHandler::execute(
'content', 'publish', array(
'object_id' => $userObjectID,
'version' => $newVersionNr
)
); }
Certified eZ publish developer with over 9 years of eZ publish experience. Available for challenging eZ publish projects as a technical consultant, project manager, trouble shooter or strategic advisor.
|