Inheritance diagram for ilSoapGroupAdministration:
Collaboration diagram for ilSoapGroupAdministration:Public Member Functions | |
| ilSoapGroupAdministration () | |
| addGroup ($sid, $target_id, $grp_xml) | |
| updateGroup ($sid, $ref_id, $grp_xml) | |
| groupExists ($sid, $title) | |
| getGroup ($sid, $ref_id) | |
| assignGroupMember ($sid, $group_id, $user_id, $type) | |
| excludeGroupMember ($sid, $group_id, $user_id) | |
| isAssignedToGroup ($sid, $group_id, $user_id) | |
Definition at line 35 of file class.ilSoapGroupAdministration.php.
| ilSoapGroupAdministration::addGroup | ( | $ | sid, | |
| $ | target_id, | |||
| $ | grp_xml | |||
| ) |
Definition at line 44 of file class.ilSoapGroupAdministration.php.
References $target_id, ilSoapAdministration::__checkSession(), ilSoapAdministration::__raiseError(), and ilObject::_isInTrash().
{
if(!$this->__checkSession($sid))
{
return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
}
if(!is_numeric($target_id))
{
return $this->__raiseError('No valid target id given. Please choose an existing reference id of an ILIAS category or course',
'Client');
}
// Include main header
include_once './include/inc.header.php';
global $rbacsystem;
if(!$rbacsystem->checkAccess('create',$target_id,'grp'))
{
return $this->__raiseError('Check access failed. No permission to create groups','Server');
}
if(ilObject::_isInTrash($target_id))
{
return $this->__raiseError("Parent with ID $target_id has been deleted.", 'CLIENT_TARGET_DELETED');
}
// Start import
include_once("classes/class.ilObjGroup.php");
include_once 'classes/class.ilGroupImportParser.php';
$xml_parser = new ilGroupImportParser($grp_xml,$target_id);
$new_ref_id = $xml_parser->startParsing();
return $new_ref_id ? $new_ref_id : "0";
}
Here is the call graph for this function:| ilSoapGroupAdministration::assignGroupMember | ( | $ | sid, | |
| $ | group_id, | |||
| $ | user_id, | |||
| $ | type | |||
| ) |
Definition at line 191 of file class.ilSoapGroupAdministration.php.
References ilSoapAdministration::__checkSession(), ilSoapAdministration::__raiseError(), ilObject::_getAllReferences(), ilObject::_lookupObjId(), ilObject::_lookupType(), ilObjectFactory::getInstanceByObjId(), and ilObjectFactory::getInstanceByRefId().
{
if(!$this->__checkSession($sid))
{
return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
}
if(!is_numeric($group_id))
{
return $this->__raiseError('No valid group id given. Please choose an existing reference id of an ILIAS group',
'Client');
}
// Include main header
include_once './include/inc.header.php';
global $rbacsystem;
if(($obj_type = ilObject::_lookupType(ilObject::_lookupObjId($group_id))) != 'grp')
{
$group_id = end($ref_ids = ilObject::_getAllReferences($group_id));
if(ilObject::_lookupType(ilObject::_lookupObjId($group_id)) != 'grp')
{
return $this->__raiseError('Invalid group id. Object with id "'. $group_id.'" is not of type "group"','Client');
}
}
if(!$rbacsystem->checkAccess('write',$group_id))
{
return $this->__raiseError('Check access failed. No permission to write to group','Server');
}
if(ilObject::_lookupType($user_id) != 'usr')
{
return $this->__raiseError('Invalid user id. User with id "'. $user_id.' does not exist','Client');
}
if($type != 'Admin' and
$type != 'Member')
{
return $this->__raiseError('Invalid type '.$type.' given. Parameter "type" must be "Admin","Member"','Client');
}
if(!$tmp_group = ilObjectFactory::getInstanceByRefId($group_id,false))
{
return $this->__raiseError('Cannot create group instance!','Server');
}
if(!$tmp_user = ilObjectFactory::getInstanceByObjId($user_id,false))
{
return $this->__raiseError('Cannot create user instance!','Server');
}
switch($type)
{
case 'Admin':
return $tmp_group->addMember($user_id,$tmp_group->getDefaultAdminRole());
case 'Member':
return $tmp_group->addMember($user_id,$tmp_group->getDefaultMemberRole());
break;
}
return true;
}
Here is the call graph for this function:| ilSoapGroupAdministration::excludeGroupMember | ( | $ | sid, | |
| $ | group_id, | |||
| $ | user_id | |||
| ) |
Definition at line 257 of file class.ilSoapGroupAdministration.php.
References ilSoapAdministration::__checkSession(), ilSoapAdministration::__raiseError(), ilObject::_getAllReferences(), ilObject::_lookupObjId(), ilObject::_lookupType(), and ilObjectFactory::getInstanceByRefId().
{
if(!$this->__checkSession($sid))
{
return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
}
if(!is_numeric($group_id))
{
return $this->__raiseError('No valid group id given. Please choose an existing reference id of an ILIAS group',
'Client');
}
// Include main header
include_once './include/inc.header.php';
global $rbacsystem;
if(($type = ilObject::_lookupType(ilObject::_lookupObjId($group_id))) != 'grp')
{
$group_id = end($ref_ids = ilObject::_getAllReferences($group_id));
if(ilObject::_lookupType(ilObject::_lookupObjId($group_id)) != 'grp')
{
return $this->__raiseError('Invalid group id. Object with id "'. $group_id.'" is not of type "group"','Client');
}
}
if(ilObject::_lookupType($user_id) != 'usr')
{
return $this->__raiseError('Invalid user id. User with id "'. $user_id.' does not exist','Client');
}
if(!$tmp_group = ilObjectFactory::getInstanceByRefId($group_id,false))
{
return $this->__raiseError('Cannot create group instance!','Server');
}
if(!$rbacsystem->checkAccess('write',$group_id))
{
return $this->__raiseError('Check access failed. No permission to write to group','Server');
}
$tmp_group->leave($user_id);
return true;
}
Here is the call graph for this function:| ilSoapGroupAdministration::getGroup | ( | $ | sid, | |
| $ | ref_id | |||
| ) |
Definition at line 157 of file class.ilSoapGroupAdministration.php.
References $ref_id, ilSoapAdministration::__checkSession(), ilSoapAdministration::__raiseError(), ilObject::_isInTrash(), and ilObjectFactory::getInstanceByRefId().
{
if(!$this->__checkSession($sid))
{
return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
}
// Include main header
include_once './include/inc.header.php';
if(ilObject::_isInTrash($ref_id))
{
return $this->__raiseError("Parent with ID $ref_id has been deleted.", 'CLIENT_OBJECT_DELETED');
}
if(!$grp_obj =& ilObjectFactory::getInstanceByRefId($ref_id,false))
{
return $this->__raiseError('No valid reference id given.',
'Client');
}
include_once 'classes/class.ilGroupXMLWriter.php';
$xml_writer = new ilGroupXMLWriter($grp_obj);
$xml_writer->start();
$xml = $xml_writer->getXML();
return strlen($xml) ? $xml : '';
}
Here is the call graph for this function:| ilSoapGroupAdministration::groupExists | ( | $ | sid, | |
| $ | title | |||
| ) |
Definition at line 138 of file class.ilSoapGroupAdministration.php.
References $title, ilSoapAdministration::__checkSession(), ilSoapAdministration::__raiseError(), and ilUtil::groupNameExists().
{
if(!$this->__checkSession($sid))
{
return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
}
if(!$title)
{
return $this->__raiseError('No title given. Please choose an title for the group in question.',
'Client');
}
// Include main header
include_once './include/inc.header.php';
return ilUtil::groupNameExists($title);
}
Here is the call graph for this function:| ilSoapGroupAdministration::ilSoapGroupAdministration | ( | ) |
Definition at line 37 of file class.ilSoapGroupAdministration.php.
References ilSoapAdministration::ilSoapAdministration().
{
parent::ilSoapAdministration();
}
Here is the call graph for this function:| ilSoapGroupAdministration::isAssignedToGroup | ( | $ | sid, | |
| $ | group_id, | |||
| $ | user_id | |||
| ) |
Definition at line 302 of file class.ilSoapGroupAdministration.php.
References ilSoapAdministration::__checkSession(), ilSoapAdministration::__raiseError(), ilObject::_getAllReferences(), ilObject::_lookupObjId(), ilObject::_lookupType(), and ilObjectFactory::getInstanceByRefId().
{
if(!$this->__checkSession($sid))
{
return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
}
if(!is_numeric($group_id))
{
return $this->__raiseError('No valid group id given. Please choose an existing id of an ILIAS group',
'Client');
}
// Include main header
include_once './include/inc.header.php';
global $rbacsystem;
if(($type = ilObject::_lookupType(ilObject::_lookupObjId($group_id))) != 'grp')
{
$group_id = end($ref_ids = ilObject::_getAllReferences($group_id));
if(ilObject::_lookupType(ilObject::_lookupObjId($group_id)) != 'grp')
{
return $this->__raiseError('Invalid group id. Object with id "'. $group_id.'" is not of type "group"','Client');
}
}
if(ilObject::_lookupType($user_id) != 'usr')
{
return $this->__raiseError('Invalid user id. User with id "'. $user_id.' does not exist','Client');
}
if(!$tmp_group = ilObjectFactory::getInstanceByRefId($group_id,false))
{
return $this->__raiseError('Cannot create group instance!','Server');
}
if(!$rbacsystem->checkAccess('read',$group_id))
{
return $this->__raiseError('Check access failed. No permission to read group data','Server');
}
if($tmp_group->isAdmin($user_id))
{
return 1;
}
if($tmp_group->isMember($user_id))
{
return 2;
}
return "0";
}
Here is the call graph for this function:| ilSoapGroupAdministration::updateGroup | ( | $ | sid, | |
| $ | ref_id, | |||
| $ | grp_xml | |||
| ) |
Definition at line 83 of file class.ilSoapGroupAdministration.php.
References $ref_id, ilGroupImportParser::$UPDATE, ilSoapAdministration::__checkSession(), ilSoapAdministration::__raiseError(), ilObject::_isInTrash(), ilObjectFactory::getInstanceByRefId(), and ilObjectFactory::getTypeByRefId().
{
if(!$this->__checkSession($sid))
{
return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
}
if(!is_numeric($ref_id))
{
return $this->__raiseError('No valid target id given. Please choose an existing reference id of an ILIAS category or course',
'Client');
}
// Include main header
include_once './include/inc.header.php';
global $rbacsystem;
if(!$rbacsystem->checkAccess('write',$ref_id,'grp'))
{
return $this->__raiseError('Check access failed. No permission to edit groups','Server');
}
// Start import
include_once("classes/class.ilObjGroup.php");
if(!$grp = ilObjectFactory::getInstanceByRefId($ref_id, false))
{
return $this->__raiseError('Cannot create group instance!','CLIENT_OBJECT_NOT_FOUND');
}
if(ilObject::_isInTrash($ref_id))
{
return $this->__raiseError("Object with ID $ref_id has been deleted.", 'CLIENT_OBJECT_DELETED');
}
if (ilObjectFactory::getTypeByRefId($ref_id, false) !="grp")
{
return $this->__raiseError('Reference id does not point to a group!','CLIENT_WRONG_TYPE');
}
include_once 'classes/class.ilGroupImportParser.php';
$xml_parser = new ilGroupImportParser($grp_xml, -1);
$xml_parser->setMode(ilGroupImportParser::$UPDATE);
$xml_parser->setGroup($grp);
$new_ref_id = $xml_parser->startParsing();
return $new_ref_id ? $new_ref_id : "0";
}
Here is the call graph for this function:
1.7.1