[geeklog-cvs] geeklog: Fixed visibility of the "Send Ping" links in the Story ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Mon Sep 14 11:47:45 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6e95d3d48652
changeset: 7313:6e95d3d48652
user:      Dirk Haun <dirk at haun-online.de>
date:      Mon Sep 14 14:55:14 2009 +0200
description:
Fixed visibility of the "Send Ping" links in the Story Admin's list of stories and the Story Options block, part 2: Forgot to check the topic permissions

diffstat:

 public_html/article.php |  11 ++++++++---
 system/lib-admin.php    |   8 ++++++--
 2 files changed, 14 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r 844012d4a915 -r 6e95d3d48652 public_html/article.php
--- a/public_html/article.php	Mon Sep 14 12:58:40 2009 +0200
+++ b/public_html/article.php	Mon Sep 14 14:55:14 2009 +0200
@@ -325,11 +325,16 @@
                 ($story->displayElements('draft_flag') == 0) &&
                 ($story->displayElements('day') < time ()) &&
                 ($story->displayElements('perm_anon') != 0)) {
-                
+
+            // also check permissions for the topic
+            $topic_anon = DB_getItem($_TABLES['topics'], 'perm_anon',
+                "tid = '" . addslashes($story->displayElements('tid')) . "'");
+
             // check special case: no link when Trackbacks are disabled for this
             // story AND pinging weblog directories is disabled
-            if (($story->displayElements('trackbackcode') >= 0) ||
-                    $_CONF['ping_enabled']) {
+            if (($topic_anon != 0) &&
+                    (($story->displayElements('trackbackcode') >= 0) ||
+                    $_CONF['ping_enabled'])) {
                 $url = $_CONF['site_admin_url']
                      . '/trackback.php?mode=sendall&id=' . $story->getSid();
                 $story_options[] = COM_createLink($LANG_TRB['send_trackback'],
diff -r 844012d4a915 -r 6e95d3d48652 system/lib-admin.php
--- a/system/lib-admin.php	Mon Sep 14 12:58:40 2009 +0200
+++ b/system/lib-admin.php	Mon Sep 14 14:55:14 2009 +0200
@@ -860,7 +860,7 @@
 {
     global $_CONF, $_TABLES, $LANG_ADMIN, $LANG24, $LANG_ACCESS, $_IMAGE_TYPE;
 
-    static $topics, $topic_access;
+    static $topics, $topic_access, $topic_anon;
 
     if (!isset($topics)) {
         $topics = array();
@@ -934,8 +934,12 @@
         break;
 
     case 'ping':
+        if (!isset($topic_anon[$A['tid']])) {
+            $topic_anon[$A['tid']] = DB_getItem($_TABLES['topics'], 'perm_anon',
+                "tid = '" . addslashes($A['tid']) . "'");
+        }
         if (($A['draft_flag'] == 0) && ($A['unixdate'] < time()) &&
-                ($A['perm_anon'] != 0)) {
+                ($A['perm_anon'] != 0) && ($topic_anon[$A['tid']] != 0)) {
             $pingico = '<img src="' . $_CONF['layout_url'] . '/images/sendping.'
                      . $_IMAGE_TYPE . '" alt="' . $LANG24[21] . '" title="'
                      . $LANG24[21] . '"' . XHTML . '>';



More information about the geeklog-cvs mailing list