[geeklog-cvs] geeklog: Merging - forgot to pull Randy's fix

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Oct 17 09:22:38 EDT 2009


changeset 7380:eda2a40b633c
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/eda2a40b633c
user: Dirk Haun <dirk at haun-online.de>
date: Sat Oct 17 13:12:44 2009 +0200
description:
Merging - forgot to pull Randy's fix

diffstat:

 public_html/admin/plugins.php |  39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)

diffs (114 lines):

diff -r d9ce993e1951 -r eda2a40b633c public_html/admin/plugins.php
--- a/public_html/admin/plugins.php	Sat Oct 17 13:11:32 2009 +0200
+++ b/public_html/admin/plugins.php	Sat Oct 17 13:12:44 2009 +0200
@@ -491,7 +491,7 @@
  *                          returns false if no error occured
  *
  */
-function plugin_getUploadError($mFile) 
+function plugin_getUploadError($mFile)
 {
     global $LANG32;
 
@@ -514,7 +514,7 @@
         $retval = false;
 
     }
-    
+
     return $retval;
 }
 
@@ -534,9 +534,9 @@
     // If 'file_uploads' is enabled in php.ini
     // and the plugin directories are writable by the web server.
     $upload_enabled = (ini_get('file_uploads')
-                        && is_writable($_CONF['path'] . 'plugins/') 
+                        && is_writable($_CONF['path'] . 'plugins/')
                         && is_writable($_CONF['path_html'])
-                        && is_writable($path_admin . 'plugins/')) 
+                        && is_writable($path_admin . 'plugins/'))
                             ? true
                             : false;
 
@@ -663,7 +663,7 @@
                 }
             }
 
-            /** 
+            /**
              * Install the plugin
              * This doesn't work if the public_html & public_html/admin/plugins directories aren't 777
              */
@@ -686,11 +686,11 @@
             /**
              * One time I wanted to install a muffler on my car and
              * needed to match up the outside diameter of the car's
-             * exhaust pipe to the inside diameter of the muffler. 
+             * exhaust pipe to the inside diameter of the muffler.
              * Unfortunately, when I went to the auto parts store they
              * didn't have a coupling adapter that would perfectly
              * match the two pipes, only a bunch of smaller adapters.
-             * I ended up using about 4 small adapters to step down 
+             * I ended up using about 4 small adapters to step down
              * one size at a time to the size of the muffler's input.
              *
              * It's kind of like this regular expression:
@@ -1033,20 +1033,21 @@
         }
     }
 
-    // Add plugin's Admin group to the Root user group 
+    // Add plugin's Admin group to the Root user group
     // (assumes that the Root group's ID is always 1)
-    if ($admin_group_id > 1) {
+    if (count($groups) > 0) {
         if ($verbose) {
             COM_errorLog("Attempting to give all users in the Root group access to the '$plugin' Admin group", 1);
         }
 
-        DB_query("INSERT INTO {$_TABLES['group_assignments']} VALUES "
-                 . "($admin_group_id, NULL, 1)");
-        if (DB_error()) {
-            COM_errorLog('Error adding plugin admin group to Root group', 1);
-            PLG_uninstall($plugin);
-
-            return false;
+        foreach($groups as $key=>$value){
+            DB_query("INSERT INTO {$_TABLES['group_assignments']} VALUES "
+             . "($value, NULL, 1)");
+            if (DB_error()) {
+                COM_errorLog('Error adding plugin admin group to Root group', 1);
+                PLG_uninstall($plugin);
+                return false;
+            }
         }
     }
 
@@ -1061,7 +1062,7 @@
             if (DB_error()) {
                 COM_errorLog('Error adding plugin default data', 1);
                 PLG_uninstall($plugin);
-            
+
                 return false;
             }
         }
@@ -1108,7 +1109,7 @@
             PLG_uninstall($plugin);
 
             return false;
-        }   
+        }
     }
 
     if ($verbose) {
@@ -1248,7 +1249,7 @@
     }
 
 } elseif (isset($_FILES['plugin']) && SEC_checkToken() &&
-        SEC_hasRights('plugin.install,plugin.upload')) { 
+        SEC_hasRights('plugin.install,plugin.upload')) {
     $display .= plugin_upload();
 
 } else { // 'cancel' or no mode at all



More information about the geeklog-cvs mailing list