summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9257dd8)
raw | patch | inline | side by side (parent: 9257dd8)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Nov 2006 05:01:39 +0000 (05:01 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Nov 2006 05:01:39 +0000 (05:01 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5223 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_termDNS.inc | patch | blob | history | |
plugins/admin/systems/network.tpl | patch | blob | history |
index 974e133910723406f7d8743bde2207da36c887a3..953a29f55c55c136d2ed357ab968f155f8ec9945 100644 (file)
/* DNS attributes
*/
var $DNSattributes = array("dNSClass","zoneName","dNSTTL");
- var $DNS_is_Account = false;
+ var $DNS_is_account = false;
var $initially_was_account = false;
var $dnsEntry = array();
var $DNSenabled = false;
}else{
$this->DNS_is_account = false;
}
-
}
/* Store initally account settings
if($this->DNSenabled == false){
/* Is IP address must ? */
- $smarty->assign("DNS_is_account",false);
+ $smarty->assign("DNS_enabled",false);
$smarty->assign("IPisMust",(($this->IPisMust)||($this->DNS_is_account)));
/* Assign smarty all non DNs attributes */
$display.= $smarty->fetch(get_template_path('network.tpl', TRUE));
return($display);
}else{
- $smarty->assign("DNS_is_account",true);
+ $smarty->assign("DNS_enabled",true);
}
$accountACL = false;
- if($this->DNSenabled && $this->acl_is_removeable()){
+ if($this->DNS_is_account && $this->acl_is_removeable()){
$accountACL = true;
- }elseif(!$this->DNSenabled && $this->acl_is_createable()){
+ }elseif(!$this->DNS_is_account && $this->acl_is_createable()){
$accountACL = true;
}
$smarty->assign("accountACL",$accountACL);
}
/* Assign all needed vars */
- $smarty->assign("DNSAccount",$this->DNS_is_account);
+ $smarty->assign("DNS_is_account",$this->DNS_is_account);
$smarty->assign("Zones",$this->Zones);
$smarty->assign("ZoneKeys",($this->Zones));
$smarty->assign("IPisMust",(($this->IPisMust)||($this->DNS_is_account)));
$ldap->cd($this->orig_dn);
$ldap->search("(&(objectClass=dNSZone)(zoneName=*)(!(relativeDomainName=@)))",array("relativeDomainName","zoneName"));
while($attr = $ldap->fetch()){
- $ldap->cd($attr['dn']);
- $ldap->rmDir($attr['dn']);
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of terminal/dns acoount with dn '%s' failed."),$this->dn));
+ $ldap->cd($attr['dn']);
+ $ldap->rmDir($attr['dn']);
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of terminal/dns acoount with dn '%s' failed."),$this->dn));
}
- */
+ */
}
/* Save data to object */
{
/* Save all posted vars */
plugin::save_object();
-
- /* Ge all non dns attributes (IP/MAC)*/
- foreach($this->attributes as $attr){
- if(isset($_POST[$attr]) && $this->acl_is_writeable($attr)){
- $this->$attr = $_POST[$attr];
- }
- }
-
- /* Get dns attributes */
- if(($this->DNSenabled) && (isset($_POST['network_tpl_posted']))){
- /* Check for posted record changes */
- if(is_array($this->dnsEntry['RECORDS']) && $this->acl_is_writeable("Records")){
- foreach($this->dnsEntry['RECORDS'] as $key => $value){
+ if(isset($_POST['network_tpl_posted'])){
- /* Check if type has changed */
- if(isset($_POST['RecordTypeSelectedFor_'.$key])){
- $this->dnsEntry['RECORDS'][$key]['type'] = $_POST['RecordTypeSelectedFor_'.$key];
- }
- /* Check if value has changed */
- if(isset($_POST['RecordValue_'.$key])){
- $this->dnsEntry['RECORDS'][$key]['value'] = $_POST['RecordValue_'.$key];
- }
- }
- }
- /* Get all basic DNS attributes (TTL, Clas ..)*/
- foreach($this->DNSattributes as $attr){
+ /* Ge all non dns attributes (IP/MAC)*/
+ foreach($this->attributes as $attr){
if(isset($_POST[$attr]) && $this->acl_is_writeable($attr)){
- $this->dnsEntry[$attr] = $_POST[$attr];
+ $this->$attr = $_POST[$attr];
}
}
- if($this->DNSenabled && $this->acl_is_removeable() && !isset($_POST['enableDNS'])){
+ /* Check if DNS should be enabled / disabled */
+ if($this->DNS_is_account && $this->acl_is_removeable() && !isset($_POST['DNS_is_account'])){
$this->DNS_is_account = false;
- }elseif(!$this->DNSenabled && $this->acl_is_createable() && isset($_POST['enableDNS'])){
+ }elseif(!$this->DNS_is_account && $this->acl_is_createable() && isset($_POST['DNS_is_account'])){
$this->DNS_is_account = true;
}
+
+ /* Get dns attributes */
+ if(($this->DNSenabled) && (isset($_POST['network_tpl_posted']))){
+
+ /* Check for posted record changes */
+ if(is_array($this->dnsEntry['RECORDS']) && $this->acl_is_writeable("Records")){
+ foreach($this->dnsEntry['RECORDS'] as $key => $value){
+
+ /* Check if type has changed */
+ if(isset($_POST['RecordTypeSelectedFor_'.$key])){
+ $this->dnsEntry['RECORDS'][$key]['type'] = $_POST['RecordTypeSelectedFor_'.$key];
+ }
+ /* Check if value has changed */
+ if(isset($_POST['RecordValue_'.$key])){
+ $this->dnsEntry['RECORDS'][$key]['value'] = $_POST['RecordValue_'.$key];
+ }
+ }
+ }
+ /* Get all basic DNS attributes (TTL, Clas ..)*/
+ foreach($this->DNSattributes as $attr){
+ if(isset($_POST[$attr]) && $this->acl_is_writeable($attr)){
+ $this->dnsEntry[$attr] = $_POST[$attr];
+ }
+ }
+
+
+ }
}
}
index 06d73f4c7764f5f0652585e7d5bf89bbb13e37c1..436e363210014ee7ded6370a97c743f8fd2262b4 100644 (file)
{/if}
</table>
</td>
- {if $DNS_is_account==true}
+ {if $DNS_enabled==true}
<td style="width:50%;vertical-align:top;border-left:1px solid #b0b0b0;" valign="top">
- <input type="checkbox" name="enableDNS" value="1"
+ <input type="checkbox" name="DNS_is_account" value="1"
{if !$accountACL}
disabled
{/if}
- {if $DNSAccount == true}checked="checked"
+ {if $DNS_is_account == true}checked="checked"
onclick="toggle('test2');
changeState('zoneName');
changeState('dNSTTL');
{/if}
{t}Enable DNS for this device{/t}
<input type="submit" name="reloadThisDNSStuff" value="{t}Refresh{/t}"/>
- {if $DNSAccount == true}
+ {if $DNS_is_account == true}
<div style="padding-left:20px;visibility:visible;" id="test2">
{else}
<div style="padding-left:20px;visibility:hidden;" id="test2">
<td><LABEL for="zoneName">{t}Zone{/t}</LABEL></td>
<td>
{render acl=$zoneNameACL}
- <select name="zoneName" id="zoneName" {if $DNSAccount == false} disabled='disabled' {/if}>
+ <select name="zoneName" id="zoneName" {if $DNS_is_account == false} disabled='disabled' {/if}>
{html_options values=$ZoneKeys output=$Zones selected=$zoneName}
</select>
{/render}
<td>{t}TTL{/t}</td>
<td>
{render acl=$dNSTTLACL}
- <input type="text" name="dNSTTL" value="{$dNSTTL}" id="dNSTTL" {if $DNSAccount == false} disabled {/if}>
+ <input type="text" name="dNSTTL" value="{$dNSTTL}" id="dNSTTL" {if $DNS_is_account == false} disabled {/if}>
{/render}
</td>
</tr>
<tr>
<td valign="top">{t}Dns records{/t}</td>
<td>
- {if $DNSAccount == true}
+ {if $DNS_is_account == true}
{render acl=$RecordsACL}
{$records}
{/render}