aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template/twig/extension.php
diff options
context:
space:
mode:
authormrgoldy <gijsmartens1@gmail.com>2018-12-10 00:10:27 +0100
committerMarc Alexander <admin@m-a-styles.de>2019-09-25 20:39:04 +0200
commit133dfd0a84ce258fadab5f48de45684869b14800 (patch)
treecb9acf47f24f975850ede6c9941a41524c201627 /phpBB/phpbb/template/twig/extension.php
parenteee00652e7b608967a2ec5ee8fd165c2760be145 (diff)
downloadforums-133dfd0a84ce258fadab5f48de45684869b14800.tar
forums-133dfd0a84ce258fadab5f48de45684869b14800.tar.gz
forums-133dfd0a84ce258fadab5f48de45684869b14800.tar.bz2
forums-133dfd0a84ce258fadab5f48de45684869b14800.tar.xz
forums-133dfd0a84ce258fadab5f48de45684869b14800.zip
[ticket/15905] Try it without auth
PHPBB3-15905
Diffstat (limited to 'phpBB/phpbb/template/twig/extension.php')
-rw-r--r--phpBB/phpbb/template/twig/extension.php59
1 files changed, 1 insertions, 58 deletions
diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php
index 384bac773a..027abc44ec 100644
--- a/phpBB/phpbb/template/twig/extension.php
+++ b/phpBB/phpbb/template/twig/extension.php
@@ -15,9 +15,6 @@ namespace phpbb\template\twig;
class extension extends \Twig_Extension
{
- /** @var \phpbb\auth\auth */
- protected $auth;
-
/** @var \phpbb\template\context */
protected $context;
@@ -30,14 +27,12 @@ class extension extends \Twig_Extension
/**
* Constructor
*
- * @param \phpbb\auth\auth $auth
* @param \phpbb\template\context $context
* @param \phpbb\template\twig\environment $environment
* @param \phpbb\language\language $language
*/
- public function __construct(\phpbb\auth\auth $auth, \phpbb\template\context $context, \phpbb\template\twig\environment $environment, $language)
+ public function __construct(\phpbb\template\context $context, \phpbb\template\twig\environment $environment, $language)
{
- $this->auth = $auth;
$this->context = $context;
$this->environment = $environment;
$this->language = $language;
@@ -94,10 +89,6 @@ class extension extends \Twig_Extension
{
return array(
new \Twig_SimpleFunction('lang', array($this, 'lang')),
- new \Twig_SimpleFunction('lang_defined', array($this, 'lang_defined')),
- new \Twig_SimpleFunction('get_class', 'get_class'),
- new \Twig_SimpleFunction('auth', array($this, 'get_auth')),
- new \Twig_SimpleFunction('auth_global', array($this, 'get_auth_global')),
);
}
@@ -195,52 +186,4 @@ class extension extends \Twig_Extension
return call_user_func_array(array($this->language, 'lang'), $args);
}
-
- /**
- * Check if a language variable exists
- *
- * @return bool
- */
- public function lang_defined($key)
- {
- return call_user_func_array([$this->language, 'is_set'], [$key]);
- }
-
- /**
- * Look up permission option(s).
- *
- * How to use in a template:
- * - {{ auth(options, forum_id) }}
- *
- * The options are required, either as a single string 'a_' or as a twig array ['a_', 'm_'].
- * The forum identifier is optional.
- *
- * @return bool
- */
- public function get_auth()
- {
- $args = func_get_args();
-
- $options = $args[0];
- $forum_id = isset($args[1]) ? (int) $args[1] : 0;
-
- return is_array($options) ? $this->auth->acl_gets($options, $forum_id) : $this->auth->acl_get($options, $forum_id);
- }
-
- /**
- * Look up permission option(s) for any forum
- *
- * How to use in a template:
- * - {{ auth_global(options) }}
- *
- * The options are required, either as a single string 'a_' or as a twig array ['a_', 'm_'].
- *
- * @return bool
- */
- public function get_auth_global()
- {
- $args = func_get_args();
-
- return $this->auth->acl_getf_global($args);
- }
}