Code

Fixed removing and adding of plugins
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 24 Jan 2008 07:50:15 +0000 (07:50 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 24 Jan 2008 07:50:15 +0000 (07:50 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8576 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/update-gosa

index 9d3b2738dfbb6e0f6a07b12f02af23a60f7def49..186947d5afd344da366bd9848bf60c923afd40c9 100755 (executable)
@@ -290,7 +290,14 @@ function install_plugin($file)
 
                                /* Check if dependencies are fullfilled */
                                foreach ($depends as $dep){
-                                       if (!in_array($dep, $provides)){
+                                       $found= false;
+                                       foreach ($provides as $provide => $dummy){
+                                               if ($dep == $provide){
+                                                       $found= true;
+                                                       break;
+                                               }
+                                       }
+                                       if (!$found){
                                                echo "! Error: plugin depends on '$dep', but this is not installed\n\n";
                                                exit (3);
                                        }
@@ -388,7 +395,7 @@ function remove_plugin($name)
 
        /* Depends? */
        foreach ($depends as $sname => $pl_depends){
-               if (!in_array($name, $pl_depends)){
+               if (in_array($name, $pl_depends)){
                        echo "! Error: plugin '$sname' depends on '$name' - cannot remove it\n\n";
                        exit (1);
                }