Code

Several gofon acl updated.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 Dec 2006 05:18:39 +0000 (05:18 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 Dec 2006 05:18:39 +0000 (05:18 +0000)
Added some infos to snapshot template

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

ihtml/themes/default/snapshotdialog.tpl
plugins/gofon/conference/class_divListConferences.inc
plugins/gofon/conference/class_phoneConferenceGeneric.inc
plugins/gofon/conference/class_phoneConferenceManagment.inc
plugins/gofon/conference/generic.tpl
plugins/gofon/macro/class_divListMacros.inc
plugins/gofon/macro/class_gofonMacro.inc
plugins/gofon/macro/class_gofonMacroManagement.inc
plugins/gofon/macro/class_gofonMacroParameters.inc
plugins/gofon/macro/generic.tpl
plugins/gofon/phoneaccount/class_phoneAccount.inc

index 7732258a341edba307588301aa6bd3b734523609..1fc7cff7883d9feccb0c70a55563f7ce5a91b531 100755 (executable)
@@ -5,6 +5,12 @@
 <br>
 {t}This procedure will restore a snapshot of the selected object. It will replace the existing object after pressing the restore button.{/t}
 <br>
+<br>
+{t}Remember that DNS configuration and database entries could not be restored. For some objects it is only nescessary to open and save them again (goFon), but some entries must be recreated manually (glpi).{/t}
+<br>
+<br>
+{t}Don't forget to check references to other objects, for example does the selected printer still exists ?{/t}
+<br>
 <p class="seperator">&nbsp;</p>
 <br>
 <table summary="" style="width:100%">
@@ -46,7 +52,7 @@
 {t}This procedure will create a snapshot of the selected object. It will be stored inside a special branch of your directory system and can be restored later on.{/t}
 <br>
 <br>
-{t}Remember that the DNS configurations for this entry and possibly created zones in server extensions will not be stored in the snapshot.{/t}
+{t}Remember that database entries, DNS configurations and possibly created zones in server extensions will not be stored in the snapshot.{/t}
 <br>
 <p class="seperator">&nbsp;</p>
 <br>
index 339d561aed4d4f6fd36f4cf4fdd5f1670e7da021..3251d6eab2c401cb4ec35f18a0ba29bd88d81f94 100755 (executable)
@@ -22,7 +22,7 @@ class divListConference extends MultiSelectWindow
 
   function divListConference ($config,$parent)
   {
-    MultiSelectWindow::MultiSelectWindow($config,"Conferences", "gofon");
+    MultiSelectWindow::MultiSelectWindow($config,"Conferences", "gofonconference");
     
     $this->parent       = $parent;
     $this->ui           = get_userinfo();
@@ -61,6 +61,7 @@ class divListConference extends MultiSelectWindow
     $this->AddRegex   ("Regex",      _("Regular expression for matching conference names"),"*" , true);
   }
 
+
   function GenHeader()
   {
     /* Prepare departments,
@@ -74,9 +75,9 @@ class divListConference extends MultiSelectWindow
                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH);
 
     /* Load possible departments */
-    $ui= get_userinfo();
-    $tdeps= $ui->get_module_departments("gofon");
-    $ids = $this->config->idepartments;
+    $ui     = get_userinfo();
+    $tdeps  = $ui->get_module_departments("gofonconference");
+    $ids    = $this->config->idepartments;
 
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
@@ -89,7 +90,9 @@ class divListConference extends MultiSelectWindow
       }
     }
 
-    $acls = $ui->get_permissions($this->selectedBase,"gofon/conference");
+    /* Get acls */
+    $acls     = $ui->get_permissions($this->selectedBase,"gofonconference/conference");
+    $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"gofonconference") ;
 
     /* NEW LIST MANAGMENT */
     $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
@@ -111,7 +114,7 @@ class divListConference extends MultiSelectWindow
     }
 
     /* Only display snapshot settings if we are able to write && create new entries */
