Code

Fixed acls && checks for conferences
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 Dec 2006 07:25:09 +0000 (07:25 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 Dec 2006 07:25:09 +0000 (07:25 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5319 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/conference/class_phoneConferenceGeneric.inc

index 7c8d6c1ff9c2d912246d1edd54e6956c51112151..82ee473bd927795511165ed48e4cebf4c9ec72e8 100644 (file)
@@ -115,12 +115,6 @@ class conference extends plugin
 
     $smarty= get_smarty();
 
-    /* Assign base ACL */
-    $baseACL = $this->getacl("base");
-    if(!$this->acl_is_moveable()) {
-      $baseACL = preg_replace("/w/","",$baseACL);
-    }
-    $smarty->assign("baseACL",          $baseACL);
 
     $tmp = $this->plInfo();
     foreach($tmp['plProvidedAcls'] as $name => $translation){
@@ -140,7 +134,7 @@ class conference extends plugin
     foreach($_POST as $name => $value){
       if(preg_match("/^chooseBase/",$name) && $once && $this->acl_is_writeable("base")){
         $once = false;
-        $this->dialog = new baseSelectDialog($this->config,$this);
+        $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases());
         $this->dialog->setCurrentBase($this->base);
       }
     }
@@ -153,7 +147,13 @@ class conference extends plugin
       if($this->dialog->isClosed()){
         $this->dialog = false;
       }elseif($this->dialog->isSelected()){
-        $this->base = $this->dialog->isSelected();
+
+        /* A new base was selected, check if it is a valid one */
+        $tmp = $this->get_allowed_bases();
+        if(isset($tmp[$this->dialog->isSelected()])){
+          $this->base = $this->dialog->isSelected();
+        }
+
         $this->dialog= false;
       }else{
         return($this->dialog->execute());
@@ -204,7 +204,20 @@ class conference extends plugin
   {
     if(isset($_POST['phoneConferenceGeneric'])){
 
+      /* Create a base backup and reset the
+         base directly after calling plugin::save_object();
+         Base will be set seperatly a few lines below */
+      $base_tmp = $this->base;
       plugin::save_object();
+      $this->base = $base_tmp;
+
+      /* Save base, since this is no LDAP attribute */
+      $tmp = $this->get_allowed_bases();
+      if(isset($_POST['base'])){
+        if(isset($tmp[$_POST['base']])){
+          $this->base= $_POST['base'];
+        }
+      }
 
       foreach(array("goFonConferenceOption_P","goFonConferenceOption_r","goFonConferenceOption_M","goFonConferenceOption_s",
             "goFonConferenceOption_i","goFonConferenceOption_c","goFonConferenceOption_D") as $attrs){