aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dfrn_confirm.php
diff options
context:
space:
mode:
authorVasudev Kamath <kamathvasudev@gmail.com>2012-06-04 12:04:17 +0530
committerVasudev Kamath <kamathvasudev@gmail.com>2012-06-04 12:04:17 +0530
commit12474e3c2eb21e4b5f9f6cd4b9d223f1f39bfe89 (patch)
tree49e5e7dd30e1b1263fa5a9c9921b4a59758d94bd /mod/dfrn_confirm.php
parent3a45d4f9e0af301b8fdd4d509fc7ffe7514fb519 (diff)
parentca105f1c669950768a1f4cd6b93f471cabbc5114 (diff)
downloadvolse-hubzilla-12474e3c2eb21e4b5f9f6cd4b9d223f1f39bfe89.tar.gz
volse-hubzilla-12474e3c2eb21e4b5f9f6cd4b9d223f1f39bfe89.tar.bz2
volse-hubzilla-12474e3c2eb21e4b5f9f6cd4b9d223f1f39bfe89.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'mod/dfrn_confirm.php')
-rw-r--r--mod/dfrn_confirm.php34
1 files changed, 22 insertions, 12 deletions
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index 2b25095fd..76b99cbca 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -144,19 +144,12 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
* worried about key leakage than anybody cracking it.
*
*/
+ require_once('include/crypto.php');
- $res = openssl_pkey_new(array(
- 'digest_alg' => 'sha1',
- 'private_key_bits' => 4096,
- 'encrypt_key' => false )
- );
-
- $private_key = '';
-
- openssl_pkey_export($res, $private_key);
+ $res = new_keypair(1024);
- $pubkey = openssl_pkey_get_details($res);
- $public_key = $pubkey["key"];
+ $private_key = $res['prvkey'];
+ $public_key = $res['pubkey'];
// Save the private key. Send them the public key.
@@ -209,6 +202,8 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
if($user[0]['page-flags'] == PAGE_COMMUNITY)
$params['page'] = 1;
+ if($user[0]['page-flags'] == PAGE_PRVGROUP)
+ $params['page'] = 2;
logger('dfrn_confirm: Confirm: posting data to ' . $dfrn_confirm . ': ' . print_r($params,true), LOGGER_DATA);
@@ -500,6 +495,16 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
}
}
}
+
+
+ $g = q("select def_gid from user where uid = %d limit 1",
+ intval($uid)
+ );
+ if($contact && $g && intval($g[0]['def_gid'])) {
+ require_once('include/group.php');
+ group_add_member($uid,'',$contact['id'],$g[0]['def_gid']);
+ }
+
// Let's send our user to the contact editor in case they want to
// do anything special with this new friend.
@@ -534,6 +539,9 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
$page = ((x($_POST,'page')) ? intval($_POST['page']) : 0 );
$version_id = ((x($_POST,'dfrn_version')) ? (float) $_POST['dfrn_version'] : 2.0);
+ $forum = (($page == 1) ? 1 : 0);
+ $prv = (($page == 2) ? 1 : 0);
+
logger('dfrn_confirm: requestee contacted: ' . $node);
logger('dfrn_confirm: request: POST=' . print_r($_POST,true), LOGGER_DATA);
@@ -688,6 +696,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
`pending` = 0,
`duplex` = %d,
`forum` = %d,
+ `prv` = %d,
`network` = '%s' WHERE `id` = %d LIMIT 1
",
dbesc($photos[0]),
@@ -698,7 +707,8 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
dbesc(datetime_convert()),
dbesc(datetime_convert()),
intval($duplex),
- intval($page),
+ intval($forum),
+ intval($prv),
dbesc(NETWORK_DFRN),
intval($dfrn_record)
);