Code

Some additional session changes
[gosa.git] / gosa-core / include / functions.inc
index e27fc0e65cead6050302359d62d49ac67bd2c65e..1b90b74878b16d9c177a629149a73fb3858df299 100644 (file)
@@ -360,7 +360,7 @@ function ldap_login_user_htaccess ($username)
   $ui->loadACL();
 
   /* TODO: check java script for htaccess authentication */
-  $_SESSION['js']= true;
+  session::set('js',true);
 
   return ($ui);
 }
@@ -745,8 +745,7 @@ function get_sub_list($filter, $category,$sub_base, $base= "", $attributes= arra
 
   /* Check if there is a sub department specified */
   if($sub_base == ""){
-    trigger_error("Please specify a valid sub search base, like 'ou=apps'. Parameter 3");
-    return(FALSE);
+    return(get_list($filter, $category,$base,$attributes,$flags));
   }
 
   /* Get all deparments matching the given sub_base */
@@ -1035,6 +1034,29 @@ function get_ou($name)
   global $config;
 
   $map = array( "applicationou" => "ou=apps,",
+                "systemsou"     => "ou=systems,",
+                "serverou"      => "ou=servers,ou=systems,",
+                "terminalou"    => "ou=terminals,ou=systems,",
+                "workstationou" => "ou=workstations,ou=systems,",
+                "printerou"     => "ou=printers,ou=systems,",
+                "phoneou"       => "ou=phones,ou=systems,",
+                "componentou"   => "ou=netdevices,ou=systems,",
+                "blocklistou"   => "ou=gofax,ou=systems,",
+                "incomingou"    => "ou=incoming,",
+                "aclroleou"     => "ou=aclroles,",
+                "macroou"       => "ou=macros,ou=asterisk,ou=configs,ou=systems,",
+                "conferenceou"  => "ou=conferences,ou=asterisk,ou=configs,ou=systems,",
+
+                "faiou"         => "ou=fai,ou=configs,ou=systems,",
+                "faiscriptou"   => "ou=scripts,",
+                "faihookou"     => "ou=hooks,",
+                "faitemplateou" => "ou=templates,",
+                "faivariableou" => "ou=variables,",
+                "faiprofileou"  => "ou=profiles,",
+                "faipackageou"  => "ou=packages,",
+                "faipartitionou"=> "ou=disk,",
+
+                "deviceou"      => "ou=devices,",
                 "mimetypeou"    => "ou=mime,");
 
   /* Preset ou... */
@@ -1044,6 +1066,7 @@ function get_ou($name)
     $ou = $map[$name];
     return($ou);
   } else {
+    trigger_error("No department mapping found for type ".$name);
     return "";
   }
  
@@ -1516,19 +1539,19 @@ function print_header($image, $headline, $info= "")
 
 function register_global($name, $object)
 {
-  $_SESSION[$name]= $object;
+  session::set($name,$object);
 }
 
 
 function is_global($name)
 {
-  return isset($_SESSION[$name]);
+  return(session::is_set($name));
 }
 
 
-function &get_global($name)
+function get_global($name)
 {
-  return $_SESSION[$name];
+  return(session::get($name));
 }