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

Commit

Permalink
# [#20001] Do not allow users to move/post into sections
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/oratzes/svn/kunena@2094 daf2aa89-cb5b-0410-b8ee-fe93ebc9b27d
  • Loading branch information
mahagr committed Mar 23, 2010
1 parent 63e1134 commit af1f5d8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions components/com_kunena/CHANGELOG.php
Expand Up @@ -38,6 +38,7 @@
^ [#15784] Merge and review all fixes from /branches/1.5-xillibit-fixing
+ [#19992] Allow anonymous posts from registered users in special categories
+ [#19992] Allow anonymous also in Quick Reply
# [#20001] Do not allow users to move/post into sections
22-Mar-2010 Xillibit
^ [#19984] Give administrator option to hide userlist and do not use it if integration provides list
Expand Down
5 changes: 3 additions & 2 deletions components/com_kunena/class.kunena.php
Expand Up @@ -836,8 +836,9 @@ function fbMovePosts($catid, $isMod, $return) {
$oldRecord = $kunena_db->loadObjectList();
check_dberror("Unable to load message detail.");

$newCatObj = new jbCategory($kunena_db, $oldRecord[0]->catid);
if (fb_has_moderator_permission($kunena_db, $newCatObj, $kunena_my->id, $isAdmin)) {
$oldCatObj = new jbCategory($kunena_db, $oldRecord[0]->catid);
$newCatObj = new jbCategory($kunena_db, $catid);
if ($newCatObj && $newCatObj->parent>0 && fb_has_moderator_permission($kunena_db, $oldCatObj, $kunena_my->id, $isAdmin)) {

$newSubject = _MOVED_TOPIC . " " . $oldRecord[0]->subject;
$kunena_db->setQuery("SELECT MAX(time) AS timestamp FROM #__fb_messages WHERE thread='{$id}'");
Expand Down
17 changes: 12 additions & 5 deletions components/com_kunena/template/default/post.php
Expand Up @@ -135,6 +135,17 @@

$objCatInfo = $kunena_db->loadObject();
$catName = $objCatInfo->name;

if (empty($objCatInfo)) {
// Do not allow actions in categories that do not exist
echo _KUNENA_POST_ERROR_NO_CATEGORY;
return;
} else if ($objCatInfo->parent == 0) {
// Do not allow actions in sections
echo _KUNENA_POST_ERROR_IS_SECTION;
return;
}

?>

<table border = "0" cellspacing = "0" cellpadding = "0" width = "100%" align = "center">
Expand All @@ -158,11 +169,7 @@
<?php
$parent = (int)$parentid;
if ($fbConfig->askemail) jimport( 'joomla.mail.helper' );
if ($catid==0 || empty($objCatInfo)) {
echo _KUNENA_POST_ERROR_NO_CATEGORY;
} else if ($objCatInfo->parent == 0) {
echo _KUNENA_POST_ERROR_IS_SECTION;
} else if ($anonymous && !$objCatInfo->allow_anonymous) {
if ($anonymous && !$objCatInfo->allow_anonymous) {
echo _KUNENA_POST_ERROR_ANONYMOUS_FORBITTEN;
} else if (empty($my_name)) {
echo _POST_FORGOT_NAME;
Expand Down

0 comments on commit af1f5d8

Please sign in to comment.