Procedural File: lib-webservices.php
Source Location: /system/lib-webservices.php
Page Details:
Implementation of the Webservices functions for the Atom Publishing Protocol (AtomPub).
WS_APP_NS [line 46]
WS_APP_NS2 [line 47]
WS_ATOM_NS [line 45]
WS_EXTN_NS [line 48]
WS_arrayToEntryXML [line 655]
void WS_arrayToEntryXML(
array $arr, array $extn_elements, object &$entry_elem, DOMDocument &$atom_doc)
|
|
Converts an array into an XML entry node
Parameters
| array |
$arr |
the array which is to be converted into XML |
| array |
$extn_elements |
Geeklog-specific extension elements |
| object |
&$entry_elem |
entry to append to |
| DOMDocument |
&$atom_doc |
the Atom document to which the entry should be appended |
WS_authenticate [line 778]
Authenticates the user if authentication headers are present Our handling of the speedlimit here requires some explanation ... Atompub clients will usually try to do everything without logging in first. Since that would mean that we can't provide feeds for drafts, items with special permissions, etc. we ask them to log in (PLG_RET_AUTH_FAILED). That, however, means that every request from an Atompub client will count as one failed login attempt. So doing a couple of requests in quick succession will surely get the client blocked. Therefore - a request without any login credentials counts as one failed login attempt
- a request with wrong login credentials counts as two failed login attempts
- if, after a successful login, we have only one failed attempt on record,
we reset the speedlimit
This still ensures that - repeated failed logins (without or with invalid credentials) will cause the
client to be blocked eventually
- this can not be used for dictionary attacks
WS_delete [line 427]
Handles the DELETE request
WS_dissectURI [line 116]
void WS_dissectURI(
array &$args)
|
|
Dissects the URI and obtains parameters
Parameters
| array |
&$args |
the array to store any input parameters |
WS_error [line 64]
void WS_error(
string $error_code, [string $error_desc = ''])
|
|
Displays an error message with the appropriate HTTP error-code
Parameters
| string |
$error_code |
the name of the error |
| string |
$error_desc |
a short description of the actual error (optional) |
WS_get [line 264]
WS_getContent [line 461]
void WS_getContent(
array &$args, object $atom_doc, object $node)
|
|
Get 'content', depending on the type
Tags:
Parameters
| array |
&$args |
the array to which the content is to be appended |
| object |
$atom_doc |
current DOMDocument |
| object |
$node |
the 'content' node |
WS_makeId [line 995]
string WS_makeId(
[string $slug = ''], [int $max_length = 40])
|
|
Create a new ID, preferrably from a provided 'Slug:' header For more information on the 'Slug:' header, see RFC 5023, section 9.7
Tags:
Parameters
| string |
$slug |
Content of the 'Slug:' header |
| int |
$max_length |
max. length of the created ID |
WS_post [line 155]
WS_put [line 224]
WS_write [line 967]
void WS_write(
string $text)
|
|
Buffers text for output
Parameters
| string |
$text |
the text to be written |
WS_writeSync [line 977]
Writes buffered text to output
WS_xmlToArgs [line 510]
void WS_xmlToArgs(
array &$args)
|
|
Converts the input XML into an argument array
Parameters
| array |
&$args |
the array to which the arguments are to be appended |
|
|