summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9c8ad99)
raw | patch | inline | side by side (parent: 9c8ad99)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 8 Apr 2008 07:13:43 +0000 (07:13 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 8 Apr 2008 07:13:43 +0000 (07:13 +0000) |
-DSpecial handling for default entries
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10266 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10266 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc b/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc
index a02d5a24c6b1ed9a0729ceee82142742b2b90b39..fa135f12031adc3c1ba9abfbccf85aeac2c23a2c 100644 (file)
}
$display = $val['cn'][0].$desc;
+
+ /* Highlight default entry */
+ if(preg_match("/^default$/i",$val['cn'][0])){
+ $display = "<b>$display</b>";
+ }
+
$field1 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
"attach" => "style='width:20px;'");
$field2 = array("string" => sprintf($userimg,$val['dn']),
diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc
index 807315c952c845fd6e9bb6ae32d9ce20803ffec6..7af22e569453f9572b2cfd7d5dc95c457bb8c2de 100644 (file)
var $attributes = array("cn","description","sudoUser","sudoCommand","sudoHost","sudoRunAs","accessTo","trustModel");
var $is_account = TRUE;
-
+ var $is_default = FALSE;
var $dialog;
/*! \brief Returns to the base department for sudo roles.
}
+ if(preg_match("/^default$/i",$this->cn)){
+ $this->is_default = TRUE;
+ }
+
/* Get global filter config */
if (!session::is_set("sysfilter")){
$ui= get_userinfo();
*********************/
$smarty = get_smarty();
+ $smarty->assign("is_default",$this->is_default);
foreach($this->attributes as $attr){
$smarty->assign($attr,$this->$attr);
$smarty->assign($attr."ACL",$this->getacl($attr));
function check()
{
$message = plugin::check();
+
+ /* Is a name given? */
+ if(empty($this->cn)){
+ $message[] = msgPool::required(_("Name"));
+ }
+
+ /* Check name */
+ if(!preg_match("/^[a-z]*$/i",$this->cn)){
+ $message[] = msgPool::invalid(_("Name"),$this->cn,"/[a-z]/i");
+ }
+
+ /* Check if this entry will cause duplicated ldap entries */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->get_sudoers_ou($this->config));
+ $ldap->search("(&(objectClass=sudoRole)(cn=".$this->cn."))");
+ while($attrs = $ldap->fetch()){
+ if($attrs['dn'] != $this->dn){
+ $message[] = msgPool::duplicated(_("Name"));
+ }
+ }
+
return ($message);
}
index 08450eefa75899376ac628f2d492878f62c7b9a0..d437576122d7120c5a5b7c827921cd824f80e7a0 100644 (file)
+{if $is_default}
+
+<h2>{t}Sudo generic{/t} - {t}Global defaults{/t}</h2>
+<table>
+ <tr>
+ <td>
+ {t}Name{/t}
+ </td>
+ <td>
+ {render acl=$cnACL}
+ <input type="text" name="cn" value="{$cn}">
+ {/render}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ {t}Description{/t}
+ </td>
+ <td>
+ {render acl=$descriptionACL}
+ <input type="text" name="description" value="{$description}">
+ {/render}
+ </td>
+ </tr>
+</table>
+
+{else}
+
<table style="width: 90%;">
<tr>
<td style="vertical-align:top;width:50%">
- <h2>Sudo generic</h2>
+ <h2>{t}Sudo generic{/t}</h2>
<table>
<tr>
<td>
</td>
</tr>
</table>
+{/if}