Code

Renamed the device classes
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 16 Sep 2010 08:09:57 +0000 (08:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 16 Sep 2010 08:09:57 +0000 (08:09 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19694 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/devices/Device.tpl [new file with mode: 0644]
gosa-plugins/goto/admin/systems/goto/devices/class_Device.inc [new file with mode: 0644]
gosa-plugins/goto/admin/systems/goto/devices/class_registeredDevice.inc [deleted file]
gosa-plugins/goto/admin/systems/goto/devices/registeredDevice.tpl [deleted file]

diff --git a/gosa-plugins/goto/admin/systems/goto/devices/Device.tpl b/gosa-plugins/goto/admin/systems/goto/devices/Device.tpl
new file mode 100644 (file)
index 0000000..8a45bf8
--- /dev/null
@@ -0,0 +1,77 @@
+<h3>{t}Registered device{/t}</h3>
+
+
+<table width="100%">
+    <tr>
+        <td style='width:50%;'>
+            <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>
+                <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>
+            </table>
+        </td>
+        <td class='left-border'>
+            <table>
+                <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='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>
+            <table>
+                <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>
+                <tr>
+                    <td><LABEL for='manager'>{t}Manager{/t}</LABEL></td>
+                    <td> <input type="text" name="manager" value="{$manager}"></td>
+                </tr>
+            </table>
+        </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>
diff --git a/gosa-plugins/goto/admin/systems/goto/devices/class_Device.inc b/gosa-plugins/goto/admin/systems/goto/devices/class_Device.inc
new file mode 100644 (file)
index 0000000..c295d88
--- /dev/null
@@ -0,0 +1,113 @@
+<?php
+
+
+class registeredDevice extends plugin
+{
+
+    public $objectclasses = array('top','device','registeredDevice');
+    public $attributes = array("cn","serialNumber","seeAlso","owner","ou","o","ipHostNumber",
+            "l","description","manager","deviceUUID","deviceStatus","macAddress",);
+
+    public $dynClasses = array(
+            'ieee802Device' => array('macAddress'),
+            '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 $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/registeredDevice.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" => _("Registered device"),
+                    "plSelfModify"  => FALSE,
+                    "plDepends"     => array(),
+                    "plPriority"    => 1,
+                    "plSection"     => array("administration"),
+                    "plCategory"    => array(
+                        "registeredDevice" => array( "description"  => _("Registered device"),
+                            "objectClass"  => "registeredDevice")),
+                    "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_registeredDevice.inc b/gosa-plugins/goto/admin/systems/goto/devices/class_registeredDevice.inc
deleted file mode 100644 (file)
index c295d88..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-<?php
-
-
-class registeredDevice extends plugin
-{
-
-    public $objectclasses = array('top','device','registeredDevice');
-    public $attributes = array("cn","serialNumber","seeAlso","owner","ou","o","ipHostNumber",
-            "l","description","manager","deviceUUID","deviceStatus","macAddress",);
-
-    public $dynClasses = array(
-            'ieee802Device' => array('macAddress'),
-            '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 $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/registeredDevice.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" => _("Registered device"),
-                    "plSelfModify"  => FALSE,
-                    "plDepends"     => array(),
-                    "plPriority"    => 1,
-                    "plSection"     => array("administration"),
-                    "plCategory"    => array(
-                        "registeredDevice" => array( "description"  => _("Registered device"),
-                            "objectClass"  => "registeredDevice")),
-                    "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/registeredDevice.tpl b/gosa-plugins/goto/admin/systems/goto/devices/registeredDevice.tpl
deleted file mode 100644 (file)
index 8a45bf8..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-<h3>{t}Registered device{/t}</h3>
-
-
-<table width="100%">
-    <tr>
-        <td style='width:50%;'>
-            <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>
-                <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>
-            </table>
-        </td>
-        <td class='left-border'>
-            <table>
-                <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='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>
-            <table>
-                <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>
-                <tr>
-                    <td><LABEL for='manager'>{t}Manager{/t}</LABEL></td>
-                    <td> <input type="text" name="manager" value="{$manager}"></td>
-                </tr>
-            </table>
-        </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>