84                 return ($this->obj == null) ? null : $this->obj->getId();
 
  106                 $this->obj->setPermissions($this->
getRefId());
 
  120                 if (is_null($this->obj))
 
  122                         $this->obj =& $ilias->obj_factory->getInstanceByRefId($this->
getRefId());
 
  132                 $this->
writelog(
'write() refid='.$this->refId);
 
  133                 $this->obj->update();
 
  144                 return $this->obj->getUntranslatedTitle();
 
  153                 $this->
writelog(
'setResourceName('.$name.
')');
 
  154                 return $this->obj->setTitle($name);
 
  163                 return $this->obj->getTitle();
 
  173                 return strtotime($this->obj->getCreateDate());
 
  183                 return strtotime($this->obj->getLastUpdateDate());
 
  229                 return 'application/x-non-readable';
 
  315                 if(isset(
$_GET[
'mount-instructions']))
 
  324                         $ops = explode(
',',$operations);
 
  325                         if (in_array(
'visible',$ops) && ! in_array(
'write',$ops))
 
  328                                         $operations .= 
',write';
 
  333                         return $rbacsystem->checkAccess($operations, $this->
getRefId(), $type);
 
  337                         $GLOBALS[
'ilLog']->write(
'Checking permission for ref_id: '.$this->
getRefId());
 
  338                         $GLOBALS[
'ilLog']->write(
"Operations: ".print_r($operations,
true));
 
  341                         $operations = explode(
",",$operations.
"");
 
  342                         foreach ($operations as $operation)
 
  344                                 if (!$ilAccess->checkAccess($operation, 
'', $this->getRefId(), $type))
 
  346                                         $GLOBALS[
'ilLog']->write(__METHOD__.
': Permission denied for user '.
$GLOBALS[
'ilUser']->getId());
 
  361                         return $this->obj->getType();
 
  363                 $GLOBALS[
'ilLog']->write(__METHOD__.
': Invalid object given, class='.get_class($this->obj));
 
  400                 require_once 
'Modules/Folder/classes/class.ilObjFolder.php';
 
  403                 $newObj->setTitle($name);
 
  406                 $newObj->createReference();
 
  407                 $newObj->setPermissions($this->
getRefId());
 
  408                 $newObj->putInTree($this->
getRefId());
 
  410                 require_once 
'class.ilObjFolderDAV.php';
 
  424                 require_once 
'Modules/File/classes/class.ilObjFile.php';
 
  427                 $newObj->setTitle($name);
 
  428                 $newObj->setFileName($name);
 
  429                 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
 
  432                 $newObj->setFileType($mime);
 
  435                 $newObj->createReference();
 
  436                 $newObj->setPermissions($this->
getRefId());
 
  437                 $newObj->putInTree($this->
getRefId());
 
  440                 require_once 
'class.ilObjFileDAV.php';
 
  441                 $objDAV = 
new ilObjFileDAV($newObj->getRefId(), $newObj);
 
  460                 require_once 
'Modules/File/classes/class.ilObjFile.php';
 
  462                 $objDAV->initFromNull();
 
  477                 require_once 
'./Services/Object/classes/class.ilObject.php';
 
  479                 $newObj->setType(
'null');
 
  480                 $newObj->setTitle($name);
 
  482                 $newObj->createReference();
 
  483                 $newObj->setPermissions($this->
getRefId());
 
  484                 $newObj->putInTree($this->
getRefId());
 
  486                 require_once 
'class.ilObjNullDAV.php';
 
  487                 $objDAV = 
new ilObjNullDAV($newObj->getRefId(), $newObj);
 
  499         function remove($objDAV)
 
  501                 global $tree, $rbacadmin;
 
  503                 $subnodes = $tree->getSubTree($tree->getNodeData($objDAV->getRefId()));
 
  504                 foreach ($subnodes as $node)
 
  506                         $rbacadmin->revokePermission($node[
"child"]);
 
  509                 $tree->saveSubTree($objDAV->getRefId());
 
  510                 $tree->deleteTree($tree->getNodeData($objDAV->getRefId()));
 
  522                 $this->
writelog(
"addCopy($objDAV,$newName) ....");
 
  523                 global $rbacadmin, $tree;
 
  524                 $revIdMapping = array(); 
 
  525                 $newRef = $this->
cloneNodes($objDAV->getRefId(),$this->
getRefId(),$revIdMapping, $newName);
 
  527                 return $this->
createObject($newRef, $objDAV->getILIASType());
 
  528                 $this->
writelog(
'... addCopy done.');
 
  541         function cloneNodes($srcRef,$dstRef,&$mapping, $newName=null)
 
  543                 $this->
