33 include_once
'./webservice/soap/classes/class.ilSoapAdministration.php';
54 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
59 return $this->
__raiseError(
'No valid target id given. Please choose an existing reference id of an ILIAS category or group',
64 include_once
'./include/inc.header.php';
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";
93 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
100 return $this->
__raiseError(
'No valid target id given. Please choose an existing reference id of an ILIAS category or group',
105 include_once
'./include/inc.header.php';
108 if(!$rbacsystem->checkAccess(
'write',
$ref_id,
'grp'))
110 return $this->
__raiseError(
'Check access failed. No permission to edit groups',
'Server');
114 include_once(
"./Modules/Group/classes/class.ilObjGroup.php");
118 return $this->
__raiseError(
'Cannot create group instance!',
'CLIENT_OBJECT_NOT_FOUND');
123 return $this->
__raiseError(
"Object with ID $ref_id has been deleted.",
'CLIENT_OBJECT_DELETED');
129 return $this->
__raiseError(
'Reference id does not point to a group!',
'CLIENT_WRONG_TYPE');
133 include_once
'Modules/Group/classes/class.ilGroupXMLParser.php';
136 $xml_parser->setGroup($grp);
137 $new_ref_id = $xml_parser->startParsing();
139 return $new_ref_id ? $new_ref_id :
"0";
147 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
152 return $this->
__raiseError(
'No title given. Please choose an title for the group in question.',
157 include_once
'./include/inc.header.php';
166 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
170 include_once
'./include/inc.header.php';
174 return $this->
__raiseError(
"Parent with ID $ref_id has been deleted.",
'CLIENT_OBJECT_DELETED');
180 return $this->
__raiseError(
'No valid reference id given.',
185 include_once
'Modules/Group/classes/class.ilGroupXMLWriter.php';
188 $xml_writer->start();
190 $xml = $xml_writer->getXML();
192 return strlen($xml) ? $xml :
'';
200 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
203 if(!is_numeric($group_id))
205 return $this->
__raiseError(
'No valid group id given. Please choose an existing reference id of an ILIAS group',
210 include_once
'./include/inc.header.php';
218 return $this->
__raiseError(
'Invalid group id. Object with id "'. $group_id.
'" is not of type "group"',
'Client');
222 if(!$rbacsystem->checkAccess(
'write',$group_id))
224 return $this->
__raiseError(
'Check access failed. No permission to write to group',
'Server');
230 return $this->
__raiseError(
'Invalid user id. User with id "'. $user_id.
' does not exist',
'Client');
232 if($type !=
'Admin' and
235 return $this->
__raiseError(
'Invalid type '.$type.
' given. Parameter "type" must be "Admin","Member"',
'Client');
240 return $this->
__raiseError(
'Cannot create group instance!',
'Server');
245 return $this->
__raiseError(
'Cannot create user instance!',
'Server');
249 include_once
'Modules/Group/classes/class.ilGroupParticipants.php';
269 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
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',
278 include_once
'./include/inc.header.php';
286 return $this->
__raiseError(
'Invalid group id. Object with id "'. $group_id.
'" is not of type "group"',
'Client');
292 return $this->
__raiseError(
'Invalid user id. User with id "'. $user_id.
' does not exist',
'Client');
297 return $this->
__raiseError(
'Cannot create group instance!',
'Server');
300 if(!$rbacsystem->checkAccess(
'write',$group_id))
302 return $this->
__raiseError(
'Check access failed. No permission to write to group',
'Server');
305 $tmp_group->leave($user_id);
314 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
316 if(!is_numeric($group_id))
318 return $this->
__raiseError(
'No valid group id given. Please choose an existing id of an ILIAS group',
322 include_once
'./include/inc.header.php';
330 return $this->
__raiseError(
'Invalid group id. Object with id "'. $group_id.
'" is not of type "group"',
'Client');
336 return $this->
__raiseError(
'Invalid user id. User with id "'. $user_id.
' does not exist',
'Client');
341 return $this->
__raiseError(
'Cannot create group instance!',
'Server');
344 if(!$rbacsystem->checkAccess(
'read',$group_id))
346 return $this->
__raiseError(
'Check access failed. No permission to read group data',
'Server');
349 include_once(
'./Modules/Group/classes/class.ilGroupParticipants.php');
352 if($participants->isAdmin($user_id))
356 if($participants->isMember($user_id))
376 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
379 include_once
'./include/inc.header.php';
380 global $rbacreview, $ilObjDataCache, $tree;
382 include_once
'webservice/soap/classes/class.ilXMLResultSetParser.php';
385 $parser->startParsing();
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->isInTree($r))
452 if (count($refs) > 0)
453 $ref_ids[] = array_pop($refs);
456 $ref_ids = array_unique($ref_ids);
460 include_once
'webservice/soap/classes/class.ilXMLResultSetWriter.php';
461 include_once
'Modules/Group/classes/class.ilObjGroup.php';
462 include_once
'Modules/Group/classes/class.ilGroupXMLWriter.php';
465 $xmlResultSet->addColumn(
"ref_id");
466 $xmlResultSet->addColumn(
"xml");
467 $xmlResultSet->addColumn(
"parent_ref_id");
469 foreach ($ref_ids as $group_id) {
473 $row->setValue(
"ref_id", $group_id);
475 $xmlWriter->setAttachUsers(
false);
477 $row->setValue(
"xml", $xmlWriter->getXML());
478 $row->setValue(
"parent_ref_id", $tree->getParentId($group_id));
479 $xmlResultSet->addRow($row);
483 $xmlResultSetWriter->start();
484 return $xmlResultSetWriter->getXML();