]> git.mxchange.org Git - friendica.git/blobdiff - mod/dfrn_confirm.php
Merge pull request #646 from annando/master
[friendica.git] / mod / dfrn_confirm.php
index 564ae5ca2346a952e4ccf750c30bdd8b43d7012d..769036c5e0b694627bdfba20a4669c6cd5be9e58 100644 (file)
@@ -146,7 +146,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                         */
                        require_once('include/crypto.php');
 
-                       $res = new_keypair(1024);
+                       $res = new_keypair(4096);
 
                        $private_key = $res['prvkey'];
                        $public_key  = $res['pubkey'];
@@ -202,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);
 
@@ -537,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);
@@ -666,7 +671,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                else
                        $photo = $a->get_baseurl() . '/images/person-175.jpg';
                                
-               require_once("Photo.php");
+               require_once("include/Photo.php");
 
                $photos = import_profile_photo($photo,$local_uid,$dfrn_record);
 
@@ -691,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]),
@@ -701,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)
                );
@@ -739,10 +746,11 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                                '$dfrn_url' => $r[0]['url'],
                                '$uid' => $newuid )
                        );
-       
-                       $res = mail($r[0]['email'], sprintf( t("Connection accepted at %s") , $a->config['sitename']),
+                       require_once('include/email.php');
+
+                       $res = mail($r[0]['email'], email_header_encode( sprintf( t("Connection accepted at %s") , $a->config['sitename']),'UTF-8'),
                                $email_tpl,
-                               'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+                               'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
                                . 'Content-type: text/plain; charset=UTF-8' . "\n"
                                . 'Content-transfer-encoding: 8bit' );