summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b3469ad)
raw | patch | inline | side by side (parent: b3469ad)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 16 Sep 2010 08:48:18 +0000 (08:48 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 16 Sep 2010 08:48:18 +0000 (08:48 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19700 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl b/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl
--- /dev/null
@@ -0,0 +1,77 @@
+
+
+<table width="100%">
+ <tr>
+ <td style='width:50%;'>
+
+ <h3>{t}Device{/t}</h3>
+ <table>
+ <tr>
+ <td><LABEL for='name'>{t}Name{/t}</LABEL></td>
+ <td> <input type="text" name="cn" value="{$cn}"></td>
+ </tr>
+ <tr>
+ <td><LABEL for='description'>{t}Description{/t}</LABEL></td>
+ <td> <input type="text" name="description" value="{$description}"></td>
+ </tr>
+ </table>
+ <hr>
+ <table>
+ <tr>
+ <td><LABEL for='ou'>{t}Organizational unit{/t}</LABEL></td>
+ <td> <input type="text" name="ou" value="{$ou}"></td>
+ </tr>
+ <tr>
+ <td><LABEL for='o'>{t}Organizaton{/t}</LABEL></td>
+ <td> <input type="text" name="o" value="{$o}"></td>
+ </tr>
+ <tr>
+ <td><LABEL for='l'>{t}Location{/t}</LABEL></td>
+ <td> <input type="text" name="l" value="{$l}"></td>
+ </tr>
+ <tr>
+ <td><LABEL for='serialNumber'>{t}Serial number{/t}</LABEL></td>
+ <td> <input type="text" name="serialNumber" value="{$serialNumber}"></td>
+ </tr>
+ <tr>
+ <td><LABEL for='seeAlso'>{t}See also{/t}</LABEL></td>
+ <td> <input type="text" name="seeAlso" value="{$seeAlso}"></td>
+ </tr>
+ <tr>
+ <td><LABEL for='owner'>{t}Owner{/t}</LABEL></td>
+ <td> <input type="text" name="owner" value="{$owner}"></td>
+ </tr>
+ </table>
+ </td>
+ <td class='left-border' style='padding-left:5px;'>
+ <h3>{t}Registered device{/t}</h3>
+ <table>
+ <tr>
+ <td><LABEL for='manager'>{t}Manager{/t}</LABEL></td>
+ <td> <input type="text" name="manager" value="{$manager}"></td>
+ </tr>
+ <tr>
+ <td><LABEL for='deviceUUID'>{t}Device UUID{/t}</LABEL></td>
+ <td> <input type="text" name="deviceUUID" value="{$deviceUUID}"></td>
+ </tr>
+ <tr>
+ <td><LABEL for='deviceStatus'>{t}Status{/t}</LABEL></td>
+ <td> <input type="text" name="deviceStatus" value="{$deviceStatus}"></td>
+ </tr>
+ </table>
+
+ <hr>
+ <h3>{t}Network settings{/t}</h3>
+ <table>
+ <tr>
+ <td><LABEL for='ipHostNumber'>{t}IP-address{/t}</LABEL></td>
+ <td> <input type="text" name="ipHostNumber" value="{$ipHostNumber}"></td>
+ </tr>
+ <tr>
+ <td><LABEL for='macAddress'>{t}MAC-address{/t}</LABEL></td>
+ <td> <input type="text" name="macAddress" value="{$macAddress}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/DeviceTab.inc b/gosa-plugins/goto/admin/systems/goto/Device/DeviceTab.inc
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+class DeviceTab extends tabs
+{
+ function save($ignore_account= FALSE)
+ {
+ // Prepare object DN
+ $baseobject= $this->by_object['Device'];
+ $cn = preg_replace('/,/', '\,', $baseobject->cn);
+ $cn = preg_replace('/"/', '\"', $cn);
+ $this->dn= "cn=".$cn.",ou=systems,".$baseobject->base;
+ $baseobject->dn= $this->dn;
+
+ // Object moved?
+ if($this->dn != $baseobject->orig_dn && $baseobject->orig_dn != "new"){
+ $baseobject->update_acls($baseobject->orig_dn,$this->dn);
+ $baseobject->move($baseobject->orig_dn,$this->dn);
+ }
+
+ // Populate values
+ foreach ($this->by_object as $key => $obj){
+ $this->by_object[$key]->dn= $this->dn;
+ $this->by_object[$key]->cn= $baseobject->cn;
+ }
+
+ // Save now
+ tabs::save(TRUE);
+ }
+}
+
+?>
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc
--- /dev/null
@@ -0,0 +1,115 @@
+<?php
+
+
+class Device extends plugin
+{
+
+ public $objectclasses = array('top','device');
+ public $attributes = array("cn","serialNumber","seeAlso","owner","ou","o","ipHostNumber",
+ "l","description","manager","deviceUUID","deviceStatus","macAddress","deviceType");
+
+ public $dynClasses = array(
+ 'ieee802Device' => array('macAddress'),
+ 'registeredDevice' => array('deviceStatus','deviceUUID','manager','deviceType'),
+ 'ipHost' => array('ipHostNumber'));
+
+ public $cn = "";
+ public $serialNumber = "";
+ public $seeAlso = "";
+ public $owner = "";
+ public $ou = "";
+ public $o = "";
+ public $l = "";
+ public $description = "";
+ public $manager = "";
+ public $deviceUUID = "";
+ public $deviceStatus = "";
+ public $deviceType = "";
+ public $ipHostNumber = "";
+ public $macAddress = "";
+
+ public $base = "";
+ public $orig_dn ="";
+
+ function __construct(&$config, $dn)
+ {
+ plugin::plugin($config, $dn);
+ $this->base = $this->config->current['BASE'];
+ $this->orig_dn = $this->dn;
+ }
+
+ function execute()
+ {
+ plugin::execute();
+ $smarty = get_smarty();
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr, $this->$attr);
+ }
+ return($smarty->fetch(get_template_path('goto/devices/Device.tpl', TRUE)));
+ }
+
+
+ function save()
+ {
+
+ plugin::save();
+
+ // Append and remove dynmic object classes
+ foreach($this->dynClasses as $oc => $attrs){
+ $this->attrs['objectClass'] = array_remove_entries(array($oc), $this->attrs['objectClass']);
+ foreach($attrs as $attr){
+ if(isset($this->attrs[$attr]) && !empty($this->attrs[$attr])){
+ $this->attrs['objectClass'][] = $oc;
+ break;
+ }
+ }
+ }
+
+ $this->cleanup();
+ $ldap=$this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->cd($this->dn);
+
+ if($this->initially_was_account){
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->add($this->attrs);
+ }
+ echo $ldap->get_error();
+ }
+
+
+ static function plInfo()
+ {
+ return (array(
+ "plShortName" => _("Device"),
+ "plDescription" => _("Device"),
+ "plSelfModify" => FALSE,
+ "plDepends" => array(),
+ "plPriority" => 1,
+ "plSection" => array("administration"),
+ "plCategory" => array(
+ "Device" => array(
+ "description" => _("Device"),
+ "objectClass" => "Device")),
+ "plProvidedAcls" => array(
+ "cn" => _("Name"),
+ "serialNumber" => _("Serial number"),
+ "seeAlso" => _("See also"),
+ "owner" => _("Owner"),
+ "ou" => _("Organizational unit"),
+ "o" => _("Organization"),
+ "l" => _("Location"),
+ "description" => _("Description"),
+ "manager" => _("Manager"),
+ "deviceUUID" => _("Uuid"),
+ "deviceStatus" => _("Stauts"),
+ "macAddress" => _("MAC address"),
+ "ipHostNumber" => _("IP address")
+ )
+ )
+ );
+ }
+}
+
+?>
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_installRecipe.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_installRecipe.inc
--- /dev/null
@@ -0,0 +1,81 @@
+<?php
+
+class installRecipe extends plugin
+{
+ public $member = array();
+ public $ksTemplate = "";
+ public $ksKeyboardlayout = "";
+ public $ksSystemLocale = "";
+ public $ksTimezone = "";
+ public $ksTimeUTC = "";
+ public $ksNTPServer = "";
+ public $ksMirror = "";
+ public $ksMirrorTorrent = "";
+ public $ksRootEnabled = "";
+ public $ksRootPasswordHash = "";
+ public $ksKernelPackage = "";
+ public $ksPartitionTable = "";
+
+ public $objectclasses = array('installRecipe');
+ public $attributes = array("member","ksTemplate","ksKeyboardlayout","ksSystemLocale",
+ "ksTimezone","ksTimeUTC","ksNTPServer","ksMirror","ksMirrorTorrent",
+ "ksRootEnabled","ksRootPasswordHash","ksKernelPackage","ksPartitionTable");
+
+ function __construct(&$config, $dn)
+ {
+ plugin::plugin($config, $dn);
+ }
+
+ function execute()
+ {
+ plugin::execute();
+ $smarty = get_smarty();
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr, $this->$attr);
+ }
+ return($smarty->fetch(get_template_path('goto/devices/installRecipe.tpl', TRUE)));
+ }
+
+
+ function save()
+ {
+ plugin::save();
+ $this->cleanup();
+ $ldap=$this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ echo $ldap->get_error();
+ }
+
+ static function plInfo()
+ {
+ return (array(
+ "plShortName" => _("Device"),
+ "plDescription" => _("Registered device"),
+ "plSelfModify" => FALSE,
+ "plDepends" => array(),
+ "plPriority" => 1,
+ "plSection" => array("administration"),
+ "plCategory" => array("registeredDevice"),
+ "plProvidedAcls" => array(
+ "member" => _("Member"),
+ "ksTemplate" => _("Template"),
+ "ksKeyboardlayout" => _("Keyboard layout"),
+ "ksSystemLocale" => _("System locale"),
+ "ksTimezone" => _("Timezone"),
+ "ksTimeUTC" => _("Time"),
+ "ksNTPServer" => _("NTP-Server"),
+ "ksMirror" => _("Kickstart mirror"),
+ "ksMirrorTorrent" => _("Kickstart torrent mirror"),
+ "ksRootEnabled" => _("Root login enabled"),
+ "ksRootPasswordHash" => _("Root password hash"),
+ "ksKernelPackage" => _("Kernal package"),
+ "ksPartitionTable" => _("Partition table")
+ )
+ )
+ );
+ }
+}
+
+?>
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/installRecipe.tpl b/gosa-plugins/goto/admin/systems/goto/Device/installRecipe.tpl
--- /dev/null
@@ -0,0 +1 @@
+test
diff --git a/gosa-plugins/goto/admin/systems/goto/devices/Device.tpl b/gosa-plugins/goto/admin/systems/goto/devices/Device.tpl
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-<table width="100%">
- <tr>
- <td style='width:50%;'>
-
- <h3>{t}Device{/t}</h3>
- <table>
- <tr>
- <td><LABEL for='name'>{t}Name{/t}</LABEL></td>
- <td> <input type="text" name="cn" value="{$cn}"></td>
- </tr>
- <tr>
- <td><LABEL for='description'>{t}Description{/t}</LABEL></td>
- <td> <input type="text" name="description" value="{$description}"></td>
- </tr>
- </table>
- <hr>
- <table>
- <tr>
- <td><LABEL for='ou'>{t}Organizational unit{/t}</LABEL></td>
- <td> <input type="text" name="ou" value="{$ou}"></td>
- </tr>
- <tr>
- <td><LABEL for='o'>{t}Organizaton{/t}</LABEL></td>
- <td> <input type="text" name="o" value="{$o}"></td>
- </tr>
- <tr>
- <td><LABEL for='l'>{t}Location{/t}</LABEL></td>
- <td> <input type="text" name="l" value="{$l}"></td>
- </tr>
- <tr>
- <td><LABEL for='serialNumber'>{t}Serial number{/t}</LABEL></td>
- <td> <input type="text" name="serialNumber" value="{$serialNumber}"></td>
- </tr>
- <tr>
- <td><LABEL for='seeAlso'>{t}See also{/t}</LABEL></td>
- <td> <input type="text" name="seeAlso" value="{$seeAlso}"></td>
- </tr>
- <tr>
- <td><LABEL for='owner'>{t}Owner{/t}</LABEL></td>
- <td> <input type="text" name="owner" value="{$owner}"></td>
- </tr>
- </table>
- </td>
- <td class='left-border' style='padding-left:5px;'>
- <h3>{t}Registered device{/t}</h3>
- <table>
- <tr>
- <td><LABEL for='manager'>{t}Manager{/t}</LABEL></td>
- <td> <input type="text" name="manager" value="{$manager}"></td>
- </tr>
- <tr>
- <td><LABEL for='deviceUUID'>{t}Device UUID{/t}</LABEL></td>
- <td> <input type="text" name="deviceUUID" value="{$deviceUUID}"></td>
- </tr>
- <tr>
- <td><LABEL for='deviceStatus'>{t}Status{/t}</LABEL></td>
- <td> <input type="text" name="deviceStatus" value="{$deviceStatus}"></td>
- </tr>
- </table>
-
- <hr>
- <h3>{t}Network settings{/t}</h3>
- <table>
- <tr>
- <td><LABEL for='ipHostNumber'>{t}IP-address{/t}</LABEL></td>
- <td> <input type="text" name="ipHostNumber" value="{$ipHostNumber}"></td>
- </tr>
- <tr>
- <td><LABEL for='macAddress'>{t}MAC-address{/t}</LABEL></td>
- <td> <input type="text" name="macAddress" value="{$macAddress}"></td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
diff --git a/gosa-plugins/goto/admin/systems/goto/devices/DeviceTab.inc b/gosa-plugins/goto/admin/systems/goto/devices/DeviceTab.inc
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-class DeviceTab extends tabs
-{
- function save($ignore_account= FALSE)
- {
- // Prepare object DN
- $baseobject= $this->by_object['Device'];
- $cn = preg_replace('/,/', '\,', $baseobject->cn);
- $cn = preg_replace('/"/', '\"', $cn);
- $this->dn= "cn=".$cn.",ou=systems,".$baseobject->base;
- $baseobject->dn= $this->dn;
-
- // Object moved?
- if($this->dn != $baseobject->orig_dn && $baseobject->orig_dn != "new"){
- $baseobject->update_acls($baseobject->orig_dn,$this->dn);
- $baseobject->move($baseobject->orig_dn,$this->dn);
- }
-
- // Populate values
- foreach ($this->by_object as $key => $obj){
- $this->by_object[$key]->dn= $this->dn;
- $this->by_object[$key]->cn= $baseobject->cn;
- }
-
- // Save now
- tabs::save(TRUE);
- }
-}
-
-?>
diff --git a/gosa-plugins/goto/admin/systems/goto/devices/class_Device.inc b/gosa-plugins/goto/admin/systems/goto/devices/class_Device.inc
+++ /dev/null
@@ -1,115 +0,0 @@
-<?php
-
-
-class Device extends plugin
-{
-
- public $objectclasses = array('top','device');
- public $attributes = array("cn","serialNumber","seeAlso","owner","ou","o","ipHostNumber",
- "l","description","manager","deviceUUID","deviceStatus","macAddress","deviceType");
-
- public $dynClasses = array(
- 'ieee802Device' => array('macAddress'),
- 'registeredDevice' => array('deviceStatus','deviceUUID','manager','deviceType'),
- 'ipHost' => array('ipHostNumber'));
-
- public $cn = "";
- public $serialNumber = "";
- public $seeAlso = "";
- public $owner = "";
- public $ou = "";
- public $o = "";
- public $l = "";
- public $description = "";
- public $manager = "";
- public $deviceUUID = "";
- public $deviceStatus = "";
- public $deviceType = "";
- public $ipHostNumber = "";
- public $macAddress = "";
-
- public $base = "";
- public $orig_dn ="";
-
- function __construct(&$config, $dn)
- {
- plugin::plugin($config, $dn);
- $this->base = $this->config->current['BASE'];
- $this->orig_dn = $this->dn;
- }
-
- function execute()
- {
- plugin::execute();
- $smarty = get_smarty();
- foreach($this->attributes as $attr){
- $smarty->assign($attr, $this->$attr);
- }
- return($smarty->fetch(get_template_path('goto/devices/Device.tpl', TRUE)));
- }
-
-
- function save()
- {
-
- plugin::save();
-
- // Append and remove dynmic object classes
- foreach($this->dynClasses as $oc => $attrs){
- $this->attrs['objectClass'] = array_remove_entries(array($oc), $this->attrs['objectClass']);
- foreach($attrs as $attr){
- if(isset($this->attrs[$attr]) && !empty($this->attrs[$attr])){
- $this->attrs['objectClass'][] = $oc;
- break;
- }
- }
- }
-
- $this->cleanup();
- $ldap=$this->config->get_ldap_link();
- $ldap->cd($this->config->current['BASE']);
- $ldap->cd($this->dn);
-
- if($this->initially_was_account){
- $ldap->modify($this->attrs);
- }else{
- $ldap->add($this->attrs);
- }
- echo $ldap->get_error();
- }
-
-
- static function plInfo()
- {
- return (array(
- "plShortName" => _("Device"),
- "plDescription" => _("Device"),
- "plSelfModify" => FALSE,
- "plDepends" => array(),
- "plPriority" => 1,
- "plSection" => array("administration"),
- "plCategory" => array(
- "Device" => array(
- "description" => _("Device"),
- "objectClass" => "Device")),
- "plProvidedAcls" => array(
- "cn" => _("Name"),
- "serialNumber" => _("Serial number"),
- "seeAlso" => _("See also"),
- "owner" => _("Owner"),
- "ou" => _("Organizational unit"),
- "o" => _("Organization"),
- "l" => _("Location"),
- "description" => _("Description"),
- "manager" => _("Manager"),
- "deviceUUID" => _("Uuid"),
- "deviceStatus" => _("Stauts"),
- "macAddress" => _("MAC address"),
- "ipHostNumber" => _("IP address")
- )
- )
- );
- }
-}
-
-?>
diff --git a/gosa-plugins/goto/admin/systems/goto/devices/class_installRecipe.inc b/gosa-plugins/goto/admin/systems/goto/devices/class_installRecipe.inc
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-
-class installRecipe extends plugin
-{
- public $member = array();
- public $ksTemplate = "";
- public $ksKeyboardlayout = "";
- public $ksSystemLocale = "";
- public $ksTimezone = "";
- public $ksTimeUTC = "";
- public $ksNTPServer = "";
- public $ksMirror = "";
- public $ksMirrorTorrent = "";
- public $ksRootEnabled = "";
- public $ksRootPasswordHash = "";
- public $ksKernelPackage = "";
- public $ksPartitionTable = "";
-
- public $objectclasses = array('installRecipe');
- public $attributes = array("member","ksTemplate","ksKeyboardlayout","ksSystemLocale",
- "ksTimezone","ksTimeUTC","ksNTPServer","ksMirror","ksMirrorTorrent",
- "ksRootEnabled","ksRootPasswordHash","ksKernelPackage","ksPartitionTable");
-
- function __construct(&$config, $dn)
- {
- plugin::plugin($config, $dn);
- }
-
- function execute()
- {
- plugin::execute();
- $smarty = get_smarty();
- foreach($this->attributes as $attr){
- $smarty->assign($attr, $this->$attr);
- }
- return($smarty->fetch(get_template_path('goto/devices/installRecipe.tpl', TRUE)));
- }
-
-
- function save()
- {
- plugin::save();
- $this->cleanup();
- $ldap=$this->config->get_ldap_link();
- $ldap->cd($this->config->current['BASE']);
- $ldap->cd($this->dn);
- $ldap->modify($this->attrs);
- echo $ldap->get_error();
- }
-
- static function plInfo()
- {
- return (array(
- "plShortName" => _("Device"),
- "plDescription" => _("Registered device"),
- "plSelfModify" => FALSE,
- "plDepends" => array(),
- "plPriority" => 1,
- "plSection" => array("administration"),
- "plCategory" => array("registeredDevice"),
- "plProvidedAcls" => array(
- "member" => _("Member"),
- "ksTemplate" => _("Template"),
- "ksKeyboardlayout" => _("Keyboard layout"),
- "ksSystemLocale" => _("System locale"),
- "ksTimezone" => _("Timezone"),
- "ksTimeUTC" => _("Time"),
- "ksNTPServer" => _("NTP-Server"),
- "ksMirror" => _("Kickstart mirror"),
- "ksMirrorTorrent" => _("Kickstart torrent mirror"),
- "ksRootEnabled" => _("Root login enabled"),
- "ksRootPasswordHash" => _("Root password hash"),
- "ksKernelPackage" => _("Kernal package"),
- "ksPartitionTable" => _("Partition table")
- )
- )
- );
- }
-}
-
-?>
diff --git a/gosa-plugins/goto/admin/systems/goto/devices/installRecipe.tpl b/gosa-plugins/goto/admin/systems/goto/devices/installRecipe.tpl
+++ /dev/null
@@ -1 +0,0 @@
-test