Code

Fixed search_config stuff in user tabs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 Sep 2007 11:45:02 +0000 (11:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 Sep 2007 11:45:02 +0000 (11:45 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7370 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/users/class_userManagement.inc
plugins/personal/connectivity/class_opengwAccount.inc
plugins/personal/environment/class_environment.inc
plugins/personal/environment/class_kioskManagementDialog.inc
plugins/personal/environment/environment.tpl

index e2bfe961ddc881e8d798f309cd91a677894013e1..67cf4ee1332aa6087ac60ed58f410e458390e30c 100644 (file)
@@ -112,11 +112,10 @@ class userManagement extends plugin
       $s_tab= "user";
     }
 
-    if(!search_config($this->config->data['TABS'], $s_tab , "CLASS")){
+    if(!$this->config->search($s_tab, 'class',array('tabs'))){
       $s_tab = "user";
     }
 
-
     /********************
       Copy & Paste 
      ********************/
index 8a589c113d5053a06c836f7a50aba35cec0c90b5..3646256f00ea5bb6d819379ccdb936a2c712987f 100644 (file)
@@ -50,20 +50,23 @@ class opengwAccount extends plugin
                $this->initialy_was_account = false;
                $this->is_account           = false;
 
-               /* check if datebase funktions are available, and if database configurations are available */ 
-               if(is_callable("pg_connect")){
-
-                       /* Get configurations */
-                       if(search_config($this->config->data,"opengwAccount","USERNAME")){
-                               $atr = array();
-                               $atr['LOGIN']   =       search_config($this->config->data,"opengwAccount","USERNAME");
-                               $atr['PASSWORD']=       search_config($this->config->data,"opengwAccount","PASSWORD");
-                               $atr['SERVER']  =       search_config($this->config->data,"opengwAccount","DATAHOST");
-                               $atr['DB']              =       search_config($this->config->data,"opengwAccount","DATABASE");
-                               $this->serverCon = $atr;
-                       }else{
-                               $this->serverCon  = $this->config->data['SERVERS']['OPENGROUPWARE'];
-                       }
+               /* Get configurations */
+    if($this->config->search("opengwAccount", 'USERNAME',array('data'))){
+      $atr = array();
+      $atr['LOGIN']    =         $this->config->search("opengwAccount", 'USERNAME',array('data'));
+      $atr['PASSWORD']=        $this->config->search("opengwAccount", 'PASSWORD',array('data'));
+      $atr['SERVER']   =       $this->config->search("opengwAccount", 'DATAHOST',array('data'));
+      $atr['DB']               =         $this->config->search("opengwAccount", 'DATABASE',array('data'));
+      $this->serverCon = $atr;
+    }elseif(isset($this->config->data['SERVERS']['OPENGROUPWARE'])){
+      $this->serverCon  = $this->config->data['SERVERS']['OPENGROUPWARE'];
+    }else{
+      $this->serverCon = array();
+    }
+
+    /* check if datebase funktions are available, and if database configurations are available */ 
+               if(is_callable("pg_connect") && count($this->serverCon)){
+
                        $this->handle     = new ogw($this->serverCon['LOGIN'],$this->serverCon['PASSWORD'],$this->serverCon['SERVER'],$this->serverCon['DB']);
 
                        /* Check if current configuration allows database connection */
index 82b7a7bcefc6ac398e54079043f2cd2757b066a2..4ecebf758389a1f8dcdc229b91167922ddbd4c7b 100644 (file)
@@ -50,6 +50,7 @@ class environment extends plugin
   var $gotoAvailableShares= array();// Available Shares for this account
 
   /* Kiosk profile */
+  var $kiosk_enabled      = FALSE;
   var $gotoKioskProfile   = "none";     // The selected Kiosk Profile
   var $gotoKioskProfiles  = array();// All available Kiosk profiles
   var $newKioskProfiles   = array();
@@ -237,10 +238,17 @@ class environment extends plugin
     $this->gotoShareSelections= $config->getShareList(true);
     $this->gotoAvailableShares= $config->getShareList(false);  
 
-    $tmp = new kioskManagementDialog($this->config,$this->dn);
-    $list = $tmp->getKioskProfiles($this->newKioskProfiles);
-    $list['none']=_("None");
-    $this->kioskProfileList = array_reverse($list);
+
+    if($this->config->search('environment', 'kioskpath') != ""){
+      $tmp = new kioskManagementDialog($this->config,$this->dn);
+      $list = $tmp->getKioskProfiles($this->newKioskProfiles);
+      $list['none']=_("None");
+      $this->kioskProfileList = array_reverse($list);
+      $this->kiosk_enabled = TRUE;
+    }else{
+      $this->kiosk_enabled = FALSE;
+      $this->kioskProfileList = array();
+    }
   }
 
 
@@ -299,6 +307,7 @@ class environment extends plugin
 
     /* Fill templating stuff */
     $smarty= get_smarty();
+    $smarty->assign("kiosk_enabled",$this->kiosk_enabled);
     $display= "";
 
     $smarty->assign("is_group",$this->is_group);
index 1e8bc9697c5ec495e6acf88dd5a5591d4ce3fb58..384306e21fccd8b817fd12d106c39a51206ed608 100644 (file)
@@ -24,7 +24,7 @@ class kioskManagementDialog extends plugin
     if($attach){
       $this->filesToAttach = $attach;
     }
-    $this->baseDir = search_config($this->config->data,"environment", "KIOSKPATH");
+    $this->baseDir = $this->config->search('environment', 'kioskpath');
   }
 
   function execute()
index dd31581c65d41e1c01dc57930c871b39e820054c..0e5bae3a0f09bc5a60488da1ac31134186851178 100644 (file)
@@ -79,6 +79,9 @@
    </table>
   </td>
   <td style="vertical-align:top">
+
+{if $kiosk_enabled}
+
    <table summary="{t}Kiosk profile settings{/t}">
     <tr>
      <td>
      </td>
     </tr>
    </table> 
+
+ {else}
+       <table summary="{t}Kiosk profile settings{/t}">
+               <tr>
+                       <td>
+                               <label for="dummy1">{t}Kiosk profile{/t}</label>
+                       </td>
+                       <td>
+                               <select name="dummy1" disabled id="dummy1"><option disabled>&nbsp;</option></select>
+                               <input type="button" disabled name="dummy2" value="{t}Manage{/t}">
+                       </td>
+               </tr>
+               <tr>
+                       <td colspan=2>
+                               <br>
+                               <input type="checkbox" disabled name="dummy3" id="dummy3">
+                               <label for="dummy3">{t}Resolution changeable during session{/t}</label>
+                               </td>
+               </tr>
+               <tr>
+                       <td>
+                               <label for="dummy4">{t}Resolution{/t}</label>
+                       </td>
+                       <td>
+                               <select name="dummy4" id="dummy4" disabled>
+                               <option disabled>&nbsp;</option>
+                               </select>
+                       </td>
+               </tr>
+       </table>
+{/if}
+
+
+
+
+
   </td>
  </tr>
 </table>