X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=sudo-ldap%2Fsrc%2Fclass_sudoldapEditRole.inc;fp=sudo-ldap%2Fsrc%2Fclass_sudoldapEditRole.inc;h=0000000000000000000000000000000000000000;hb=e7f157ba8e9b2052338570efdf767a6fdde19749;hp=64f0761a880ae72039954fe2e781b689ea250270;hpb=632ddd217c167e49dcbb48a19055e822cebf0223;p=gosa.git diff --git a/sudo-ldap/src/class_sudoldapEditRole.inc b/sudo-ldap/src/class_sudoldapEditRole.inc deleted file mode 100644 index 64f0761a8..000000000 --- a/sudo-ldap/src/class_sudoldapEditRole.inc +++ /dev/null @@ -1,108 +0,0 @@ -isNew = true; - }else{ - $this->isNew = false; - foreach($this->attributes as $value){ - if(isset($attrs[$value])){ - $this->$value = $attrs[$value]; - } - } - } - } - - function execute() - { - /* Call parent execute */ - plugin::execute(); - - - /* Fill templating stuff */ - $smarty= get_smarty(); - $display= ""; - - $smarty->assign("cn", $this->cn); - $smarty->assign("description", $this->description); - $smarty->assign("sudoUser", $this->sudoUser); - $smarty->assign("sudoHost", $this->sudoHost); - $smarty->assign("sudoCommand", $this->sudoCommand); - $smarty->assign("sudoRunAs", $this->sudoRunAs); - $smarty->assign("sudoOption", $this->sudoOption); - - /* Display template */ - $display.= $smarty->fetch( - get_template_path('sudoldapeditrole.tpl', TRUE)); - return($display); - } - - /* Save data to object */ - function save_object() - { - //plugin::save_object(); - foreach($this->attributes as $attr){ - if(isset($_POST[$attr])){ - $this->$attr = $_POST[$attr]; - } - } - } - - - /* Check supplied data */ - function check() - { - } - - - /* Save to LDAP */ - function save() - { - plugin::save(); - $ldap= $this->config->get_ldap_link(); - - $this->dn = "cn=".$this->cn.",ou=SUDOers,".$this->config->current['BASE']; - $this->attrs['objectClass'] = array("sudoRole"); - - $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn)); - $ldap->cd($this->dn); - $ldap->add($this->attrs); - - /* Display errors - */ - if($ldap->get_error() != "Success"){ - show_ldap_error("Record:".$ldap->get_error(), _("Saving failed!")); - } - } - - -} - -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -?>