]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/apioauthstore.php
distribute flag for Notice::saveNew()
[quix0rs-gnu-social.git] / lib / apioauthstore.php
index 9a260826334ab3b839b164430441163921c1ece0..2a65fffc4bb3fa281d9a22fd518c58bd8acbd75c 100644 (file)
@@ -41,13 +41,13 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
 
                 $result = $con->insert();
                 if (!$result) {
-                    $this->serverError(_("Could not create anonymous consumer."));
+                    // TRANS: Server error displayed when trying to create an anynymous OAuth consumer.
+                    $this->serverError(_('Could not create anonymous consumer.'));
                 }
 
                 $app = Oauth_application::getByConsumerKey('anonymous');
 
                 if (!$app) {
-
                     common_debug("API OAuth - creating anonymous application");
                     $app               = new OAuth_application();
                     $app->owner        = 1; // XXX: What to do here?
@@ -65,6 +65,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
                     $id = $app->insert();
 
                     if (!$id) {
+                       // TRANS: Server error displayed when trying to create an anynymous OAuth application.
                         $this->serverError(_("Could not create anonymous OAuth application."));
                     }
                 }
@@ -142,11 +143,11 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
             common_debug('Request token found.', __FILE__);
 
             // find the app and profile associated with this token
-
-            $tokenAssoc = OAuth_token_association::staticGet('token', $rt->tok);
+            $tokenAssoc = Oauth_token_association::staticGet('token', $rt->tok);
 
             if (!$tokenAssoc) {
                 throw new Exception(
+                    // TRANS: Exception thrown when no token association could be found.
                     _('Could not find a profile and application associated with the request token.')
                 );
             }
@@ -181,6 +182,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
 
                 if (!$result) {
                     throw new Exception(
+                        // TRANS: Exception thrown when no access token can be issued.
                         _('Could not issue access token.')
                     );
                 }
@@ -237,6 +239,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
 
                 if (!$result) {
                     common_log_db_error($appUser, 'INSERT', __FILE__);
+                    // TRANS: Server error displayed when a database error occurs.
                     $this->serverError(_('Database error inserting OAuth application user.'));
                 }
 
@@ -296,7 +299,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
      *
      * @return OAuthToken   $token a new unauthorized OAuth request token
      */
-
     function new_request_token($consumer, $callback)
     {
         $t = new Token();
@@ -321,6 +323,4 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
             return new OAuthToken($t->tok, $t->secret);
         }
     }
-
-
 }