X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=spec%2Fdfrn2_contact_request.svg;h=9b75acd5dba6fa998d5cb4a6a349735a9de10911;hb=747139d186b163ab26685406993e57a42bb437b9;hp=e85eaf20b51f811c961552a1a9b86e84ca1686a2;hpb=0dfa57948f152a90a4d8093419a2ea5ced07349c;p=friendica.git diff --git a/spec/dfrn2_contact_request.svg b/spec/dfrn2_contact_request.svg index e85eaf20b5..9b75acd5db 100644 --- a/spec/dfrn2_contact_request.svg +++ b/spec/dfrn2_contact_request.svg @@ -1,218 +1 @@ - - - - - - - - - -Friendica - Contact request - - - - -karenn@karenhompage.com - - - - -bob@example.com - - - dfrn_request.php -- -https://karenhompage/dfrn_request/karin - - -dfrn_request_post - SCENARIO 1 ----------------------------------------------- -- Cleanup old introductions that remain blocked + Cleanup -any old email intros - which will have a greater lifetime -- Probe::uri Bobs posted dfrn_url and get the network with -webfinger_dfrn -- try to select all contact data of Bob (contact table) by the -url ($_POST['dfrn_url] and profile uid ($a->profile['uid']) -where self = 0 to look if this contact is already there (if -issued-id or rel is already available return here because it -seems that we are already connected) -- create a issued-id with $issued_id = random_string(); -- if we already found a contact record above update the -issued-id with the one we have created -- otherwise if Bob is not already in the contact table scrape -Bobs profile and create a new contact with this data (e.g. -the scraped issued-id / profiles pubkey becomes contacts -site-pubkey) in the contact table (blocked = 1, pending = 1) -- select this created contact from contact table and create -an intro in the intro table (blocked = 1) - - -$_POST['dfrn_url'] is transmited and is Bobs profile url - - -redirect to Bobs request page -goaway($parms['dfrn-request'] . "?dfrn_url=$dfrn_url" - . '&dfrn_version=' . -DFRN_PROTOCOL_VERSION - . '&confirm_key=' . $hash - . (($aes_allow) ? "&aes_allow=1" : "") - ); -http://example.com/dfrn_request/bob?dfrn_url=6874747 -03a2f2f6b6172656e686f6d65706167652e636f6d2f70726f66 -696c652f6b6172656e&aes_allow=1&confirm_key=”ABC123” - - -dfrn_request.php - - -http://example.com/dfrn_request/bob? -dfrn_url= -687474703a2f2f6b6172656e686f6d65706167652e -636f6d2f70726f66696c652f6b6172656e&aes_allow=1& -confirm_key=”ABC123” -dfrn_request_content() ------------------------------------------- -- copy the posted parameters (dfrn_url, key and so on) -to $_POST - dfrn_request_post() - SCENARIO 2 -($_POST['localconfirm'] == 1) ------------------------------------------------------------------------ -- if(local_user() && ($a->user['nickname'] == $a- ->argv[1]) && (x($_POST,'dfrn_url'))) --> -- $confirm_key comes from $_POST -- get data for contact Karen (contact table) by -$dfrn_url (contacts url and nurl) -> if contact Karen -does already have a dfrn-id Bob seems already -connected with Karen (abort here) -- if this contact (Karen) isn't available in the contact -tabel, scrape Karens profile page to pick up the dfrn -links, key, fn, and photo -- create a contact for Karen in the contact table with -the scraped data with blocked = 1 and pending = 1 -(Karens pubkey becomes the contact site-pubkey) -- fetch_url($dfrn_request . '?confirm_key=' . -$confirm_key); -- fetch_url(http://karenhomepage.com/dfrn_request? -confirm_key=”ABC123”) - - -dfrn_request.php - - -http://karenhomepage.com/dfrn_request?confirm_key=”ABC123” -dfrn_request_content() - -(elseif((x($_GET,'confirm_key')) && strlen($_GET['confirm_key'])) ) ----------------------------------------------------------------------------------------------- -- select the intro by confirm_key (intro table) -> get contact id -- use the intro contact id to get the contact in the contact table -- build a notification package ( notification(array.....) ) -- update intro in intro table (blocked = 0) - - -Bob stays on his Friendica server -- goaway($forwardurl); - - -Note: this chart respects only dfrn -contacts and focuses on key exchange -(for other areas it might be very -incomplete) - - -dfrn_request_content() ------------------------------------- -- the page for the on Katrins server where Bob do a connection -request -- the form transmit on submit Bobs profile url as dfrn_url - - - - - - - - - - -bob wants to make a request and is directed from karens profile page to karens dfrn-request page - - - - - - - - - - - - - - - - - - - - - - - - - - -redirict to bobs dfrn_request page - - - - - - - - - - - - - - - - - - - - -http://karenhomepage.com/dfrn_request?confirm_key=”ABC123” - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Bob fills request form and presses submit - +Friendica - Contact requestkarenn@karenhompage.combob@example.comdfrn_request.php-https://karenhompage/dfrn_request/karindfrn_request_post - SCENARIO 1----------------------------------------------- Cleanup old introductions that remain blocked + Cleanupany old email intros - which will have a greater lifetime- Probe::uri Bobs posted dfrn_url and get the network withwebfinger_dfrn- try to select all contact data of Bob (contact table) by theurl ($_POST['dfrn_url] and profile uid ($a->profile['uid'])where self = 0 to look if this contact is already there (ifissued-id or rel is already available return here because itseems that we are already connected)- create a issued-id with $issued_id = Strings::getRandomHex();- if we already found a contact record above update theissued-id with the one we have created- otherwise if Bob is not already in the contact table scrapeBobs profile and create a new contact with this data (e.g.the scraped issued-id / profiles pubkey becomes contactssite-pubkey) in the contact table (blocked = 1, pending = 1)- select this created contact from contact table and createan intro in the intro table (blocked = 1)$_POST['dfrn_url'] is transmited and is Bobs profile urlredirect to Bobs request pagegoaway($parms['dfrn-request'] . "?dfrn_url=$dfrn_url". '&dfrn_version=' .DFRN_PROTOCOL_VERSION. '&confirm_key=' . $hash. (($aes_allow) ? "&aes_allow=1" : ""));http://example.com/dfrn_request/bob?dfrn_url=687474703a2f2f6b6172656e686f6d65706167652e636f6d2f70726f66696c652f6b6172656e&aes_allow=1&confirm_key=”ABC123”dfrn_request.phphttp://example.com/dfrn_request/bob?dfrn_url=687474703a2f2f6b6172656e686f6d65706167652e636f6d2f70726f66696c652f6b6172656e&aes_allow=1&confirm_key=”ABC123”dfrn_request_content()------------------------------------------- copy the posted parameters (dfrn_url, key and so on)to $_POSTdfrn_request_post() - SCENARIO 2($_POST['localconfirm'] == 1)------------------------------------------------------------------------ if(local_user() && ($a->user['nickname'] == $a->argv[1]) && !empty($_POST['dfrn_url']))->- $confirm_key comes from $_POST- get data for contact Karen (contact table) by$dfrn_url (contacts url and nurl) -> if contact Karendoes already have a dfrn-id Bob seems alreadyconnected with Karen (abort here)- if this contact (Karen) isn't available in the contacttabel, scrape Karens profile page to pick up the dfrnlinks, key, fn, and photo- create a contact for Karen in the contact table withthe scraped data with blocked = 1 and pending = 1(Karens pubkey becomes the contact site-pubkey)- Network::fetchUrl($dfrn_request . '?confirm_key=' .$confirm_key);- Network::fetchUrl(http://karenhomepage.com/dfrn_request?confirm_key=”ABC123”)dfrn_request.phphttp://karenhomepage.com/dfrn_request?confirm_key=”ABC123”dfrn_request_content() -elseif (!empty($_GET['confirm_key']))----------------------------------------------------------------------------------------------- select the intro by confirm_key (intro table) -> get contact id- use the intro contact id to get the contact in the contact table- build a notification package ( notification(array.....) )- update intro in intro table (blocked = 0)Bob stays on his Friendica server- goaway($forwardurl);Note: this chart respects only dfrncontacts and focuses on key exchange(for other areas it might be veryincomplete)dfrn_request_content()------------------------------------- the page for the on Katrins server where Bob do a connectionrequest- the form transmit on submit Bobs profile url as dfrn_urlbob wants to make a request and is directed from karens profile page to karens dfrn-request pageredirict to bobs dfrn_request pagehttp://karenhomepage.com/dfrn_request?confirm_key=”ABC123”Bob fills request form and presses submit \ No newline at end of file