]> git.mxchange.org Git - friendica.git/blobdiff - mod/dfrn_confirm.php
Speed optimisation by enabling the posibility of the MySQL fulltext engine
[friendica.git] / mod / dfrn_confirm.php
index 2b25095fde2209314ff65b7d71a8eb51fb108e00..093993bbc429070fd5a9d529ede1d3ef0c497a03 100644 (file)
@@ -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.
 
@@ -500,6 +493,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[0]['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.