aboutsummaryrefslogtreecommitdiff
path: root/actions/add.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/add.php')
-rw-r--r--actions/add.php43
1 files changed, 0 insertions, 43 deletions
diff --git a/actions/add.php b/actions/add.php
deleted file mode 100644
index 494229aad..000000000
--- a/actions/add.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-global $CONFIG;
-$user = get_loggedin_user();
-$name = get_input('name');
-$webid = get_input('webid');
-$modulus = get_input('modulus');
-$exponent = get_input('exponent');
-
-error_log($name);
-error_log($webid);
-error_log($modulus);
-error_log($exponent);
-
-if (isset($_FILES['cert_file'])) {
- $cert = get_uploaded_file('cert_file');
- $res = openssl_x509_read($cert);
- $cert_data = openssl_x509_parse($cert);
- $pubKey = openssl_pkey_get_public($res);
- $keyData = openssl_pkey_get_details($pubKey);
- $webid = $cert_data["extensions"]["subjectAltName"];
-
- //Remove certificate armour
- $unpacked_n = unpack("H*",$keyData['rsa']['n']);
- $modulus = strtoupper($unpacked_n[1]);
-
- $unpacked_e = unpack("H*",$keyData['rsa']['e']);
- $exponent = hexdec($unpacked_e[1]);
- $name = $cert_data["subject"]["CN"];
- error_log("load file");
- error_log("webid:".$webid);
- error_log("exponent".$exponent);
- error_log("mod".$modulus);
-}
-
-if ($modulus && $exponent && $user && $webid) {
- $key = elgg_foafssl_createkey($modulus, $exponent, $user, $webid, $name);
- system_message(elgg_echo("foafssl:addkey"));
-}
-else {
- register_error(elgg_echo("foafssl:cantadd"));
-}
-forward($CONFIG->wwwroot."pg/foafssl/manage");
-?>