<?php
 class vB_Api_ExternalLogin extends vB_Api { use vB_Trait_NoSerialize; protected $disableWhiteList = array( 'getState', 'showExternalLoginButton', ); protected $disableFalseReturnOnly = array( ); protected $library; protected function __construct() { parent::__construct(); $this->library = vB_Library::instance('externallogin'); } public function getState() { return [ "enabled" => false, "register_enabled" => false, "external_userid" => '', ]; } final public function showExternalLoginButton() { $options = vB::getDatastore()->getValue('options'); $doShow = (bool)$options['facebookactive']; $buttons = [ 'facebook' => (bool)$options['facebookactive'], ]; vB::getHooks()->invoke('hookShowExternalLoginButton', [ 'buttons' => &$buttons, ]); $doShow = false; foreach ($buttons AS $__show) { if ($__show) { $doShow = true; break; } } return [ 'show' => $doShow, 'buttons' => $buttons, ]; } final public function showExternalRegistrationBlock() { $options = vB::getDatastore()->getValue('options'); $doShow = (bool)$options['facebookactive']; $blocks = array( 'facebook' => (bool)$options['facebookactive'], ); vB::getHooks()->invoke('hookShowExternalRegistrationBlock', array( 'blocks' => &$blocks, )); $doShow = false; foreach ($blocks AS $__show) { if ($__show) { $doShow = true; break; } } return array( 'show' => $doShow, 'blocks' => $blocks, ); } public function getOauthCallbackTemplate($code, $checkstate) : array { return [ 'template' => '', 'data' => [], ]; } } 