$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?
$id = $app->insert();
if (!$id) {
- // TRANS: Server error displayed when trying to create an anynymous OAuth application.
+ // TRANS: Server error displayed when trying to create an anynymous OAuth application.
$this->serverError(_("Could not create anonymous OAuth application."));
}
}
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.')
);
}
if (!$result) {
throw new Exception(
+ // TRANS: Exception thrown when no access token can be issued.
_('Could not issue access token.')
);
}
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.'));
}