]> git.mjollnir.org Git - s9y.git/commitdiff
fix bug #1371893: Wrong category read permissions
authorgarvinhicking <garvinhicking>
Mon, 5 Dec 2005 09:03:12 +0000 (09:03 +0000)
committergarvinhicking <garvinhicking>
Mon, 5 Dec 2005 09:03:12 +0000 (09:03 +0000)
docs/NEWS
docs/README
include/functions_entries.inc.php

index 39b2a6141765c58834dce987ab58b7fc8fa596d9..1f64794a476d4c627172382aa336525c4094d05a 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -42,6 +42,10 @@ Version 1.0 ()
 Version 0.9.2 ()
 ------------------------------------------------------------------------
 
+    * Fix bug #1371893: Category write permissions are not properly
+      evaluated when writing into a category that a user has no
+      access to. Thanks to cydvicious! (garvinhicking)
+
     * Fix bug #1371630: Write permissions to category are stored with
       input data of the 'Read permissions' author listing.
           
index f72ad62296a67280fe7c7beeceef273af8975724..5c63e299477111a1c18f20e959d37d40ce92bb6a 100644 (file)
@@ -2,9 +2,26 @@
 # README                                                               #
 ########################################################################
 
+
+
+
+
+
 For the most up-to-date information on documentation, creating styles,
 plugins and so on, please visit our Wiki on http://www.s9y.org/!
 
+
+
+
+
+
+
+
+
+
+
+
+
 ########################################################################
 # NOTES FOR CONDITIONAL GET IN RSS FEEDS                               #
 ########################################################################
index 47f672b519cef57e8f9337e57517513aca45f821..74a1f81d4be2f9327a707437f2061caa1b2d0d32 100644 (file)
@@ -534,15 +534,17 @@ function serendipity_fetchCategories($authorid = null, $name = null, $order = nu
 
     $where = '';
     if ($authorid != 'all' && is_numeric($authorid)) {
+        $sql_authorid = $authorid;
         if (!serendipity_checkPermission('adminCategoriesMaintainOthers', $authorid)) {
             $where = " WHERE (c.authorid = $authorid OR c.authorid = 0)";
             $where .= "OR (
                           acl.artifact_type = 'category'
                           AND acl.artifact_mode = '" . serendipity_db_escape_string($artifact_mode) . "'
-                         )";
+                         ) ";
 
         }
     } else {
+        $sql_authorid = 'c.authorid';
         $where = '';
     }
 
@@ -579,12 +581,11 @@ function serendipity_fetchCategories($authorid = null, $name = null, $order = nu
            LEFT OUTER JOIN {$serendipity['dbPrefix']}authors AS a
                         ON c.authorid = a.authorid
            LEFT OUTER JOIN {$serendipity['dbPrefix']}authorgroups AS ag
-                        ON ag.authorid = a.authorid
+                        ON ag.authorid = $sql_authorid
            LEFT OUTER JOIN {$serendipity['dbPrefix']}access AS acl
                         ON (ag.groupid = acl.groupid AND acl.artifact_id = c.categoryid)
                            $where
                            $group";
-
     if (!empty($order)) {
         $querystring .= "\n ORDER BY $order";
     }