[geeklog-cvs] geeklog: Use SEC_removeFeatureFromDB when uninstalling a plugin ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Aug 9 14:31:52 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/950d9348fed8
changeset: 7250:950d9348fed8
user:      Dirk Haun <dirk at haun-online.de>
date:      Sun Aug 09 18:07:23 2009 +0200
description:
Use SEC_removeFeatureFromDB when uninstalling a plugin to avoid code duplication

diffstat:

 system/lib-plugins.php |  11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diffs (21 lines):

diff -r 70283e536ccd -r 950d9348fed8 system/lib-plugins.php
--- a/system/lib-plugins.php	Sun Aug 09 13:18:51 2009 +0200
+++ b/system/lib-plugins.php	Sun Aug 09 18:07:23 2009 +0200
@@ -277,16 +277,7 @@
         // removing features
         $num_features = count($remvars['features']);
         for ($i = 0; $i < $num_features; $i++) {
-            $access_id = DB_getItem ($_TABLES['features'], 'ft_id',
-                                    "ft_name = '{$remvars['features'][$i]}'");
-            if (!empty($access_id)) {
-                COM_errorLog ("Attempting to remove {$remvars['features'][$i]} rights from all groups" ,1);
-                DB_delete($_TABLES['access'], 'acc_ft_id', $access_id);
-                COM_errorLog ('...success', 1);
-                COM_errorLog ("Attempting to remove the {$remvars['features'][$i]} feature", 1);
-                DB_delete($_TABLES['features'], 'ft_name', $remvars['features'][$i]);
-                COM_errorLog ('...success', 1);
-            }
+            SEC_removeFeatureFromDB($remvars['features'][$i]);
         }
 
         // uninstall feeds



More information about the geeklog-cvs mailing list