From: hickert Date: Thu, 16 Sep 2010 08:09:57 +0000 (+0000) Subject: Renamed the device classes X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3bb14e9c66522cb4f38d60850372f813b480335f;p=gosa.git Renamed the device classes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19694 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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 index 000000000..8a45bf8bd --- /dev/null +++ b/gosa-plugins/goto/admin/systems/goto/devices/Device.tpl @@ -0,0 +1,77 @@ +

{t}Registered device{/t}

+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + +
+
+ +
+ +

{t}Network settings{/t}

+ + + + + + + + + + +
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 index 000000000..c295d888e --- /dev/null +++ b/gosa-plugins/goto/admin/systems/goto/devices/class_Device.inc @@ -0,0 +1,113 @@ + 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 index c295d888e..000000000 --- a/gosa-plugins/goto/admin/systems/goto/devices/class_registeredDevice.inc +++ /dev/null @@ -1,113 +0,0 @@ - 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 index 8a45bf8bd..000000000 --- a/gosa-plugins/goto/admin/systems/goto/devices/registeredDevice.tpl +++ /dev/null @@ -1,77 +0,0 @@ -

{t}Registered device{/t}

- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - -
-
- - - - - - - - - - - - - -
-
- -
- -

{t}Network settings{/t}

- - - - - - - - - - -