Code

Added first part of the role management plugin
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 30 Jun 2009 14:17:04 +0000 (14:17 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 30 Jun 2009 14:17:04 +0000 (14:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13856 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/roleManagement/admin/roleManagement/class_divListRole.inc [new file with mode: 0644]
gosa-plugins/roleManagement/admin/roleManagement/class_roleGeneric.inc [new file with mode: 0644]
gosa-plugins/roleManagement/admin/roleManagement/class_roleManagement.inc [new file with mode: 0644]
gosa-plugins/roleManagement/admin/roleManagement/main.inc [new file with mode: 0644]
gosa-plugins/roleManagement/admin/roleManagement/roleGeneric.tpl [new file with mode: 0644]
gosa-plugins/roleManagement/admin/roleManagement/tabs_roles.inc [new file with mode: 0644]
gosa-plugins/roleManagement/plugin.dsc [new file with mode: 0644]

diff --git a/gosa-plugins/roleManagement/admin/roleManagement/class_divListRole.inc b/gosa-plugins/roleManagement/admin/roleManagement/class_divListRole.inc
new file mode 100644 (file)
index 0000000..bc76d0e
--- /dev/null
@@ -0,0 +1,225 @@
+<?php
+/*
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id: class_divListRole.inc 12852 2008-10-31 16:19:40Z cajus $$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+class divListRole extends MultiSelectWindow
+{
+
+  // Current base 
+  var $selectedBase       = "";
+  var $departments        = array();
+
+  // Regex 
+  var $Regex              = "*";
+
+  // Subsearch checkbox 
+  var $SubSearch          ;
+  var $parent             ;
+  var $ui                 ;
+
+  function divListRole (&$config,$parent)
+  {
+    MultiSelectWindow::MultiSelectWindow($config, "Roles", "roles");
+    
+    $this->parent       = $parent;
+    $this->ui           = get_userinfo();
+    $action_col_size = 90;
+
+    // Set list strings 
+    $this->SetTitle(_("List of roles"));
+    $this->SetSummary(_("List of roles"));
+    $this->EnableAplhabet(true);
+
+    // Result page will look like a headpage 
+    $this->SetHeadpageMode();
+  
+    // Disable buttonsm 
+    $this->EnableCloseButton(false);
+    $this->EnableSaveButton (false);
+
+    // Add checkbox: Toggle all selected / deselected 
+    $chk = "<input type='checkbox' id='select_all' name='select_all' title='"._("Select all")."'
+               onClick='toggle_all_(\"^item_selected_[0-9]*$\",\"select_all\");' >";
+
+    // Set Page col headers 
+    $this->AddHeader(array("string" => $chk,"attach"=>"style='width:20px;'"));
+    $this->AddHeader(array("string" => "&nbsp;", "attach" => "style='text-align:center;width:20px;'"));
+    $this->AddHeader(array("string" => _("Role")." / "._("Department"), "attach" => "style=''"));
+    $this->AddHeader(array("string" => _("Actions"), 
+          "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'"));
+
+    // Add SubSearch checkbox 
+    //$this->AddCheckBox(SEPERATOR);
+    $this->AddCheckBox("SubSearch",  msgPool::selectToView("","subsearch"), 
+        msgPool::selectToView("","subsearch_small"), false);
+
+    // Add regex user input field
+    $this->AddRegex   ("Regex", _("Regular expression for matching role names"), "*" , true);
+  }
+
+
+  function GenHeader()
+  {
+    /* Get all departments within this subtree */
+    $ui= get_userinfo();
+    $first = "";
+    $found = FALSE;
+    $base = $this->config->current['BASE'];
+    $options  = $this->create_department_list($this->module);
+
+    /* Add base */
+    $tmp = array();
+    $tmp[] = array("dn"=>$this->config->current['BASE']);
+    $tmp= array_merge(
+        $tmp,
+        get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", 
+          $this->module, 
+          $base,
+          array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH));
+
+    /* Add a seperator after displaying c&p and snapshot icons ? */
+    $add_sep = false;
+  
+    /* Get copy & paste icon */
+    $acls  = $ui->get_permissions($this->selectedBase,"roles/role");
+    $acl_all= $ui->has_complete_category_acls($this->selectedBase,"roles");
+
+    /* Add default header */
+    $listhead = MultiSelectWindow::get_default_header();
+  
+    /* Add department selector */
+    $listhead .= _("Base")."&nbsp;<select name='CurrentMainBase' 
+      onChange='mainform.submit()' class='center'>$options</select>".
+      " <input class='center' type='image' src='images/lists/submit.png' align='middle' 
+      title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'>&nbsp;";
+
+    /* Create Layers menu */
+    $s  = ".|"._("Actions")."|\n";
+
+    /* Append create options */
+    if(preg_match("/c/",$acls)) {
+      $s .= "..|<img src='images/lists/new.png' alt='' border='0' class='center'>".
+        "&nbsp;"._("Create")."|\n";
+      $s.= "...|<input class='center' type='image' src='plugins/roles/images/new.png' alt=''>".
+        "&nbsp;"._("Roles")."|role_new|\n";
+    }
+
+    /* Multiple options */
+    $s.= "..|---|\n";
+    $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
+      "&nbsp;"._("Remove")."|"."remove_multiple_roles|\n";
+
+    $this->SetDropDownHeaderMenu($s);
+    $this->SetListHeader($listhead);
+  }
+
+
+  function execute()
+  {
+    $this->ClearElementsList();
+    $this->GenHeader();
+  }
+
+  function setEntries($list)
+  {
+    // Defining Links
+    $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
+
+    $action_col_size = 90;
+  
+    $ui = get_userinfo();
+
+    // Assigning roles
+    foreach($list as $key => $val){
+      
+      // Get object permissions
+      $acl    = $ui->get_permissions($val['dn'],"roles/role");
+      $acl_all= $ui->has_complete_category_acls($val['dn'],"roles");
+
+      // Add copy & cut functionality 
+      $actions = $this->parent->get_copypaste_action($val['dn'],"roles","role");
+
+      // Create edit and remove icon buttons 
+      $actions.= "<input class='center' type='image'
+        src='images/lists/edit.png' alt='"._("edit")."' 
+        name='role_edit_%KEY%' title='"._("Edit this entry")."'>";
+      $actions.= $this->parent->get_snapshot_action($val['dn'],$this->module);
+      if(preg_match("/d/",$acl)){
+        $actions.= "<input class='center' type='image'
+          src='images/lists/trash.png' alt='"._("delete")."' 
+          name='role_del_%KEY%' title='"._("Delete this entry")."'>";
+      }else{
+        $actions.= "<img class='center' src='images/empty.png' alt='&nbsp;'
+          title='".msgPool::permDelete()."'>";
+      }
+
+      // Append role descriptio, if available
+      $title = "title='".preg_replace('/ /', '&nbsp;', LDAP::fix($val['dn']))."'";
+      if(!isset($val['description'][0])){
+        $desc = "";
+      }else{
+        $desc = " - [ ".$val['description'][0]." ]";
+      }
+
+      // Cutted entry are displayed in a light grey as indication.
+      $display = $val['cn'][0].$desc;
+      if($this->parent->CopyPasteHandler){
+        foreach($this->parent->CopyPasteHandler->queue as $queue_key => $queue_data){
+          if($queue_data['dn'] == $val['dn']) {
+            $display = "<font color='#999999'>".$display."</font>";
+            break;
+          }
+        }
+      }
+
+      // Append the entry to the divlist
+      $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' 
+          name='item_selected_".$key."'>" ,
+          "attach" => "style='width:20px;'");
+      $field1 = array("string" => "<img src='plugins/roles/images/role.png' 
+          alt='"._("Role")."' ".$title.">", 
+          "attach" => "style='text-align:center;width: 20px;'");
+      $field2 = array("string" => sprintf($editlink,$key,$display), 
+          "attach" => "style='' ".$title);
+      $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions), 
+          "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
+
+      $this->AddElement(array($field0,$field1,$field2,$field4));
+    }
+   
+    // Create the list summary 
+    $num_deps=0;
+    if(!$this->SubSearch){
+      $num_deps = count($this->Added_Departments);
+    }
+    $num_objs = count($list);
+    $num_obj_str = _("Number of listed roles");
+    $num_dep_str = _("Number of listed departments");
+    $str = "<img class='center' src='plugins/roles/images/role.png'
+              title='".$num_obj_str."' alt='".$num_obj_str."'>&nbsp;".$num_objs."&nbsp;&nbsp;&nbsp;&nbsp;";
+    $str.= "<img class='center' src='images/lists/folder.png'
+              title='".$num_dep_str."' alt='".$num_dep_str."'>&nbsp;".$num_deps."&nbsp;&nbsp;&nbsp;&nbsp;";
+    $this->set_List_Bottom_Info($str);
+  }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/roleManagement/admin/roleManagement/class_roleGeneric.inc b/gosa-plugins/roleManagement/admin/roleManagement/class_roleGeneric.inc
new file mode 100644 (file)
index 0000000..0982157
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/*
+* This code is part of GOsa (http://www.gosa-project.org)
+* Copyright (C) 2003-2008 GONICUS GmbH
+*
+* ID: $$Id: class_roleManagement.inc 13520 2009-03-09 14:54:13Z hickert $$
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+
+class roleGeneric extends plugin {
+
+  var $cn ="";
+  
+  function __construct($config,$dn){
+    plugin::plugin($config,$dn);
+  }
+
+
+  function execute(){
+    $smarty = get_smarty();
+
+
+    return($smarty->fetch(get_template_path('roleGeneric.tpl',TRUE,dirname(__FILE__))));
+  }
+
+}
+
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/roleManagement/admin/roleManagement/class_roleManagement.inc b/gosa-plugins/roleManagement/admin/roleManagement/class_roleManagement.inc
new file mode 100644 (file)
index 0000000..6752cde
--- /dev/null
@@ -0,0 +1,252 @@
+<?php
+/*
+* This code is part of GOsa (http://www.gosa-project.org)
+* Copyright (C) 2003-2008 GONICUS GmbH
+*
+* ID: $$Id: class_roleManagement.inc 13520 2009-03-09 14:54:13Z hickert $$
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+class roleManagement extends plugin
+{
+  /* Definitions */
+  var $plHeadline= "Roles";
+  var $plDescription= "Manage roles";
+
+  // Copy and paste handler 
+  var $CopyPasteHandler = NULL;
+
+  // The headpage list handler. 
+  var $DivListRoles    = NULL;
+
+  // A list of currently visible roles
+  var $roles = array();
+
+  // A list of currently edited/removed/aso roles.
+  var $dns = array();
+
+  // Permission modules to use.
+  var $acl_module   = array("roles");  
+
+  // Internal: Is truw while objects are pasted.
+  var $start_pasting_copied_objects = FALSE;
+
+  
+  // Construct and initialize the plugin 
+  function __construct (&$config, $dn= NULL)
+  {
+    // Include config object 
+    $this->config= &$config;
+    $this->ui= get_userinfo();
+
+    // Copy & Paste enabled ?
+    if ($this->config->get_cfg_value("copyPaste") == "true"){
+      $this->CopyPasteHandler = new CopyPasteHandler($this->config);
+    }
+
+    // Initialize the corresponding list class.
+    $this->DivListRoles = new divListRole($this->config,$this);
+  }
+
+
+  function execute()
+  {
+    // Call parent execute 
+    plugin::execute();
+
+    /* Variables to restore after 'entry locked' warning was displayed */
+    session::set('LOCK_VARS_TO_USE',array('/^role_/'));
+
+    $smarty     = get_smarty();
+    $s_action   = "";
+    $s_entry    = "";
+
+    /***************
+     * Handle _POST/_GET variables
+     ***************/
+   
+    // Get entry related posts 
+    foreach($_POST as $name => $value){
+      if(preg_match("/^role_edit_/",$name)){
+        $s_action = "edit";  
+        $s_entry = preg_replace("/^role_edit_([0-9]*)_.*$/","\\1",$name);
+        break;
+      }
+      if(preg_match("/^role_del_/",$name)){
+        $s_action = "del";  
+        $s_entry = preg_replace("/^role_del_([0-9]*)_.*$/","\\1",$name);
+        break;
+      }
+    }
+    if(isset($_GET['act']) && $_GET['act'] == "edit_entry" && isset($_GET['id'])){
+      $id = $_GET['id'];
+      if(isset($this->roles[$id])){
+        $s_action = "edit";
+        $s_entry = $id;
+      }
+    }
+    // Get menu related posts 
+    if(isset($_POST['menu_action'])) {
+      if($_POST['menu_action'] == "role_new"){
+        $s_action = "new";
+      }elseif($_POST['menu_action'] == "remove_multiple_roles"){
+        $s_action = "remove_multiple";
+      }
+    }
+
+
+    /***************
+     * New handling
+     ***************/
+
+    if($s_action == "new"){
+      $this->dialog = new roletabs($this->config, $this->config->data['TABS']['ROLETABS'], "new");
+    }
+    
+    /***************
+     * Edit handling
+     ***************/
+
+    if($s_action == "edit"){
+      if(!isset($this->roles[$s_entry])){
+        trigger_error("Unknown entry!"); 
+      }else{
+        $entry = $this->roles[$s_entry];
+        print_a($entry);
+      }
+    }
+
+    /***************
+     * Dialog handling
+     ***************/
+
+    if (isset($_POST['edit_cancel'])){
+      if(isset($this->grouptab->dn)){
+        $this->remove_lock();
+      }
+      $this->dialog= NULL;
+      set_object_info();
+    }
+
+    if($this->dialog instanceOf tabs){
+      $this->dialog->save_object();
+      $display= $this->dialog->execute();
+
+      if($this->dialog->read_only   == TRUE){
+        $display.= "<p style=\"text-align:right\">
+          <input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">
+          </p>";
+      }else{
+
+        $display.= "<p style=\"text-align:right\">\n";
+        $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" 
+          value=\"".msgPool::okButton(). "\">\n";
+        $display.= "&nbsp;\n";
+        if ($this->dn != "new"){
+          $display.= "<input type=submit name=\"edit_apply\" 
+            value=\"".msgPool::applyButton()."\">\n";
+          $display.= "&nbsp;\n";
+        }
+        $display.= "<input type=submit name=\"edit_cancel\" 
+          value=\"".msgPool::cancelButton()."\">\n";
+        $display.= "</p>";
+      }
+      return ($display);
+    }
+
+
+    /***************
+     * List handling
+     ***************/
+
+    // Display dialog with group list 
+    $this->DivListRoles->parent = $this;
+    $this->DivListRoles->execute();
+
+    // Add departments if subsearch is disabled 
+    if(!$this->DivListRoles->SubSearch){
+      $this->DivListRoles->AddDepartments($this->DivListRoles->selectedBase,4,1);
+    }
+    $this->reload ();
+    $this->DivListRoles->setEntries($this->roles);
+    return($this->DivListRoles->Draw());
+  }
+
+
+  // Refreshes the list of known role objects. 
+  function reload()
+  {
+
+    // Get current ldap base and filter settings.
+    $base     = $this->DivListRoles->selectedBase;
+    $Regex    = $this->DivListRoles->Regex;
+
+    // Search and fetch all matching role objects.
+    $this->roles = array();
+    $ldap = $this->config->get_ldap_link();
+    $ldap->search("(objectClass=gosaGroupOfNames)",array("cn","description"));
+    $tmp = array();
+    while($attrs = $ldap->fetch()){
+      $tmp[$attrs['cn'][0].$attrs['dn']] = $attrs;
+    }
+    
+    uksort($tmp, 'strnatcasecmp');
+    $this->roles = array_values($tmp);
+  }
+
+
+  /* \brief  Returns a list of selected entry ids.
+   *         E.g. remove multiple entries.
+   * @return Array  A list of entry IDs
+   */
+  function list_get_selected_items()
+  {
+    $ids = array();
+    foreach($_POST as $name => $value){
+      if(preg_match("/^item_selected_[0-9]*$/",$name)){
+        $id   = preg_replace("/^item_selected_/","",$name);
+        $ids[$id] = $id;
+      }
+    }
+    return($ids);
+  }
+
+
+  function remove_lock()
+  {
+  }
+
+
+  /* Return departments, that will be included within snapshot detection 
+   */
+  function get_used_snapshot_bases()
+  {
+    return(array(get_ou('roleRDN').$this->DivListRoles->selectedBase));
+  }
+
+  
+  function save_object()
+  {
+    $this->DivListRoles->save_object();
+    if(is_object($this->CopyPasteHandler)){
+      $this->CopyPasteHandler->save_object();
+    }
+  }
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/roleManagement/admin/roleManagement/main.inc b/gosa-plugins/roleManagement/admin/roleManagement/main.inc
new file mode 100644 (file)
index 0000000..28c548c
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/*
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id: main.inc 13288 2008-12-12 14:54:13Z hickert $$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+/* Remove locks created by this plugin
+*/
+if ($remove_lock){
+  if(session::is_set('roleManagement')){
+    $macl = session::get('roleManagement');
+    $macl->remove_lock();
+  }
+}
+
+/* Remove this plugin from session
+*/
+if ( $cleanup ){
+  session::un_set('roleManagement');
+}else{
+
+  /* Create object object on demand */
+  if (!session::is_set('roleManagement')){
+    session::set('roleManagement',new roleManagement ($config));
+    
+  }
+  $roleManagement = session::get('roleManagement');
+
+  /* Execute formular */
+  $roleManagement->save_object();
+  $output= $roleManagement->execute ();
+
+  /* Page header*/
+  if (get_object_info() != ""){
+    $display= print_header(get_template_path('plugins/roleManagement/images/plugin.png'),
+        _("Roles"),
+        "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/locked.png')."\"> ".
+        LDAP::fix(get_object_info()));
+  } else {
+    $display= print_header(get_template_path('plugins/roleManagement/images/plugin.png'), _("roleManagement"));
+  }
+
+  $display.= $output;
+
+  /* Store changes  in session */
+  session::set('roleManagement',$roleManagement);
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/roleManagement/admin/roleManagement/roleGeneric.tpl b/gosa-plugins/roleManagement/admin/roleManagement/roleGeneric.tpl
new file mode 100644 (file)
index 0000000..45f95e2
--- /dev/null
@@ -0,0 +1,169 @@
+       <tr>
+               <td>{t}x121Address{/t}:</td>
+               <td>
+                       {render acl=$x121AddressACL}
+                        <input type='text' value='{$x121Address}' name='x121Address'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}registeredAddress{/t}:</td>
+               <td>
+                       {render acl=$registeredAddressACL}
+                        <input type='text' value='{$registeredAddress}' name='registeredAddress'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}destinationIndicator{/t}:</td>
+               <td>
+                       {render acl=$destinationIndicatorACL}
+                        <input type='text' value='{$destinationIndicator}' name='destinationIndicator'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}preferredDeliveryMethod{/t}:</td>
+               <td>
+                       {render acl=$preferredDeliveryMethodACL}
+                        <input type='text' value='{$preferredDeliveryMethod}' name='preferredDeliveryMethod'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}telexNumber{/t}:</td>
+               <td>
+                       {render acl=$telexNumberACL}
+                        <input type='text' value='{$telexNumber}' name='telexNumber'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}teletexTerminalIdentifier{/t}:</td>
+               <td>
+                       {render acl=$teletexTerminalIdentifierACL}
+                        <input type='text' value='{$teletexTerminalIdentifier}' name='teletexTerminalIdentifier'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}telephoneNumber{/t}:</td>
+               <td>
+                       {render acl=$telephoneNumberACL}
+                        <input type='text' value='{$telephoneNumber}' name='telephoneNumber'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}internationaliSDNNumber{/t}:</td>
+               <td>
+                       {render acl=$internationaliSDNNumberACL}
+                        <input type='text' value='{$internationaliSDNNumber}' name='internationaliSDNNumber'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}facsimileTelephoneNumber{/t}:</td>
+               <td>
+                       {render acl=$facsimileTelephoneNumberACL}
+                        <input type='text' value='{$facsimileTelephoneNumber}' name='facsimileTelephoneNumber'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}seeAlso{/t}:</td>
+               <td>
+                       {render acl=$seeAlsoACL}
+                        <input type='text' value='{$seeAlso}' name='seeAlso'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}roleOccupant{/t}:</td>
+               <td>
+                       {render acl=$roleOccupantACL}
+                        <input type='text' value='{$roleOccupant}' name='roleOccupant'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}preferredDeliveryMethod{/t}:</td>
+               <td>
+                       {render acl=$preferredDeliveryMethodACL}
+                        <input type='text' value='{$preferredDeliveryMethod}' name='preferredDeliveryMethod'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}street{/t}:</td>
+               <td>
+                       {render acl=$streetACL}
+                        <input type='text' value='{$street}' name='street'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}postOfficeBox{/t}:</td>
+               <td>
+                       {render acl=$postOfficeBoxACL}
+                        <input type='text' value='{$postOfficeBox}' name='postOfficeBox'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}postalCode{/t}:</td>
+               <td>
+                       {render acl=$postalCodeACL}
+                        <input type='text' value='{$postalCode}' name='postalCode'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}postalAddress{/t}:</td>
+               <td>
+                       {render acl=$postalAddressACL}
+                        <input type='text' value='{$postalAddress}' name='postalAddress'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}physicalDeliveryOfficeName{/t}:</td>
+               <td>
+                       {render acl=$physicalDeliveryOfficeNameACL}
+                        <input type='text' value='{$physicalDeliveryOfficeName}' name='physicalDeliveryOfficeName'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}ou{/t}:</td>
+               <td>
+                       {render acl=$ouACL}
+                        <input type='text' value='{$ou}' name='ou'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}st{/t}:</td>
+               <td>
+                       {render acl=$stACL}
+                        <input type='text' value='{$st}' name='st'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}l{/t}:</td>
+               <td>
+                       {render acl=$lACL}
+                        <input type='text' value='{$l}' name='l'>
+                       {/render}
+               </td>
+       </tr>
+       <tr>
+               <td>{t}description{/t}:</td>
+               <td>
+                       {render acl=$descriptionACL}
+                        <input type='text' value='{$description}' name='description'>
+                       {/render}
+               </td>
+       </tr>
+
diff --git a/gosa-plugins/roleManagement/admin/roleManagement/tabs_roles.inc b/gosa-plugins/roleManagement/admin/roleManagement/tabs_roles.inc
new file mode 100644 (file)
index 0000000..fc660f0
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+/*
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id: tabs_group.inc 9275 2008-03-04 07:29:22Z cajus $$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+class roletabs extends tabs
+{
+
+       function __construct($config, $data, $dn)
+       {
+               tabs::tabs($config, $data, $dn,"roles");
+               $this->addSpecialTabs();
+       }
+
+       function save_object($save_current= FALSE)
+       {
+               tabs::save_object($save_current);
+
+               /* Update reference, transfer variables */
+               $baseobject= $this->by_object['roleGeneric'];
+               foreach ($this->by_object as $name => $obj){
+
+                       /* Don't touch base object */
+                       if ($name != 'roleGeneric'){
+                               $obj->parent= &$this;
+                               $obj->cn= $baseobject->cn;
+                               $this->by_object[$name]= $obj;
+                       }
+               }
+       }
+
+  function save($ignore_account= FALSE)
+       {
+               $baseobject= $this->by_object['roleGeneric'];
+
+               /* Check for new 'dn', in order to propagate the
+                  'dn' to all plugins */
+               $new_dn= 'cn='.$baseobject->cn.','.get_ou("roleRDN").$baseobject->base;
+
+               /* Move group? */
+               if ($this->dn != $new_dn){
+
+                       /* Write entry on new 'dn' */
+                       if ($this->dn != "new"){
+                               $baseobject->update_acls($this->dn,$new_dn);
+                               $baseobject->move($this->dn, $new_dn);
+                               $this->by_object['roleGeneric']= $baseobject;
+                       }
+
+                       /* Happen to use the new one */
+                       $this->dn= $new_dn;
+               }
+               $ret= tabs::save();
+               return $ret;
+       }
+}
+
+?>
diff --git a/gosa-plugins/roleManagement/plugin.dsc b/gosa-plugins/roleManagement/plugin.dsc
new file mode 100644 (file)
index 0000000..c485096
--- /dev/null
@@ -0,0 +1,7 @@
+[gosa-plugin]
+name = roleManagement
+description = "System management base plugin"
+version = 2.6.4
+author = "Cajus Pollmeier <pollmeier@gonicus.de>"
+homepage = https://oss.gonicus.de/labs/gosa/
+provides = roleManagement