diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/dfrn_confirm.php | 4 | ||||
-rw-r--r-- | mod/register.php | 20 |
2 files changed, 20 insertions, 4 deletions
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index dd50e82a0..265a62b88 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -290,7 +290,7 @@ function dfrn_confirm_post(&$a) { $source_url = hex2bin($_POST['source_url']); $aes_key = $_POST['aes_key']; $duplex = $_POST['duplex']; - $version_id = $_POST['dfrn_version']; + $version_id = (float) $_POST['dfrn_version']; // If $aes_key is set, both of these items require unpacking from the hex transport encoding. @@ -483,7 +483,7 @@ function dfrn_confirm_post(&$a) { $res = mail($r[0]['email'], t("Connection accepted at ") . $a->config['sitename'], $email_tpl, 'From: ' . t('Administrator') . '@' . $_SERVER[SERVER_NAME] ); if(!$res) { - notice( t("Email notification failed.") . EOL ); + // pointless throwing an error here and confusing the person at the other end of the wire. } } xml_status(0); // Success diff --git a/mod/register.php b/mod/register.php index d65c154a8..a2cae9961 100644 --- a/mod/register.php +++ b/mod/register.php @@ -109,15 +109,31 @@ function register_post(&$a) { $pkey = openssl_pkey_get_details($res); $pubkey = $pkey["key"]; + $sres=openssl_pkey_new(array( + 'encrypt_key' => false )); + + // Get private key + + $sprvkey = ''; + + openssl_pkey_export($sres, $sprvkey); + + // Get public key + + $spkey = openssl_pkey_get_details($sres); + $spubkey = $spkey["key"]; + $r = q("INSERT INTO `user` ( `username`, `password`, `email`, `nickname`, - `pubkey`, `prvkey`, `verified`, `blocked` ) - VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )", + `pubkey`, `prvkey`, `spubkey`, `sprvkey`, `verified`, `blocked` ) + VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )", dbesc($username), dbesc($new_password_encoded), dbesc($email), dbesc($nickname), dbesc($pubkey), dbesc($prvkey), + dbesc($spubkey), + dbesc($sprvkey), intval($verified), intval($blocked) ); |