Code

Applied in_array strict patches from trunk
[gosa.git] / gosa-core / plugins / addons / propertyEditor / class_propertyEditor.inc
index 4800151f7c29304750d2c0282f7499c0259e3b5c..b4fc9924ef8a65591bdf4a6bda558e3c3ae674b8 100644 (file)
@@ -4,11 +4,13 @@
 class propertyEditor extends management
 {
     var $plHeadline= "Preferences";
-    var $plDescription= "Configure global and special GOsa settings like hooks and plugin parameters";
+    var $plDescription= "Configure global and special GOsa settings like hooks and plug-in parameters";
     var $plIcon  = "plugins/propertyEditor/images/plugin.png";
 
     var $toBeMigrated = array();
 
+    var $warningAccepted = FALSE;
+
     function __construct($config,$ui)
     {
         $this->config = $config;
@@ -62,7 +64,7 @@ class propertyEditor extends management
 
         // Once accepted hide the warning message        
         if(isset($_POST['warningAccepted'])){
-            $this->warningNotAccepted = TRUE;
+            $this->warningAccepted = TRUE;
         }
 
         // Execute registered management event listeners.
@@ -119,7 +121,8 @@ class propertyEditor extends management
         }
 
         $smarty = get_smarty();
-        $smarty->assign("warningNotAccepted", $this->warningNotAccepted);
+        $smarty->assign("warningAccepted", $this->warningAccepted);
+        $smarty->assign("ignoreLdapProperties", $this->config->configRegistry->ignoreLdapProperties);
         return(management::execute());
     }
 
@@ -128,7 +131,7 @@ class propertyEditor extends management
         // Walk trough all properties and check if we have modified something
         $all = $this->config->configRegistry->getAllProperties();
         foreach($all as $prop){
-            $modified = in_array($prop->getStatus(),array('modified','removed'));
+            $modified = in_array_strict($prop->getStatus(),array('modified','removed'));
             if($modified) break;
         }
        
@@ -201,7 +204,7 @@ class propertyEditor extends management
         $id = "{$class[0]}_{$cn[0]}";
 
         $title = _("No description");
-        if(isset($description[0])) $title = htmlentities($description[0],ENT_COMPAT, 'UTF-8');
+        if(isset($description[0])) $title = set_post($description[0]);
         $title = preg_replace("/\n/", "<br>", $title);
         $tooltip = "<div id='tooltip_{$id}' class='tooltip' style='display:none'>".$title."</div>";
 
@@ -214,18 +217,18 @@ class propertyEditor extends management
         $ssize  = "208px";
         $isize  = "200px";
         $name  = "{$class[0]}:{$cn[0]}";
-        $value = htmlentities($value[0],ENT_QUOTES      ,'UTF-8');
-
-        // Add slashes to keep escaped values escaped after passing them to smarty.
-        $value = addslashes($value);
+        $value = set_post($value[0]);
 
         switch($type[0]){
+            case 'noLdap':
+                $res = $value." &nbsp;<i>(".CONFIG_DIR.'/'.CONFIG_FILE.")</i>";
+                break;
             case 'bool':
                 $res = "<select size=1 name=\"{$name}\" style='width:{$ssize}'>";
                 $false = (preg_match('/true/i', $value)) ? '' : "selected";
                 $true  = (preg_match('/true/i', $value)) ? "selected" : '';
-                $res.= "<option {$false} value='false'>"._("FALSE")."</option>";
-                $res.= "<option {$true} value='true'>"._("TRUE")."</option>";
+                $res.= "<option {$false} value='false'>"._("Off")."</option>";
+                $res.= "<option {$true} value='true'>"._("On")."</option>";
                 $res.= "</select>";
             case 'switch':
                 if(!empty($defaults[0])){