Code

Set mode to read_only if we edit frozen apps
[gosa.git] / gosa-plugins / goto / admin / applications / class_applicationGeneric.inc
index b6caa4d92e41ee5becc1d495299430004d078fb3..59a67c8b8dcdb9d9541ff37fe34525d738127231 100644 (file)
@@ -57,7 +57,7 @@ class application extends plugin
         $this->base= dn2base($ui->dn);
       }
     } else {
-      $this->base= preg_replace ("/^[^,]+,".get_ou('applicationRDN')."/", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou('applicationRDN'), '/')."/i", "", $this->dn);
     }
 
     $this->orig_cn = $this->cn;
@@ -167,36 +167,6 @@ class application extends plugin
       $smarty->assign("selectmode", "disabled");
     }
     
-    /* Base select dialog */
-    $once = true;
-    foreach($_POST as $name => $value){
-      if(preg_match("/^chooseBase/",$name) && $once && !preg_match("/freeze/i",$this->FAIstate)){
-        $once = false;
-        $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases());
-        $this->dialog->setCurrentBase($this->base);
-      }
-    }
-
-    /* Dialog handling */
-    if(is_object($this->dialog)){
-      /* Must be called before save_object */
-      $this->dialog->save_object();
-
-      if($this->dialog->isClosed()){
-        $this->dialog = false;
-      }elseif($this->dialog->isSelected()){
-        /* Just allow selection valid bases */ 
-        $tmp = $this->get_allowed_bases();
-        if(isset($tmp[$this->dialog->isSelected()])){
-          $this->base = $this->dialog->isSelected();
-        }
-        $this->dialog= false;
-      }else{
-        return($this->dialog->execute());
-      }
-    }
-
     /* Get random number for pictures */
     srand((double)microtime()*1000000);
     $smarty->assign("rand", rand(0, 10000));
@@ -230,7 +200,7 @@ class application extends plugin
     restore_error_handler();
 
     /* Parse release out of object dn */
-    $release = preg_replace("/".get_ou("applicationRDN").preg_quote($this->base, '/')."$/","",$this->dn);
+    $release = preg_replace("/".preg_quote(get_ou("applicationRDN").$this->base, '/')."$/i","",$this->dn);
     $release = preg_replace("/^cn=[^,]+,/","",$release);
 
     /* Get a list of all groups 
@@ -554,8 +524,8 @@ class application extends plugin
   {
     $vars = array("cn");
 
-    $str ="<h2>"._("Application settings")."</h2>
-      <table>
+    $str ="<h3>"._("Application settings")."</h3>
+      <table summary=\""._("Application settings")."\">
       <tr>
       <td>".
       _("Application name").