ILIAS
eassessment Revision 61809
|
Public Member Functions | |
ilDAVServer () | |
Constructor. | |
serveRequest () | |
Serves a WebDAV request. | |
PROPFIND (&$options, &$files) | |
PROPFIND method handler. | |
GET (&$options) | |
GET method handler. | |
PUT (&$options) | |
PUT method handler. | |
PUTfinished (&$options) | |
PUTfinished handler. | |
MKCOL ($options) | |
MKCOL method handler. | |
DELETE ($options) | |
DELETE method handler. | |
MOVE ($options) | |
MOVE method handler. | |
COPY ($options, $del=false) | |
COPY method handler. | |
PROPPATCH (&$options) | |
PROPPATCH method handler. | |
LOCK (&$options) | |
LOCK method handler. | |
UNLOCK (&$options) | |
UNLOCK method handler. | |
toNodePath ($davPath) | |
Converts a DAV path into a node path. | |
getMountURI ($refId, $nodeId=0, $ressourceName=null, $parentRefId=null, $genericURI=false) | |
Returns an URI for mounting the repository object as a webfolder. | |
getFolderURI ($refId, $nodeId=0, $ressourceName=null, $parentRefId=null) | |
Returns an URI for mounting the repository object as a webfolder using Internet Explorer and Firefox with the "openwebfolder" plugin. | |
getObjectURI ($refId, $ressourceName=null, $parentRefId=null) | |
Returns an URI for getting a object using WebDAV by its name. | |
getFileURI ($refId, $ressourceName=null, $parentRefId=null) | |
Returns an URI for getting a file object using WebDAV. | |
isWebDAVoverHTTPS () | |
Returns true, if the WebDAV server transfers data over HTTPS. | |
Public Member Functions inherited from HTTP_WebDAV_Server | |
HTTP_WebDAV_Server () | |
Constructor. | |
http_OPTIONS () | |
GET implementation. | |
http_PROPFIND () | |
PROPFIND method handler. | |
http_PROPPATCH () | |
PROPPATCH method handler. | |
http_MKCOL () | |
MKCOL method handler. | |
http_GET () | |
GET method handler. | |
_get_ranges (&$options) | |
parse HTTP Range: header | |
_multipart_byterange_header ($mimetype=false, $from=false, $to=false, $total=false) | |
generate separator headers for multipart response | |
http_HEAD () | |
HEAD method handler. | |
http_PUT () | |
PUT method handler. | |
http_DELETE () | |
DELETE method handler. | |
http_COPY () | |
COPY method handler. | |
http_MOVE () | |
MOVE method handler. | |
http_LOCK () | |
LOCK method handler. | |
http_UNLOCK () | |
UNLOCK method handler. | |
_copymove ($what) | |
_allow () | |
check for implemented HTTP methods | |
mkprop () | |
helper for property element creation | |
_check_auth () | |
check authentication if check is implemented | |
_new_uuid () | |
generate Unique Universal IDentifier for lock token | |
_new_locktoken () | |
create a new opaque lock token as defined in RFC2518 | |
_if_header_lexer ($string, &$pos) | |
_if_header_parser ($str) | |
parse If: header | |
_check_if_header_conditions () | |
check if conditions from "If:" headers are meat | |
_check_uri_condition ($uri, $condition) | |
Check a single URI condition parsed from an if-header. | |
_check_lock_status ($path, $exclusive_only=false) | |
lockdiscovery ($path) | |
Generate lockdiscovery reply from checklock() result. | |
http_status ($status) | |
set HTTP return status and mirror it in a private header | |
_urlencode ($url) | |
private minimalistic version of PHP urlencode() | |
_urldecode ($path) | |
private version of PHP urldecode | |
_prop_encode ($text) | |
UTF-8 encode property values if not already done so. | |
_slashify ($path) | |
Slashify - make sure path ends in a slash. |
Static Public Member Functions | |
static | getInstance () |
Get singelton iunstance. | |
static | _isActive () |
Static getter. | |
static | _isActionsVisible () |
Static getter. | |
static | _getDefaultWebfolderInstructions () |
Gets instructions for the usage of webfolders. | |
static | _getWebfolderInstructionsFor ($webfolderTitle, $webfolderURI, $webfolderURI_IE, $webfolderURI_Konqueror, $webfolderURI_Nautilus, $os= 'unknown', $osFlavor= 'unknown') |
Gets Webfolder mount instructions for the specified webfolder. |
Protected Member Functions | |
checkLock ($path) | |
checkLock() helper | |
getLogin ($userId) | |
Returns the login for the specified user id, or null if the user does not exist. | |
writelog ($message) | |
Writes a message to the logfile.,. |
Private Member Functions | |
davUrlEncode ($path) | |
We do not implement this method, because authentication is done by ilias3/webdav.php. | |
isFileHidden (&$objDAV) | |
Returns true, if the resource has a file name which is hidden from the user. | |
fileinfo ($resourcePath, $displayPath, &$objDAV) | |
Creates file info properties for a single file/resource. | |
mountDir (&$objDAV, &$options) | |
Mount method handler for directories. | |
showMountInstructions (&$objDAV, &$options) | |
Mount instructions method handler for directories. | |
getDir (&$objDAV, &$options) | |
GET method handler for directories. | |
getObject ($davPath) | |
Gets a DAV object for the specified path. | |
toObjectPath ($davPath) | |
Converts a DAV path into an array of DAV objects. | |
davDeslashify ($path) | |
davDeslashify - make sure path does not end in a slash | |
davBasename ($path) | |
Private implementation of PHP basename() function. | |
getUploadMaxFilesize () | |
Gets the maximum permitted upload filesize from php.ini in bytes. |
Private Attributes | |
$cachedObjectDAV | |
Cached object handler. | |
$locks | |
Handler for locks. | |
$properties | |
Handler for properties. | |
$clientOS = 'unknown' | |
The operating system of the WebDAV client. | |
$clientOSFlavor = 'unknown' | |
The flavor of the operating system of the WebDAV client. | |
$clientBrowser = 'unknown' | |
The name of some well known browsers, that need special support. | |
$putObjDAV = null | |
$isHTTPS = null | |
$isDebug = false | |
The WebDAVServer prints lots of log messages to the ilias log, if this variable is set to true. |
Static Private Attributes | |
static | $instance = null |
Additional Inherited Members | |
Data Fields inherited from HTTP_WebDAV_Server | |
$uri | |
$base_uri | |
$path | |
$http_auth_realm = "PHP WebDAV" | |
$dav_powered_by = "" | |
$_if_header_uris = array() | |
$_http_status = "200 OK" | |
$_prop_encoding = "utf-8" |
Definition at line 50 of file class.ilDAVServer.php.
|
static |
Gets instructions for the usage of webfolders.
The instructions consist of HTML text with placeholders. See _getWebfolderInstructionsFor for a description of the supported placeholders.
Definition at line 2021 of file class.ilDAVServer.php.
References $lng.
Referenced by _getWebfolderInstructionsFor(), ilObjFileAccessSettings\getCustomWebfolderInstructions(), and ilObjFileAccessSettings\getDefaultWebfolderInstructions().
|
static |
Gets Webfolder mount instructions for the specified webfolder.
The following placeholders are currently supported:
[WEBFOLDER_TITLE] - the title of the webfolder [WEBFOLDER_URI] - the URL for mounting the webfolder with standard compliant WebDAV clients [WEBFOLDER_URI_IE] - the URL for mounting the webfolder with Internet Explorer [WEBFOLDER_URI_KONQUEROR] - the URL for mounting the webfolder with Konqueror [WEBFOLDER_URI_NAUTILUS] - the URL for mounting the webfolder with Nautilus [IF_WINDOWS]...[/IF_WINDOWS] - conditional contents, with instructions for Windows [IF_MAC]...[/IF_MAC] - conditional contents, with instructions for Mac OS X [IF_LINUX]...[/IF_LINUX] - conditional contents, with instructions for Linux [ADMIN_MAIL] - the mailbox address of the system administrator
String | Title of the webfolder |
String | Mount URI of the webfolder for standards compliant WebDAV clients |
String | Mount URI of the webfolder for IE |
String | Mount URI of the webfolder for Konqueror |
String | Mount URI of the webfolder for Nautilus |
String | Operating system: 'windows', 'unix' or 'unknown'. |
String | Operating system flavor: 'xp', 'vista', 'osx', 'linux' or 'unknown'. |
Definition at line 2053 of file class.ilDAVServer.php.
References $ilSetting, and _getDefaultWebfolderInstructions().
Referenced by showMountInstructions().
|
static |
Static getter.
Returns true, if WebDAV actions are visible for repository items.
Definition at line 2006 of file class.ilDAVServer.php.
Referenced by ilContainerGUI\lockObject().
|
static |
Static getter.
Returns true, if the WebDAV server is active.
THe WebDAV Server is active, if the variable file_access::webdav_enabled is set in the client ini file, and if PEAR Auth_HTTP is installed.
Definition at line 1995 of file class.ilDAVServer.php.
Referenced by ilInfoScreenGUI\addObjectSections(), ilPersonalProfileGUI\initPasswordForm(), ilContainerGUI\lockObject(), and ilObjectGUI\prepareOutput().
|
protected |
checkLock() helper
string | resource path to check for locks |
Definition at line 1540 of file class.ilDAVServer.php.
References $locks, HTTP_WebDAV_Server\$path, getLogin(), toObjectPath(), and writelog().
ilDAVServer::COPY | ( | $options, | |
$del = false |
|||
) |
COPY method handler.
array | general parameter passing array |
Definition at line 1256 of file class.ilDAVServer.php.
References ilChangeEvent\_isActive(), ilChangeEvent\_recordReadEvent(), ilChangeEvent\_recordWriteEvent(), davBasename(), davDeslashify(), getObject(), and writelog().
|
private |
Private implementation of PHP basename() function.
The PHP basename() function does not work properly with filenames that contain international characters. e.g. basename('/x/ö') returns 'x' instead of 'ö'
Definition at line 1765 of file class.ilDAVServer.php.
References HTTP_WebDAV_Server\$path.
Referenced by COPY(), LOCK(), MKCOL(), MOVE(), and PUT().
|
private |
davDeslashify - make sure path does not end in a slash
string | directory path |
Definition at line 1748 of file class.ilDAVServer.php.
References HTTP_WebDAV_Server\$path, UtfNormal\toNFC(), and writelog().
Referenced by COPY(), DELETE(), GET(), getDir(), LOCK(), MKCOL(), mountDir(), MOVE(), PROPFIND(), PROPPATCH(), PUT(), showMountInstructions(), and UNLOCK().
|
private |
We do not implement this method, because authentication is done by ilias3/webdav.php.
private
string | HTTP Authentication type (Basic, Digest, ...) |
string | Username |
string | Password |
if (! $user) { return false; } return true; } Encodes an URL. This function differs from the PHP urlencode() function in the following way:
Definition at line 256 of file class.ilDAVServer.php.
References HTTP_WebDAV_Server\$path, and UtfNormal\toNFC().
Referenced by getDir(), getFileURI(), getObjectURI(), and PROPFIND().
ilDAVServer::DELETE | ( | $options | ) |
DELETE method handler.
array | general parameter passing array |
Definition at line 1100 of file class.ilDAVServer.php.
References HTTP_WebDAV_Server\$path, ilChangeEvent\_isActive(), ilChangeEvent\_recordWriteEvent(), davDeslashify(), getObject(), and writelog().
|
private |
Creates file info properties for a single file/resource.
string | resource path |
ilObjectDAV | resource DAV object |
Definition at line 421 of file class.ilDAVServer.php.
References $locks, $properties, HTTP_WebDAV_Server\mkprop(), and writelog().
Referenced by PROPFIND().
ilDAVServer::GET | ( | & | $options | ) |
GET method handler.
If the path denotes a directory, and if URL contains the query string "mount", a WebDAV mount-request is sent to the client. If the path denotes a directory, and if URL contains the query string "mount-instructions", instructions for mounting the directory are sent to the client.
array | parameter passing array |
Definition at line 528 of file class.ilDAVServer.php.
References $_GET, HTTP_WebDAV_Server\$path, ilChangeEvent\_isActive(), ilChangeEvent\_recordReadEvent(), davDeslashify(), getDir(), getObject(), mountDir(), showMountInstructions(), and writelog().
|
private |
GET method handler for directories.
This is a very simple mod_index lookalike. See RFC 2518, Section 8.4 on GET/HEAD for collections
ilObjectDAV | dav object handler |
Definition at line 723 of file class.ilDAVServer.php.
References $lng, $name, HTTP_WebDAV_Server\$path, davDeslashify(), davUrlEncode(), exit, and isFileHidden().
Referenced by GET().
ilDAVServer::getFileURI | ( | $refId, | |
$ressourceName = null , |
|||
$parentRefId = null |
|||
) |
Returns an URI for getting a file object using WebDAV.
Browsers can use this URI to download a file from ILIAS.
Note: This could be the same URI that is returned by getObjectURI. But we use a different URI, because we want to use the regular ILIAS authentication method, if no session exists, and we want to be able to download a file from the repository, even if the name of the file object is not unique.
refId | of the file object. |
ressourceName | title of the file object (if known), to reduce SQL queries |
parentRefId | refId of parent object (if known), to reduce SQL queries |
Definition at line 1944 of file class.ilDAVServer.php.
References HTTP_WebDAV_Server\$uri, davUrlEncode(), and isWebDAVoverHTTPS().
ilDAVServer::getFolderURI | ( | $refId, | |
$nodeId = 0 , |
|||
$ressourceName = null , |
|||
$parentRefId = null |
|||
) |
Returns an URI for mounting the repository object as a webfolder using Internet Explorer and Firefox with the "openwebfolder" plugin.
The FolderURI is only in effect on Windows. Therefore we don't need to deal with other pecularities.
The URI can be used as the value of a "folder" attribute inside of an HTML anchor tag "<a>".
refId | of the repository object. |
nodeId | of a childnode of the repository object. |
ressourceName | ressource name (if known), to reduce SQL queries |
parentRefId | refId of parent object (if known), to reduce SQL queries |
Definition at line 1862 of file class.ilDAVServer.php.
References $query, HTTP_WebDAV_Server\$uri, and isWebDAVoverHTTPS().
|
static |
Get singelton iunstance.
Definition at line 182 of file class.ilDAVServer.php.
References $instance, and ilDAVServer().
Referenced by ilObjFileAccessSettingsGUI\editWebDAVSettings(), ilObjGroupListGUI\getCommandLink(), ilObjCategoryListGUI\getCommandLink(), ilObjFolderListGUI\getCommandLink(), ilObjectListGUI\getCommandLink(), and ilContainerGUI\showPasswordInstructionObject().
|
protected |
Returns the login for the specified user id, or null if the user does not exist.
Definition at line 1608 of file class.ilDAVServer.php.
References ilObjUser\_lookupLogin(), and writelog().
Referenced by checkLock().
ilDAVServer::getMountURI | ( | $refId, | |
$nodeId = 0 , |
|||
$ressourceName = null , |
|||
$parentRefId = null , |
|||
$genericURI = false |
|||
) |
Returns an URI for mounting the repository object as a webfolder.
The URI can be used as the value of a "href" attribute attribute inside of an HTML anchor tag "<a>".
refId | of the repository object. |
nodeId | of a childnode of the repository object. |
ressourceName | ressource name (if known), to reduce SQL queries |
parentRefId | refId of parent object (if known), to reduce SQL queries |
genericURI | boolean Returns a generic mount URI, which works on all platforms which support WebDAV as in the IETF specification. |
Definition at line 1819 of file class.ilDAVServer.php.
References $query, HTTP_WebDAV_Server\$uri, and isWebDAVoverHTTPS().
|
private |
Gets a DAV object for the specified path.
String | davPath A DAV path expression. |
Definition at line 1622 of file class.ilDAVServer.php.
References $ref_id, ilObjectDAV\createObject(), and toNodePath().
Referenced by COPY(), DELETE(), GET(), LOCK(), MKCOL(), MOVE(), PROPFIND(), PROPPATCH(), PUT(), and UNLOCK().
ilDAVServer::getObjectURI | ( | $refId, | |
$ressourceName = null , |
|||
$parentRefId = null |
|||
) |
Returns an URI for getting a object using WebDAV by its name.
WebDAV clients can use this URI to access the object from ILIAS.
refId | of the object. |
ressourceName | object title (if known), to reduce SQL queries |
parentRefId | refId of parent object (if known), to reduce SQL queries |
Definition at line 1899 of file class.ilDAVServer.php.
References HTTP_WebDAV_Server\$uri, davUrlEncode(), and isWebDAVoverHTTPS().
|
private |
Gets the maximum permitted upload filesize from php.ini in bytes.
Definition at line 2114 of file class.ilDAVServer.php.
Referenced by PUT().
ilDAVServer::ilDAVServer | ( | ) |
Constructor.
void |
ilDAVServer::getInstance()
Definition at line 125 of file class.ilDAVServer.php.
References HTTP_WebDAV_Server\HTTP_WebDAV_Server(), and writelog().
Referenced by getInstance().
|
private |
Returns true, if the resource has a file name which is hidden from the user.
Note, that resources with a hidden file name can still be accessed by a
WebDAV client, if the client knows the resource name.
- We hide all Null Resources who haven't got an active lock - We hide all files with the prefix "." from Windows DAV Clients. - We hide all files which contain characters that are not allowed on Windows from Windows DAV Clients. - We hide the files with the prefix " ~$" or the name "Thumbs.db" from Unix DAV Clients.
Definition at line 378 of file class.ilDAVServer.php.
References $name, and writelog().
Referenced by getDir(), PROPFIND(), and showMountInstructions().
ilDAVServer::isWebDAVoverHTTPS | ( | ) |
Returns true, if the WebDAV server transfers data over HTTPS.
Definition at line 1977 of file class.ilDAVServer.php.
References $ilSetting, and $isHTTPS.
Referenced by getFileURI(), getFolderURI(), getMountURI(), getObjectURI(), and showMountInstructions().
ilDAVServer::LOCK | ( | & | $options | ) |
LOCK method handler.
array | general parameter passing array |
Definition at line 1379 of file class.ilDAVServer.php.
References $data, HTTP_WebDAV_Server\$path, davBasename(), davDeslashify(), getObject(), and writelog().
ilDAVServer::MKCOL | ( | $options | ) |
MKCOL method handler.
array | general parameter passing array |
Definition at line 1039 of file class.ilDAVServer.php.
References $name, HTTP_WebDAV_Server\$path, ilChangeEvent\_isActive(), ilChangeEvent\_recordWriteEvent(), davBasename(), davDeslashify(), getObject(), and writelog().
|
private |
Mount method handler for directories.
Mounting is done according to the internet draft RFC 4709 "Mounting WebDAV servers" "draft-reschke-webdav-mount-latest". See http://greenbytes.de/tech/webdav/draft-reschke-webdav-mount-latest.html
ilObjectDAV | dav object handler |
Definition at line 605 of file class.ilDAVServer.php.
References HTTP_WebDAV_Server\$path, davDeslashify(), and exit.
Referenced by GET().
ilDAVServer::MOVE | ( | $options | ) |
MOVE method handler.
array | general parameter passing array |
Definition at line 1139 of file class.ilDAVServer.php.
References ilChangeEvent\_isActive(), ilChangeEvent\_recordWriteEvent(), davBasename(), davDeslashify(), getObject(), and writelog().
ilDAVServer::PROPFIND | ( | & | $options, |
& | $files | ||
) |
PROPFIND method handler.
array | general parameter passing array |
array | return array for file properties |
Definition at line 278 of file class.ilDAVServer.php.
References $files, $GLOBALS, HTTP_WebDAV_Server\$path, ilChangeEvent\_isActive(), ilChangeEvent\_recordReadEvent(), davDeslashify(), davUrlEncode(), fileinfo(), getObject(), isFileHidden(), and writelog().
ilDAVServer::PROPPATCH | ( | & | $options | ) |
PROPPATCH method handler.
array | general parameter passing array |
Definition at line 1347 of file class.ilDAVServer.php.
References HTTP_WebDAV_Server\$path, davDeslashify(), getObject(), and writelog().
ilDAVServer::PUT | ( | & | $options | ) |
PUT method handler.
array | parameter passing array |
Definition at line 885 of file class.ilDAVServer.php.
References $name, $out, HTTP_WebDAV_Server\$path, ilChangeEvent\_catchupWriteEvents(), ilChangeEvent\_isActive(), ilChangeEvent\_recordWriteEvent(), davBasename(), davDeslashify(), ilMimeTypeUtil\getMimeType(), getObject(), getUploadMaxFilesize(), and writelog().
ilDAVServer::PUTfinished | ( | & | $options | ) |
PUTfinished handler.
array | parameter passing array |
Definition at line 1016 of file class.ilDAVServer.php.
References $putObjDAV, and writelog().
ilDAVServer::serveRequest | ( | ) |
Serves a WebDAV request.
Reimplemented from HTTP_WebDAV_Server.
Definition at line 194 of file class.ilDAVServer.php.
References HTTP_WebDAV_Server\http_status(), and writelog().
|
private |
Mount instructions method handler for directories.
ilObjectDAV | dav object handler |
Definition at line 630 of file class.ilDAVServer.php.
References $GLOBALS, $lng, HTTP_WebDAV_Server\$path, _getWebfolderInstructionsFor(), davDeslashify(), exit, isFileHidden(), isWebDAVoverHTTPS(), and toObjectPath().
Referenced by GET().
ilDAVServer::toNodePath | ( | $davPath | ) |
Converts a DAV path into a node path.
The returned array is granted to represent an absolute path. The first component of a DAV Path is the ILIAS client id. The following component either denote an absolute path, or a relative path starting at a ref_id.
String | davPath A DAV path expression. |
Definition at line 1699 of file class.ilDAVServer.php.
References $ref_id, and writelog().
Referenced by getObject(), and toObjectPath().
|
private |
Converts a DAV path into an array of DAV objects.
String | davPath A DAV path expression. |
Definition at line 1663 of file class.ilDAVServer.php.
References ilObjectDAV\createObject(), toNodePath(), and writelog().
Referenced by checkLock(), and showMountInstructions().
ilDAVServer::UNLOCK | ( | & | $options | ) |
UNLOCK method handler.
array | general parameter passing array |
Definition at line 1491 of file class.ilDAVServer.php.
References $log, HTTP_WebDAV_Server\$path, davDeslashify(), getObject(), and writelog().
|
protected |
Writes a message to the logfile.,.
message | String. |
Reimplemented from HTTP_WebDAV_Server.
Definition at line 1777 of file class.ilDAVServer.php.
References $ilLog.
Referenced by checkLock(), COPY(), davDeslashify(), DELETE(), fileinfo(), GET(), getLogin(), ilDAVServer(), isFileHidden(), LOCK(), MKCOL(), MOVE(), PROPFIND(), PROPPATCH(), PUT(), PUTfinished(), serveRequest(), toNodePath(), toObjectPath(), and UNLOCK().
|
private |
Cached object handler.
This is a private variable of function getObject.
Definition at line 62 of file class.ilDAVServer.php.
|
private |
The name of some well known browsers, that need special support.
This is either "konqueror", or unknown.
Definition at line 88 of file class.ilDAVServer.php.
|
private |
The operating system of the WebDAV client.
This is 'windows', 'unix' or 'unknown'. (Mac OS X considered as 'unix'.).
Definition at line 78 of file class.ilDAVServer.php.
|
private |
The flavor of the operating system of the WebDAV client.
This is 'xp', 'osx', or 'unknown'.
Definition at line 83 of file class.ilDAVServer.php.
|
staticprivate |
Definition at line 56 of file class.ilDAVServer.php.
Referenced by getInstance().
|
private |
The WebDAVServer prints lots of log messages to the ilias log, if this variable is set to true.
Definition at line 114 of file class.ilDAVServer.php.
|
private |
Definition at line 108 of file class.ilDAVServer.php.
Referenced by isWebDAVoverHTTPS().
|
private |
Handler for locks.
Definition at line 67 of file class.ilDAVServer.php.
Referenced by checkLock(), and fileinfo().
|
private |
Handler for properties.
Definition at line 71 of file class.ilDAVServer.php.
Referenced by fileinfo().
|
private |
Definition at line 100 of file class.ilDAVServer.php.
Referenced by PUTfinished().