[geeklog-cvs] geeklog: Delete a feed's file when deleting a feed (bug #0000758)

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Oct 11 16:25:18 EDT 2008


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/fa6bf49fe93d
changeset: 6436:fa6bf49fe93d
user:      Dirk Haun <dirk at haun-online.de>
date:      Sat Oct 11 22:25:08 2008 +0200
description:
Delete a feed's file when deleting a feed (bug #0000758)

diffstat:

2 files changed, 17 insertions(+), 8 deletions(-)
public_html/admin/syndication.php |   24 ++++++++++++++++--------
public_html/docs/history          |    1 +

diffs (59 lines):

diff -r 0102c409a695 -r fa6bf49fe93d public_html/admin/syndication.php
--- a/public_html/admin/syndication.php	Sat Oct 11 19:22:54 2008 +0200
+++ b/public_html/admin/syndication.php	Sat Oct 11 22:25:08 2008 +0200
@@ -529,18 +529,23 @@
 * @return   string          HTML redirect
 *
 */
-function deletefeed ($fid)
+function deletefeed($fid)
 {
     global $_CONF, $_TABLES;
 
     if ($fid > 0) {
-        DB_delete ($_TABLES['syndication'], 'fid', $fid);
+        $feedfile = DB_getItem($_TABLES['syndication'], 'filename',
+                               "fid = $fid");
+        if (!empty($feedfile)) {
+            @unlink(SYND_getFeedPath($feedfile));
+        }
+        DB_delete($_TABLES['syndication'], 'fid', $fid);
 
-        return COM_refresh ($_CONF['site_admin_url']
-                            . '/syndication.php?msg=59');
+        return COM_refresh($_CONF['site_admin_url']
+                           . '/syndication.php?msg=59');
     }
 
-    return COM_refresh ($_CONF['site_admin_url'] . '/syndication.php');
+    return COM_refresh($_CONF['site_admin_url'] . '/syndication.php');
 }
 
 
@@ -577,9 +582,12 @@
 {
     $display .= savefeed($_POST);
 }
-elseif (($mode == $LANG_ADMIN['delete']) && !empty($LANG_ADMIN['delete']) && SEC_checkToken())
-{
-    $display .= deletefeed(COM_applyFilter($_REQUEST['fid']));
+elseif (($mode == $LANG_ADMIN['delete']) && !empty($LANG_ADMIN['delete']) && SEC_checkToken()) {
+    $fid = 0;
+    if (isset($_POST['fid'])) {
+        $fid = COM_applyFilter($_POST['fid'], true);
+    }
+    $display .= deletefeed($fid);
 }
 else
 {
diff -r 0102c409a695 -r fa6bf49fe93d public_html/docs/history
--- a/public_html/docs/history	Sat Oct 11 19:22:54 2008 +0200
+++ b/public_html/docs/history	Sat Oct 11 22:25:08 2008 +0200
@@ -3,6 +3,7 @@
 ??? ??, 2008 (1.5.2)
 ------------
 
+- Delete a feed's file when deleting a feed (bug #0000758) [Dirk]
 - The {start_storylink_anchortag} variable in the story templates was missing
   a '>' (reported by Michael Brusletten) [Dirk]
 - Display a "Service" column in the Admin's list of users when remote auth is



More information about the geeklog-cvs mailing list