Code

Added check
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 26 Aug 2005 10:20:37 +0000 (10:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 26 Aug 2005 10:20:37 +0000 (10:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1226 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_kioskManagementDialog.inc

index 4b26117810407e6cc854220158f7cb75086f41dc..3d00450b636c1e5b9e38ba774042d7841bb263b8 100644 (file)
@@ -76,15 +76,16 @@ class kioskManagementDialog extends plugin
 
   function getKioskProfiles()
   {
-    $dir = opendir($this->baseDir);
-    if(!file_exists($this->baseDir)){
-      mkdir($this->baseDir);
-    }
-    $a_return = array();
-    while($file = readdir($dir)){
-      if(preg_match("/".$this->filePrefix."$/i",$file)){
-        $name = preg_replace("/".$this->filePrefix."$/i","",$file);;
-        $a_return[$name] = $name;
+    $dir = @opendir($this->baseDir);
+    if(!dir){
+      print_red(sprintf(_("Can't open %s permission denied."),$this->baseDir));
+    }else{
+      $a_return = array();
+      while($file = readdir($dir)){
+        if(preg_match("/".$this->filePrefix."$/i",$file)){
+          $name = preg_replace("/".$this->filePrefix."$/i","",$file);;
+          $a_return[$name] = $name;
+        }
       }
     }
     return($a_return);