[geeklog-cvs] Geeklog-1.x/system lib-plugins.php,1.142,1.143
Dirk Haun
dhaun at qs1489.pair.com
Sat Apr 19 12:44:41 EDT 2008
Update of /cvsroot/geeklog/Geeklog-1.x/system
In directory qs1489.pair.com:/tmp/cvs-serv39242/system
Modified Files:
lib-plugins.php
Log Message:
Fixed a crucial typo ("acess_id" -> "access_id") and improved deletion of plugin features, e.g. after faulty uninstalls ...
Index: lib-plugins.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/lib-plugins.php,v
retrieving revision 1.142
retrieving revision 1.143
diff -C2 -d -r1.142 -r1.143
*** lib-plugins.php 6 Apr 2008 16:19:42 -0000 1.142
--- lib-plugins.php 19 Apr 2008 16:44:39 -0000 1.143
***************
*** 211,215 ****
// removing variables
! for ($i=0; $i < count($remvars['vars']); $i++) {
COM_errorLog ("Removing variable {$remvars['vars'][$i]}", 1);
DB_query("DELETE FROM {$_TABLES['vars']} WHERE name = '{$remvars['vars'][$i]}'");
--- 211,215 ----
// removing variables
! for ($i = 0; $i < count($remvars['vars']); $i++) {
COM_errorLog ("Removing variable {$remvars['vars'][$i]}", 1);
DB_query("DELETE FROM {$_TABLES['vars']} WHERE name = '{$remvars['vars'][$i]}'");
***************
*** 218,222 ****
// removing groups
! for ($i=0; $i < count($remvars['groups']); $i++) {
$grp_id = DB_getItem ($_TABLES['groups'], 'grp_id',
"grp_name = '{$remvars['groups'][$i]}'");
--- 218,222 ----
// removing groups
! for ($i = 0; $i < count($remvars['groups']); $i++) {
$grp_id = DB_getItem ($_TABLES['groups'], 'grp_id',
"grp_name = '{$remvars['groups'][$i]}'");
***************
*** 225,229 ****
DB_query ("DELETE FROM {$_TABLES['groups']} WHERE grp_id = $grp_id");
COM_errorLog ('...success', 1);
! COM_errorLog ("Attempting to {$remvars['groups'][$i]} group from all groups.", 1);
DB_query("DELETE FROM {$_TABLES['group_assignments']} WHERE ug_main_grp_id = $grp_id");
COM_errorLog ('...success', 1);
--- 225,229 ----
DB_query ("DELETE FROM {$_TABLES['groups']} WHERE grp_id = $grp_id");
COM_errorLog ('...success', 1);
! COM_errorLog ("Attempting to remove the {$remvars['groups'][$i]} group from all groups.", 1);
DB_query("DELETE FROM {$_TABLES['group_assignments']} WHERE ug_main_grp_id = $grp_id");
COM_errorLog ('...success', 1);
***************
*** 232,244 ****
// removing features
! for ($i=0; $i < count($remvars['features']); $i++) {
$access_id = DB_getItem ($_TABLES['features'], 'ft_id',
"ft_name = '{$remvars['features'][$i]}'");
! if (!empty ($acess_id)) {
COM_errorLog ("Attempting to remove {$remvars['features'][$i]} rights from all groups" ,1);
DB_query ("DELETE FROM {$_TABLES['access']} WHERE acc_ft_id = $access_id");
COM_errorLog ('...success', 1);
COM_errorLog ("Attempting to remove the {$remvars['features'][$i]} feature", 1);
! DB_query ("DELETE FROM {$_TABLES['features']} WHERE ft_id = $access_id");
COM_errorLog ('...success', 1);
}
--- 232,244 ----
// removing features
! for ($i = 0; $i < count($remvars['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_query ("DELETE FROM {$_TABLES['access']} WHERE acc_ft_id = $access_id");
COM_errorLog ('...success', 1);
COM_errorLog ("Attempting to remove the {$remvars['features'][$i]} feature", 1);
! DB_query ("DELETE FROM {$_TABLES['features']} WHERE ft_name = '{$remvars['features'][$i]}'");
COM_errorLog ('...success', 1);
}
***************
*** 287,295 ****
// uninstall the plugin
! COM_errorLog ('Attempting to unregister the $type plugin from Geeklog', 1);
DB_query ("DELETE FROM {$_TABLES['plugins']} WHERE pi_name = '$type'");
COM_errorLog ('...success',1);
! COM_errorLog ('Finished uninstalling the $type plugin.', 1);
return true;
--- 287,295 ----
// uninstall the plugin
! COM_errorLog ("Attempting to unregister the $type plugin from Geeklog", 1);
DB_query ("DELETE FROM {$_TABLES['plugins']} WHERE pi_name = '$type'");
COM_errorLog ('...success',1);
! COM_errorLog ("Finished uninstalling the $type plugin.", 1);
return true;
More information about the geeklog-cvs
mailing list