Beispiel #1
0
    // write profile to file
    $data = $graph->serialise('rdfxml');
    if (!is_scalar($data)) {
        $data = var_export($data, true);
    }
    $pf = fopen($user_dir . '/foaf.rdf', 'w') or die('Cannot create profile RDF file in ' . $user_dir . '!');
    fwrite($pf, $data);
    fclose($pf);
    $pf = fopen($user_dir . '/foaf.txt', 'w') or die('Cannot create profile PHP file!');
    fwrite($pf, $data);
    fclose($pf);
    // everything is fine
    $ok = true;
    // Send the X.509 SSL certificate to the script caller (user) as a file transfer
    if ($_REQUEST['action'] == 'new' || $_REQUEST['action'] == 'import') {
        download_identity_x509($x509, $webid);
    } else {
        if ($ok) {
            $alert .= success('Your profile has been updated.');
            // reload the profile information
            $_SESSION['myprofile'] = new MyProfile($webid, $base_uri, SPARQL_ENDPOINT);
            $_SESSION['myprofile']->load(true);
        } else {
            $alert .= error('Could not update your profile!');
        }
    }
}
// Display form
$title = 'Create / Edit Profile';
$profile_on = 'profile-on';
include 'header.php';
Beispiel #2
0
    $localityName = $_POST['localityName'];
    $organizationName = $_POST['organizationName'];
    $organizationalUnitName = $_POST['organizationalUnitName'];
    $emailAddress = $_POST['emailAddress'];
    $pubkey = $_POST['pubkey'];
    // check that everything is ok
    if (strlen($error) > 0) {
        include 'header.php';
        $ret = "<div class=\"container\">\n";
        $ret .= "<div class=\"content\">\n";
        $ret .= "<div class=\"row\">\n";
        $ret .= "<div class=\"ui-state-error ui-corner-all\">\n";
        $ret .= "<p><span class=\"ui-icon ui-icon-info\" style=\"float: left; margin-right: .3em;\"></span>\n";
        $ret .= "<div align=\"left\"><strong>Error: </strong>" . $error . ".</div>\n";
        $ret .= "</p></div></div><br/>\n";
        echo $ret;
        echo $form;
        include 'footer.php';
    } else {
        include_once 'lib/functions.php';
        // Create a x509 SSL certificate
        if ($x509 = create_identity_x509($countryName, $stateOrProvinceName, $localityName, $organizationName, $organizationalUnitName, $commonName, $emailAddress, $foafLocation, $pubkey, SSL_CONF, CA_PASS)) {
            // Send the X.509 SSL certificate to the script caller (user) as a file transfer
            download_identity_x509($x509, $foafLocation[0]);
        }
    }
} else {
    include_once 'header.php';
    echo $form;
    include_once 'footer.php';
}