Code

91539f1092c9d5d2aac463b5dc155b35b349786c
[gosa.git] / gosa-plugins / goto / admin / systems / goto / Device / class_InstallRecipe.inc
1 <?php
3 class InstallRecipe extends plugin
4 {
5     public $member = array();
6     public $ksTemplate = "";
7     public $ksKeyboardlayout = "";
8     public $ksSystemLocale = "";
9     public $ksTimezone = "";
10     public $ksTimeUTC = "";
11     public $ksNTPServer = "";
12     public $ksMirror = "";
13     public $ksMirrorTorrent = "";
14     public $ksRootEnabled = "";
15     public $ksRootPasswordHash = "";
16     public $ksKernelPackage = "";
17     public $ksPartitionTable = "";
19     public $objectclasses = array('installRecipe');
20     public $attributes = array("member","ksTemplate","ksKeyboardlayout","ksSystemLocale",
21             "ksTimezone","ksTimeUTC","ksNTPServer","ksMirror","ksMirrorTorrent",
22             "ksRootEnabled","ksRootPasswordHash","ksKernelPackage","ksPartitionTable");
24     function __construct(&$config, $dn)
25     {
26         plugin::plugin($config, $dn);
27     }
29     function execute()
30     {
31         plugin::execute();    
32         $smarty = get_smarty();
33         foreach($this->attributes as $attr){
34             $smarty->assign($attr, $this->$attr);
35         }
36         return($smarty->fetch(get_template_path('goto/Device/InstallRecipe.tpl', TRUE)));
37     }
40     function save()
41     {
42         plugin::save();
43         $this->cleanup();
44         $ldap=$this->config->get_ldap_link();
45         $ldap->cd($this->config->current['BASE']);
46         $ldap->cd($this->dn);
47         $ldap->modify($this->attrs);
48         new log("modify","Device/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
49         if (!$ldap->success()){
50             msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
51         }else{
52             $this->handle_post_events("modify");
53         }
54     }
56     static function plInfo()
57     {
58         return (array(
59                     "plShortName"   => _("Device"),
60                     "plDescription" => _("Registered device"),
61                     "plSelfModify"  => FALSE,
62                     "plDepends"     => array(),
63                     "plPriority"    => 1,
64                     "plSection"     => array("administration"),
65                     "plCategory"    => array("Device"),
66                     "plProvidedAcls" => array(
67                         "member" => _("Member"),
68                         "ksTemplate" => _("Template"),
69                         "ksKeyboardlayout" => _("Keyboard layout"),
70                         "ksSystemLocale" => _("System locale"),
71                         "ksTimezone" => _("Timezone"),
72                         "ksTimeUTC" => _("Time"),
73                         "ksNTPServer" => _("NTP-Server"),
74                         "ksMirror" => _("Kickstart mirror"),
75                         "ksMirrorTorrent" => _("Kickstart torrent mirror"),
76                         "ksRootEnabled" => _("Root login enabled"),
77                         "ksRootPasswordHash" => _("Root password hash"),
78                         "ksKernelPackage" => _("Kernal package"),
79                         "ksPartitionTable" => _("Partition table")
80                         )
81                         )
82                         );
83     }
84 }
86 ?>