33 include_once
'./webservice/soap/classes/class.ilSoapAdministration.php';
44 parent::ilSoapAdministration();
54 if(!$this->__checkSession($sid))
61 return $this->
__raiseError(
'No valid target id given. Please choose an existing reference id of an ILIAS category or group',
67 if(!$rbacsystem->checkAccess(
'create',
$target_id,
'grp'))
69 return $this->
__raiseError(
'Check access failed. No permission to create groups',
'Server');
74 return $this->
__raiseError(
"Parent with ID $target_id has been deleted.",
'CLIENT_TARGET_DELETED');
79 include_once(
"./Modules/Group/classes/class.ilObjGroup.php");
80 include_once
'Modules/Group/classes/class.ilGroupXMLParser.php';
82 $new_ref_id = $xml_parser->startParsing();
84 return $new_ref_id ? $new_ref_id :
"0";
94 if(!$this->__checkSession($sid))
103 return $this->
__raiseError(
'No valid target id given. Please choose an existing reference id of an ILIAS category or group',
109 if(!$rbacsystem->checkAccess(
'write',
$ref_id,
'grp'))
111 return $this->
__raiseError(
'Check access failed. No permission to edit groups',
'Server');
115 include_once(
"./Modules/Group/classes/class.ilObjGroup.php");
119 return $this->
__raiseError(
'Cannot create group instance!',
'CLIENT_OBJECT_NOT_FOUND');
124 return $this->
__raiseError(
"Object with ID $ref_id has been deleted.",
'CLIENT_OBJECT_DELETED');
130 return $this->
__raiseError(
'Reference id does not point to a group!',
'CLIENT_WRONG_TYPE');
134 include_once
'Modules/Group/classes/class.ilGroupXMLParser.php';
137 $xml_parser->setGroup($grp);
138 $new_ref_id = $xml_parser->startParsing();
140 return $new_ref_id ? $new_ref_id :
"0";
149 if(!$this->__checkSession($sid))
156 return $this->
__raiseError(
'No title given. Please choose an title for the group in question.',
168 if(!$this->__checkSession($sid))
175 return $this->
__raiseError(
"Parent with ID $ref_id has been deleted.",
'CLIENT_OBJECT_DELETED');
181 return $this->
__raiseError(
'No valid reference id given.',
186 include_once
'Modules/Group/classes/class.ilGroupXMLWriter.php';
189 $xml_writer->start();
191 $xml = $xml_writer->getXML();
193 return strlen($xml) ? $xml :
'';
202 if(!$this->__checkSession($sid))
207 if(!is_numeric($group_id))
209 return $this->
__raiseError(
'No valid group id given. Please choose an existing reference id of an ILIAS group',
220 return $this->
__raiseError(
'Invalid group id. Object with id "'. $group_id.
'" is not of type "group"',
'Client');
224 if(!$rbacsystem->checkAccess(
'write',$group_id))
226 return $this->
__raiseError(
'Check access failed. No permission to write to group',
'Server');
232 return $this->
__raiseError(
'Invalid user id. User with id "'. $user_id.
' does not exist',
'Client');
234 if($type !=
'Admin' and
237 return $this->
__raiseError(
'Invalid type '.$type.
' given. Parameter "type" must be "Admin","Member"',
'Client');
242 return $this->
__raiseError(
'Cannot create group instance!',
'Server');
247 return $this->
__raiseError(
'Cannot create user instance!',
'Server');
251 include_once
'Modules/Group/classes/class.ilGroupParticipants.php';
272 if(!$this->__checkSession($sid))
276 if(!is_numeric($group_id))
278 return $this->
__raiseError(
'No valid group id given. Please choose an existing reference id of an ILIAS group',
289 return $this->
__raiseError(
'Invalid group id. Object with id "'. $group_id.
'" is not of type "group"',
'Client');
295 return $this->
__raiseError(
'Invalid user id. User with id "'. $user_id.
' does not exist',
'Client');
300 return $this->
__raiseError(
'Cannot create group instance!',
'Server');
303 if(!$rbacsystem->checkAccess(
'write',$group_id))
305 return $this->
__raiseError(
'Check access failed. No permission to write to group',
'Server');
308 $tmp_group->leave($user_id);
318 if(!$this->__checkSession($sid))
322 if(!is_numeric($group_id))
324 return $this->
__raiseError(
'No valid group id given. Please choose an existing id of an ILIAS group',
334 return $this->
__raiseError(
'Invalid group id. Object with id "'. $group_id.
'" is not of type "group"',
'Client');
340 return $this->
__raiseError(
'Invalid user id. User with id "'. $user_id.
' does not exist',
'Client');
345 return $this->
__raiseError(
'Cannot create group instance!',
'Server');
348 if(!$rbacsystem->checkAccess(
'read',$group_id))
350 return $this->
__raiseError(
'Check access failed. No permission to read group data',
'Server');
353 include_once(
'./Modules/Group/classes/class.ilGroupParticipants.php');
356 if($participants->isAdmin($user_id))
360 if($participants->isMember($user_id))
381 if(!$this->__checkSession($sid))
385 global $rbacreview, $ilObjDataCache, $tree;
387 include_once
'webservice/soap/classes/class.ilXMLResultSetParser.php';
390 $parser->startParsing();
392 return $this->
__raiseError($exception->getMessage(),
"Client");
394 $xmlResultSet = $parser->getXMLResultSet();
396 if (!$xmlResultSet->hasColumn (
"user_id"))
397 return $this->
__raiseError(
"parameter user_id is missing",
"Client");
399 if (!$xmlResultSet->hasColumn (
"status"))
400 return $this->
__raiseError(
"parameter status is missing",
"Client");
402 $user_id = (int) $xmlResultSet->getValue (0,
"user_id");
403 $status = (int) $xmlResultSet->getValue (0,
"status");
408 #var_dump($xmlResultSet); 409 #echo "uid:".$user_id; 410 #echo "status:".$status; 413 foreach($rbacreview->assignedRoles($user_id) as $role_id)
417 #echo $role->getType(); 418 if ($role->getType() !=
"role")
421 if ($role->getParent() == ROLE_FOLDER_ID)
425 $role_title = $role->getTitle();
433 if (ilSoapGroupAdministration::MEMBER == ($status & ilSoapGroupAdministration::MEMBER) && strpos($role_title,
"member") !==
false)
436 } elseif (ilSoapGroupAdministration::ADMIN == ($status & ilSoapGroupAdministration::ADMIN) && strpos($role_title,
"admin") !==
false)
447 foreach ($owned_objects as $obj_id) {
450 foreach($allrefs as
$r)
452 if($tree->isDeleted($r))
456 if ($tree->isInTree($r))
461 if (count($refs) > 0)
462 $ref_ids[] = array_pop($refs);
465 $ref_ids = array_unique($ref_ids);
469 include_once
'webservice/soap/classes/class.ilXMLResultSetWriter.php';
470 include_once
'Modules/Group/classes/class.ilObjGroup.php';
471 include_once
'Modules/Group/classes/class.ilGroupXMLWriter.php';
474 $xmlResultSet->addColumn(
"ref_id");
475 $xmlResultSet->addColumn(
"xml");
476 $xmlResultSet->addColumn(
"parent_ref_id");
478 foreach ($ref_ids as $group_id) {
482 $row->setValue(
"ref_id", $group_id);
484 $xmlWriter->setAttachUsers(
false);
486 $row->setValue(
"xml", $xmlWriter->getXML());
487 $row->setValue(
"parent_ref_id", $tree->getParentId($group_id));
488 $xmlResultSet->addRow(
$row);
492 $xmlResultSetWriter->start();
493 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.
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
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.
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)
ilSoapGroupAdministration()
groupExists($sid, $title)
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
_isInTrash($a_ref_id)
checks wether object is in trash
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupType($a_id, $a_reference=false)
lookup object type
getTypeByRefId($a_ref_id, $stop_on_error=true)
get object type by reference id
addGroup($sid, $target_id, $grp_xml)