]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/remotesubscribe.php
fix url for redirect
[quix0rs-gnu-social.git] / actions / remotesubscribe.php
index 8baa3b7af54ab602ee7cfc334277855ab108ef21..b676484cd8fde58626d38fe968b098567b894482 100644 (file)
@@ -20,7 +20,6 @@
 if (!defined('LACONICA')) { exit(1); }
 
 require_once(INSTALLDIR.'/lib/omb.php');
-require_once('Auth/Yadis/Yadis.php');
 
 class RemotesubscribeAction extends Action {
 
@@ -42,14 +41,17 @@ class RemotesubscribeAction extends Action {
 
        function show_form($err=NULL) {
                $nickname = $this->trimmed('nickname');
+               $profile = $this->trimmed('profile_url');
                common_show_header(_t('Remote subscribe'));
                if ($err) {
                        common_element('div', 'error', $err);
                }
                common_element_start('form', array('id' => 'remotesubscribe', 'method' => 'POST',
                                                                                   'action' => common_local_url('remotesubscribe')));
-               common_input('nickname', _t('User nickname'), $nickname);
-               common_input('profile', _t('Profile URL'));
+               common_input('nickname', _t('User nickname'), $nickname,
+                                        _t('Nickname of the user you want to follow'));
+               common_input('profile_url', _t('Profile URL'), $profile,
+                                        _t('URL of your profile on another compatible microblogging service'));
                common_submit('submit', _t('Subscribe'));
                common_element_end('form');
                common_show_footer();
@@ -63,7 +65,7 @@ class RemotesubscribeAction extends Action {
                        return;
                }
 
-               $profile = $this->trimmed('profile');
+               $profile = $this->trimmed('profile_url');
 
                if (!$profile) {
                        $this->show_form(_t('No such user!'));
@@ -309,10 +311,13 @@ class RemotesubscribeAction extends Action {
                # store all our info here
 
                $omb['listenee'] = $user->nickname;
+               $omb['listener'] = omb_local_id($omb[OAUTH_ENDPOINT_REQUEST]);
                $omb['token'] = $token;
                $omb['secret'] = $secret;
                # call doesn't work after bounce back so we cache; maybe serialization issue...?
                $omb['access_token_url'] = omb_service_uri($omb[OAUTH_ENDPOINT_ACCESS]);
+               $omb['post_notice_url'] = omb_service_uri($omb[OMB_ENDPOINT_POSTNOTICE]);
+               $omb['update_profile_url'] = omb_service_uri($omb[OMB_ENDPOINT_UPDATEPROFILE]);
 
                $_SESSION['oauth_authorization_request'] = $omb;