Code

Moved to -cow
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 Apr 2008 10:01:22 +0000 (10:01 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 Apr 2008 10:01:22 +0000 (10:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10206 594d385d-05f5-0310-b6e9-bd551577e9d8

14 files changed:
gosa-plugins/fai/admin/fai/class_FAI.inc
gosa-plugins/fai/admin/fai/class_divListFai.inc
gosa-plugins/fai/admin/fai/class_faiHook.inc
gosa-plugins/fai/admin/fai/class_faiHookEntry.inc
gosa-plugins/fai/admin/fai/class_faiManagement.inc
gosa-plugins/fai/admin/fai/class_faiPackage.inc
gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc
gosa-plugins/fai/admin/fai/class_faiProfile.inc
gosa-plugins/fai/admin/fai/class_faiScript.inc
gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc
gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc
gosa-plugins/fai/admin/fai/class_faiVariable.inc
gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc

index f6f806185e295efdd04d423dd3c58cbee45857c4..32d129c424ccd6a9bfa08fb7ac9831ade57d4a58 100644 (file)
@@ -787,7 +787,7 @@ class FAI
     $n_data['ou'] = $destination_name;
     $n_data['objectClass'] = array("top","organizationalUnit","FAIbranch");
     if(!empty($type)){
-      $n_data['FAIstate'] = $type;
+      $n_data['FAIstate'] = $type."/cow";
     }
 
     foreach($groups as $dn => $att){
index 19345338c8a1fe5cf33183d1e40282d20a1ebacc..efc16028ebd1911ebdd65e49d0edf8da11e7ec36 100644 (file)
@@ -327,7 +327,7 @@ class divListFai extends MultiSelectWindow
            src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
        }
 
-       if($value['FAIstate'] == "freeze"){
+       if(preg_match("/^freeze/", $value['FAIstate'])){
          $action.=  "<input class='center' type='image' src='images/edit.png'  alt='"._("edit")."'
                       name='entry_edit_%KEY%' title='"._("Edit class")."'>";
          $action.=  "<img src='images/closedlock.png' alt='F' class='center'>";
index 82e14b4a869b5a62c337161612535e1aa9758c5c..0e5a17105739cf73dcb6bb90bdd8f232efe78371 100644 (file)
@@ -319,7 +319,7 @@ class faiHook extends plugin
       $act = "";
 
       /* Check if this object is freezed, in this case hide the delete icon */
-      if($this->FAIstate == "freeze"){
+      if(preg_match("/^freeze/", $this->FAIstate)){
         $act .= "<input type='image' src='images/edit.png'      name='editscript_%s'    title='"._("Edit")."' alt='"._("Edit")."'>";
       }else{
         $act .= "<input type='image' src='images/edit.png'      name='editscript_%s'    title='"._("Edit")."' alt='"._("Edit")."'>";
@@ -369,7 +369,7 @@ class faiHook extends plugin
     $tmp = $this->plInfo();
       
     $c_dn = $this->acl_base_for_current_object($this->dn);
-    $smarty->assign("sub_object_is_addable", preg_match("/c/",$this->ui->get_permissions($c_dn,"fai/faiHookEntry")) && $this->FAIstate!="freeze");
+    $smarty->assign("sub_object_is_addable", preg_match("/c/",$this->ui->get_permissions($c_dn,"fai/faiHookEntry")) && !preg_match('/^freeze/', $this->FAIstate));
     foreach($tmp['plProvidedAcls'] as $name => $translation){
       $smarty->assign($name."ACL",$this->getacl($name));
     }
@@ -436,7 +436,7 @@ class faiHook extends plugin
    */
   function save_object()
   {
-    if((isset($_POST['FAIhook_posted'])) && ($this->FAIstate != "freeze")){
+    if((isset($_POST['FAIhook_posted'])) && !preg_match("/^freeze/", $this->FAIstate)){
       plugin::save_object();
       foreach($this->attributes as $attrs){
         if(isset($_POST[$attrs])){
index 30caab263e1cb696d671c70ff508902b27ce632a..433437e5be990a93b693a1a89a01d220990dc1d2 100644 (file)
@@ -129,7 +129,7 @@ class faiHookEntry extends plugin
   /* Save data to object */
   function save_object()
   {
-    if((isset($_POST['SubObjectFormSubmitted'])) && ($this->FAIstate != "freeze")){
+    if((isset($_POST['SubObjectFormSubmitted'])) && !preg_match("/^freeze/", $this->FAIstate)){
       foreach($this->attributes as $attrs){
         if($this->acl_is_writeable($attrs)){
           if(isset($_POST[$attrs])){
index 958f2696792f0695467fe29eee4c4bf712a6c92f..5a781fcf878eed1bb30b71994ccb89b82881a20b 100644 (file)
@@ -229,7 +229,7 @@ class faiManagement extends plugin
         foreach($ids as $id){
           $dn = $this->objects[$id]['dn'];
           $cn = $this->objects[$id]['cn'];
-          if($this->objects[$id]['FAIstate'] != "freeze"){
+          if(!preg_match('/^freeze/', $this->objects[$id]['FAIstate'])){
             $this->dns[$id] = $dn;
           }else{
             $errors .= $cn.", ";
@@ -399,7 +399,7 @@ class faiManagement extends plugin
       $this->dialog->set_acl_base($this->dn);
                        $this->is_dialog  = true;
 
-      if($entry['FAIstate'] == "freeze"){
+      if(preg_match("/^freeze/", $entry['FAIstate'])){
         #$this->dialog->set_acl(array("*none*"))  ;    
       }
                        session::set('objectinfo',$this->dn);
index 075d80072cd1d10b90dac6ad6c1ee53d1f7189d1..76f5cae5cc5797702e2c4fca4ea94a00b99769f4 100644 (file)
@@ -217,7 +217,7 @@ class faiPackage extends plugin
 
     /* Delete selected package */ 
     if(isset($_POST['Delpkg']) && $this->acl_is_writeable("FAIpackage")){
-      if($this->FAIstate != "freeze"){
+      if(!preg_match("/^freeze/", $this->FAIstate)){
         foreach($_POST['usedPackages'] as $del){
           if(isset($this->usedPackages[$del])){
             unset($this->usedPackages[$del]);
@@ -234,7 +234,7 @@ class faiPackage extends plugin
 
     /* attach new packages */
     if(isset($_POST['SaveSubObject'])) {
-      if($this->FAIstate != "freeze"){
+      if(!preg_match("/^freeze/", $this->FAIstate)){
         $this->dialog->save_object();
         if(count($this->dialog->check())){
           foreach($this->dialog->check() as $msgs){
@@ -265,7 +265,7 @@ class faiPackage extends plugin
     }
 
     /* Configuration dialog open*/
-    if($this->FAIstate != "freeze" && $this->acl_is_writeable("FAIpackage")){
+    if(preg_match('/^freeze/', $this->FAIstate) && $this->acl_is_writeable("FAIpackage")){
       if((isset($_POST['Markpkg']))&&(isset($_POST['usedPackages']))&&(!empty($_POST['usedPackages']))){
         foreach($_POST['usedPackages'] as $pkg){
           if (isset($this->usedPackages[$pkg])){
@@ -283,7 +283,7 @@ class faiPackage extends plugin
 
     /* Save Configuration */
     if(isset($_POST['SaveObjectConfig'])){
-      if($this->FAIstate != "freeze"){
+      if(!preg_match("/^freeze/", $this->FAIstate)){
         $this->ConfiguredPackages= array_merge($this->ConfiguredPackages,$this->dialog->save());
       }
       $this->dialog = false;
@@ -356,7 +356,7 @@ class faiPackage extends plugin
    */
   function save_object()
   {
-    if($this->FAIstate == "freeze") return;  
+    if(preg_match("/^freeze/", $this->FAIstate)) return;
     plugin::save_object();
   }
 
index 2ef87bc1f8d696f5b36d15561f951df0bcbafd6e..3179e4cb23e70fd3aa3ff0618fa52281395298f8 100644 (file)
@@ -193,7 +193,7 @@ class faiPartitionTable extends plugin
      */
     if(isset($_POST['SaveDisk'])){
 
-      if($this->FAIstate != "freeze"){
+      if (!preg_match("/freeze/", $this->FAIstate)){
         $this->dialog->save_object();
         if(count($this->dialog->check())){
           foreach($this->dialog->check() as $msg){
@@ -234,7 +234,7 @@ class faiPartitionTable extends plugin
      * Assign delete status for all its partitions      
      */
     if((isset($_POST['DelDisk']))&&(!empty($_POST['disks']))){
-      if($this->FAIstate != "freeze"){
+      if (!preg_match("/freeze/", $this->FAIstate)){
         foreach($_POST['disks'] as $disk) {
 
           if(isset($this->disks[$disk])){
@@ -376,7 +376,7 @@ class faiPartitionTable extends plugin
    */
   function save_object()
   {
-    if($this->FAIstate == "freeze") return;
+    if (preg_match("/freeze/", $this->FAIstate)) return;
     plugin::save_object();
     foreach($this->attributes as $attrs){
       if(isset($_POST[$attrs])){
index 8e29422fbb5ef3d965199278703e5bdc71ab07e2..2524c97cc6bc3d417fd9c9b686d8b74025b4e695 100644 (file)
@@ -214,7 +214,7 @@ class faiPartitionTableEntry extends plugin
       }
 
       $disableALL = "";
-      if($this->FAIstate =="freeze"){
+      if (preg_match("/freeze/", $this->FAIstate)){
         $disableALL = " disabled ";
       }
 
@@ -356,7 +356,7 @@ class faiPartitionTableEntry extends plugin
   /* Save data to object */
   function save_object()
   {
-    if((isset($_POST['TableEntryFrameSubmitted'])) && ($this->FAIstate != "freeze") ){
+    if((isset($_POST['TableEntryFrameSubmitted'])) && !preg_match("/freeze/", $this->FAIstate) ){
       plugin::save_object();
 
       foreach($this->partitions as $key => $part){
index 9fb9ae0f7272e50e21d773c686c5f078333de1a3..c6c4c2f53a3c831140a3530a8a6c5cfacc1f3572 100644 (file)
@@ -319,7 +319,7 @@ class faiProfile extends plugin
 
         $field1 = array("string"=> $usedClass,"attach"=>"");
         $field2 = array("string"=> $str,"attach"=>"");
-        if(($this->FAIstate != "freeze") && $this->acl_is_writeable("FAIclass")){
+        if(!preg_match("/freeze/", $this->FAIstate) && $this->acl_is_writeable("FAIclass")){
           $field3 = array("string"=> preg_replace("/%KEY%/",base64_encode($usedClass),$actions).
               preg_replace("/%s/",base64_encode($usedClass),$linkupdown),
               "attach"=>"style='border-right:none;'");
index 331ca3799ca77faf0c112dba4ec709dd1d454202..2693e8b386b94cffc1b14b9d67220159395fd9cf 100644 (file)
@@ -354,7 +354,7 @@ class faiScript extends plugin
       $act = "";
       
       /* Hide delete icon if this object is freezed */
-      if($this->FAIstate == "freeze"){
+      if(preg_match("/freeze/", $this->FAIstate)){
         $act .= "<input type='image' src='images/edit.png'      name='editscript_%s'    title='"._("edit")."' alt='"._("edit")."'>";
       }else{
         $act .= "<input type='image' src='images/edit.png'      name='editscript_%s'    title='"._("edit")."' alt='"._("edit")."'>";
@@ -471,7 +471,7 @@ class faiScript extends plugin
    */
   function save_object()
   {
-    if((isset($_POST['FAIscript_posted'])) && ($this->FAIstate != "freeze")){
+    if((isset($_POST['FAIscript_posted'])) && !preg_match("/freeze/", $this->FAIstate)){
       plugin::save_object();
       foreach($this->attributes as $attrs){
         if(isset($_POST[$attrs])){
index 51a42682906c548f0e93a7e915b89c9fc3fa272c..370c892a07054ef27ec7165ecfe72ceccba95cf6 100644 (file)
@@ -121,7 +121,7 @@ class faiScriptEntry extends plugin
   /* Save data to object */
   function save_object()
   {
-    if((isset($_POST['SubObjectFormSubmitted'])) && ($this->FAIstate != "freeze")){
+    if((isset($_POST['SubObjectFormSubmitted'])) && !preg_match("/freeze/", $this->FAIstate)){
       foreach($this->attributes as $attrs){
         if($this->acl_is_writeable($attrs)){
           if(isset($_POST[$attrs])){
index 62752d01d6d5872099e373bbbf9df564591cfa9c..0d288b1bc1107623e4f77b45fc1b6e99da0bb410 100644 (file)
@@ -149,7 +149,7 @@ class faiTemplateEntry extends plugin
   function save_object()
   {
     /* Check if form is posted and we are not freezed */
-    if((isset($_POST['SubObjectFormSubmitted'])) && ($this->FAIstate != "freeze")){
+    if((isset($_POST['SubObjectFormSubmitted'])) && !preg_match("/freeze/", $this->FAIstate)){
 
       plugin::save_object();
 
index a3ca17002fc1dee5e50efc4a21bbe5b18f49ab42..53bf6706b5c387159985394a43d84e87cc47c2e6 100644 (file)
@@ -233,8 +233,8 @@ class faiVariable extends plugin
     }
 
     $c_dn = $this->acl_base_for_current_object($this->dn);
-    $smarty->assign("is_createable",     preg_match("/c/",$this->ui->get_permissions($c_dn,"fai/faiVariableEntry")) && $this->FAIstate!="freeze");
-    $smarty->assign("is_removeable",  preg_match("/d/",$this->ui->get_permissions($c_dn,"fai/faiVariableEntry")) && $this->FAIstate!="freeze");
+    $smarty->assign("is_createable",     preg_match("/c/",$this->ui->get_permissions($c_dn,"fai/faiVariableEntry")) && !preg_match("/freeze/", $this->FAIstate));
+    $smarty->assign("is_removeable",  preg_match("/d/",$this->ui->get_permissions($c_dn,"fai/faiVariableEntry")) && !preg_match("/freeze/", $this->FAIstate));
 
     $tmp = $this->plInfo();
     foreach($tmp['plProvidedAcls'] as $name => $translation) {
@@ -304,7 +304,7 @@ class faiVariable extends plugin
    */
   function save_object()
   {
-    if((isset($_POST['FAIvariable_posted'])) && ($this->FAIstate != "freeze") ){
+    if((isset($_POST['FAIvariable_posted'])) && !preg_match("/freeze/", $this->FAIstate) ){
       plugin::save_object();
       foreach($this->attributes as $attrs){
         if(isset($_POST[$attrs])){
index fa9ecbb353502f7af3819f7dad8f827ecc03ae3b..50e7348203146fb3636108a4863770ad048318d7 100644 (file)
@@ -75,7 +75,7 @@ class faiVariableEntry extends plugin
   /* Save data to object */
   function save_object()
   {
-     if((isset($_POST['SubObjectFormSubmitted'])) && ($this->FAIstate != "freeze")){
+     if((isset($_POST['SubObjectFormSubmitted'])) && !preg_match("/freeze/", $this->FAIstate)){
       foreach($this->attributes as $attrs){
         if($this->acl_is_writeable($attrs)){
           if(isset($_POST[$attrs])){