X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fremotesubscribe.php;h=0b117489621d7307776b5266177e21e7b35be788;hb=244149e0225970b76596b79758566ae5bb9fc806;hp=f727a63b822f2acbe1f730a05a9a9739058ecc5a;hpb=a7c85bebd5be9ea019a8c80d74730d7eb28d4651;p=quix0rs-gnu-social.git diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php index f727a63b82..0b11748962 100644 --- a/actions/remotesubscribe.php +++ b/actions/remotesubscribe.php @@ -97,9 +97,9 @@ class RemotesubscribeAction extends Action 'class' => 'form_settings', 'action' => common_local_url('remotesubscribe'))); $this->elementStart('fieldset'); - $this->element('legend', 'Subscribe to a remote user'); + $this->element('legend', _('Subscribe to a remote user')); $this->hidden('token', common_session_token()); - + $this->elementStart('ul', 'form_data'); $this->elementStart('li'); $this->input('nickname', _('User nickname'), $this->nickname, @@ -321,8 +321,7 @@ class RemotesubscribeAction extends Action $result = $fetcher->post($req->get_normalized_http_url(), $req->to_postdata(), - array('User-Agent' => 'Laconica/' . LACONICA_VERSION)); - + array('User-Agent: Laconica/' . LACONICA_VERSION)); if ($result->status != 200) { return null; } @@ -334,8 +333,6 @@ class RemotesubscribeAction extends Action function requestAuthorization($user, $omb, $token, $secret) { - global $config; # for license URL - $con = omb_oauth_consumer(); $tok = new OAuthToken($token, $secret); @@ -359,7 +356,7 @@ class RemotesubscribeAction extends Action $req->set_parameter('omb_listenee', $user->uri); $req->set_parameter('omb_listenee_profile', common_profile_url($user->nickname)); $req->set_parameter('omb_listenee_nickname', $user->nickname); - $req->set_parameter('omb_listenee_license', $config['license']['url']); + $req->set_parameter('omb_listenee_license', common_config('license', 'url')); $profile = $user->getProfile(); if (!$profile) { @@ -368,16 +365,16 @@ class RemotesubscribeAction extends Action return; } - if ($profile->fullname) { + if (!is_null($profile->fullname)) { $req->set_parameter('omb_listenee_fullname', $profile->fullname); } - if ($profile->homepage) { + if (!is_null($profile->homepage)) { $req->set_parameter('omb_listenee_homepage', $profile->homepage); } - if ($profile->bio) { + if (!is_null($profile->bio)) { $req->set_parameter('omb_listenee_bio', $profile->bio); } - if ($profile->location) { + if (!is_null($profile->location)) { $req->set_parameter('omb_listenee_location', $profile->location); } $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); @@ -410,7 +407,7 @@ class RemotesubscribeAction extends Action # Redirect to authorization service - common_redirect($req->to_url()); + common_redirect($req->to_url(), 303); return; } }