From bb65ba85595828ae6ad075bf0a101b5892c43505 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 13 Oct 2011 08:30:33 +0300 Subject: [PATCH 1/3] [#150] Access control: Do not check Joomla groups if users have access --- .../com_kunena/libraries/integration/joomla15/access.php | 6 ++++-- .../com_kunena/libraries/integration/joomla16/access.php | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/administrator/components/com_kunena/libraries/integration/joomla15/access.php b/administrator/components/com_kunena/libraries/integration/joomla15/access.php index 286ded8c..5164a1e0 100644 --- a/administrator/components/com_kunena/libraries/integration/joomla15/access.php +++ b/administrator/components/com_kunena/libraries/integration/joomla15/access.php @@ -117,10 +117,12 @@ protected function checkSubscribers($category, &$userids) { $query->where("u.gid!=18"); } } elseif ($category->accesstype == 'none') { + // All users are allowed to see Public (0) or All Registered (-1) categories + if ($category->pub_access <= 0) return; // Check against Joomla user groups $public = $this->_get_groups($category->pub_access, $category->pub_recurse); - // Ignore admin_access if pub_access is Public (0) or All Registered (-1) or has the same group - $admin = $category->pub_access > 0 && $category->admin_access != $category->pub_access ? $this->_get_groups($category->admin_access, $category->admin_recurse) : array(); + // Ignore admin_access if pub_access has the same group + $admin = $category->admin_access != $category->pub_access ? $this->_get_groups($category->admin_access, $category->admin_recurse) : array(); $groups = implode ( ',', array_unique ( array_merge ( $public, $admin ) ) ); if ($groups) { $query->join('INNER', "#__core_acl_aro AS a ON u.id=a.value AND a.section_value='users'"); diff --git a/administrator/components/com_kunena/libraries/integration/joomla16/access.php b/administrator/components/com_kunena/libraries/integration/joomla16/access.php index 47bbfd98..437ba048 100644 --- a/administrator/components/com_kunena/libraries/integration/joomla16/access.php +++ b/administrator/components/com_kunena/libraries/integration/joomla16/access.php @@ -94,6 +94,7 @@ protected function checkSubscribers($category, &$userids) { $groups = $this->getGroupsByViewLevel($category->access); $userids = $this->getUsersByGroup($groups, true, $userids); } elseif ($category->accesstype == 'none') { + if ($category->pub_access <= 0) return; // Check against Joomla user groups $public = $this->getUsersByGroup($category->pub_access, $category->pub_recurse, $userids); $admin = $category->admin_access && $category->admin_access != $category->pub_access ? $this->getUsersByGroup($category->admin_access, $category->admin_recurse, $userids) : array(); From cb44bc7507d3d4c5165fb4293b242aaf523410ae Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 13 Oct 2011 08:35:39 +0300 Subject: [PATCH 2/3] [#151] reCaptcha: Fix error message if server cannot be connected --- .../components/com_kunena/libraries/spam/recaptcha.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_kunena/libraries/spam/recaptcha.php b/administrator/components/com_kunena/libraries/spam/recaptcha.php index f2e736b7..c36a1414 100644 --- a/administrator/components/com_kunena/libraries/spam/recaptcha.php +++ b/administrator/components/com_kunena/libraries/spam/recaptcha.php @@ -150,7 +150,7 @@ function checkAnswer ($extra_params = array()) { ); if (!$response) { - $response = "false\nrecaptcha-not-reachable"; + $response[1] = "false\nrecaptcha-not-reachable"; } $answers = preg_split('/[\s,]+/', $response[1]); if (empty($answers[0]) || trim ($answers [0]) != 'true') { From 319505c23485b3fdeac46d6e2dfd4cd608031c67 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 13 Oct 2011 10:47:15 +0300 Subject: [PATCH 3/3] [#152] Allow [url] to start with index.php --- components/com_kunena/CHANGELOG.php | 5 +++++ components/com_kunena/lib/kunena.parser.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/com_kunena/CHANGELOG.php b/components/com_kunena/CHANGELOG.php index 177e9a6b..4f3354ab 100644 --- a/components/com_kunena/CHANGELOG.php +++ b/components/com_kunena/CHANGELOG.php @@ -33,6 +33,11 @@ Kunena 1.7.1-DEV +13-October-2011 Matias +# [#150] Access control: Do not check Joomla groups if all users have access +# [#151] reCaptcha: Fix error message if server cannot be connected +# [#152] Allow [url] to start with index.php + 10-September-2011 Xillibit # [#133] Bug in page titles and meta descriptions diff --git a/components/com_kunena/lib/kunena.parser.php b/components/com_kunena/lib/kunena.parser.php index 9966f2fb..15863681 100644 --- a/components/com_kunena/lib/kunena.parser.php +++ b/components/com_kunena/lib/kunena.parser.php @@ -304,7 +304,7 @@ function TagStandard(&$tns, &$tne, &$task, $tag) { $task->autolink_disable --; if (isset ( $tag->options ['default'] )) { $tempstr = $tag->options ['default']; - if (! preg_match ( "`^(/|https?://)`", $tempstr )) { + if (! preg_match ( "`^(/|index.php|https?://)`", $tempstr )) { $tempstr = 'http://' . $tempstr; } $tns = ''; @@ -422,7 +422,7 @@ function TagExtended(&$tag_new, &$task, $tag, $between) { break; case 'url' : $tempstr = $between; - if (! preg_match ( "`^(/|https?://)`", $tempstr )) { + if (! preg_match ( "`^(/|index.php|https?://)`", $tempstr )) { $tempstr = 'http://' . $tempstr; } $tag_new = '' . $between . '';