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 { class FacebooksettingsAction extends SettingsAction {
private $facebook; // Facebook PHP-SDK client obj private $facebook; // Facebook PHP-SDK client obj
private $flink;
protected $flink;
protected function doPreparation() protected function doPreparation()
{ {
@ -57,8 +58,6 @@ class FacebooksettingsAction extends SettingsAction {
$this->scoped->getID(), $this->scoped->getID(),
FACEBOOK_SERVICE FACEBOOK_SERVICE
); );
return true;
} }
protected function doPost() protected function doPost()
@ -98,7 +97,9 @@ class FacebooksettingsAction extends SettingsAction {
* @return void * @return void
*/ */
function showContent() { 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( $this->elementStart(
'form', 'form',
@ -201,7 +202,6 @@ class FacebooksettingsAction extends SettingsAction {
$this->elementEnd('form'); $this->elementEnd('form');
} }
}
/* /*
* Save the user's Facebook settings * Save the user's Facebook settings