-    if(preg_match("/[cw]/",$acls)){
+    if(preg_match("/(c.*w|w.*c)/",$acl_all)){
       $listhead .= $this->get_snapshot_header($this->selectedBase);
     }
   
@@ -146,7 +149,8 @@ class divListConference extends MultiSelectWindow
     /* Insert conferneces*/
     foreach($list as $conferencekey => $conference ){
 
-      $acl = $this->ui -> get_permissions($conference['dn'],"gofon/conference");
+      $acl      = $this->ui->get_permissions($conference['dn'],"gofonconference/conference");
+      $acl_all  = $this->ui->has_complete_category_acls($conference['dn'],"gofonconference");
 
       /* You will need at least read access for the 
           current conference informations to display it */  
@@ -159,7 +163,7 @@ class divListConference extends MultiSelectWindow
                     alt='"._("edit")."'    name='conf_edit_%KEY%' title='"._("Edit this entry")."'>";
 
       /* Add snapshot icon - This is allowed when we have create and write access for the current entry */
-      if(preg_match("/[cw]/",$acl)){
+      if(preg_match("/(c.*w|w.*c)/",$acl_all)){
         $actions.= $this->GetSnapShotActions($conference['dn']);
       }
 
@@ -171,7 +175,7 @@ class divListConference extends MultiSelectWindow
 
       /* Display PIN icon, only if we are the owner of the given conference */
       $owner = $this->parent->ui->dn==$conference['goFonConferenceOwner'][0];
-      $p_acl = $this->ui->get_permissions($conference['dn'],"gofon/conference","goFonPIN");
+      $p_acl = $this->ui->get_permissions($conference['dn'],"gofonconference/conference","goFonPIN");
       if((isset($conference['goFonPIN'][0])) && $owner && preg_match("/r/",$p_acl)){
         $pin = "<img class='center' src='images/list_password.png' title='PIN : ".$conference['goFonPIN'][0]."' alt='PIN'>";
       }else{
@@ -179,7 +183,7 @@ class divListConference extends MultiSelectWindow
       }
 
       /* Display numer of the conference if we are allowed to view it */
-      $n_acl = $this->ui->get_permissions($conference['dn'],"gofon/conference","telephoneNumber");
+      $n_acl = $this->ui->get_permissions($conference['dn'],"gofonconference/conference","telephoneNumber");
       if(isset($conference['telephoneNumber'][0]) && preg_match("/r/",$n_acl)){
         $number = " - ".$conference['telephoneNumber'][0];
       }else{
index ef9f91ca14a980d0cd17fc75594c6b45c9f966f6..7c8d6c1ff9c2d912246d1edd54e6956c51112151 100644 (file)
@@ -202,7 +202,7 @@ class conference extends plugin
   /* Save data to object */
   function save_object()
   {
-    if(isset($_POST['cn'])){
+    if(isset($_POST['phoneConferenceGeneric'])){
 
       plugin::save_object();
 
@@ -541,7 +541,7 @@ class conference extends plugin
           "plDepends"     => array(),
           "plPriority"    => 0,
           "plSection"     => array("addons" => _("Addons")),
-          "plCategory"    => array("gofon" => array("description" => _("GOfon"),
+          "plCategory"    => array("gofonconference" => array("description" => _("GOfon conference"),
                                                   "objectClass" => "gofonConference")),
 
           "plProvidedAcls" => array(
index 58ee81d325736e4ec41aac9d2da98c76b6572ae2..4084ebb9fc5a97a88b4e14b70be6109314682464 100644 (file)
@@ -119,7 +119,7 @@ class phoneConferenceManagment extends plugin
      */
     if ($s_action =="del"){
 
-      $acl = $this->ui->get_permissions($this->conferences[$s_entry]['dn'],"gofon/conference"); 
+      $acl = $this->ui->get_permissions($this->conferences[$s_entry]['dn'],"gofonconference/conference"); 
       if(preg_match("/d/",$acl)){
         $this->dn= $this->conferences[$s_entry]['dn'];
 
@@ -145,7 +145,7 @@ class phoneConferenceManagment extends plugin
      * Finally delete department
      */
     if (isset($_POST['delete_department_confirm'])){
-      $acl = $this->ui->get_permissions($this->dn,"gofon/conference"); 
+      $acl = $this->ui->get_permissions($this->dn,"gofonconference/conference"); 
       if(preg_match("/d/",$acl)){
         $this->remove_from_parent();
         gosa_log ("Department object'".$this->dn."' has been removed");
@@ -174,7 +174,7 @@ class phoneConferenceManagment extends plugin
       add_lock ($this->dn, $this->ui->dn);
 
       /* Register conftab to trigger edit dialog */
-      $this->conftab= new conferencetabs($this->config,$this->config->data['TABS']['CONFERENCETABS'], $this->dn,"gofon");
+      $this->conftab= new conferencetabs($this->config,$this->config->data['TABS']['CONFERENCETABS'], $this->dn,"gofonconference");
       $this->conftab->set_acl_base($this->dn);
       $_SESSION['objectinfo']= $this->dn;
     }
@@ -188,11 +188,11 @@ class phoneConferenceManagment extends plugin
     if($s_action == "new" ){
 
       $dummy_dn = "cn=dummy,ou=conferences,ou=asterisk,ou=configs,ou=systems,".$this->DivListConference->selectedBase;      
-      $acl = $this->ui->get_permissions($dummy_dn,"gofon/conference"); 
+      $acl = $this->ui->get_permissions($dummy_dn,"gofonconference/conference"); 
       if(preg_match("/c/",$acl)){
         /* Set up the users ACL's for this 'dn' */
         $this->dn= "new";
-        $this->conftab= new conferencetabs($this->config,$this->config->data['TABS']['CONFERENCETABS'], $this->dn,"gofon");
+        $this->conftab= new conferencetabs($this->config,$this->config->data['TABS']['CONFERENCETABS'], $this->dn,"gofonconference");
         $this->conftab->set_acl_base($dummy_dn);
         unset($_SESSION['objectinfo']);
       }
@@ -306,7 +306,7 @@ class phoneConferenceManagment extends plugin
       $Flags |= GL_SUBSEARCH;
     }
 
-    $this->conferences= get_list($Filter, "gofon", $Base, $Attrs, $Flags);
+    $this->conferences= get_list($Filter, "gofonconference", $Base, $Attrs, $Flags);
   }
 
   function remove_from_parent()
@@ -314,7 +314,7 @@ class phoneConferenceManagment extends plugin
     /* Ehm what are we doinf here ? */
   
     $cfg = new conference($this->config, $this->dn);
-    $cfg->set_acl_category("gofon");
+    $cfg->set_acl_category("gofonconference");
     $cfg->set_acl_base($this->dn);
 
     $cfg->remove_from_parent();
index 75548aca23d2e799d6893302724b7f1535b02b4b..5ba587b0a013fff9ee8ef11af4426e518134c5f2 100644 (file)
   </tr>
 </table>
 
+<input type='hidden' name='phoneConferenceGeneric' value='1'>
+
 <!-- Place cursor -->
 <script language="JavaScript" type="text/javascript">
   <!-- // First input field on page
index 68dce0468493810ac032ebac74f0ba2a529290c3..bf85a22b75557cf04a51704c6e0bbb171ea89fd3 100755 (executable)
@@ -22,7 +22,7 @@ class divListMacro extends MultiSelectWindow
 
   function divListMacro ($config,$parent)
   {
-    MultiSelectWindow::MultiSelectWindow($config,"Macros", "gofon");
+    MultiSelectWindow::MultiSelectWindow($config,"Macros", "gofonmacro");
     
     $this->parent       = $parent;
     $this->ui           = get_userinfo();
@@ -74,7 +74,7 @@ class divListMacro extends MultiSelectWindow
 
     /* Load possible departments */
     $ui= get_userinfo();
-    $tdeps= $ui->get_module_departments("groups");
+    $tdeps= $ui->get_module_departments("gofonmacro");
 
     $ids = $this->config->idepartments;
 
@@ -90,7 +90,7 @@ class divListMacro extends MultiSelectWindow
       }
     }
 
-    $acls  = $ui->get_permissions($this->selectedBase,"gofon/macro");
+    $acls  = $ui->get_permissions($this->selectedBase,"gofonmacro/macro");
 
     /* NEW LIST MANAGMENT */
     $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
@@ -149,7 +149,7 @@ class divListMacro extends MultiSelectWindow
 
     foreach($list as $key => $val){
        
-      $sacl  = $ui->get_permissions($val['dn'],"gofon/macro");
+      $sacl  = $ui->get_permissions($val['dn'],"gofonmacro/macro");
 
       $action = "";
       if(!preg_match("/r/",$sacl)){
@@ -168,7 +168,7 @@ class divListMacro extends MultiSelectWindow
           name='user_del_%KEY%' title='"._("Delete macro")."'>";
       }
 
-      $display= $val["displayName"][0];
+      $display= $val["displayName"][0]."&nbsp;(".$val["cn"][0].")";
       if(isset($val['goFonMacroVisible']['0'])&&($val['goFonMacroVisible']['0'] == "1")){
         $pic1 = $visible;
       }else{
index cbed42605bfe58080330c70fc902ae8796e05a4b..981b526c2519b8ff882df253482a2d3df774b1d4 100755 (executable)
@@ -357,7 +357,7 @@ class macro extends plugin
   */
   function save_object()
   {
-    if (isset($_POST['displayName'])){
+    if (isset($_POST['gofonMacroGenericPosted'])){
       $old_cn= $this->cn;
       $old_visible = $this->goFonMacroVisible;
 
@@ -473,18 +473,19 @@ class macro extends plugin
     return (array(
         "plShortName"   => _("Generic"),
         "plDescription" => _("Asterisk macro management"),
-        "plSelfModify"  => TRUE,
+        "plSelfModify"  => FALSE,
         "plDepends"     => array(),
         "plPriority"    => 0,
         "plSection"     => array("administration"),
-        "plCategory"    => array("gofon"),
+        "plCategory"    => array("gofonmacro" => array("description" => _("GOfon macro"),
+                                                  "objectClass" => "gofonMacro")),
 
         "plProvidedAcls" => array(
           "cn"                            => _("Macro name"),
           "base"                          => _("Base"), 
           "description"                   => _("Description"), 
           "displayName"                   => _("Display name"),
-          "goFonMacroContent"             => _("Macro content"),
+          "goFonMacroContent"             => _("Macro content and parameter"),
           "goFonMacroVisible"             => _("Visibility flag"))
         ));
   }
index 5fea98f343f6e63c2494c17ed81088f13e724727..a21074b109d17a957746e7aad469306cdaf249ba 100755 (executable)
@@ -96,7 +96,8 @@ class gofonMacro extends plugin
       $this->dn= "new";
 
       /* Create new usertab object */
-      $this->macrotabs= new macrotabs($this->config,$this->config->data['TABS']['MACROTABS'], $this->dn,"gofon");
+      $this->macrotabs= new macrotabs($this->config,$this->config->data['TABS']['MACROTABS'], $this->dn,"gofonmacro");
+      $this->macrotabs->set_acl_base($this->DivListMacro->selectedBase);
     }
 
 
@@ -161,7 +162,7 @@ class gofonMacro extends plugin
     if (($s_action=="edit") && (!isset($this->macrotabs->config))){
 
       $dn  = $this->macros[$s_entry]['dn'];
-      $acl = $this->ui->get_permissions($dn,"gofon/macro");
+      $acl = $this->ui->get_permissions($dn,"gofonmacro/macro");
       if(preg_match("/r/",$acl)){
         $this->dn = $dn;
 
@@ -176,7 +177,7 @@ class gofonMacro extends plugin
         add_lock ($this->dn, $this->ui->dn);
         /* Register macrotabs to trigger edit dialog */
         $this->macrotabs= new macrotabs($this->config,
-            $this->config->data['TABS']['MACROTABS'], $this->dn,"gofon");
+            $this->config->data['TABS']['MACROTABS'], $this->dn,"gofonmacro");
         $_SESSION['objectinfo']= $this->dn;
       }
     }
@@ -190,7 +191,7 @@ class gofonMacro extends plugin
 
       /* Get 'dn' from posted 'uid' */
       $dn  = $this->macros[$s_entry]['dn'];
-      $acl = $this->ui->get_permissions($dn,"gofon/macro");
+      $acl = $this->ui->get_permissions($dn,"gofonmacro/macro");
 
       if(preg_match("/d/",$acl)){
 
@@ -223,12 +224,12 @@ class gofonMacro extends plugin
     /* Confirmation for deletion has been passed. Macro should be deleted. */
     if (isset($_POST['delete_macro_confirm'])){
 
-      $acl = $this->ui->get_permissions($this->dn,"gofon/macro");
+      $acl = $this->ui->get_permissions($this->dn,"gofonmacro/macro");
 
       if(preg_match("/r/",$acl)){
 
         /* Delete request is permitted, perform LDAP action */
-        $this->macrotabs= new macrotabs($this->config,$this->config->data['TABS']['MACROTABS'], $this->dn,"gofon");
+        $this->macrotabs= new macrotabs($this->config,$this->config->data['TABS']['MACROTABS'], $this->dn,"gofonmacro");
         $this->macrotabs->delete ();
         gosa_log ("macro object'".$this->dn."' has been removed");
         unset ($this->macrotabs);
@@ -318,7 +319,7 @@ class gofonMacro extends plugin
     }
 
     /* Generate macro list */
-    $res= get_list($Filter, "gofon", $base, $Attrs, $Flags);
+    $res= get_list($Filter, "gofonmacro", $base, $Attrs, $Flags);
 
     $tmp=array();
     foreach($res as $tkey => $val ){
index 5a1aacfc0bb62e2186f1249cdf9270c128cb779a..b1ca0a8afe3dab8dad79b05a168777a58ec03629 100755 (executable)
@@ -186,7 +186,7 @@ class macroParameter extends plugin
     /* Get acls for this tab, 
         there is only one attribute to write,
          so we use the acls from gofon/marco */
-    $ACLs = $this->ui->get_permissions($this->dn,"gofon/macro","goFonMarcoContent");
+    $ACLs = $this->ui->get_permissions($this->dn,"gofonmacro/macro","goFonMarcoContent");
 
     /* get current content */ 
     $content = $_SESSION['macroManagment']->macrotabs->by_object['macro']->goFonMacroContent;
index 9c5d37c30f014211d3136a783a5930533104029f..75b613fbbaab48091a9bb8338e086423582bbf5d 100755 (executable)
@@ -73,6 +73,8 @@
 <textarea name="goFonMacroContent" style="width:99%;height:300px;font-size:14px;font-family:Arial;">{$goFonMacroContent}</textarea>
 {/render}
 
+<input type='hidden' name='gofonMacroGenericPosted' value='1'>
+
 <!-- Place cursor -->
 <script language="JavaScript" type="text/javascript">
   <!-- // First input field on page
index 4c4749c6e410f07ae7351bc4aeb7812eceb6a581..c1932f5590b33b456369554733e0269fabc22ce6 100644 (file)
@@ -1234,7 +1234,9 @@ class phoneAccount extends plugin
           "plDepends"       => array("user"),
           "plPriority"      => 7,                                 // Position in tabs
           "plSection"       => "personal",                        // This belongs to personal
-          "plCategory"      => array("users"),
+          "plCategory"      => array("gofonreport" => array("description" => _("GOfon reports"),
+                                                  "objectClass" => "")),
+
           "plOptions"       => array(),
 
           "plProvidedAcls"  => array(