Early return in FacebookBridge settings action

This commit is contained in:
Mikael Nordfeldth 2015-07-17 15:27:47 +02:00
parent be0c10e8f6
commit 8d2504a809
1 changed files with 89 additions and 89 deletions

View File

@ -41,7 +41,8 @@ if (!defined('GNUSOCIAL')) { exit(1); }
*/
class FacebooksettingsAction extends SettingsAction {
private $facebook; // Facebook PHP-SDK client obj
private $flink;
protected $flink;
protected function doPreparation()
{
@ -57,8 +58,6 @@ class FacebooksettingsAction extends SettingsAction {
$this->scoped->getID(),
FACEBOOK_SERVICE
);
return true;
}
protected function doPost()
@ -98,7 +97,9 @@ class FacebooksettingsAction extends SettingsAction {
* @return void
*/
function showContent() {
if (!empty($this->flink)) {
if (!$this->flink instanceof Foreign_link) {
throw new ServerException(_m('You have not linked this account to Facebook.'));
}
$this->elementStart(
'form',
@ -201,7 +202,6 @@ class FacebooksettingsAction extends SettingsAction {
$this->elementEnd('form');
}
}
/*
* Save the user's Facebook settings