Code

Remove , if it is the last char in given people_ou.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Dec 2006 06:35:30 +0000 (06:35 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Dec 2006 06:35:30 +0000 (06:35 +0000)
If someone enters something like this   people='ou=people,'
Several errors will be the result.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5345 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_config.inc

index 0672d07044312f1ee3dcb92c3867944597b452f1..ffa4f7d71ebcb6deed64c5c7e01e4f80ae4b4800 100644 (file)
@@ -240,6 +240,11 @@ class config  {
     if (!isset($this->current['GROUPS'])){
       $this->current['GROUPS']= "ou=groups";
     }
+
+    /* Remove possibly added ',' from end of group and people ou */
+    $this->current['GROUPS'] = preg_replace("/,*$/","",$this->current['GROUPS']);
+    $this->current['PEOPLE'] = preg_replace("/,*$/","",$this->current['PEOPLE']);
+
     if (!isset($this->current['WINSTATIONS'])){
       $this->current['WINSTATIONS']= "ou=winstations,ou=systems";
     }