X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ffinishremotesubscribe.php;h=871bc3d2d131c3d8fbd7b1c33deb598ca461ebfc;hb=82b0927f5838f3c12816e03712df9460a9f77b72;hp=76db887deb4dca85f0347e5c46a18a4ee5021e82;hpb=47a5d2b7f06cd1612734c47ad21fc397bbff5276;p=quix0rs-gnu-social.git diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php index 76db887deb..871bc3d2d1 100644 --- a/actions/finishremotesubscribe.php +++ b/actions/finishremotesubscribe.php @@ -1,7 +1,7 @@ . */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); @@ -44,7 +44,7 @@ class FinishremotesubscribeAction extends Action common_debug('stored request: '.print_r($omb,true), __FILE__); common_remove_magic_from_request(); - $req = OAuthRequest::from_request(); + $req = OAuthRequest::from_request('POST', common_local_url('finishuserauthorization')); $token = $req->get_parameter('oauth_token'); @@ -136,16 +136,16 @@ class FinishremotesubscribeAction extends Action $profile->nickname = $nickname; $profile->profileurl = $profile_url; - if ($fullname) { + if (!is_null($fullname)) { $profile->fullname = $fullname; } - if ($homepage) { + if (!is_null($homepage)) { $profile->homepage = $homepage; } - if ($bio) { + if (!is_null($bio)) { $profile->bio = $bio; } - if ($location) { + if (!is_null($location)) { $profile->location = $location; } @@ -230,7 +230,8 @@ class FinishremotesubscribeAction extends Action # show up close to the top of the page common_redirect(common_local_url('subscribers', array('nickname' => - $user->nickname))); + $user->nickname)), + 303); } function add_avatar($profile, $url) @@ -283,7 +284,7 @@ class FinishremotesubscribeAction extends Action $fetcher = Auth_Yadis_Yadis::getHTTPFetcher(); $result = $fetcher->post($req->get_normalized_http_url(), $req->to_postdata(), - array('User-Agent' => 'Laconica/' . LACONICA_VERSION)); + array('User-Agent: StatusNet/' . STATUSNET_VERSION)); common_debug('got result: "'.print_r($result,true).'"', __FILE__);