Skip to content
This repository has been archived by the owner on Oct 11, 2020. It is now read-only.

Fix bugs #150, #151 and #152 #153

Merged
merged 4 commits into from Oct 15, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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'");
Expand Down
Expand Up @@ -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();
Expand Down
Expand Up @@ -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') {
Expand Down
6 changes: 3 additions & 3 deletions build/build.number
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Sat Sep 03 09:52:18 CEST 2011
build.number=5139
#Build Number for ANT. Do not edit!
#Thu Sep 22 12:00:27 EEST 2011
build.number=5140
8 changes: 8 additions & 0 deletions build/build.xml
Expand Up @@ -116,6 +116,14 @@
<copy todir="${tmp_dir}/components">
<fileset dir="${project_dir}/components">
<exclude name="com_kunena/language/**"/>
<exclude name="com_kunena/template/**"/>
</fileset>
</copy>
<copy todir="${tmp_dir}/components">
<fileset dir="${project_dir}/components">
<include name="com_kunena/template/index.php"/>
<include name="com_kunena/template/default/**"/>
<include name="com_kunena/template/example/**"/>
<exclude name="com_kunena/template/**/params.ini"/>
</fileset>
</copy>
Expand Down
5 changes: 5 additions & 0 deletions components/com_kunena/CHANGELOG.php
Expand Up @@ -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

26-September-2011 Xillibit
# [#140] Undefined property: stdClass::$description

Expand Down
4 changes: 2 additions & 2 deletions components/com_kunena/lib/kunena.parser.php
Expand Up @@ -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 = '<a href="' . $tempstr . '" rel="nofollow" target="_blank">';
Expand Down Expand Up @@ -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 = '<a href="' . $tempstr .'" rel="nofollow" target="_blank">' . $between . '</a>';
Expand Down