Merging - forgot to pull Randy's fix HEAD
authorDirk Haun <dirk@haun-online.de>
Sat Oct 17 13:12:44 2009 +0200 (2009-10-17)
branchHEAD
changeset 7380eda2a40b633c
parent 7379 d9ce993e1951
parent 7376 ceb385174647
child 7381 e02d71d401c3
Merging - forgot to pull Randy's fix
     1.1 --- a/public_html/admin/plugins.php	Sat Oct 17 13:11:32 2009 +0200
     1.2 +++ b/public_html/admin/plugins.php	Sat Oct 17 13:12:44 2009 +0200
     1.3 @@ -491,7 +491,7 @@
     1.4   *                          returns false if no error occured
     1.5   *
     1.6   */
     1.7 -function plugin_getUploadError($mFile) 
     1.8 +function plugin_getUploadError($mFile)
     1.9  {
    1.10      global $LANG32;
    1.11  
    1.12 @@ -514,7 +514,7 @@
    1.13          $retval = false;
    1.14  
    1.15      }
    1.16 -    
    1.17 +
    1.18      return $retval;
    1.19  }
    1.20  
    1.21 @@ -534,9 +534,9 @@
    1.22      // If 'file_uploads' is enabled in php.ini
    1.23      // and the plugin directories are writable by the web server.
    1.24      $upload_enabled = (ini_get('file_uploads')
    1.25 -                        && is_writable($_CONF['path'] . 'plugins/') 
    1.26 +                        && is_writable($_CONF['path'] . 'plugins/')
    1.27                          && is_writable($_CONF['path_html'])
    1.28 -                        && is_writable($path_admin . 'plugins/')) 
    1.29 +                        && is_writable($path_admin . 'plugins/'))
    1.30                              ? true
    1.31                              : false;
    1.32  
    1.33 @@ -663,7 +663,7 @@
    1.34                  }
    1.35              }
    1.36  
    1.37 -            /** 
    1.38 +            /**
    1.39               * Install the plugin
    1.40               * This doesn't work if the public_html & public_html/admin/plugins directories aren't 777
    1.41               */
    1.42 @@ -686,11 +686,11 @@
    1.43              /**
    1.44               * One time I wanted to install a muffler on my car and
    1.45               * needed to match up the outside diameter of the car's
    1.46 -             * exhaust pipe to the inside diameter of the muffler. 
    1.47 +             * exhaust pipe to the inside diameter of the muffler.
    1.48               * Unfortunately, when I went to the auto parts store they
    1.49               * didn't have a coupling adapter that would perfectly
    1.50               * match the two pipes, only a bunch of smaller adapters.
    1.51 -             * I ended up using about 4 small adapters to step down 
    1.52 +             * I ended up using about 4 small adapters to step down
    1.53               * one size at a time to the size of the muffler's input.
    1.54               *
    1.55               * It's kind of like this regular expression:
    1.56 @@ -1033,20 +1033,21 @@
    1.57          }
    1.58      }
    1.59  
    1.60 -    // Add plugin's Admin group to the Root user group 
    1.61 +    // Add plugin's Admin group to the Root user group
    1.62      // (assumes that the Root group's ID is always 1)
    1.63 -    if ($admin_group_id > 1) {
    1.64 +    if (count($groups) > 0) {
    1.65          if ($verbose) {
    1.66              COM_errorLog("Attempting to give all users in the Root group access to the '$plugin' Admin group", 1);
    1.67          }
    1.68  
    1.69 -        DB_query("INSERT INTO {$_TABLES['group_assignments']} VALUES "
    1.70 -                 . "($admin_group_id, NULL, 1)");
    1.71 -        if (DB_error()) {
    1.72 -            COM_errorLog('Error adding plugin admin group to Root group', 1);
    1.73 -            PLG_uninstall($plugin);
    1.74 -
    1.75 -            return false;
    1.76 +        foreach($groups as $key=>$value){
    1.77 +            DB_query("INSERT INTO {$_TABLES['group_assignments']} VALUES "
    1.78 +             . "($value, NULL, 1)");
    1.79 +            if (DB_error()) {
    1.80 +                COM_errorLog('Error adding plugin admin group to Root group', 1);
    1.81 +                PLG_uninstall($plugin);
    1.82 +                return false;
    1.83 +            }
    1.84          }
    1.85      }
    1.86  
    1.87 @@ -1061,7 +1062,7 @@
    1.88              if (DB_error()) {
    1.89                  COM_errorLog('Error adding plugin default data', 1);
    1.90                  PLG_uninstall($plugin);
    1.91 -            
    1.92 +
    1.93                  return false;
    1.94              }
    1.95          }
    1.96 @@ -1108,7 +1109,7 @@
    1.97              PLG_uninstall($plugin);
    1.98  
    1.99              return false;
   1.100 -        }   
   1.101 +        }
   1.102      }
   1.103  
   1.104      if ($verbose) {
   1.105 @@ -1248,7 +1249,7 @@
   1.106      }
   1.107  
   1.108  } elseif (isset($_FILES['plugin']) && SEC_checkToken() &&
   1.109 -        SEC_hasRights('plugin.install,plugin.upload')) { 
   1.110 +        SEC_hasRights('plugin.install,plugin.upload')) {
   1.111      $display .= plugin_upload();
   1.112  
   1.113  } else { // 'cancel' or no mode at all