summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: db74eb0)
raw | patch | inline | side by side (parent: db74eb0)
author | zeph <zeph@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sun, 23 Mar 2008 21:23:01 +0000 (21:23 +0000) | ||
committer | zeph <zeph@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sun, 23 Mar 2008 21:23:01 +0000 (21:23 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5-plugins@9962 594d385d-05f5-0310-b6e9-bd551577e9d8
sudo-ldap/src/class_sudoLdap.inc | [deleted file] | patch | blob | history |
sudo-ldap/src/class_sudoldap.inc | [new file with mode: 0644] | patch | blob |
sudo-ldap/src/class_sudoldapEditRole.inc | [new file with mode: 0644] | patch | blob |
sudo-ldap/src/main.inc | patch | blob | history |
diff --git a/sudo-ldap/src/class_sudoLdap.inc b/sudo-ldap/src/class_sudoLdap.inc
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-/*!
- \brief sudo-ldap plugin
- \author Guido Serra <gserra@guidoserra.it>
- \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 = "<input type='image' src='images/edit.png' name='editZone_%s'>
- <input type='image' src='images/edittrash.png' name='delZone_%s'>";
- /*
- foreach($this->Zones as $zone => $values ){
- $link = "<a href='?plug=".$_GET['plug']."&act=edit&id=%s'>%s</a>";
- $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
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/*!
+ \brief sudo-ldap plugin
+ \author Guido Serra <gserra@guidoserra.it>
+ \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 = "<input type='image' src='images/edit.png' name='editZone_%s'>
+ <input type='image' src='images/edittrash.png' name='delZone_%s'>";
+ /*
+ foreach($this->Zones as $zone => $values ){
+ $link = "<a href='?plug=".$_GET['plug']."&act=edit&id=%s'>%s</a>";
+ $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
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+
+class sudoldapEditRole extends plugin
+{
+ /* Plugin specific values */
+ var $attributes = array( "sudoUser",
+ "sudoHost",
+ "sudoCommand",
+ "sudoRunAs",
+ "sudoOption");
+
+ var $objectclasses = array("sudoRole");
+
+ function sudoldapEditRole ($config, $dn= NULL,$attrs = array())
+ {
+ plugin::plugin ($config, $dn);
+
+ }
+
+ function execute()
+ {
+ /* Call parent execute */
+ plugin::execute();
+
+
+ /* Fill templating stuff */
+ $smarty= get_smarty();
+ $display= "";
+
+ }
+
+ /* Save data to object */
+ function save_object()
+ {
+ }
+
+
+ /* Check supplied data */
+ function check()
+ {
+ }
+
+
+ /* Save to LDAP */
+ function save()
+ {
+ }
+
+
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/sudo-ldap/src/main.inc b/sudo-ldap/src/main.inc
index 25589d47ae046c690074b01e108ff7b9ac4ded83..1d57e66edee04cd26c26954b64c419f1f6785edd 100644 (file)
--- a/sudo-ldap/src/main.inc
+++ b/sudo-ldap/src/main.inc
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? */
/* 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 */
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);
}
/* Execute formular */
- $display.= $sudoLdap->execute ();
+ $display.= $sudoldap->execute ();
/* Store changes in session */
if (isset ($_SESSION['edit'])){
- $_SESSION['sudoLdap']= $sudoLdap;
+ $_SESSION['sudoldap']= $sudoldap;
}
/* Page header*/