summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d84edb6)
raw | patch | inline | side by side (parent: d84edb6)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 29 Mar 2006 06:35:41 +0000 (06:35 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 29 Mar 2006 06:35:41 +0000 (06:35 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2922 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_servDNSeditZoneEntries.inc | patch | blob | history | |
plugins/admin/systems/servDNSeditZoneEntries.tpl | patch | blob | history |
diff --git a/plugins/admin/systems/class_servDNSeditZoneEntries.inc b/plugins/admin/systems/class_servDNSeditZoneEntries.inc
index 9265bf61d975d9c78fbd61a62d2618f2fcc7dc54..e775a21f05f3ee0c41aab93d675e676d38d479b7 100644 (file)
var $RecordTypes= array(); // Possible record type. They will be set in contrucktor
// and some types will be added later (cName/Ptr)
+
+ var $disableDialog = false; // Dialog will be disabled, if this zone is new
+
function servDNSeditZoneEntries ($config, $dn= NULL,$zoneName,$reverseName,$RTypes)
{
plugin::plugin ($config, $dn);
* Workstations / Terminals
*/
$res = $ldap->search("(&(objectClass=dNSZone)(|(zoneName=".$zoneName.")(zoneName=".$reverseName.".in-addr.arpa))(!(relativeDomainName=@)))");
+ $this->disableDialog = false;
while($attrs = $ldap->fetch($res)){
if(preg_match("/zoneName=/",$attrs['dn'])) continue;
foreach($this->RecordTypes as $atr => $val){
}
}
}
+
+ /* Check if this zone exists
+ */
+ $res = $ldap->search("(&(objectClass=dNSZone)(relativeDomainName=@)(|(zoneName=".$zoneName.")(zoneName=".$reverseName.".in-addr.arpa)))",
+ array("zoneName"));
+ if($ldap->count()){
+ }else{
+ $this->disableDialog = true;
+ }
/* Add additional informations
- to all catched objects ( ObjectInformations)
+ to all caught objects ( ObjectInformations)
*/
foreach($this->Devices as $dn => $Recs){
$attrs = $ldap->fetch($ldap->cat($dn,array("objectClass","cn")));
$GetSubInformations = array();
while($attrs = $ldap->fetch()){
- unset($attrs[$val]['count']);
-
$dn = $attrs['dn'];
/* Split dn into relativeDomainNames
$table .= $this->generateRecordConfigurationRow($key);
}
+
+ $smarty->assign("disableDialog",$this->disableDialog);
$smarty->assign("table",$table);;
$display.= $smarty->fetch(get_template_path('servDNSeditZoneEntries.tpl', TRUE));
return($display);
<td>
<input type='text' value='".$type."' name='ValueSelection_".$name."' style='width:250px;'>
</td>
- <td style='width:30px;text-align:right;'>
+ <td style='width:50px;text-align:right;'>
<input type='image' name='AddRecord_".$name."' src='images/crossref.png' alt='"._("Add")."' title='"._("Add")."'>
- </td>
- <td style='width:60px;text-align:right;'>
- <input type='image' name='UserRecord_".$name."' src='images/select_default.png' alt='"._("New")."' title='"._("New")."'>
<input type='image' name='RemoveRecord_".$name."' src='images/edittrash.png' alt='"._("Remove")."' title='"._("Remove")."'>
</td>
</tr>";
function save()
{
+
+ if($this->disableDialog) return;
+
/* Set all initial records to array()
This means they will be removed from the entry
if they won't be overwritten
diff --git a/plugins/admin/systems/servDNSeditZoneEntries.tpl b/plugins/admin/systems/servDNSeditZoneEntries.tpl
index c4d81168afeb57852aed4b943a9a48103b8bac16..fed6442c7553578949fc0ac4b6cb1f3a40d6f2f0 100644 (file)
<br>
<br>
<p class="seperator"> </p>
-
-{$table}
+{if $disableDialog}
+ <br><b>
+ {t}This dialog can't be used until the currently edited zone was saved or the zone entry exists in the ldap database.{/t}
+ </b>
+{else}
+ {t}To add a new host entry just click here{/t}
+ <input type='image' name='UserRecord_Free' src='images/select_default.png' alt='{t}New{/t}' title='{t}New{/t}'>
+ <br>
+ {$table}
+{/if}
<p class="seperator"> </p>
<div style="text-algin:right;" align="right">