webservice = $webservice; $this->urlBase = $urlBase; } /** * @return array */ public function getFunctions() { return array( new \Twig_SimpleFunction('is_granted_previous_admin', array($this, 'isGrantedPreviousAdmin')), new \Twig_SimpleFunction('switch_user_exit', array($this, 'switchUserExit')), ); } /** * @return boolean */ public function isGrantedPreviousAdmin() { return false; try { return $this->webservice->makeGetRequest($this->urlBase . '/admin/user/is_granted'); } catch (\Exception $e) { return false; } } /** * @return boolean */ public function switchUserExit() { return 'https://' . $this->urlBase . '/?_switch_user=_exit'; } /** * @return string */ public function getName() { return 'is_granted_previous_admin_extension'; } }