Thomas Bruederli
2015-02-07 2f8b1036da42ec3d15a51c6b17a473f9f4df71d3
program/include/rcmail_install.php
@@ -234,10 +234,9 @@
      else if (is_numeric($value)) {
        $value = intval($value);
      }
      else if ($prop == 'plugins') {
      else if ($prop == 'plugins' && !empty($_POST['submit'])) {
        $value = array();
        foreach(array_keys($_POST) as $key)
        {
        foreach (array_keys($_POST) as $key) {
          if (preg_match('/^_plugins_*/', $key))
            array_push($value, $_POST[$key]);
        }
@@ -298,7 +297,7 @@
    $out = $seen = array();
    // iterate over the current configuration
    foreach ($this->config as $prop => $value) {
    foreach (array_keys($this->config) as $prop) {
      if ($replacement = $this->replaced_config[$prop]) {
        $out['replaced'][] = array('prop' => $prop, 'replacement' => $replacement);
        $seen[$replacement] = true;
@@ -578,17 +577,18 @@
    foreach (glob($plugin_dir . '*') as $path) 
    {
      if (is_dir($path) && file_exists($path.'/composer.json'))
      if (is_dir($path) && is_readable($path.'/composer.json'))
      {
        $file_json = json_decode(file_get_contents($path.'/composer.json'));
        $plugin_desc = $file_json->description;
        $plugin_desc = $file_json->description ?: 'N/A';
      }
      else
      {
        $plugin_desc = 'N/A';
      }
      $plugins[] = array('name' => substr($path, strlen($plugin_dir)), 'desc' => $plugin_desc);
      $name = substr($path, strlen($plugin_dir));
      $plugins[] = array('name' => $name, 'desc' => $plugin_desc, 'enabled' => in_array($name, $this->config['plugins']));
    }
    return $plugins;