]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/remotesubscribe.php
Merge commit 'dcostalis/econversation' into 0.8.x
[quix0rs-gnu-social.git] / actions / remotesubscribe.php
index a2e01bd3ae9028bbed70c78d85cb4a38873266b9..7323103fc5c0d5bb289ede1815c5979e1dde8c7f 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -71,11 +71,13 @@ class RemotesubscribeAction extends Action
         if ($this->err) {
             $this->element('div', 'error', $this->err);
         } else {
-            $inst = _('To subscribe, you can [login](%%action.login%%),' .
-                      ' or [register](%%action.register%%) a new ' .
-                      ' account. If you already have an account ' .
-                      ' on a [compatible microblogging site](%%doc.openmublog%%), ' .
-                      ' enter your profile URL below.');
+            $inst = sprintf(_('To subscribe, you can [login](%%%%action.%s%%%%),' .
+                              ' or [register](%%%%action.%s%%%%) a new ' .
+                              ' account. If you already have an account ' .
+                              ' on a [compatible microblogging site](%%doc.openmublog%%), ' .
+                              ' enter your profile URL below.'),
+                            (!common_config('site','openidonly')) ? 'login' : 'openidlogin',
+                            (!common_config('site','openidonly')) ? 'register' : 'openidlogin');
             $output = common_markup_to_html($inst);
             $this->elementStart('div', 'instructions');
             $this->raw($output);
@@ -97,9 +99,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,
@@ -333,8 +335,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);
 
@@ -358,7 +358,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) {
@@ -409,7 +409,7 @@ class RemotesubscribeAction extends Action
 
         # Redirect to authorization service
 
-        common_redirect($req->to_url());
+        common_redirect($req->to_url(), 303);
         return;
     }
 }