";
20 | $turtle .= '.';
21 |
22 | //TODO: locking
23 | if (sites\is_available($i_name)) {
24 | @mkdir($_ENV['CLOUD_DATA'].'/'.substr($domain_uri, 4));
25 | $sites->append('turtle', $turtle);
26 | }
27 |
28 | header('Location: /manage');
29 |
--------------------------------------------------------------------------------
/www/inc/401.php:
--------------------------------------------------------------------------------
1 |
10 |
11 | You must login to access this URL
12 |
13 |
14 |
17 |
18 |
19 |
Firefox 3.5+, currently shipping Safari, IE, and Chrome builds are known to work
20 |
21 |
22 |
10 | The requested URI is inaccessible or does not exist.
11 | ';
26 | TAG(__FILE__, __LINE__, '$Id$');
27 | defined('FOOTER') || include_once('footer.php');
28 |
--------------------------------------------------------------------------------
/www/inc/contrib/skin.html.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
16 |
17 |
18 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/www/root/rp_auth.php:
--------------------------------------------------------------------------------
1 | $_SERVER['REMOTE_ADDR'],
14 | 'continueUrl' => REQUEST_BASE.'/rp_callback',
15 | 'identifier' => strtolower($i_provider).'.com',
16 | );
17 | $q = http('POST', $url, json_encode($q));
18 | if ($q->status == 200) {
19 | $q = json_decode($q->body);
20 | if (isset($q->authUri)) {
21 | header('Location: '.$q->authUri);
22 | exit;
23 | }
24 | } else {
25 | $q = json_decode($q->body);
26 | if (isset($q->error))
27 | echo $q->error->message;
28 | }
29 |
--------------------------------------------------------------------------------
/www/wildcard/input.php:
--------------------------------------------------------------------------------
1 | 'turtle',
14 | '/n3' => 'turtle',
15 | '/nt' => 'ntriples',
16 | '/rdf+n3' => 'turtle',
17 | '/rdf+nt' => 'ntriples',
18 | '/rdf+xml' => 'rdfxml',
19 | '/rdf' => 'rdfxml',
20 | '/html' => 'rdfa',
21 | '/xhtml' => 'rdfa',
22 | '/rss+xml' => 'rss-tag-soup',
23 | '/rss' => 'rss-tag-soup',
24 | '/json' => 'json',
25 | '/json-ld' => 'json-ld',
26 | );
27 |
28 | // negotiation: process HTTP Content-Type
29 | $_input = '';
30 | foreach ($_content_type_map as $needle=>$input) {
31 | if (strstr($_content_type, $needle) !== FALSE) {
32 | $_input = $input;
33 | break;
34 | }
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/www/root/s.php:
--------------------------------------------------------------------------------
1 | false);
25 | if (strlen($i_name)) {
26 | $r['id'] = $i_name;
27 | $r['available'] = \sites\is_available($i_name);
28 | }
29 | echo json_encode($r);
30 | } elseif ($_method == 'DELETE') {
31 | header('Content-Type: text/javascript');
32 | if ($i_name && substr($i_name, -1*strlen($_ENV['CLOUD_BASE']))!=$_ENV['CLOUD_BASE']) {
33 | $i_name = $i_name . $_ENV['CLOUD_BASE'];
34 | }
35 | $r = $sites->remove_any("dns:$i_name");
36 | echo 'cloud.refresh();';
37 | }
38 |
--------------------------------------------------------------------------------
/www/wildcard/PUT.php:
--------------------------------------------------------------------------------
1 | clobber && $g->exists())
31 | httpStatusExit(409, 'Resource Exists', null, 'First DELETE the resource or set X-Options: clobber');
32 | $g->truncate();
33 | if (!empty($_input) && $g->append($_input, $_data)) {
34 | librdf_php_last_log_level() && httpStatusExit(400, 'Bad Request', null, librdf_php_last_log_message());
35 | $g->save();
36 | } else {
37 | httpStatusExit(406, 'Content-Type Not Acceptable');
38 | }
39 |
40 | @header('X-Triples: '.$g->size());
41 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2010 by Joe Presbrey
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/www/root/common/css/common.css:
--------------------------------------------------------------------------------
1 | /* $Id$ */
2 |
3 | body { line-height: 1.25; }
4 | a { text-decoration: underline; vertical-align: top; }
5 | hr { background-color: silver; }
6 |
7 | input { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius:3px; }
8 | div { border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius:10px; }
9 |
10 | address { color: gray; }
11 | #codeID { float: left; }
12 | #codeID a { color: gray; }
13 | #codeTime { float: right; }
14 |
15 | input[type=submit], input[type=button] {
16 | border: 1px solid black;
17 | border-collapse: collapse;
18 | }
19 | #login input[type=submit] {
20 | background-color: #6078AB;
21 | color: white;
22 | font-weight: bold;
23 | }
24 | div.span-icon {
25 | height: 16px;
26 | width: 16px;
27 | vertical-align: middle;
28 | }
29 | #identity { float: right; }
30 | #identity a { text-decoration: none; }
31 | #login { float: right; clear: right; }
32 | #status { float: left; text-align: center; width: 32px; }
33 | #status img { vertical-align: middle; }
34 | #title { float: left; }
35 | #welcome { float: left; clear: left; }
36 |
37 |
38 | .box { border-style: outset; }
39 | .cleft { clear: left; }
40 | .cright { clear: right; }
41 |
--------------------------------------------------------------------------------
/www/wildcard/.htaccess:
--------------------------------------------------------------------------------
1 | # $Id$
2 |
3 | # headers: HTTP Access-Control
4 | Header set "Access-Control-Allow-Credentials" "true"
5 | Header set "Access-Control-Allow-Methods" "GET, POST, PUT, DELETE, OPTIONS"
6 |
7 | # headers: HTTP Caching
8 | #Header set "Cache-Control" "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
9 | #Header set "Pragma" "no-cache"
10 |
11 | # headers: SPARQL
12 | Header set "MS-Author-Via" "SPARQL"
13 |
14 | # rewrite
15 |
16 | RewriteEngine On
17 | #RewriteMap lowercase int:tolower
18 | #RewriteRule ^/(.*)$ /srv/clouds/${lowercase:%{SERVER_NAME}}/$1
19 |
20 | RewriteCond %{REQUEST_METHOD} =GET [OR]
21 | RewriteCond %{REQUEST_METHOD} =HEAD [OR]
22 | RewriteCond %{REQUEST_METHOD} =OPTIONS
23 | RewriteCond %{REQUEST_URI} !/common/
24 | RewriteRule ^(.*)$ GET.php [L]
25 |
26 | RewriteCond %{REQUEST_METHOD} =POST
27 | RewriteCond %{HTTP:Content-Type} =application/sparql-query
28 | RewriteRule ^(.*)$ SPARQL.py [L]
29 |
30 | RewriteCond %{REQUEST_METHOD} =MKCOL [OR]
31 | RewriteCond %{REQUEST_METHOD} =PATCH [OR]
32 | RewriteCond %{REQUEST_METHOD} =POST [OR]
33 | RewriteCond %{REQUEST_METHOD} =PUT [OR]
34 | RewriteCond %{REQUEST_METHOD} =DELETE
35 | RewriteRule ^(.*)$ %{REQUEST_METHOD}.php [L]
36 |
37 | # drop all other Apache responses
38 | #RewriteRule .* - [L,R=501]
39 |
--------------------------------------------------------------------------------
/conf/httpd.conf:
--------------------------------------------------------------------------------
1 | # $Id$
2 |
3 | MaxRequestsPerProcess 1000
4 |
5 |
6 | ServerName data.fm
7 | Include /home/data.fm/conf/common.conf
8 | DocumentRoot /home/data.fm/www/root
9 |
10 |
11 | ServerName data.fm
12 | Include /home/data.fm/conf/common.conf
13 | Include /home/data.fm/conf/ssl.conf
14 | DocumentRoot /home/data.fm/www/root
15 | LogLevel info
16 |
17 |
18 |
19 | ServerName www.data.fm
20 | Include /home/data.fm/conf/common.conf
21 | RewriteRule (.*) http://data.fm$1 [R,L]
22 |
23 |
24 | ServerName www.data.fm
25 | Include /home/data.fm/conf/common.conf
26 | Include /home/data.fm/conf/ssl.conf
27 | RewriteRule (.*) https://data.fm$1 [R,L]
28 |
29 |
30 |
31 | ServerName cloud.data.fm
32 | ServerAlias *.data.fm
33 | Include /home/data.fm/conf/common.conf
34 | DocumentRoot /home/data.fm/www/wildcard
35 |
36 |
37 | ServerName cloud.data.fm
38 | ServerAlias *.data.fm
39 | Include /home/data.fm/conf/common.conf
40 | Include /home/data.fm/conf/ssl.conf
41 | DocumentRoot /home/data.fm/www/wildcard
42 |
43 |
--------------------------------------------------------------------------------
/www/root/index.php:
--------------------------------------------------------------------------------
1 | editui) {
13 | ?>
14 |
15 | Login with
WebID, Facebook,
Gmail, AOL, or Yahoo:
16 |
17 |

18 |
19 |
20 |
25 |
26 |
27 |
28 |
29 | patch_json($_data) || 1)) {
38 | librdf_php_last_log_level() && httpStatusExit(400, 'Bad Request', null, librdf_php_last_log_message());
39 | $g->save();
40 | }
41 | } elseif (!empty($_input) && ($g->append($_input, $_data) || 1)) {
42 | librdf_php_last_log_level() && httpStatusExit(400, 'Bad Request', null, librdf_php_last_log_message());
43 | $g->save();
44 | } else {
45 | httpStatusExit(406, 'Content-Type Not Acceptable');
46 | }
47 |
48 | @header('X-Triples: '.$g->size());
49 |
--------------------------------------------------------------------------------
/www/inc/footer.php:
--------------------------------------------------------------------------------
1 | coderev) {
21 | ?>
22 |
23 |
24 |
30 | =$caller['id']?>
31 | /
36 |
37 | generated in =substr($time, 0, 6)?>s
38 | =$sparql_n<1?'':sprintf('with %d quer%s in %ss', $sparql_n, $sparql_n>1?'ies':'y', substr($sparql_t, 0, 6))?>
39 |
40 |
41 |