summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 054f5b4)
raw | patch | inline | side by side (parent: 054f5b4)
author | zeph <zeph@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 25 Mar 2008 16:02:48 +0000 (16:02 +0000) | ||
committer | zeph <zeph@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 25 Mar 2008 16:02:48 +0000 (16:02 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5-plugins@9977 594d385d-05f5-0310-b6e9-bd551577e9d8
index d82761b5f9337c1a3ddbabce75ff63613b6d6110..03338a3ec6f552c190380d2355306f53360b71aa 100644 (file)
# schema file for sudo
#
- attributetype ( 1.3.6.1.4.1.15953.9.1.1
- NAME 'sudoUser'
- DESC 'User(s) who may run sudo'
- EQUALITY caseExactIA5Match
- SUBSTR caseExactIA5SubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+attributetype ( 1.3.6.1.4.1.15953.9.1.1
+ NAME 'sudoUser'
+ DESC 'User(s) who may run sudo'
+ EQUALITY caseExactIA5Match
+ SUBSTR caseExactIA5SubstringsMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
- attributetype ( 1.3.6.1.4.1.15953.9.1.2
- NAME 'sudoHost'
- DESC 'Host(s) who may run sudo'
- EQUALITY caseExactIA5Match
- SUBSTR caseExactIA5SubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+attributetype ( 1.3.6.1.4.1.15953.9.1.2
+ NAME 'sudoHost'
+ DESC 'Host(s) who may run sudo'
+ EQUALITY caseExactIA5Match
+ SUBSTR caseExactIA5SubstringsMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
- attributetype ( 1.3.6.1.4.1.15953.9.1.3
- NAME 'sudoCommand'
- DESC 'Command(s) to be executed by sudo'
- EQUALITY caseExactIA5Match
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+attributetype ( 1.3.6.1.4.1.15953.9.1.3
+ NAME 'sudoCommand'
+ DESC 'Command(s) to be executed by sudo'
+ EQUALITY caseExactIA5Match
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
- attributetype ( 1.3.6.1.4.1.15953.9.1.4
- NAME 'sudoRunAs'
- DESC 'User(s) impersonated by sudo'
- EQUALITY caseExactIA5Match
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+attributetype ( 1.3.6.1.4.1.15953.9.1.4
+ NAME 'sudoRunAs'
+ DESC 'User(s) impersonated by sudo'
+ EQUALITY caseExactIA5Match
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
- attributetype ( 1.3.6.1.4.1.15953.9.1.5
- NAME 'sudoOption'
- DESC 'Options(s) followed by sudo'
- EQUALITY caseExactIA5Match
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+attributetype ( 1.3.6.1.4.1.15953.9.1.5
+ NAME 'sudoOption'
+ DESC 'Options(s) followed by sudo'
+ EQUALITY caseExactIA5Match
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
- objectclass ( 1.3.6.1.4.1.15953.9.2.1 NAME 'sudoRole' SUP top STRUCTURAL
- DESC 'Sudoer Entries'
- MUST ( cn )
- MAY ( sudoUser $ sudoHost $ sudoCommand $ sudoRunAs $ sudoOption $
- description )
- )
+objectclass ( 1.3.6.1.4.1.15953.9.2.1 NAME 'sudoRole' SUP top STRUCTURAL
+ DESC 'Sudoer Entries'
+ MUST ( cn )
+ MAY ( sudoUser $ sudoHost $ sudoCommand $ sudoRunAs $ sudoOption $
+ description )
+ )
index 4db97485f6285aa6046fa3cdca99302e1384405d..8629e73f303e8c22ee0fa1fefb82e5c6ac1cfd77 100644 (file)
var $dialog = NULL;
- var $attributes = array("sudoUser",
+ var $attributes = array("cn",
+ "description",
+ "sudoUser",
"sudoHost",
"sudoCommand",
"sudoRunAs",
/* add new/edited zone
*/
$ret = $this->dialog->save();
- if(!$this->dialog->isNew){
- unset($this->Roles[$this->dialog->OldRoleName]);
- }
+ //if(!$this->dialog->isNew){
+ // unset($this->Roles[$this->dialog->OldRoleName]);
+ //}
$this->Roles[$ret['roleName']] = $ret;
$this->dialog = NULL;
}
*/
//if(isset($_POST['AddRole']) && chkacl($this->acl,"sudoldap") == ""){
if(isset($_POST['AddRole'])){
- $this->dialog = new sudoldapEditRole($this->config,$this->dn);
+ $this->dialog = new sudoldapEditRole($this->config);
}
/* Show dialog
index c048c17bf8e0c4d8b332ec82ae442cd4448d8225..acbfeefd72eb62622d1ae53b6b1d567c289b1ba8 100644 (file)
class sudoldapEditRole extends plugin
{
/* Plugin specific values */
- var $attributes = array("sudoUser",
+ var $attributes = array("cn",
+ "description",
+ "sudoUser",
"sudoHost",
"sudoCommand",
"sudoRunAs",
var $objectclasses = array("sudoRole");
- var $roleName = ""; // cn
-
+ var $cn = "";
+ var $description = "";
var $sudoUser = "";
var $sudoHost = "";
var $sudoCommand = "";
var $sudoRunAs = "";
var $sudoOption = "";
- function sudoldapEditRole ($config, $dn= NULL,$attrs = array())
+ var $isNew = true;
+
+ function sudoldapEditRole ($config, $dn= NULL)
{
plugin::plugin ($config, $dn);
-
}
function execute()
$smarty= get_smarty();
$display= "";
- $smarty->assign("roleName", $this->roleName);
+ $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);
/* Save to LDAP */
function save()
{
+ plugin::save();
$ldap= $this->config->get_ldap_link();
- /* $dn was posted as parameter */
- //$this->dn = $dn;
+ $this->dn = "cn=".$this->cn.",ou=SUDOers,".$this->config->current['BASE'];
+ $this->attrs['objectClass'] = array("sudoRole");
- /* Save */
- plugin::save();
-
- echo $this->dn;
+ echo '<pre>';
+ print_r($this->attrs);
+ echo '</pre>';
- /* Write back to ldap */
+ $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
$ldap->cd($this->dn);
- //$this->cleanup();
$ldap->add($this->attrs);
/* Display errors
show_ldap_error("Record:".$ldap->get_error(), _("Saving failed!"));
}
- //$ret =array();
- //foreach($this->attributes as $name){
- //$ret[$name] = $this->$name;
- //}
-
- //return($ret);
}
index 8eea267eb30a17418c53601de4551d9f93469638..d4f42c61aa8283619f46ff008698c7f43dc232e6 100644 (file)
<h2>{t}sudo-ldap role{/t}</h2>
<table summary="" width="100%">
<tr>
- <td> {t}Role name (cn){/t}{$must} </td>
- <td> <input type="text" name="roleName" value="{$roleName}"> </td>
+ <td> {t}cn{/t}{$must} </td>
+ <td> <input type="text" name="cn" value="{$cn}"> </td>
+ </tr>
+ <tr>
+ <td> {t}description{/t}{$must} </td>
+ <td> <input type="text" name="description" value="{$description}"> </td>
</tr>
<tr>
<td> {t}sudoUser{/t}{$must} </td>