X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fupdateprofile.php;h=bae6108cced4e0647982e4b579705ff48ba938c1;hb=a21a17263956808e074fb62551300c5d6297387b;hp=4ff4f41c0de2e7a20e36148a1f56f05e007a2b1b;hpb=8548e1185deac0a289e16ea48a64f323c3bec679;p=quix0rs-gnu-social.git diff --git a/actions/updateprofile.php b/actions/updateprofile.php index 4ff4f41c0d..bae6108cce 100644 --- a/actions/updateprofile.php +++ b/actions/updateprofile.php @@ -55,13 +55,15 @@ class UpdateprofileAction extends Action */ function prepare($argarray) { + StatusNet::setApi(true); // Send smaller error pages + parent::prepare($argarray); $license = $_POST['omb_listenee_license']; $site_license = common_config('license', 'url'); if (!common_compatible_license($license, $site_license)) { - $this->clientError(sprintf(_('Listenee stream license ‘%s’ is not '. - 'compatible with site license ‘%s’.'), - $license, $site_license); + $this->clientError(sprintf(_('Listenee stream license ‘%1$s’ is not '. + 'compatible with site license ‘%2$s’.'), + $license, $site_license)); return false; } return true; @@ -75,6 +77,14 @@ class UpdateprofileAction extends Action $srv = new OMB_Service_Provider(null, omb_oauth_datastore(), omb_oauth_server()); $srv->handleUpdateProfile(); + } catch (OMB_RemoteServiceException $rse) { + $msg = $rse->getMessage(); + if (preg_match('/Revoked accesstoken/', $msg) || + preg_match('/No subscriber/', $msg)) { + $this->clientError($msg, 403); + } else { + $this->clientError($msg); + } } catch (Exception $e) { $this->serverError($e->getMessage()); return;