Let soudcloud fail gracefuly when unconfigured
This makes general preferences look nice again, even when no soundcloud id and secret is configured (those don't belong us).
This commit is contained in:
parent
51960a891f
commit
898a1ce545
1 changed files with 4 additions and 2 deletions
|
@ -64,8 +64,10 @@ class Application_Service_SoundcloudService extends Application_Service_ThirdPar
|
|||
$clientSecret = $CC_CONFIG['soundcloud-client-secret'];
|
||||
$redirectUri = $CC_CONFIG['soundcloud-redirect-uri'];
|
||||
|
||||
$this->_client = new Soundcloud\Service($clientId, $clientSecret, $redirectUri);
|
||||
$accessToken = Application_Model_Preference::getSoundCloudRequestToken();
|
||||
if ($clientId && $clientSecret && $redirectUri) {
|
||||
$this->_client = new Soundcloud\Service($clientId, $clientSecret, $redirectUri);
|
||||
$accessToken = Application_Model_Preference::getSoundCloudRequestToken();
|
||||
}
|
||||
if (!empty($accessToken)) {
|
||||
$this->_accessToken = $accessToken;
|
||||
$this->_client->setAccessToken($accessToken);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue