diff --git a/composer.json b/composer.json index d61c5b8..a948fc2 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "phpbb-extension", "description": "mChat Extension for phpbb 3.1.x", "homepage": "http://www.dmzx-web.net", - "version": "0.0.5", + "version": "0.0.6", "time": "2015-03-10", "keywords": ["phpbb", "extension", "mchat"], "license": "GPL-2.0", diff --git a/config/services.yml b/config/services.yml index c2d53f8..46ff743 100644 --- a/config/services.yml +++ b/config/services.yml @@ -39,7 +39,6 @@ services: - @template - @user - @dbal.conn - - @cache - %core.root_path% - %core.php_ext% tags: diff --git a/event/listener.php b/event/listener.php index 051f375..58aa788 100644 --- a/event/listener.php +++ b/event/listener.php @@ -16,6 +16,9 @@ class listener implements EventSubscriberInterface /** @var \dmzx\mchat\core\render_helper */ protected $render_helper; + /** @var \phpbb\auth\auth */ + protected $auth; + protected $config; /** @var \phpbb\template\template */ @@ -32,9 +35,10 @@ class listener implements EventSubscriberInterface /** @var \phpbb\controller\helper */ protected $controller_helper; - public function __construct(\dmzx\mchat\core\render_helper $render_helper, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\controller\helper $controller_helper, \phpbb\template\template $template, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, $root_path, $php_ext, $auth) + public function __construct(\dmzx\mchat\core\render_helper $render_helper, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\controller\helper $controller_helper, \phpbb\template\template $template, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, $root_path, $php_ext) { $this->render_helper = $render_helper; + $this->auth = $auth; $this->config = $config; $this->template = $template; $this->controller_helper = $controller_helper; @@ -42,7 +46,6 @@ class listener implements EventSubscriberInterface $this->db = $db; $this->root_path = $root_path; $this->php_ext = $php_ext; - $this->auth = $auth; } static public function getSubscribedEvents() @@ -88,8 +91,9 @@ class listener implements EventSubscriberInterface public function display_mchat_on_index($event) { $mchat_on_index = $this->config['mchat_on_index']; + $mchat_view = ($this->auth->acl_get('u_mchat_view')) ? true : false; - if ($mchat_on_index) + if ($mchat_on_index && $mchat_view) { $this->template->assign_var('S_MCHAT_ON_INDEX', true); diff --git a/migrations/mchat_schema.php b/migrations/mchat_schema.php index ca90b50..d6703c2 100644 --- a/migrations/mchat_schema.php +++ b/migrations/mchat_schema.php @@ -20,7 +20,7 @@ class mchat_schema extends \phpbb\db\migration\migration array('config.add', array('mchat_on_index', true)), array('config.add', array('mchat_new_posts', false)), array('config.add', array('mchat_stats_index', false)), - array('config.add', array('mchat_version','0.0.5')), + array('config.add', array('mchat_version','0.0.6')), array('permission.add', array('u_mchat_use')), array('permission.add', array('u_mchat_view')), diff --git a/styles/prosilver/template/event/index_body_forumlist_body_after.html b/styles/prosilver/template/event/index_body_forumlist_body_after.html deleted file mode 100644 index ca8b367..0000000 --- a/styles/prosilver/template/event/index_body_forumlist_body_after.html +++ /dev/null @@ -1 +0,0 @@ -