summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3dbfa8f)
raw | patch | inline | side by side (parent: 3dbfa8f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Sep 2006 06:12:22 +0000 (06:12 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Sep 2006 06:12:22 +0000 (06:12 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4790 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_servGeneric.inc | patch | blob | history | |
plugins/admin/systems/class_termDNS.inc | patch | blob | history | |
plugins/admin/systems/network.tpl | patch | blob | history |
diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc
index c11ae498d5c617b66268d14c28c7787db83a0465..1f1596829ed103dfac7eea68db09ab6fc72b0804 100644 (file)
$this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn);
}
$this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
+ $this->netConfigDNS->set_acl_category("server");
+ $this->netConfigDNS->set_acl_base($this->base);
+
/* Save dn for later references */
$this->orig_dn= $this->dn;
}
index 1fb01de68033af692405e511454b8e7c7598ef63..afcd002120f77f1eda675f97034da8c0622f4224 100644 (file)
{
/* Call parent execute */
$smarty= get_smarty();
+
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $name => $translation){
+ $smarty->assign($name."ACL",$this->getacl($name));
+ }
+
$display= "";
$smarty->assign("staticAddress", "");
}else{
$smarty->assign("DNS_is_account",true);
}
-
+
+ $accountACL = false;
+ if($this->DNSenabled && $this->acl_is_removeable()){
+ $accountACL = true;
+ }elseif(!$this->DNSenabled && $this->acl_is_createable()){
+ $accountACL = true;
+ }
+ $smarty->assign("accountACL",$accountACL);
+
/* Add new empty array to our record list */
if(isset($_POST['AddNewRecord'])){
$this->dnsEntry['RECORDS'][] =array("type"=>"aRecord","value"=>"");
/* Ge all non dns attributes (IP/MAC)*/
foreach($this->attributes as $attr){
- if(isset($_POST[$attr])){
+ if(isset($_POST[$attr]) && $this->acl_is_writeable($attr)){
$this->$attr = $_POST[$attr];
}
}
if(($this->DNSenabled) && (isset($_POST['network_tpl_posted']))){
/* Check for posted record changes */
- if(is_array($this->dnsEntry['RECORDS'])){
+ if(is_array($this->dnsEntry['RECORDS']) && $this->acl_is_writeable("Records")){
foreach($this->dnsEntry['RECORDS'] as $key => $value){
/* Check if type has changed */
}
/* Get all basic DNS attributes (TTL, Clas ..)*/
foreach($this->DNSattributes as $attr){
- if(isset($_POST[$attr])){
+ if(isset($_POST[$attr]) && $this->acl_is_writeable($attr)){
$this->dnsEntry[$attr] = $_POST[$attr];
}
}
- /* Enable diable DNS */
- if(isset($_POST['enableDNS'])){
- $this->DNS_is_account = true;
- }else{
+ if($this->DNSenabled && $this->acl_is_removeable() && !isset($_POST['enableDNS'])){
$this->DNS_is_account = false;
+ }elseif(!$this->DNSenabled && $this->acl_is_createable() && isset($_POST['enableDNS'])){
+ $this->DNS_is_account = true;
}
}
}
/* Check if ip is empty
*/
- if ($this->ipHostNumber == "" && chkacl ($this->acl, "ipHostNumber") == ""){
+ if ($this->ipHostNumber == "" && $this->acl_is_writeable("ipHostNumber")){
$message[]= _("The required field 'IP-address' is not set.");
}
/* Check if mac is empty
*/
- if ($this->macAddress == "" && chkacl ($this->acl, "macAddress") == ""){
+ if ($this->macAddress == "" && $this->acl_is_writeable("macAddress")){
$message[]= _("The required field 'MAC-address' is not set.");
}
/* Return plugin informations for acl handling */
function plInfo()
{
- return (array(
- "plShortName" => _("DNS"),
- "plDescription" => _("DNS settings"),
- "plSelfModify" => FALSE,
- "plDepends" => array(),
- "plPriority" => 5,
- "plSection" => array("administration"),
- "plCategory" => array("workstation","terminal","phone","server","component","printer"),
-
- "plProvidedAcls"=> array(
- "Records" => _("DNS records"),
- "zoneName" => _("Zone name"),
- "dNSTTL" => _("TTL"),
- "ipHostNumber" => _("IP address"),
- "macAddress" => _("MAC address"))
- ));
+ $tmp = array(
+ "plShortName" => _("DNS"),
+ "plDescription" => _("DNS settings"),
+ "plSelfModify" => FALSE,
+ "plDepends" => array(),
+ "plPriority" => 5,
+ "plSection" => array("administration"),
+ "plCategory" => array("workstation","terminal","phone","server","component","printer"),
+
+ "plProvidedAcls"=> array(
+ "ipHostNumber" => _("IP address"),
+ "macAddress" => _("MAC address"))
+ );
+
+ /* Hide all dns specific code, if dns is not available
+ */
+ $DNSenabled = false;
+ foreach($_SESSION['config']->data['TABS']['SERVERSERVICE'] as $tab){
+ if(preg_match("/^servdns$/",$tab['CLASS'])){
+ $tmp['plProvidedAcls']["Records"] = _("DNS records");
+ $tmp['plProvidedAcls']["zoneName"] = _("Zone name");
+ $tmp['plProvidedAcls']["dNSTTL"] = _("TTL");
+ }
+ }
+ return($tmp);
}
}
index dcb3d45210490e3a04ec8090dd85a58e1dc3bb61..7a1bd8fa184de24a6cd816718466cdb5eb32fa0d 100644 (file)
<table summary="">
<tr>
<td><LABEL for="ipHostNumber">{t}IP-address{/t}{if $IPisMust}{$staticAddress}{/if}</LABEL></td>
- <td><input id="ipHostNumber" name="ipHostNumber" size=25 maxlength=80 value="{$ipHostNumber}"></td>
+ <td>
+{render acl=$ipHostNumberACL}
+ <input id="ipHostNumber" name="ipHostNumber" size=25 maxlength=80 value="{$ipHostNumber}">
+{/render}
+ </td>
</tr>
<tr>
<td><LABEL for="macAddress">{t}MAC-address{/t}</LABEL>{$staticAddress}</td>
- <td><input name="macAddress" id="macAddress" size=25 maxlength=80 value="{$macAddress}"></td>
+ <td>
+{render acl=$macAddressACL}
+ <input name="macAddress" id="macAddress" size=25 maxlength=80 value="{$macAddress}">
+{/render}
+ </td>
</tr>
{if $autonet==true}
<tr>
<td> </td>
- <td><input type="submit" name="autonet" value="{t}Autodetect{/t}"></td>
+ <td>
+{render acl=$macAddressACL.$ipHostNumberACL}
+ <input type="submit" name="autonet" value="{t}Autodetect{/t}">
+{/render}
+ </td>
</tr>
{/if}
</table>
{if $DNS_is_account==true}
<td style="width:50%;vertical-align:top;border-left:1px solid #b0b0b0;" valign="top">
<input type="checkbox" name="enableDNS" value="1"
+
+ {if !$accountACL}
+ disabled
+ {/if}
+
{if $DNSAccount == true}checked="checked"
onclick="toggle('test2');
changeState('zoneName');
<tr>
<td><LABEL for="zoneName">{t}Zone{/t}</LABEL></td>
<td>
+{render acl=$zoneNameACL}
<select name="zoneName" id="zoneName" {if $DNSAccount == false} disabled='disabled' {/if}>
{html_options values=$ZoneKeys output=$Zones selected=$zoneName}
</select>
+{/render}
</td>
</tr>
<tr>
<td>{t}TTL{/t}</td>
- <td><input type="text" name="dNSTTL" value="{$dNSTTL}" id="dNSTTL" {if $DNSAccount == false} disabled='disabled' {/if}>
+ <td>
+{render acl=$dNSTTLACL}
+ <input type="text" name="dNSTTL" value="{$dNSTTL}" id="dNSTTL" {if $DNSAccount == false} disabled {/if}>
+{/render}
</td>
</tr>
<tr>
<td valign="top">{t}Dns records{/t}</td>
<td>
- {if $DNSAccount == true}{$records}{/if}
+ {if $DNSAccount == true}
+{render acl=$RecordsACL}
+ {$records}
+{/render}
+ {/if}
</td>
</tr>
</table>