writelog(
"cloneNodes($srcRef,$dstRef,$mapping,$newName)");
 
  548                 $srcObj =& $ilias->obj_factory->getInstanceByRefId($srcRef);
 
  549                 $this->
writelog(
'cloneNodes cloning srcRef='.$srcRef.
' dstRef='.$dstRef.
'...');
 
  550                 $newObj = $srcObj->cloneObject($dstRef);
 
  551                 $newRef = $newObj->getRefId();
 
  556                 $this->
writelog(
"cloneNodes newname not null? ".(! is_null($newName)));
 
  557                 if (! is_null($newName))
 
  559                         $newObjDAV = $this->
createObject($newRef, $srcObj->getType()); 
 
  560                         $newObjDAV->setResourceName($newName);
 
  564                 $mapping[$newRef] = $srcRef;
 
  567                 $children = $tree->getChilds($srcRef);
 
  568                 foreach ($tree->getChilds($srcRef) as $child)
 
  572                         if ($child[
"type"] != 
'rolf')
 
  574                                 $this->
cloneNodes($child[
"ref_id"],$newRef,$mapping,null);
 
  578                                 if (count($rolf = $tree->getChildsByType($newRef,
"rolf")))
 
  580                                         $mapping[$rolf[0][
"ref_id"]] = $child[
"ref_id"];
 
  584                 $this->
writelog(
'cloneNodes ...cloned srcRef='.$srcRef.
' dstRef='.$dstRef.
' newRef='.$newRef);
 
  602                 $this->
writelog(
'addMove('.$objDAV->getRefId().
' to '.$this->
getRefId().
', newName='.$newName.
')');
 
  605                 if (! is_null($newName))
 
  607                         $objDAV->setResourceName($newName);
 
  612                 $old_parent = $tree->getParentId($objDAV->getRefId());
 
  615                 $tree->moveTree($objDAV->getRefId(),$this->
getRefId());
 
  618                 $rbacadmin->adjustMovedObjectPermissions($objDAV->getRefId(), $old_parent);
 
  680                 global $ilDB, 
$log, $ilias, $tree;
 
  682                 $query = 
"SELECT tree FROM tree WHERE parent = ? AND tree < 0 ";
 
  683                 $sta = $ilDB->prepare(
$query,array(
'integer',
'integer'));
 
  684                 $res = $ilDB->execute($sta,array(
 
  689                 while(
$row = $ilDB->fetchObject(
$res))
 
  692                         if (!in_array(
$row->tree,$a_checked))
 
  695                                 $a_checked[] = 
$row->tree;
 
  698                                 $del_node_data = $deleted_tree->getNodeData(
$row->tree);
 
  699                                 $del_subtree_nodes = $deleted_tree->getSubTree($del_node_data);
 
  703                                 if ($a_delete_objects)
 
  705                                         foreach ($del_subtree_nodes as $node)
 
  707                                                 $node_obj =& $ilias->obj_factory->getInstanceByRefId($node[
"ref_id"]);
 
  718                                 $tree->deleteTree($del_node_data);
 
  742                 $childrenDAV = array();
 
  745                 $childrenData =& $tree->getChilds($this->
getRefId(),
'');
 
  746                 foreach ($childrenData as 
$data)
 
  748                         $childDAV =& $this->
createObject($data[
'ref_id'],$data[
'type']);
 
  749                         if (! is_null($childDAV))
 
  753                                 $childrenDAV[] = $childDAV;
 
  772                 $permittedChildrenDAV = array();
 
  773                 foreach ($childrenDAV as $childDAV)
 
  775                         if ($childDAV->isPermitted($operations, $type))
 
  777                                 $permittedChildrenDAV[] = $childDAV;
 
  782                 return $permittedChildrenDAV;
 
  799                                 require_once 
'class.ilObjMountPointDAV.php';
 
  803                                 require_once 
'class.ilObjRootDAV.php';
 
  807                                 require_once 
'class.ilObjCategoryDAV.php';
 
  811                                 require_once 
'class.ilObjFolderDAV.php';
 
  815                                 require_once 
'class.ilObjCourseDAV.php';
 
  819                                 require_once 
'class.ilObjGroupDAV.php';
 
  823                                 require_once 
'class.ilObjFileDAV.php';
 
  827                                 require_once 
'class.ilObjNullDAV.php';
 
  833                 if (! is_null($newObj))
 
  851                                 $ilias->account->getLogin()
 
  852                                 .
' DAV .'.get_class($this).
' '.str_replace(
"\n",
";",$message)