From: zeph Date: Sun, 23 Mar 2008 21:23:01 +0000 (+0000) Subject: add + renaming X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f068db9dd8f0bfea7993706978417f1b90fc6674;p=gosa.git add + renaming git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5-plugins@9962 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/sudo-ldap/src/class_sudoLdap.inc b/sudo-ldap/src/class_sudoLdap.inc deleted file mode 100644 index 7319e73ba..000000000 --- a/sudo-ldap/src/class_sudoLdap.inc +++ /dev/null @@ -1,92 +0,0 @@ - - \version 1.00 - \date 22.03.2008 - - This class provides the functionality to read and write all attributes - relevant for sudo-ldap from/to the LDAP. - */ - -class sudoldap extends plugin -{ - /* Definitions */ - var $plHeadline= "sudo-ldap"; - var $plDescription= "This does something"; - - /* Plugin specific values */ - - var $attributes = array( "sudoUser", - "sudoHost", - "sudoCommand", - "sudoRunAs", - "sudoOption"); - - var $objectclasses = array("sudoRole"); - - /* constructor, if 'dn' is set, the node loads the given - 'dn' from LDAP */ - function sudoldap ($config, $dn= NULL, $parent= NULL) - { - /* Configuration is fine, allways */ - $this->config= $config; - - /* Load bases attributes */ - plugin::plugin($config, $dn, $parent); - - $ldap= $this->config->get_ldap_link(); - - } - - - /* execute generates the html output for this node */ - function execute($isCopyPaste = false) - { - /* Call parent execute */ - plugin::execute(); - $display= ""; - $smarty= get_smarty(); - - /* Add empty new zone - */ - if(isset($_POST['AddRole']) && chkacl($this->acl,"sudoldap") == ""){ - $this->dialog = new sudoldapEditRole($this->config,$this->dn); - } - - /* Show dialog - */ - if($this->dialog!= NULL){ - $this->dialog->save_object(); - $this->dialog->parent = $this; - return($this->dialog->execute()); - } - - $RoleList = new divSelectBox("sudoRoles"); - $RoleList -> SetHeight(300); - $editImg = " - "; - /* - foreach($this->Zones as $zone => $values ){ - $link = "%s"; - $ZoneList->AddEntry(array( - array("string" => sprintf($link,base64_encode($zone),getNameFromMix($zone))), - array("string" => sprintf($link,base64_encode($zone),_("Reverse zone")." : ".getNameFromMix($values['ReverseZone']))), - array("string" => _("TTL")." : ".$values['sOAttl']), - array("string" => _("Class")." : ".$values['dNSClass']), - array("string" => str_replace("%s",base64_encode($zone),$editImg)) - )); - } - */ - - $smarty->assign("sudoldapACL",chkacl($this->acl,"sudoldap")); - - $smarty->assign("RoleList",$RoleList->DrawList()); - $display.= $smarty->fetch(get_template_path('sudoldap.tpl', TRUE)); - return($display); - } - -} - -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -?> diff --git a/sudo-ldap/src/class_sudoldap.inc b/sudo-ldap/src/class_sudoldap.inc new file mode 100644 index 000000000..7319e73ba --- /dev/null +++ b/sudo-ldap/src/class_sudoldap.inc @@ -0,0 +1,92 @@ + + \version 1.00 + \date 22.03.2008 + + This class provides the functionality to read and write all attributes + relevant for sudo-ldap from/to the LDAP. + */ + +class sudoldap extends plugin +{ + /* Definitions */ + var $plHeadline= "sudo-ldap"; + var $plDescription= "This does something"; + + /* Plugin specific values */ + + var $attributes = array( "sudoUser", + "sudoHost", + "sudoCommand", + "sudoRunAs", + "sudoOption"); + + var $objectclasses = array("sudoRole"); + + /* constructor, if 'dn' is set, the node loads the given + 'dn' from LDAP */ + function sudoldap ($config, $dn= NULL, $parent= NULL) + { + /* Configuration is fine, allways */ + $this->config= $config; + + /* Load bases attributes */ + plugin::plugin($config, $dn, $parent); + + $ldap= $this->config->get_ldap_link(); + + } + + + /* execute generates the html output for this node */ + function execute($isCopyPaste = false) + { + /* Call parent execute */ + plugin::execute(); + $display= ""; + $smarty= get_smarty(); + + /* Add empty new zone + */ + if(isset($_POST['AddRole']) && chkacl($this->acl,"sudoldap") == ""){ + $this->dialog = new sudoldapEditRole($this->config,$this->dn); + } + + /* Show dialog + */ + if($this->dialog!= NULL){ + $this->dialog->save_object(); + $this->dialog->parent = $this; + return($this->dialog->execute()); + } + + $RoleList = new divSelectBox("sudoRoles"); + $RoleList -> SetHeight(300); + $editImg = " + "; + /* + foreach($this->Zones as $zone => $values ){ + $link = "%s"; + $ZoneList->AddEntry(array( + array("string" => sprintf($link,base64_encode($zone),getNameFromMix($zone))), + array("string" => sprintf($link,base64_encode($zone),_("Reverse zone")." : ".getNameFromMix($values['ReverseZone']))), + array("string" => _("TTL")." : ".$values['sOAttl']), + array("string" => _("Class")." : ".$values['dNSClass']), + array("string" => str_replace("%s",base64_encode($zone),$editImg)) + )); + } + */ + + $smarty->assign("sudoldapACL",chkacl($this->acl,"sudoldap")); + + $smarty->assign("RoleList",$RoleList->DrawList()); + $display.= $smarty->fetch(get_template_path('sudoldap.tpl', TRUE)); + return($display); + } + +} + +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> diff --git a/sudo-ldap/src/class_sudoldapEditRole.inc b/sudo-ldap/src/class_sudoldapEditRole.inc new file mode 100644 index 000000000..0113233fe --- /dev/null +++ b/sudo-ldap/src/class_sudoldapEditRole.inc @@ -0,0 +1,53 @@ + diff --git a/sudo-ldap/src/main.inc b/sudo-ldap/src/main.inc index 25589d47a..1d57e66ed 100644 --- a/sudo-ldap/src/main.inc +++ b/sudo-ldap/src/main.inc @@ -29,18 +29,18 @@ if (!$remove_lock){ del_lock ($ui->dn); sess_del ('edit'); - sess_del ('sudoLdap'); + sess_del ('sudoldap'); } - /* Create sudoLdap object on demand */ - if (!isset($_SESSION['sudoLdap']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - $_SESSION['sudoLdap']= new sudoLdap ($config, $ui->dn); + /* Create sudoldap object on demand */ + if (!isset($_SESSION['sudoldap']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + $_SESSION['sudoldap']= new sudoldap ($config, $ui->dn); } - $sudoLdap= $_SESSION['sudoLdap']; + $sudoldap= $_SESSION['sudoldap']; /* save changes back to object */ if (isset ($_SESSION['edit'])){ - $sudoLdap->save_object (); + $sudoldap->save_object (); } /* Enter edit mode? */ @@ -62,11 +62,11 @@ if (!$remove_lock){ /* Adjust acl's to mode */ if (isset($_SESSION['edit'])){ $acl= get_permissions ($ui->dn, $ui->subtreeACL); - $sudoLdap->acl= get_module_permission($acl, "sudoLdap", $ui->dn); + $sudoldap->acl= get_module_permission($acl, "sudoldap", $ui->dn); } else { $acl= get_permissions ($ui->dn, $ui->subtreeACL); - $editacl= get_module_permission($acl, "sudoLdap", $ui->dn); - $sudoLdap->acl= "#none#"; + $editacl= get_module_permission($acl, "sudoldap", $ui->dn); + $sudoldap->acl= "#none#"; } /* save changes to LDAP and disable edit mode */ @@ -74,19 +74,19 @@ if (!$remove_lock){ if (isset($_POST['edit_finish'])){ /* Perform checks */ - $message= $sudoLdap->check (); + $message= $sudoldap->check (); /* No errors, save object */ if (count ($message) == 0){ - $sudoLdap->save (); + $sudoldap->save (); gosa_log ("SUDO/ldap object'".$ui->dn."' has been saved"); - $sudoLdap->acl= "#none#"; - $editacl= get_module_permission($acl, "sudoLdap", $ui->dn); + $sudoldap->acl= "#none#"; + $editacl= get_module_permission($acl, "sudoldap", $ui->dn); del_lock ($ui->dn); sess_del ('edit'); /* Remove from session */ - sess_del ('sudoLdap'); + sess_del ('sudoldap'); } else { /* Errors found, show message */ show_errors ($message); @@ -94,11 +94,11 @@ if (!$remove_lock){ } /* Execute formular */ - $display.= $sudoLdap->execute (); + $display.= $sudoldap->execute (); /* Store changes in session */ if (isset ($_SESSION['edit'])){ - $_SESSION['sudoLdap']= $sudoLdap; + $_SESSION['sudoldap']= $sudoldap; } /* Page header*/