} // List LDPC info $ldpc = "@prefix ldp: <http://www.w3.org/ns/ldp#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix p: <http://www.w3.org/ns/posix/stat#> ." . "<" . $_base . "> a ldp:Container, ldp:BasicContainer, p:Directory ; " . "p:mtime " . filemtime($_filename) . " ;" . "p:size " . filesize($_filename) . " ;"; $g->append('turtle', $ldpc); // add extra LDPC metadata from .meta.<LDPC> $meta_uri = dirname($_base) . '/.meta.' . basename($_base); $meta_file = dirname($_filename) . '/.meta.' . basename($_filename); $mg = new Graph('', $meta_file, '', $meta_uri); if ($mg->size() > 0) { // specific authorization $q = 'SELECT * WHERE { <' . $_base . '> ?p ?o }'; $s = $mg->SELECT($q); $res = $s['results']['bindings']; if (isset($res) && count($res) > 0) { foreach ($res as $t) { $g->append_objects($_base, $t['p']['value'], array($t['o'])); } } } // list each member foreach ($contents as $properties) { /* // check ACL for each member resource $meta_uri = $properties['uri']; $meta_file = $_filename.basename($properties['resource']); // WebACL $wac = new WAC($_user, $meta_file, $meta_uri); $can = false; $can = $wac->can('Read'); if (DEBUG) {
// create shared storage space $storage_uri = $BASE . '/storage/'; $storage_file = $_root . '/storage/'; if (!mkdir($storage_file, 0755, true)) { die('Cannot create storage space "' . $storage_file . '", please check permissions'); } // end workspaces // --- Profile --- // Write the new profile to disk $document = new Graph('', $webid_file, '', $BASE . '/' . $profile); if (!$document) { echo "Cannot create a new graph!"; exit; } // add a PrimaryTopic $document->append_objects($BASE . '/' . $profile, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', array(array('type' => 'uri', 'value' => 'http://xmlns.com/foaf/0.1/PersonalProfileDocument'))); $document->append_objects($BASE . '/' . $profile, 'http://xmlns.com/foaf/0.1/primaryTopic', array(array('type' => 'uri', 'value' => $webid))); // add a foaf:Person $document->append_objects($webid, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', array(array('type' => 'uri', 'value' => 'http://xmlns.com/foaf/0.1/Person'))); // add name $document->append_objects($webid, 'http://xmlns.com/foaf/0.1/name', array(array('type' => 'literal', 'value' => $name))); // add mbox if we have one if (strlen($email) > 0) { $document->append_objects($webid, 'http://xmlns.com/foaf/0.1/mbox', array(array('type' => 'uri', 'value' => 'mailto:' . $email))); } // add avatar if we have one if (strlen($pic) > 0) { $document->append_objects($webid, 'http://xmlns.com/foaf/0.1/img', array(array('type' => 'uri', 'value' => $pic))); } // ---- Add workspaces ---- // add shared storage space