]> git.mxchange.org Git - friendica.git/commitdiff
Reduced options when adding a friendica contact and an address was provided via URL...
authorMichael Vogel <icarus@dabo.de>
Wed, 20 Aug 2014 22:56:21 +0000 (00:56 +0200)
committerMichael Vogel <icarus@dabo.de>
Wed, 20 Aug 2014 22:56:21 +0000 (00:56 +0200)
mod/dfrn_request.php
view/templates/auto_request.tpl
view/templates/dfrn_request.tpl

index c18b1670d0ff41642192145912fe3fa1c63469fe..6f6ce61a987fb6238a60b4d363e64919f764974f 100644 (file)
@@ -111,9 +111,9 @@ function dfrn_request_post(&$a) {
                                         */
 
                                        require_once('include/Scrape.php');
-       
+
                                        $parms = scrape_dfrn($dfrn_url);
-       
+
                                        if(! count($parms)) {
                                                notice( t('Profile location is not valid or does not contain profile information.') . EOL );
                                                return;
@@ -123,7 +123,7 @@ function dfrn_request_post(&$a) {
                                                        notice( t('Warning: profile location has no identifiable owner name.') . EOL );
                                                if(! x($parms,'photo'))
                                                        notice( t('Warning: profile location has no profile photo.') . EOL );
-                                               $invalid = validate_dfrn($parms);               
+                                               $invalid = validate_dfrn($parms);
                                                if($invalid) {
                                                        notice( sprintf( tt("%d required parameter was not found at the given location",
                                                                                                "%d required parameters were not found at the given location",
@@ -194,7 +194,7 @@ function dfrn_request_post(&$a) {
 
                                if(strlen($dfrn_request) && strlen($confirm_key))
                                        $s = fetch_url($dfrn_request . '?confirm_key=' . $confirm_key);
-                               
+
                                // (ignore reply, nothing we can do it failed)
 
                                goaway(zrl($dfrn_url));
@@ -432,7 +432,7 @@ function dfrn_request_post(&$a) {
                                dbesc(datetime_convert()),
                                1
                        );
-                               
+
                        // Next send an email verify form to the requestor.
 
                }
@@ -585,7 +585,7 @@ function dfrn_request_post(&$a) {
                                        dbesc(datetime_convert())
                                );
                        }
-       
+
                        // This notice will only be seen by the requestor if the requestor and requestee are on the same server.
 
                        if(! $failed) 
@@ -768,27 +768,22 @@ function dfrn_request_content(&$a) {
                 * Try to auto-fill the profile address
                 */
 
-               if(local_user()) {
+               // At first look if an address was provided
+               // Otherwise take the local address
+               if (x($_GET,'addr') AND ($_GET['addr'] != ""))
+                       $myaddr = hex2bin($_GET['addr']);
+               elseif (x($_GET,'address') AND ($_GET['address'] != ""))
+                       $myaddr = $_GET['address'];
+               elseif(local_user()) {
                        if(strlen($a->path)) {
                                $myaddr = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
                        }
                        else {
                                $myaddr = $a->user['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 );
                        }
-               }
-               elseif(x($_GET,'addr')) {
-                       $myaddr = hex2bin($_GET['addr']);
-               }
-               else {
-                       /* $_GET variables are already urldecoded */ 
-                       $myaddr = ((x($_GET,'address')) ? $_GET['address'] : '');
-               }
-
-               // last, try a zrl
-               if(! strlen($myaddr))
+               } else  // last, try a zrl
                        $myaddr = get_my_url();
 
-
                $target_addr = $a->profile['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 );
 
 
@@ -805,9 +800,6 @@ function dfrn_request_content(&$a) {
                else
                        $tpl = get_markup_template('auto_request.tpl');
 
-       #       $page_desc = sprintf( t('Diaspora members: Please do not use this form. Instead, enter "%s" into your Diaspora search bar.'), 
-       #               $target_addr) . EOL . EOL;
-
                $page_desc .= t("Please enter your 'Identity Address' from one of the following supported communications networks:");
 
                // see if we are allowed to have NETWORK_MAIL2 contacts
@@ -824,7 +816,9 @@ function dfrn_request_content(&$a) {
                                $mail_disabled = 1;
                }
 
-               $emailnet = (($mail_disabled) ? '' : t("<strike>Connect as an email follower</strike> \x28Coming soon\x29"));
+               // "coming soon" is disabled for now
+               //$emailnet = (($mail_disabled) ? '' : t("<strike>Connect as an email follower</strike> \x28Coming soon\x29"));
+               $emailnet = "";
 
                $invite_desc = t('If you are not yet a member of the free social web, <a href="http://dir.friendica.com/siteinfo">follow this link to find a public Friendica site and join us today</a>.');
 
@@ -832,9 +826,10 @@ function dfrn_request_content(&$a) {
                        '$header' => t('Friend/Connection Request'),
                        '$desc' => t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@identi.ca'),
                        '$pls_answer' => t('Please answer the following:'),
-                       '$does_know' => sprintf( t('Does %s know you?'),$a->profile['name']),
+                       '$does_know_you' => array('knowyou', sprintf(t('Does %s know you?'),$a->profile['name']), false, '', array(t('No'),t('Yes'))),
+                       /*'$does_know' => sprintf( t('Does %s know you?'),$a->profile['name']),
                        '$yes' => t('Yes'),
-                       '$no' => t('No'),
+                       '$no' => t('No'), */
                        '$add_note' => t('Add a personal note:'),
                        '$page_desc' => $page_desc,
                        '$friendica' => t('Friendica'),
index 662ca2447e0f9f8bbf72f33a704a00323d342105..61a772cba1b1341fe1927446709b60e3ea2404b4 100644 (file)
@@ -6,6 +6,7 @@
 
 <h1>{{$header}}</h1>
 
+{{if $myaddr == ""}}
 <p id="dfrn-request-intro">
 {{$page_desc}}<br />
 <ul id="dfrn-request-networks">
 <p>
 {{$desc}}
 </p>
+{{/if}}
 
 <form action="dfrn_request/{{$nickname}}" method="post" />
 
 <div id="dfrn-request-url-wrapper" >
        <label id="dfrn-url-label" for="dfrn-url" >{{$your_address}}</label>
-       <input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}" />
+        {{if $myaddr}}
+                {{$myaddr}}
+        {{else}}
+        <input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}" />
+        {{/if}}
        <div id="dfrn-request-url-end"></div>
 </div>
 
index 29173a1d777f7b717b4f74604ff68a070a4973fe..dbd2e543ddc2396f914a9c6bb76162c55ba355aa 100644 (file)
@@ -6,6 +6,8 @@
 
 <h1>{{$header}}</h1>
 
+{{if $myaddr}}
+{{else}}
 <p id="dfrn-request-intro">
 {{$page_desc}}<br />
 <ul id="dfrn-request-networks">
 <p>
 {{$desc}}
 </p>
+{{/if}}
 
 <form action="dfrn_request/{{$nickname}}" method="post" />
 
 <div id="dfrn-request-url-wrapper" >
        <label id="dfrn-url-label" for="dfrn-url" >{{$your_address}}</label>
+       {{if $myaddr}}
+               {{$myaddr}}
+       {{else}}
        <input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}" />
+       {{/if}}
        <div id="dfrn-request-url-end"></div>
 </div>
 
@@ -34,7 +41,8 @@
 
 <div id="dfrn-request-info-wrapper" >
 
-
+{{include file="field_yesno.tpl" field=$does_know_you}}
+<!--
 <p id="doiknowyou">
 {{$does_know}}
 </p>
@@ -51,7 +59,7 @@
 
                <div id="dfrn-request-knowyou-end"></div>
                </div>
-
+-->
 
 <p id="dfrn-request-message-desc">
 {{$add_note}}