Reduced options when adding a friendica contact and an address was provided via URL parameter.

This commit is contained in:
Michael Vogel 2014-08-21 00:56:21 +02:00
parent 716e0b073f
commit d23d26f44d
3 changed files with 37 additions and 28 deletions

View file

@ -768,27 +768,22 @@ function dfrn_request_content(&$a) {
* Try to auto-fill the profile address * 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)) { if(strlen($a->path)) {
$myaddr = $a->get_baseurl() . '/profile/' . $a->user['nickname']; $myaddr = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
} }
else { else {
$myaddr = $a->user['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 ); $myaddr = $a->user['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 );
} }
} } else // last, try a zrl
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))
$myaddr = get_my_url(); $myaddr = get_my_url();
$target_addr = $a->profile['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 ); $target_addr = $a->profile['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 );
@ -805,9 +800,6 @@ function dfrn_request_content(&$a) {
else else
$tpl = get_markup_template('auto_request.tpl'); $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:"); $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 // see if we are allowed to have NETWORK_MAIL2 contacts
@ -824,7 +816,9 @@ function dfrn_request_content(&$a) {
$mail_disabled = 1; $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>.'); $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'), '$header' => t('Friend/Connection Request'),
'$desc' => t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@identi.ca'), '$desc' => t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@identi.ca'),
'$pls_answer' => t('Please answer the following:'), '$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'), '$yes' => t('Yes'),
'$no' => t('No'), '$no' => t('No'), */
'$add_note' => t('Add a personal note:'), '$add_note' => t('Add a personal note:'),
'$page_desc' => $page_desc, '$page_desc' => $page_desc,
'$friendica' => t('Friendica'), '$friendica' => t('Friendica'),

View file

@ -6,6 +6,7 @@
<h1>{{$header}}</h1> <h1>{{$header}}</h1>
{{if $myaddr == ""}}
<p id="dfrn-request-intro"> <p id="dfrn-request-intro">
{{$page_desc}}<br /> {{$page_desc}}<br />
<ul id="dfrn-request-networks"> <ul id="dfrn-request-networks">
@ -21,12 +22,17 @@
<p> <p>
{{$desc}} {{$desc}}
</p> </p>
{{/if}}
<form action="dfrn_request/{{$nickname}}" method="post" /> <form action="dfrn_request/{{$nickname}}" method="post" />
<div id="dfrn-request-url-wrapper" > <div id="dfrn-request-url-wrapper" >
<label id="dfrn-url-label" for="dfrn-url" >{{$your_address}}</label> <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}}" /> <input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}" />
{{/if}}
<div id="dfrn-request-url-end"></div> <div id="dfrn-request-url-end"></div>
</div> </div>

View file

@ -6,6 +6,8 @@
<h1>{{$header}}</h1> <h1>{{$header}}</h1>
{{if $myaddr}}
{{else}}
<p id="dfrn-request-intro"> <p id="dfrn-request-intro">
{{$page_desc}}<br /> {{$page_desc}}<br />
<ul id="dfrn-request-networks"> <ul id="dfrn-request-networks">
@ -19,12 +21,17 @@
<p> <p>
{{$desc}} {{$desc}}
</p> </p>
{{/if}}
<form action="dfrn_request/{{$nickname}}" method="post" /> <form action="dfrn_request/{{$nickname}}" method="post" />
<div id="dfrn-request-url-wrapper" > <div id="dfrn-request-url-wrapper" >
<label id="dfrn-url-label" for="dfrn-url" >{{$your_address}}</label> <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}}" /> <input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}" />
{{/if}}
<div id="dfrn-request-url-end"></div> <div id="dfrn-request-url-end"></div>
</div> </div>
@ -34,7 +41,8 @@
<div id="dfrn-request-info-wrapper" > <div id="dfrn-request-info-wrapper" >
{{include file="field_yesno.tpl" field=$does_know_you}}
<!--
<p id="doiknowyou"> <p id="doiknowyou">
{{$does_know}} {{$does_know}}
</p> </p>
@ -51,7 +59,7 @@
<div id="dfrn-request-knowyou-end"></div> <div id="dfrn-request-knowyou-end"></div>
</div> </div>
-->
<p id="dfrn-request-message-desc"> <p id="dfrn-request-message-desc">
{{$add_note}} {{$add_note}}