00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 include_once( 'lib/ezwebdav/classes/ezwebdavserver.php' );
00040 include_once( 'kernel/classes/ezcontentobjecttreenode.php' );
00041 include_once( "kernel/classes/datatypes/ezbinaryfile/ezbinaryfile.php" );
00042 include_once( "lib/ezutils/classes/ezmimetype.php" );
00043 include_once( 'lib/ezfile/classes/ezdir.php' );
00044 include_once( 'lib/ezfile/classes/ezfile.php' );
00045 include_once( "kernel/classes/ezurlalias.php" );
00046 include_once( 'kernel/classes/datatypes/ezuser/ezuser.php' );
00047
00048
00049 $varDir = eZSys::varDirectory();
00050
00051 define( "VIRTUAL_CONTENT_FOLDER_NAME", ezi18n( 'kernel/content', "Content" ) );
00052 define( "VIRTUAL_MEDIA_FOLDER_NAME", ezi18n( 'kernel/content', "Media" ) );
00053 define( "VIRTUAL_INFO_FILE_NAME", $varDir . "/webdav/root/info.txt" );
00054 define( "WEBDAV_INI_FILE", "webdav.ini" );
00055 define( "WEBDAV_AUTH_REALM", "eZ publish WebDAV interface" );
00056 define( "WEBDAV_AUTH_FAILED", "Invalid username or password!" );
00057 define( "WEBDAV_INVALID_SITE", "Invalid site name specified!" );
00058 define( "WEBDAV_DISABLED", "WebDAV functionality is disabled!" );
00059
00060 class eZWebDAVContentServer extends eZWebDAVServer
00061 {
00062
00063
00064
00065 function eZWebDAVContentServer()
00066 {
00067 $this->eZWebDAVServer();
00068 $this->User =& eZUser::currentUser();
00069 $this->FolderClasses = null;
00070 }
00071
00072
00073
00074
00075
00076
00077 function processClientRequest()
00078 {
00079 $this->User =& eZUser::currentUser();
00080 eZWebDAVServer::processClientRequest();
00081 }
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091 function outputSendDataToClient( $output, $headers_only = false )
00092 {
00093 if ( $output["file"] )
00094 {
00095 $realPath = $output["file"];
00096 require_once( 'kernel/classes/ezclusterfilehandler.php' );
00097 $file = eZClusterFileHandler::instance( $realPath );
00098 $file->fetch();
00099 }
00100 $result = eZWebDAVServer::outputSendDataToClient($output,$headers_only);
00101 if ( $output["file"] && is_object( $file ) )
00102 $file->deleteLocal();
00103 return $result;
00104 }
00105
00106
00107
00108
00109
00110 function options( $target )
00111 {
00112
00113 $options = array();
00114 $options['methods'] = array( 'OPTIONS', 'PROPFIND', 'HEAD', 'GET', 'PUT', 'MKCOL', 'MOVE' );
00115
00116
00117 return $options;
00118 }
00119
00120
00121
00122
00123
00124
00125
00126
00127 function getCollectionContent( $collection, $depth, $properties )
00128 {
00129 $fullPath = $collection;
00130 $collection = $this->splitFirstPathElement( $collection, $currentSite );
00131
00132 if ( !$currentSite )
00133 {
00134
00135 $this->appendLogEntry( "Root: Fethcing site list", 'CS:getCollectionContent' );
00136 $entries = $this->fetchSiteListContent( $depth, $properties );
00137 return $entries;
00138 }
00139
00140 if ( !$this->userHasSiteAccess( $currentSite ) )
00141 {
00142 $this->appendLogEntry( "No access to site '$currentSite'", 'CS:getCollectionContent' );
00143 return EZ_WEBDAV_FAILED_FORBIDDEN;
00144 }
00145
00146 return $this->getVirtualFolderCollection( $currentSite, $collection, $fullPath, $depth, $properties );
00147 }
00148
00149
00150
00151
00152
00153
00154 function getVirtualFolderCollection( $currentSite, $collection, $fullPath, $depth, $properties )
00155 {
00156 $this->appendLogEntry( "Check virtual folder: site '$currentSite' in '$collection' ", 'CS:getVirtualFolderCollection' );
00157 $this->setCurrentSite( $currentSite );
00158
00159 if ( !$collection )
00160 {
00161
00162 $this->appendLogEntry( "Virtual folder for '$currentSite'", 'CS:getVirtualFolderCollection' );
00163 $entries = $this->fetchVirtualSiteContent( $currentSite, $depth, $properties );
00164 return $entries;
00165 }
00166
00167 $collection = $this->splitFirstPathElement( $collection, $virtualFolder );
00168
00169 if ( !in_array( $virtualFolder, $this->virtualFolderList() ) )
00170 {
00171 $this->appendLogEntry( "Unknown virtual folder: '$virtualFolder' in site '$currentSite'", 'CS:getVirtualFolderCollection' );
00172 return EZ_WEBDAV_FAILED_NOT_FOUND;
00173 }
00174
00175 if ( !$this->userHasVirtualAccess( $currentSite, $virtualFolder ) )
00176 {
00177 $this->appendLogEntry( "No access to virtual folder '$virtualFolder' in site '$currentSite'", 'CS:getVirtualFolderCollection' );
00178 return EZ_WEBDAV_FAILED_FORBIDDEN;
00179 }
00180
00181 return $this->getContentTreeCollection( $currentSite, $virtualFolder, $collection, $fullPath, $depth, $properties );
00182 }
00183
00184
00185
00186
00187
00188
00189
00190 function getContentTreeCollection( $currentSite, $virtualFolder, $collection, $fullPath, $depth, $properties )
00191 {
00192 $this->appendLogEntry( "Content collection: from site '$currentSite' in '$virtualFolder' using path '$collection'", 'CS:getContentTreeCollection' );
00193 $nodePath = $this->internalNodePath( $virtualFolder, $collection );
00194 $node = $this->fetchNodeByTranslation( $nodePath );
00195
00196 if ( !$node )
00197 {
00198 $this->appendLogEntry( "Unknown node: $nodePath", 'CS:getContentTreeCollection' );
00199 return EZ_WEBDAV_FAILED_NOT_FOUND;
00200 }
00201
00202
00203 if ( !$node->canRead() )
00204 {
00205 $this->appendLogEntry( "No access to content '$nodePath' in site '$currentSite'", 'CS:getContentTreeCollection' );
00206 return EZ_WEBDAV_FAILED_FORBIDDEN;
00207 }
00208
00209 $entries = $this->fetchContentList( $node, $nodePath, $depth, $properties );
00210 return $entries;
00211 }
00212
00213
00214
00215
00216
00217
00218 function get( $target )
00219 {
00220 $result = array();
00221 $result["data"] = false;
00222 $result["file"] = false;
00223
00224 $fullPath = $target;
00225 $target = $this->splitFirstPathElement( $target, $currentSite );
00226
00227 if ( !$currentSite )
00228 {
00229
00230 return EZ_WEBDAV_FAILED_FORBIDDEN;
00231 }
00232
00233 if ( !$this->userHasSiteAccess( $currentSite ) )
00234 {
00235 $this->appendLogEntry( "No access to site '$currentSite'", 'CS:get' );
00236 return EZ_WEBDAV_FAILED_FORBIDDEN;
00237 }
00238
00239 return $this->getVirtualFolderData( $result, $currentSite, $target, $fullPath );
00240 }
00241
00242
00243
00244
00245
00246 function getVirtualFolderData( $result, $currentSite, $target, $fullPath )
00247 {
00248 $this->appendLogEntry( "current site: $currentSite", 'CS:get' );
00249 $this->setCurrentSite( $currentSite );
00250
00251 $target = $this->splitFirstPathElement( $target, $virtualFolder );
00252
00253 if ( !$target )
00254 {
00255 if ( !in_array( $virtualFolder, $this->virtualFileList() ) )
00256 {
00257 return EZ_WEBDAV_FAILED_NOT_FOUND;
00258 }
00259
00260
00261 if ( $virtualFolder == basename( VIRTUAL_INFO_FILE_NAME ) )
00262 {
00263 $result["file"] = VIRTUAL_INFO_FILE_NAME;
00264
00265 return $result;
00266 }
00267
00268
00269 return EZ_WEBDAV_FAILED_NOT_FOUND;
00270 }
00271
00272 if ( !$this->userHasVirtualAccess( $currentSite, $virtualFolder ) )
00273 {
00274 $this->appendLogEntry( "No access to virtual folder '$virtualFolder' in site '$currentSite'", 'CS:get' );
00275 return EZ_WEBDAV_FAILED_FORBIDDEN;
00276 }
00277
00278 if ( !in_array( $virtualFolder, $this->virtualFolderList() ) )
00279 {
00280 $this->appendLogEntry( "Unknown virtual folder: '$virtualFolder' in site '$currentSite'", 'CS:get' );
00281 return EZ_WEBDAV_FAILED_NOT_FOUND;
00282 }
00283
00284 if ( $virtualFolder == VIRTUAL_CONTENT_FOLDER_NAME or
00285 $virtualFolder == VIRTUAL_MEDIA_FOLDER_NAME )
00286 {
00287 return $this->getContentNodeData( $result, $currentSite, $virtualFolder, $target, $fullPath );
00288 }
00289 return EZ_WEBDAV_FAILED_NOT_FOUND;
00290 }
00291
00292
00293
00294
00295
00296 function getContentNodeData( $result, $currentSite, $virtualFolder, $target, $fullPath )
00297 {
00298 $this->appendLogEntry( "attempting to fetch node, target is: $target", 'CS:get' );
00299
00300
00301 $nodePath = $this->internalNodePath( $virtualFolder, $target );
00302 $node = $this->fetchNodeByTranslation( $nodePath );
00303
00304
00305 if ( $node == null )
00306 {
00307 $this->appendLogEntry( "No node for: $nodePath", 'CS:get' );
00308 return $result;
00309 }
00310
00311
00312 if ( !$node->canRead() )
00313 {
00314 $this->appendLogEntry( "No access to get '$nodePath' in site '$currentSite'", 'CS:get' );
00315 return EZ_WEBDAV_FAILED_FORBIDDEN;
00316 }
00317
00318 $object = $node->attribute( 'object' );
00319
00320 include_once( 'kernel/classes/ezcontentupload.php' );
00321 $upload = new eZContentUpload();
00322 $info = $upload->objectFileInfo( $object );
00323 if ( $info )
00324 {
00325 $result['file'] = $info['filepath'];
00326 }
00327
00328 return $result;
00329 }
00330
00331
00332
00333
00334 function head( $target )
00335 {
00336 return EZ_WEBDAV_FAILED_NOT_FOUND;
00337 }
00338
00339
00340
00341
00342
00343 function put( $target, $tempFile )
00344 {
00345 $fullPath = $target;
00346 $target = $this->splitFirstPathElement( $target, $currentSite );
00347
00348 if ( !$currentSite )
00349 {
00350 return EZ_WEBDAV_FAILED_FORBIDDEN;
00351 }
00352
00353 if ( !$this->userHasSiteAccess( $currentSite ) )
00354 {
00355 $this->appendLogEntry( "No access to site '$currentSite'", 'CS:put' );
00356 return EZ_WEBDAV_FAILED_FORBIDDEN;
00357 }
00358
00359 return $this->putVirtualFolderData( $currentSite, $target, $tempFile, $fullPath );
00360 }
00361
00362
00363
00364
00365
00366
00367 function putVirtualFolderData( $currentSite, $target, $tempFile, $fullPath )
00368 {
00369 $this->appendLogEntry( "current site is: $currentSite", 'CS:put' );
00370 $this->setCurrentSite( $currentSite );
00371
00372 $target = $this->splitFirstPathElement( $target, $virtualFolder );
00373
00374 if ( !$target )
00375 {
00376
00377
00378 return EZ_WEBDAV_FAILED_FORBIDDEN;
00379 }
00380
00381 if ( !in_array( $virtualFolder, $this->virtualFolderList() ) )
00382 {
00383 $this->appendLogEntry( "Unknown virtual folder: '$virtualFolder' in site '$currentSite'", 'CS:put' );
00384 return EZ_WEBDAV_FAILED_CONFLICT;
00385 }
00386
00387 if ( !$this->userHasVirtualAccess( $currentSite, $virtualFolder ) )
00388 {
00389 $this->appendLogEntry( "No access to virtual folder '$virtualFolder' in site '$currentSite'", 'CS:put' );
00390 return EZ_WEBDAV_FAILED_FORBIDDEN;
00391 }
00392
00393 if ( $virtualFolder == VIRTUAL_CONTENT_FOLDER_NAME or
00394 $virtualFolder == VIRTUAL_MEDIA_FOLDER_NAME )
00395 {
00396 return $this->putContentData( $currentSite, $virtualFolder, $target, $tempFile, $fullPath );
00397 }
00398
00399 return EZ_WEBDAV_FAILED_FORBIDDEN;
00400 }
00401
00402
00403
00404
00405
00406
00407
00408 function putContentData( $currentSite, $virtualFolder, $target, $tempFile, $fullPath )
00409 {
00410 $nodePath = $this->internalNodePath( $virtualFolder, $target );
00411
00412 $this->appendLogEntry( "Inside virtual content folder", 'CS:put' );
00413
00414 $parentNode = $this->fetchParentNodeByTranslation( $nodePath );
00415 if ( $parentNode == null )
00416 {
00417
00418 $this->appendLogEntry( "Cannot put file $nodePath, not parent found", 'CS:put' );
00419 return EZ_WEBDAV_FAILED_CONFLICT;
00420 }
00421
00422
00423 if ( !$parentNode->canRead() )
00424 {
00425 $this->appendLogEntry( "No access to put '$nodePath' in site '$currentSite'", 'CS:put' );
00426 return EZ_WEBDAV_FAILED_FORBIDDEN;
00427 }
00428
00429 $parentNodeID = $parentNode->attribute( 'node_id' );
00430
00431
00432 $mimeInfo = eZMimeType::findByURL( $nodePath );
00433 $mime = $mimeInfo['name'];
00434
00435 $webdavINI =& eZINI::instance( WEBDAV_INI_FILE );
00436 $defaultObjectType = $webdavINI->variable( 'PutSettings', 'DefaultClass' );
00437
00438 $existingNode = $this->fetchNodeByTranslation( $nodePath );
00439 include_once( 'kernel/classes/ezcontentupload.php' );
00440
00441 $upload = new eZContentUpload();
00442 if ( !$upload->handleLocalFile( $result, $tempFile, $parentNodeID, $existingNode ) )
00443 {
00444 foreach ( $result['errors'] as $error )
00445 {
00446 $this->appendLogEntry( "Error: " . $error['description'], 'CS: put' );
00447 }
00448 foreach ( $result['notices'] as $notice )
00449 {
00450 $this->appendLogEntry( "Notice: " . $notice['description'], 'CS: put' );
00451 }
00452 if ( $result['status'] == EZ_CONTENTUPLOAD_STATUS_PERMISSION_DENIED )
00453 {
00454 return EZ_WEBDAV_FAILED_FORBIDDEN;
00455 }
00456 else
00457 return EZ_WEBDAV_FAILED_UNSUPPORTED;
00458 }
00459
00460 return EZ_WEBDAV_OK_CREATED;
00461 }
00462
00463
00464
00465
00466
00467
00468 function mkcol( $target )
00469 {
00470 $fullPath = $target;
00471 $target = $this->splitFirstPathElement( $target, $currentSite );
00472
00473 if ( !$currentSite )
00474 {
00475
00476 return EZ_WEBDAV_FAILED_FORBIDDEN;
00477 }
00478
00479 if ( !$this->userHasSiteAccess( $currentSite ) )
00480 {
00481 $this->appendLogEntry( "No access to site '$currentSite'", 'CS:mkcol' );
00482 return EZ_WEBDAV_FAILED_FORBIDDEN;
00483 }
00484
00485 return $this->mkcolVirtualFolder( $currentSite, $target, $fullPath );
00486 }
00487
00488
00489
00490
00491
00492
00493 function mkcolVirtualFolder( $currentSite, $target, $fullPath )
00494 {
00495 $this->setCurrentSite( $currentSite );
00496
00497 $target = $this->splitFirstPathElement( $target, $virtualFolder );
00498
00499 if ( !in_array( $virtualFolder, $this->virtualList() ) )
00500 {
00501 $this->appendLogEntry( "Unknown virtual element: '$virtualFolder' in site '$currentSite'", 'CS:mkcol' );
00502 return EZ_WEBDAV_FAILED_NOT_FOUND;
00503 }
00504
00505 if ( !$target )
00506 {
00507
00508
00509 return EZ_WEBDAV_FAILED_FORBIDDEN;
00510 }
00511
00512 if ( !$this->userHasVirtualAccess( $currentSite, $virtualFolder ) )
00513 {
00514 $this->appendLogEntry( "No access to virtual folder '$virtualFolder' in site '$currentSite'", 'CS:mkcol' );
00515 return EZ_WEBDAV_FAILED_FORBIDDEN;
00516 }
00517
00518 if ( $virtualFolder == VIRTUAL_CONTENT_FOLDER_NAME or
00519 $virtualFolder == VIRTUAL_MEDIA_FOLDER_NAME )
00520 {
00521 return $this->mkcolContent( $currentSite, $virtualFolder, $target, $fullPath );
00522 }
00523
00524 return EZ_WEBDAV_FAILED_FORBIDDEN;
00525 }
00526
00527
00528
00529
00530
00531
00532
00533 function mkcolContent( $currentSite, $virtualFolder, $target, $fullPath )
00534 {
00535 $nodePath = $this->internalNodePath( $virtualFolder, $target );
00536 $node = $this->fetchNodeByTranslation( $nodePath );
00537 if ( $node )
00538 {
00539 return EZ_WEBDAV_FAILED_EXISTS;
00540 }
00541
00542 $parentNode = $this->fetchParentNodeByTranslation( $nodePath );
00543 $this->appendLogEntry( "Target is: $target", 'CS:mkcolContent' );
00544
00545 if ( !$parentNode )
00546 {
00547 return EZ_WEBDAV_FAILED_NOT_FOUND;
00548 }
00549
00550
00551 if ( !$parentNode->canRead() )
00552 {
00553 $this->appendLogEntry( "No access to mkcol '$nodePath' in site '$currentSite'", 'CS:mkcolContent' );
00554 return EZ_WEBDAV_FAILED_FORBIDDEN;
00555 }
00556
00557 return $this->createFolder( $parentNode, $nodePath );
00558 }
00559
00560
00561
00562
00563
00564 function delete( $target )
00565 {
00566 $fullPath = $target;
00567 $target = $this->splitFirstPathElement( $target, $currentSite );
00568
00569 if ( !$currentSite )
00570 {
00571
00572 return EZ_WEBDAV_FAILED_FORBIDDEN;
00573 }
00574
00575 if ( !$this->userHasSiteAccess( $currentSite ) )
00576 {
00577 $this->appendLogEntry( "No access to site '$currentSite'", 'CS:delete' );
00578 return EZ_WEBDAV_FAILED_FORBIDDEN;
00579 }
00580
00581 return $this->deleteVirtualFolder( $currentSite, $target, $fullPath );
00582 }
00583
00584
00585
00586
00587
00588
00589 function deleteVirtualFolder( $currentSite, $target, $fullPath )
00590 {
00591 $this->appendLogEntry( "Target is: $target", 'CS:delete' );
00592 $this->setCurrentSite( $currentSite );
00593
00594 $target = $this->splitFirstPathElement( $target, $virtualFolder );
00595
00596 if ( !in_array( $virtualFolder, $this->virtualList() ) )
00597 {
00598 $this->appendLogEntry( "Unknown virtual element: '$virtualFolder' in site '$currentSite'", 'CS:deleteVirtualFolder' );
00599 return EZ_WEBDAV_FAILED_NOT_FOUND;
00600 }
00601
00602 if ( !$target )
00603 {
00604
00605
00606 return EZ_WEBDAV_FAILED_FORBIDDEN;
00607 }
00608
00609 if ( !$this->userHasVirtualAccess( $currentSite, $virtualFolder ) )
00610 {
00611 $this->appendLogEntry( "No access to virtual folder '$virtualFolder' in site '$currentSite'", 'CS:deleteVirtualFolder' );
00612 return EZ_WEBDAV_FAILED_FORBIDDEN;
00613 }
00614
00615 if ( $virtualFolder == VIRTUAL_CONTENT_FOLDER_NAME or
00616 $virtualFolder == VIRTUAL_MEDIA_FOLDER_NAME )
00617 {
00618 return $this->deleteContent( $currentSite, $virtualFolder, $target, $fullPath );
00619 }
00620
00621 return EZ_WEBDAV_FAILED_FORBIDDEN;
00622 }
00623
00624
00625
00626
00627
00628
00629
00630 function deleteContent( $currentSite, $virtualFolder, $target, $fullPath )
00631 {
00632 $nodePath = $this->internalNodePath( $virtualFolder, $target );
00633 $node = $this->fetchNodeByTranslation( $nodePath );
00634
00635 if ( $node == null )
00636 {
00637 $this->appendLogEntry( "Cannot delete node/object $nodePath, it does not exist", 'CS:deleteContent' );
00638 return EZ_WEBDAV_FAILED_NOT_FOUND;
00639 }
00640
00641
00642 if ( !$node->canRead() or
00643 !$node->canRemove() )
00644 {
00645 $this->appendLogEntry( "No access to delete '$nodePath' in site '$currentSite'", 'CS:deleteContent' );
00646 return EZ_WEBDAV_FAILED_FORBIDDEN;
00647 }
00648
00649 $this->appendLogEntry( "Removing node: $nodePath", 'CS:deleteContent' );
00650 $node->removeNodeFromTree( true );
00651 return EZ_WEBDAV_OK;
00652 }
00653
00654
00655
00656
00657
00658 function move( $source, $destination )
00659 {
00660 $fullSource = $source;
00661 $fullDestination = $destination;
00662 $source = $this->splitFirstPathElement( $source, $sourceSite );
00663 $destination = $this->splitFirstPathElement( $destination, $destinationSite );
00664 if ( $sourceSite != $destinationSite )
00665 {
00666
00667
00668
00669
00670
00671 return EZ_WEBDAV_FAILED_FORBIDDEN;
00672 }
00673
00674 if ( !$sourceSite or
00675 !$destinationSite )
00676 {
00677
00678 return EZ_WEBDAV_FAILED_FORBIDDEN;
00679 }
00680
00681 if ( !$this->userHasSiteAccess( $sourceSite ) )
00682 {
00683 $this->appendLogEntry( "No access to site '$sourceSite'", 'CS:move' );
00684 return EZ_WEBDAV_FAILED_FORBIDDEN;
00685 }
00686 if ( !$this->userHasSiteAccess( $destinationSite ) )
00687 {
00688 $this->appendLogEntry( "No access to site '$destinationSite'", 'CS:move' );
00689 return EZ_WEBDAV_FAILED_FORBIDDEN;
00690 }
00691
00692 return $this->moveVirtualFolder( $sourceSite, $destinationSite,
00693 $source, $destination,
00694 $fullSource, $fullDestination );
00695 }
00696
00697
00698
00699
00700
00701
00702 function moveVirtualFolder( $sourceSite, $destinationSite,
00703 $source, $destination,
00704 $fullSource, $fullDestination )
00705 {
00706 $this->setCurrentSite( $sourceSite );
00707
00708 $source = $this->splitFirstPathElement( $source, $sourceVFolder );
00709 $destination = $this->splitFirstPathElement( $destination, $destinationVFolder );
00710
00711 if ( !in_array( $sourceVFolder, $this->virtualList() ) )
00712 {
00713 $this->appendLogEntry( "Unknown virtual element: '$sourceVFolder' in site '$sourceSite'", 'CS:moveVirtualFolder' );
00714 return EZ_WEBDAV_FAILED_NOT_FOUND;
00715 }
00716
00717 if ( !in_array( $destinationVFolder, $this->virtualList() ) )
00718 {
00719 $this->appendLogEntry( "Unknown virtual element: '$destinationVFolder' in site '$destinationSite'", 'CS:moveVirtualFolder' );
00720 return EZ_WEBDAV_FAILED_NOT_FOUND;
00721 }
00722
00723 if ( !$source or
00724 !$destination )
00725 {
00726
00727
00728 return EZ_WEBDAV_FAILED_FORBIDDEN;
00729 }
00730
00731 if ( !$this->userHasVirtualAccess( $sourceSite, $sourceVFolder ) )
00732 {
00733 $this->appendLogEntry( "No access to virtual folder '$sourceVFolder' in site '$sourceSite'", 'CS:moveVirtualFolder' );
00734 return EZ_WEBDAV_FAILED_FORBIDDEN;
00735 }
00736 if ( !$this->userHasVirtualAccess( $destinationSite, $destinationVFolder ) )
00737 {
00738 $this->appendLogEntry( "No access to virtual folder '$destinationVFolder' in site '$destinationSite'", 'CS:moveVirtualFolder' );
00739 return EZ_WEBDAV_FAILED_FORBIDDEN;
00740 }
00741
00742 if ( ( $sourceVFolder == VIRTUAL_CONTENT_FOLDER_NAME or
00743 $sourceVFolder == VIRTUAL_MEDIA_FOLDER_NAME ) and
00744 ( $destinationVFolder == VIRTUAL_CONTENT_FOLDER_NAME or
00745 $destinationVFolder == VIRTUAL_MEDIA_FOLDER_NAME ) )
00746 {
00747 return $this->moveContent( $sourceSite, $destinationSite,
00748 $sourceVFolder, $destinationVFolder,
00749 $source, $destination,
00750 $fullSource, $fullDestination );
00751 }
00752
00753 return EZ_WEBDAV_FAILED_FORBIDDEN;
00754 }
00755
00756
00757
00758
00759
00760
00761
00762 function moveContent( $sourceSite, $destinationSite,
00763 $sourceVFolder, $destinationVFolder,
00764 $source, $destination,
00765 $fullSource, $fullDestination )
00766 {
00767 $nodePath = $this->internalNodePath( $sourceVFolder, $source );
00768 $destinationNodePath = $this->internalNodePath( $destinationVFolder, $destination );
00769
00770
00771 $source = $this->fileBasename( $source );
00772
00773 $sourceNode = $this->fetchNodeByTranslation( $nodePath );
00774
00775 if ( !$sourceNode )
00776 {
00777 return EZ_WEBDAV_FAILED_NOT_FOUND;
00778 }
00779
00780
00781 if ( !$sourceNode->canMoveFrom() )
00782 {
00783 $this->appendLogEntry( "No access to move the node '$sourceSite':'$nodePath'", 'CS:moveContent' );
00784 return EZ_WEBDAV_FAILED_FORBIDDEN;
00785 }
00786
00787 $object = $sourceNode->attribute( 'object' );
00788 $classID = $object->attribute( 'contentclass_id' );
00789
00790
00791 $destination = $this->fileBasename( $destination );
00792
00793 $destinationNode = $this->fetchNodeByTranslation( $destinationNodePath );
00794 $this->appendLogEntry( "Destination: $destinationNodePath", 'CS:moveContent' );
00795
00796 if ( $destinationNode )
00797 {
00798 return EZ_WEBDAV_FAILED_EXISTS;
00799 }
00800
00801 $destinationNode = $this->fetchParentNodeByTranslation( $destinationNodePath );
00802
00803 if ( !$destinationNode )
00804 {
00805 return EZ_WEBDAV_FAILED_NOT_FOUND;
00806 }
00807
00808
00809 if ( !$destinationNode->canMoveTo( $classID ) )
00810 {
00811 $this->appendLogEntry( "No access to move the node '$sourceSite':'$nodePath' to '$destinationSite':'$destinationNodePath'", 'CS:moveContent' );
00812 return EZ_WEBDAV_FAILED_FORBIDDEN;
00813 }
00814
00815 $srcParentPath = $this->splitLastPathElement( $nodePath, $srcNodeName );
00816 $dstParentPath = $this->splitLastPathElement( $destinationNodePath, $dstNodeName );
00817 if ( $srcParentPath == $dstParentPath )
00818 {
00819 if( !$object->rename( $dstNodeName ) )
00820 {
00821 $this->appendLogEntry( "Unable to rename the node '$sourceSite':'$nodePath' to '$destinationSite':'$destinationNodePath'", 'CS:moveContent' );
00822 return EZ_WEBDAV_FAILED_FORBIDDEN;
00823 }
00824 }
00825 else
00826 {
00827 include_once( 'kernel/classes/ezcontentobjecttreenodeoperations.php' );
00828 if( !eZContentObjectTreeNodeOperations::move( $sourceNode->attribute( 'node_id' ), $destinationNode->attribute( 'node_id' ) ) )
00829 {
00830 $this->appendLogEntry( "Unable to move the node '$sourceSite':'$nodePath' to '$destinationSite':'$destinationNodePath'", 'CS:moveContent' );
00831 return EZ_WEBDAV_FAILED_FORBIDDEN;
00832 }
00833 }
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848 return EZ_WEBDAV_OK_CREATED;
00849 }
00850
00851
00852
00853
00854
00855
00856
00857
00858 function setCurrentSite( $site )
00859 {
00860 $access = array( 'name' => $site,
00861 'type' => EZ_ACCESS_TYPE_STATIC );
00862
00863 $access = changeAccess( $access );
00864 eZDebugSetting::writeDebug( 'kernel-siteaccess', $access, 'current siteaccess' );
00865
00866
00867 $nullVar = null;
00868 eZDB::setInstance( $nullVar );
00869 }
00870
00871
00872
00873
00874
00875 function userHasSiteAccess( $site )
00876 {
00877 $result = $this->User->hasAccessTo( 'user', 'login' );
00878 $accessWord = $result['accessWord'];
00879
00880 if ( $accessWord == 'limited' )
00881 {
00882 include_once( 'lib/ezutils/classes/ezsys.php' );
00883
00884 $hasAccess = false;
00885 $policyChecked = false;
00886 foreach ( array_keys( $result['policies'] ) as $key )
00887 {
00888 $policy =& $result['policies'][$key];
00889 if ( isset( $policy['SiteAccess'] ) )
00890 {
00891 $policyChecked = true;
00892 if ( in_array( eZSys::ezcrc32( $site ), $policy['SiteAccess'] ) )
00893 {
00894 $hasAccess = true;
00895 break;
00896 }
00897 }
00898 if ( $hasAccess )
00899 break;
00900 }
00901 if ( !$policyChecked )
00902 $hasAccess = true;
00903 }
00904 else if ( $accessWord == 'yes' )
00905 {
00906 $hasAccess = true;
00907 }
00908 else if ( $accessWord == 'no' )
00909 {
00910 $hasAccess = false;
00911 }
00912 return $hasAccess;
00913 }
00914
00915
00916
00917
00918
00919
00920 function userHasVirtualAccess( $site, $virtual )
00921 {
00922 $this->appendLogEntry( "Can access '$site' and '$virtual'", 'CS:userHasVirtualAccess' );
00923 return true;
00924 }
00925
00926
00927
00928
00929
00930 function currentSiteFromPath( $path )
00931 {
00932 $this->appendLogEntry( "start path: $path", 'CS:currentSiteFromPath' );
00933
00934 $indexDir = eZSys::indexDir();
00935
00936
00937 if ( preg_match( "#^" . preg_quote( $indexDir ) . "(.+)$#", $path, $matches ) )
00938 {
00939 $path = $matches[1];
00940 }
00941
00942 $this->appendLogEntry( "indexdir: $path", 'CS:currentSiteFromPath' );
00943
00944
00945 $sites = $this->availableSites();
00946
00947 foreach ( $sites as $site )
00948 {
00949
00950 if ( preg_match( "#^/" . preg_quote( $site ) . "(.*)$#", $path, $matches ) )
00951 {
00952 $this->appendLogEntry( "site $site: $path", 'CS:currentSiteFromPath' );
00953 return $site ;
00954 }
00955 }
00956
00957 $this->appendLogEntry( "no valid site was found..", 'CS:currentSiteFromPath' );
00958 return false ;
00959 }
00960
00961
00962
00963
00964
00965 function processURL( $url )
00966 {
00967 $this->appendLogEntry( "start url: $url", 'CS:processURL' );
00968 $indexDir = eZSys::indexDir();
00969 $len = strlen( $indexDir );
00970
00971 if ( $indexDir == substr( $url, 0, $len ) )
00972 {
00973 $url = substr( $url, $len );
00974 }
00975
00976
00977
00978 if ( strlen( $url ) > 0 and $url[0] == '/' )
00979 $url = substr( $url, 1 );
00980
00981 $this->appendLogEntry( "indexdir url: $url", 'CS:processURL' );
00982 return $url;
00983 }
00984
00985
00986
00987
00988 function headers()
00989 {
00990 header( "WebDAV-Powered-By: eZ publish" );
00991 }
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009
01010
01011
01012 function splitFirstPathElement( $path, &$element )
01013 {
01014 if ( $path[0] == '/' )
01015 $path = substr( $path, 1 );
01016 $pos = strpos( $path, '/' );
01017 if ( $pos === false )
01018 {
01019 $element = $path;
01020 $path = '';
01021 }
01022 else
01023 {
01024 $element = substr( $path, 0, $pos );
01025 $path = substr( $path, $pos + 1 );
01026 }
01027 return $path;
01028 }
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049 function splitLastPathElement( $path, &$element )
01050 {
01051 $len = strlen( $path );
01052 if ( $len > 0 and $path[$len - 1] == '/' )
01053 $path = substr( $path, 0, $len - 1 );
01054 $pos = strrpos( $path, '/' );
01055 if ( $pos === false )
01056 {
01057 $element = $path;
01058 $path = '';
01059 }
01060 else
01061 {
01062 $element = substr( $path, $pos + 1 );
01063 $path = substr( $path, 0, $pos );
01064 }
01065 return $path;
01066 }
01067
01068
01069
01070
01071
01072 function internalNodePath( $virtualFolder, $collection )
01073 {
01074
01075
01076 if ( $virtualFolder == VIRTUAL_MEDIA_FOLDER_NAME )
01077 {
01078 $nodePath = 'media';
01079 if ( strlen( $collection ) > 0 )
01080 $nodePath .= '/' . $collection;
01081 }
01082 else
01083 {
01084 $nodePath = $collection;
01085 }
01086 return $nodePath;
01087 }
01088
01089
01090
01091
01092
01093 function fetchNodeByTranslation( $nodePathString )
01094 {
01095
01096 $nodePathString = $this->fileBasename( $nodePathString );
01097
01098
01099 if ( strlen( $nodePathString ) > 0 and
01100 $nodePathString[strlen( $nodePathString ) - 1] == '/' )
01101 {
01102 $nodePathString = substr( $nodePathString, 0, strlen( $nodePathString ) - 1 );
01103 }
01104
01105 if ( strlen( $nodePathString ) > 0 )
01106 {
01107 $nodePathString = eZURLAlias::convertPathToAlias( $nodePathString );
01108 }
01109
01110
01111 $translateResult = eZURLAlias::translate( $nodePathString );
01112
01113 if ( !$translateResult )
01114 {
01115 $this->appendLogEntry( "Node translation failed: $nodePathString", 'CS:fetchNodeByTranslation' );
01116 }
01117
01118
01119 if ( preg_match( "#^content/view/full/([0-9]+)$#", $nodePathString, $matches ) )
01120 {
01121 $nodeID = $matches[1];
01122 $this->appendLogEntry( "NodeID: $nodeID", 'CS:fetchNodeByTranslation' );
01123 }
01124 else
01125 {
01126 $this->appendLogEntry( "No nodeID", 'CS:fetchNodeByTranslation' );
01127 return false;
01128 }
01129
01130
01131 $node = eZContentObjectTreeNode::fetch( $nodeID );
01132
01133
01134 return $node;
01135 }
01136
01137
01138
01139
01140 function fileBasename( $name )
01141 {
01142 $pos = strrpos( $name, '.' );
01143 if ( $pos !== false )
01144 {
01145 $name = substr( $name, 0, $pos );
01146 }
01147 return $name;
01148 }
01149
01150
01151
01152
01153
01154
01155
01156 function fetchParentNodeByTranslation( $nodePathString )
01157 {
01158
01159 $nodePathString = $this->fileBasename( $nodePathString );
01160
01161
01162 if ( strlen( $nodePathString ) > 0 and
01163 $nodePathString[strlen( $nodePathString ) - 1] == '/' )
01164 {
01165 $nodePathString = substr( $nodePathString, 0, strlen( $nodePathString ) - 1 );
01166 }
01167
01168 $nodePathString = $this->splitLastPathElement( $nodePathString, $element );
01169
01170 if ( strlen( $nodePathString ) == 0 )
01171 $nodePathString = '/';
01172
01173 $nodePathString = eZURLAlias::convertPathToAlias( $nodePathString );
01174
01175
01176 $translateResult = eZURLAlias::translate( $nodePathString );
01177
01178
01179 if ( preg_match( "#^content/view/full/([0-9]+)$#", $nodePathString, $matches ) )
01180 {
01181 $nodeID = $matches[1];
01182 $this->appendLogEntry( "NodeID: $nodeID", 'CS:fetchParentNodeByTranslation' );
01183 }
01184 else
01185 {
01186 $this->appendLogEntry( "Root node", 'CS:fetchParentNodeByTranslation' );
01187 $nodeID = 2;
01188 }
01189
01190
01191 $node = eZContentObjectTreeNode::fetch( $nodeID );
01192
01193
01194 return $node;
01195 }
01196
01197
01198
01199
01200 function virtualFolderList()
01201 {
01202 return array( VIRTUAL_CONTENT_FOLDER_NAME, VIRTUAL_MEDIA_FOLDER_NAME );
01203 }
01204
01205
01206
01207
01208 function virtualFolderInfoList()
01209 {
01210 return array( array( 'name' => VIRTUAL_CONTENT_FOLDER_NAME ),
01211 array( 'name' => VIRTUAL_MEDIA_FOLDER_NAME ) );
01212 }
01213
01214
01215
01216
01217 function virtualFileList()
01218 {
01219 return array( basename( VIRTUAL_INFO_FILE_NAME ) );
01220 }
01221
01222
01223
01224
01225 function virtualFileInfoList()
01226 {
01227 return array( array( 'name' => basename( VIRTUAL_INFO_FILE_NAME ),
01228 'filepath' => VIRTUAL_INFO_FILE_NAME ) );
01229 }
01230
01231
01232
01233
01234 function virtualList()
01235 {
01236 return array_merge( eZWebDAVContentServer::virtualFolderList(),
01237 eZWebDAVContentServer::virtualFileList() );
01238 }
01239
01240
01241
01242
01243 function virtualInfoList()
01244 {
01245 return array_merge( eZWebDAVContentServer::virtualFolderInfoList(),
01246 eZWebDAVContentServer::virtualFileInfoList() );
01247 }
01248
01249
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261 function fetchVirtualSiteContent( $site, $depth, $properties )
01262 {
01263 $this->appendLogEntry( "Script URL.." . $_SERVER["SCRIPT_URL"], 'CS:fetchVirtualSiteContent' );
01264
01265 $infoFile = $_SERVER['DOCUMENT_ROOT'] . '/' . VIRTUAL_INFO_FILE_NAME;
01266
01267
01268 $contentEntry = array();
01269 $contentEntry["name"] = $_SERVER["SCRIPT_URL"];
01270 $contentEntry["size"] = 0;
01271 $contentEntry["mimetype"] = 'httpd/unix-directory';
01272 $contentEntry["ctime"] = filectime( 'settings/siteaccess/' . $site );
01273 $contentEntry["mtime"] = filemtime( 'settings/siteaccess/' . $site );
01274 $contentEntry["href"] = $_SERVER["SCRIPT_URL"];
01275 $entries[] = $contentEntry;
01276
01277 $defctime = $contentEntry['ctime'];
01278 $defmtime = $contentEntry['mtime'];
01279
01280 if ( $depth > 0 )
01281 {
01282 $scriptURL = $_SERVER["SCRIPT_URL"];
01283 if ( $scriptURL{strlen($scriptURL) - 1} != "/" )
01284 $scriptURL .= "/";
01285
01286
01287 foreach ( $this->virtualInfoList() as $info )
01288 {
01289 $name = $info['name'];
01290 $filepath = false;
01291 if ( isset( $info['filepath'] ) )
01292 $filepath = $info['filepath'];
01293 $size = 0;
01294 if ( $filepath === false or file_exists( $filepath ) )
01295 {
01296 $mimeType = 'httpd/unix-directory';
01297 if ( $filepath !== false )
01298 {
01299 $mimeInfo = eZMimeType::findByFileContents( $filepath );
01300 $mimeType = $mimeInfo['name'];
01301 $ctime = filectime( $filepath );
01302 $mtime = filemtime( $filepath );
01303 $size = filesize( $filepath );
01304 }
01305 else
01306 {
01307 $ctime = $defctime;
01308 $mtime = $defmtime;
01309 }
01310
01311 $entry = array();
01312 $entry["name"] = $name;
01313 $entry["size"] = $size;
01314 $entry["mimetype"] = $mimeType;
01315 $entry["ctime"] = $ctime;
01316 $entry["mtime"] = $mtime;
01317 $entry["href"] = $scriptURL . $name;
01318 $entries[] = $entry;
01319 }
01320 }
01321 }
01322
01323 return $entries;
01324 }
01325
01326
01327
01328
01329 function fetchSiteListContent( $depth, $properties )
01330 {
01331
01332 $entries = array();
01333
01334
01335 $contentEntry = array();
01336 $entries = array();
01337
01338
01339 $contentEntry["name"] = '/';
01340 $contentEntry["href"] = $_SERVER['SCRIPT_URL'];
01341 $contentEntry["size"] = 0;
01342 $contentEntry["mimetype"] = 'httpd/unix-directory';
01343 $contentEntry["ctime"] = filectime( 'var' );
01344 $contentEntry["mtime"] = filemtime( 'var' );
01345
01346 $entries[] = $contentEntry;
01347
01348 if ( $depth > 0 )
01349 {
01350
01351 $sites = $this->availableSites();
01352
01353
01354 foreach ( $sites as $site )
01355 {
01356
01357 $contentEntry["name"] = $_SERVER['SCRIPT_URL'] . $site;
01358 $contentEntry["size"] = 0;
01359 $contentEntry["mimetype"] = 'httpd/unix-directory';
01360 $contentEntry["ctime"] = filectime( 'settings/siteaccess/' . $site );
01361 $contentEntry["mtime"] = filemtime( 'settings/siteaccess/' . $site );
01362
01363 if ( $_SERVER["SCRIPT_URL"] == '/' )
01364 {
01365 $contentEntry["href"] = $contentEntry["name"];
01366 }
01367 else
01368 {
01369 $contentEntry["href"] = $_SERVER["SCRIPT_URL"] . $contentEntry["name"];
01370 }
01371
01372 $entries[] = $contentEntry;
01373 }
01374 }
01375
01376 return $entries;
01377 }
01378
01379
01380
01381
01382
01383
01384 function fetchContentList( &$node, $target, $depth, $properties )
01385 {
01386
01387 $entries = array();
01388
01389 if ( $depth == 1 )
01390 {
01391
01392 $subTree =& $node->subTree( array ( 'Depth' => 1 ) );
01393
01394
01395
01396 foreach ( $subTree as $someNode )
01397 {
01398 $entries[] = $this->fetchNodeInfo( $someNode );
01399 }
01400 }
01401
01402
01403 $thisNodeInfo = array();
01404 $thisNodeInfo = $this->fetchNodeInfo( $node );
01405 $thisNodeInfo["href"] = $_SERVER['SCRIPT_URL'];
01406 $entries[] = $thisNodeInfo;
01407
01408
01409 return $entries;
01410 }
01411
01412
01413
01414
01415 function isObjectFolder( &$object, &$class )
01416 {
01417 $classIdentifier = $class->attribute( 'identifier' );
01418 if ( $this->FolderClasses === null )
01419 {
01420 $webdavINI =& eZINI::instance( WEBDAV_INI_FILE );
01421 $folderClasses = array();
01422 if ( $webdavINI->hasGroup( 'GeneralSettings' ) and
01423 $webdavINI->hasVariable( 'GeneralSettings', 'FolderClasses' ) )
01424 {
01425 $folderClasses = $webdavINI->variable( 'GeneralSettings', 'FolderClasses' );
01426 }
01427 $this->FolderClasses = $folderClasses;
01428 }
01429 return in_array( $classIdentifier, $this->FolderClasses );
01430 }
01431
01432
01433
01434
01435 function fetchNodeInfo( &$node )
01436 {
01437
01438 $entry = array();
01439
01440
01441 $webdavINI =& eZINI::instance( WEBDAV_INI_FILE );
01442 $iniSettings = $webdavINI->variable( 'DisplaySettings', 'FileAttribute' );
01443
01444 $classIdentifier = $node->attribute( 'class_identifier' );
01445
01446 $object =& $node->attribute( 'object' );
01447
01448
01449
01450 $entry["name"] = trim( $node->attribute( 'name' ) );
01451 $entry["size"] = 0;
01452 $entry["mimetype"] = 'httpd/unix-directory';
01453 $entry["ctime"] = $object->attribute( 'published' );
01454 $entry["mtime"] = $object->attribute( 'modified' );
01455
01456 include_once( 'kernel/classes/ezcontentupload.php' );
01457 $upload = new eZContentUpload();
01458 $info = $upload->objectFileInfo( $object );
01459 $class =& $object->contentClass();
01460 $isObjectFolder = $this->isObjectFolder( $object, $class );
01461
01462 if ( $isObjectFolder )
01463 {
01464
01465 }
01466 else if ( $info )
01467 {
01468 $filePath = $info['filepath'];
01469 $entry["mimetype"] = false;
01470 $entry["size"] = false;
01471 if ( isset( $info['filesize'] ) )
01472 $entry['size'] = $info['filesize'];
01473 if ( isset( $info['mime_type'] ) )
01474 $entry['mimetype'] = $info['mime_type'];
01475
01476
01477 $file = eZClusterFileHandler::instance( $filePath );
01478 if ( !$entry['size'] and $file->exists() )
01479 {
01480 $entry["size"] = $file->size();
01481 }
01482 if ( !$entry['mimetype'] )
01483 {
01484 $mimeInfo = eZMimeType::findByURL( $filePath );
01485 $entry["mimetype"] = $mimeInfo['name'];
01486 $suffix = $mimeInfo['suffix'];
01487 if ( strlen( $suffix ) > 0 )
01488 $entry["name"] .= '.' . $suffix;
01489 }
01490 else
01491 {
01492
01493
01494
01495 $suffix = eZFile::suffix( $filePath );
01496 if ( !$suffix )
01497 {
01498 $mimeInfo = eZMimeType::findByName( $entry['mimetype'] );
01499 $suffix = $mimeInfo['suffix'];
01500 }
01501 if ( strlen( $suffix ) > 0 )
01502 $entry["name"] .= '.' . $suffix;
01503 }
01504
01505 if ( $file->exists() )
01506 {
01507 $entry["ctime"] = $file->mtime();
01508 $entry["mtime"] = $file->mtime();
01509 }
01510 }
01511 else
01512 {
01513
01514
01515 if ( !$class->attribute( 'is_container' ) )
01516 {
01517 $entry['mimetype'] = 'application/octet-stream';
01518 }
01519 }
01520
01521 $scriptURL = $_SERVER["SCRIPT_URL"];
01522 if ( strlen( $scriptURL ) > 0 and $scriptURL[ strlen( $scriptURL ) - 1 ] != "/" )
01523 $scriptURL .= "/";
01524
01525
01526 if ( !isset( $entry['href'] ) )
01527 $entry["href"] = $scriptURL . $entry['name'];
01528
01529
01530 return $entry;
01531 }
01532
01533
01534
01535
01536
01537
01538
01539
01540 function createFolder( $parentNode, $target )
01541 {
01542
01543 $webdavINI =& eZINI::instance( WEBDAV_INI_FILE );
01544 $folderClassID = $webdavINI->variable( 'FolderSettings', 'FolderClass' );
01545 $languageCode = eZContentObject::defaultLanguage();
01546
01547 $contentObject = eZContentObject::createWithNodeAssignment( $parentNode, $folderClassID, $languageCode );
01548 if ( $contentObject )
01549 {
01550 $db =& eZDB::instance();
01551 $db->begin();
01552 $version =& $contentObject->version( 1 );
01553 $version->setAttribute( 'status', EZ_VERSION_STATUS_DRAFT );
01554 $version->store();
01555
01556 $contentObjectID = $contentObject->attribute( 'id' );
01557 $contentObjectAttributes =& $version->contentObjectAttributes();
01558
01559 $contentObjectAttributes[0]->setAttribute( 'data_text', basename( $target ) );
01560 $contentObjectAttributes[0]->store();
01561 $db->commit();
01562
01563 include_once( 'lib/ezutils/classes/ezoperationhandler.php' );
01564 $operationResult = eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $contentObjectID,
01565 'version' => 1 ) );
01566 return EZ_WEBDAV_OK_CREATED;
01567 }
01568 else
01569 {
01570 $this->appendLogEntry( "Not allowed", 'CS:createFolder' );
01571 return EZ_WEBDAV_FAILED_FORBIDDEN;
01572 }
01573 }
01574
01575
01576
01577
01578 function availableSites()
01579 {
01580
01581 $siteList = array();
01582
01583
01584 $webdavINI =& eZINI::instance();
01585 $siteList = $webdavINI->variable( 'SiteSettings', 'SiteList' );
01586
01587
01588 return $siteList ;
01589 }
01590
01591
01592
01593 var $FolderClasses;
01594 }
01595 ?>