33 include_once
'./webservice/soap/classes/class.ilSoapAdministration.php';
49 if(!$this->__checkSession($sid))
56 return $this->
__raiseError(
'No valid target id given. Please choose an existing reference id of an ILIAS category or group',
62 if(!$rbacsystem->checkAccess(
'create',
$target_id,
'grp'))
64 return $this->
__raiseError(
'Check access failed. No permission to create groups',
'Server');
69 return $this->
__raiseError(
"Parent with ID $target_id has been deleted.",
'CLIENT_TARGET_DELETED');
74 include_once(
"./Modules/Group/classes/class.ilObjGroup.php");
75 include_once
'Modules/Group/classes/class.ilGroupXMLParser.php';
77 $new_ref_id = $xml_parser->startParsing();
79 return $new_ref_id ? $new_ref_id :
"0";
89 if(!$this->__checkSession($sid))
98 return $this->
__raiseError(
'No valid target id given. Please choose an existing reference id of an ILIAS category or group',
104 if(!$rbacsystem->checkAccess(
'write',
$ref_id,
'grp'))
106 return $this->
__raiseError(
'Check access failed. No permission to edit groups',
'Server');
110 include_once(
"./Modules/Group/classes/class.ilObjGroup.php");
114 return $this->
__raiseError(
'Cannot create group instance!',
'CLIENT_OBJECT_NOT_FOUND');
119 return $this->
__raiseError(
"Object with ID $ref_id has been deleted.",
'CLIENT_OBJECT_DELETED');
125 return $this->
__raiseError(
'Reference id does not point to a group!',
'CLIENT_WRONG_TYPE');
129 include_once
'Modules/Group/classes/class.ilGroupXMLParser.php';
132 $xml_parser->setGroup($grp);
133 $new_ref_id = $xml_parser->startParsing();
135 return $new_ref_id ? $new_ref_id :
"0";
144 if(!$this->__checkSession($sid))
151 return $this->
__raiseError(
'No title given. Please choose an title for the group in question.',
163 if(!$this->__checkSession($sid))
170 return $this->
__raiseError(
"Parent with ID $ref_id has been deleted.",
'CLIENT_OBJECT_DELETED');
176 return $this->
__raiseError(
'No valid reference id given.',
181 include_once
'Modules/Group/classes/class.ilGroupXMLWriter.php';
184 $xml_writer->start();
186 $xml = $xml_writer->getXML();
188 return strlen($xml) ? $xml :
'';
197 if(!$this->__checkSession($sid))
202 if(!is_numeric($group_id))
204 return $this->
__raiseError(
'No valid group id given. Please choose an existing reference id of an ILIAS group',
215 return $this->
__raiseError(
'Invalid group id. Object with id "'. $group_id.
'" is not of type "group"',
'Client');
219 if(!$rbacsystem->checkAccess(
'write',$group_id))
221 return $this->
__raiseError(
'Check access failed. No permission to write to group',
'Server');
227 return $this->
__raiseError(
'Invalid user id. User with id "'. $user_id.
' does not exist',
'Client');
229 if($type !=
'Admin' and 232 return $this->
__raiseError(
'Invalid type '.$type.
' given. Parameter "type" must be "Admin","Member"',
'Client');
237 return $this->
__raiseError(
'Cannot create group instance!',
'Server');
242 return $this->
__raiseError(
'Cannot create user instance!',
'Server');
246 include_once
'Modules/Group/classes/class.ilGroupParticipants.php';
267 if(!$this->__checkSession($sid))
271 if(!is_numeric($group_id))
273 return $this->
__raiseError(
'No valid group id given. Please choose an existing reference id of an ILIAS group',
284 return $this->
__raiseError(
'Invalid group id. Object with id "'. $group_id.
'" is not of type "group"',
'Client');
290 return $this->
__raiseError(
'Invalid user id. User with id "'. $user_id.
' does not exist',
'Client');
295 return $this->
__raiseError(
'Cannot create group instance!',
'Server');
298 if(!$rbacsystem->checkAccess(
'write',$group_id))
300 return $this->
__raiseError(
'Check access failed. No permission to write to group',
'Server');
303 $tmp_group->leave($user_id);
313 if(!$this->__checkSession($sid))
317 if(!is_numeric($group_id))
319 return $this->
__raiseError(
'No valid group id given. Please choose an existing id of an ILIAS group',
329 return $this->
__raiseError(
'Invalid group id. Object with id "'. $group_id.
'" is not of type "group"',
'Client');
335 return $this->
__raiseError(
'Invalid user id. User with id "'. $user_id.
' does not exist',
'Client');
340 return $this->
__raiseError(
'Cannot create group instance!',
'Server');
343 if(!$rbacsystem->checkAccess(
'read',$group_id))
345 return $this->
__raiseError(
'Check access failed. No permission to read group data',
'Server');
348 include_once(
'./Modules/Group/classes/class.ilGroupParticipants.php');
351 if($participants->isAdmin($user_id))
355 if($participants->isMember($user_id))
376 if(!$this->__checkSession($sid))
380 global $rbacreview, $ilObjDataCache, $tree;
382 include_once
'webservice/soap/classes/class.ilXMLResultSetParser.php';
387 return $this->
__raiseError($exception->getMessage(),
"Client");
389 $xmlResultSet =
$parser->getXMLResultSet();
391 if (!$xmlResultSet->hasColumn (
"user_id"))
392 return $this->
__raiseError(
"parameter user_id is missing",
"Client");
394 if (!$xmlResultSet->hasColumn (
"status"))
395 return $this->
__raiseError(
"parameter status is missing",
"Client");
397 $user_id = (int) $xmlResultSet->getValue (0,
"user_id");
398 $status = (int) $xmlResultSet->getValue (0,
"status");
403 #var_dump($xmlResultSet); 404 #echo "uid:".$user_id; 405 #echo "status:".$status; 408 foreach($rbacreview->assignedRoles($user_id) as $role_id)
412 #echo $role->getType(); 413 if ($role->getType() !=
"role")
416 if ($role->getParent() == ROLE_FOLDER_ID)
420 $role_title = $role->getTitle();
428 if (ilSoapGroupAdministration::MEMBER == ($status & ilSoapGroupAdministration::MEMBER) && strpos($role_title,
"member") !==
false)
431 } elseif (ilSoapGroupAdministration::ADMIN == ($status & ilSoapGroupAdministration::ADMIN) && strpos($role_title,
"admin") !==
false)
442 foreach ($owned_objects as $obj_id) {
445 foreach($allrefs as
$r)
447 if($tree->isDeleted($r))
451 if ($tree->isInTree($r))
456 if (count($refs) > 0)
457 $ref_ids[] = array_pop($refs);
460 $ref_ids = array_unique($ref_ids);
464 include_once
'webservice/soap/classes/class.ilXMLResultSetWriter.php';
465 include_once
'Modules/Group/classes/class.ilObjGroup.php';
466 include_once
'Modules/Group/classes/class.ilGroupXMLWriter.php';
469 $xmlResultSet->addColumn(
"ref_id");
470 $xmlResultSet->addColumn(
"xml");
471 $xmlResultSet->addColumn(
"parent_ref_id");
473 foreach ($ref_ids as $group_id) {
477 $row->setValue(
"ref_id", $group_id);
479 $xmlWriter->setAttachUsers(
false);
481 $row->setValue(
"xml", $xmlWriter->getXML());
482 $row->setValue(
"parent_ref_id", $tree->getParentId($group_id));
483 $xmlResultSet->addRow(
$row);
487 $xmlResultSetWriter->start();
488 return $xmlResultSetWriter->getXML();
excludeGroupMember($sid, $group_id, $user_id)
getGroupsForUser($sid, $parameters)
get groups which belong to a specific user, fullilling the status
XML Writer for XMLResultSet.
checkObjectAccess($ref_id, $expected_type, $permission, $returnObject=false)
check access for ref id: expected type, permission, return object instance if returnobject is true ...
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
assignGroupMember($sid, $group_id, $user_id, $type)
static groupNameExists($a_group_name, $a_id=0)
checks if group name already exists.
static _isInTrash($a_ref_id)
checks wether object is in trash
SaxParserException thrown by ilSaxParser if property throwException is set.
static _getAllReferences($a_id)
get all reference ids of object
getObjectsForOwner($object_type, $owner_id)
returns all objects of an owner, filtered by type, objects are not deleted!
updateGroup($sid, $ref_id, $grp_xml)
static __extractRefId($role_title)
extract ref id from role title, e.g.
isAssignedToGroup($sid, $group_id, $user_id)
static _lookupObjId($a_id)
__raiseError($a_message, $a_code)
groupExists($sid, $title)
static getTypeByRefId($a_ref_id, $stop_on_error=true)
get object type by reference id
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
initAuth($sid)
Init authentication.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
addGroup($sid, $target_id, $grp_xml)