summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0962364)
raw | patch | inline | side by side (parent: 0962364)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 Dec 2007 08:07:23 +0000 (08:07 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 Dec 2007 08:07:23 +0000 (08:07 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8004 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_termDNS.inc | patch | blob | history | |
plugins/admin/systems/network.tpl | patch | blob | history |
index 5910182ba3b4d02c43c51d23af4586f82dd4434e..025933291e6aebd46ae0fec893cb435652aa65eb 100644 (file)
}
}
}
-
/**********
$smarty->assign("dhcpParentNodeCnt",count($this->dhcpParentNodes));
+ /**********
+ * DNS Handling
+ **********/
+
/* There is no dns available
*/
if($this->DNSenabled == false){
$this->dnsEntry['RECORDS'][] =array("type"=>"aRecord","value"=>"");
}
+ /* propose_ip */
+ if(isset($_POST['propose_ip'])){
+ foreach($this->Zones as $key => $name){
+ if($name == $this->dnsEntry['zoneName']){
+ $net = FlipIp(str_replace(".in-addr.arpa","",getNameFromMix($key)));
+ $this->ipHostNumber = $this->generateRandomIp($net);
+ }
+ }
+ }
+
/* Handle all posts */
$only_once =true;
foreach($_POST as $name => $value){
}
+ function generateRandomIP($net = "")
+ {
+ $str = $net;
+ $cnt = 4;
+ while(substr_count($str,".") < 3 && $cnt > 0){
+ $str .= ".".rand(0,255);
+ $str = preg_replace("/\.\.*/",".",$str);
+ $str = trim($str,". ");
+ $cnt --;
+ }
+ return($str);
+ }
+
+
function create_tree($arr,$base,$current = "")
{
$ret = array();
index 98c21d66b4ab62f31158b14e077cc57b7796f71c..7cb6b3ff996db6be15412e5e4c498a4fa82023d1 100644 (file)
<td>
{render acl=$ipHostNumberACL}
<input id="ipHostNumber" name="ipHostNumber" size=25 maxlength=80 value="{$ipHostNumber}">
+{/render}
+{render acl=$ipHostNumberACL}
+{if $DNSAccount == true}
+ <input id="propose_ip" type="submit" name="propose_ip" value="{t}Propose ip{/t}" style="visibility:visible;">
+ {else}
+ <input id="propose_ip" type="submit" name="propose_ip" value="{t}Propose ip{/t}" style="visibility:hidden;">
+ {/if}
{/render}
</td>
</tr>
onclick="toggle('test2');
changeState('zoneName');
changeState('dNSTTL');
+ toggle('propose_ip');
changeState('AddNewRecord');
{$changeStateForRecords}"/>
{else}
onclick="toggle('test2');
changeState('zoneName');
changeState('dNSTTL');
+ toggle('propose_ip');
changeState('AddNewRecord');"/>
{/if}