summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 533f618)
raw | patch | inline | side by side (parent: 533f618)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 31 Jan 2006 08:52:22 +0000 (08:52 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 31 Jan 2006 08:52:22 +0000 (08:52 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2607 594d385d-05f5-0310-b6e9-bd551577e9d8
19 files changed:
diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc
index c3edb7590b5cdf721309ef332222f92d32d55f80..164b4aa7cd10683407f23e14d2560549414090db 100644 (file)
/* Needed values and lists */
var $base= "";
var $cn= "";
- var $macAddress= "";
- var $ipHostNumber= "";
var $description= "";
var $orig_dn= "";
/* attribute list for save action */
- var $attributes= array("cn", "description", "macAddress", "ipHostNumber");
+ var $attributes= array("cn", "description");
var $objectclasses= array("top", "device", "ipHost", "ieee802Device");
+ var $netConfigDNS;
function componentgeneric ($config, $dn= NULL)
{
} else {
$this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn);
}
-
+ $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
/* Save dn for later references */
$this->orig_dn= $this->dn;
}
}
$smarty->assign("base_select", $this->base);
- /* Show Asterisk for required attribute ipHostNumber and macAddress */
- $smarty->assign("staticAddress", "<font class=\"must\">*</font>");
-
/* Show main page */
- $smarty->assign("netconfig", dirname(__FILE__)."/network.tpl");
+ $smarty->assign("netconfig", $this->netConfigDNS->execute());
return($smarty->fetch (get_template_path('component.tpl', TRUE)));
}
unset($og->member[$this->dn]);
$og->save ();
}
-
+ $this->netConfigDNS->remove_from_parent();
}
{
plugin::save_object();
+ $this->netConfigDNS->save_object();
+
/* Save base, since this is no LDAP attribute */
if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
$this->base= $_POST['base'];
function check()
{
$message= array();
+
+ $message = array_merge($message,$this->netConfigDNS->check());
+
$this->dn= "cn=".$this->cn.",ou=netdevices,ou=systems,".$this->base;
- /* must: cn, macAddress, ipHostNumber */
if ($this->cn == "" && chkacl ($this->acl, "cn") == ""){
$message[]= _("The required field 'Component name' is not set.");
}
- if ($this->macAddress == "" && chkacl ($this->acl, "macAddress") == ""){
- $message[]= _("The required field 'MAC-address' is not set.");
- }
- if ($this->ipHostNumber == "" && chkacl ($this->acl, "ipHostNumber") == ""){
- $message[]= _("The required field 'IP-address' is not set.");
- }
$ui= get_userinfo();
$acl= get_permissions ($this->dn, $ui->subtreeACL);
$ldap->modify($this->attrs);
$this->handle_post_events("modify");
}
+
+ $this->netConfigDNS->save($this->dn);
+
show_ldap_error($ldap->get_error());
/* Optionally execute a command after we're done */
diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc
index 13fa101e9c681bb199396f27ecff570115becbf0..97325ea6709d5f071d8cbde8dea27c19b85f8467 100644 (file)
/* Needed values and lists */
var $base = "";
var $cn = "";
- var $macAddress = "";
- var $ipHostNumber = "";
var $description = "";
var $orig_dn = "";
var $goFonType = "";
var $goFonAccountCode = "";
var $goFonMSN = "";
var $selected_categorie = 0;
+ var $netConfigDNS;
/* attribute list for save action */
- var $attributes= array("cn", "description", "macAddress", "ipHostNumber"
- ,"goFonType","goFonDmtfMode","goFonHost","goFonDefaultIP",
+ var $attributes= array("cn", "description",
+ "goFonType","goFonDmtfMode","goFonHost","goFonDefaultIP",
"goFonQualify","goFonAuth","goFonSecret","goFonInkeys","goFonOutkey",
"goFonTrunk","goFonAccountCode","goFonMSN","selected_categorie","goFonPermit","goFonDeny"
);
/* this array defines which attributes are schown / saved for the different type of phones */
- var $usedattrs = array( "0"=>array("cn", "description", "macAddress", "ipHostNumber",
+ var $usedattrs = array( "0"=>array("cn", "description",
"goFonType","goFonDmtfMode","goFonHost","goFonDefaultIP",
"goFonQualify"),
- "1"=>array("cn", "description", "macAddress", "ipHostNumber",
+ "1"=>array("cn", "description",
"goFonType","goFonHost","goFonDefaultIP",
"goFonQualify","goFonAuth","goFonSecret","goFonInkeys","goFonOutkey",
"goFonTrunk","goFonAccountCode","selected_categorie","goFonPermit","goFonDeny"),
- "2"=>array("cn", "description", "macAddress", "ipHostNumber","goFonMSN"));
+ "2"=>array("cn", "description", "goFonMSN"));
var $objectclasses= array("top", "goFonHardware");
function phonegeneric ($config, $dn= NULL)
{
plugin::plugin ($config, $dn);
+ $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
/* Set base */
if ($this->dn == "new"){
$smarty->assign("goFonDefaultIPs",array("dynamic"=>_("dynamic"),"network"=>_("Networksettings")));
- /* Show Asterisk for required attribute ipHostNumber and macAddress */
- $smarty->assign("staticAddress", "<font class=\"must\">*</font>");
-
/* Show main page */
- $smarty->assign("netconfig", dirname(__FILE__)."/network.tpl");
+ $smarty->assign("netconfig", $this->netConfigDNS->execute());
$smarty->assign("phonesettings", dirname(__FILE__)."/phonesettings.tpl");
return($smarty->fetch (get_template_path('phone.tpl', TRUE)));
}
unset($og->member[$this->dn]);
$og->save ();
}
-
+ $this->netConfigDNS->remove_from_parent();
}
function save_object()
{
plugin::save_object();
-
+ $this->netConfigDNS->save_object();
/* Save base, since this is no LDAP attribute */
if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
$this->base= $_POST['base'];
/* Check supplied data */
function check()
{
- $message= array();
+ $message= $this->netConfigDNS->check();
$this->dn= "cn=".$this->cn.",ou=phones,ou=systems,".$this->base;
/* To check for valid ip*/
// }
// }
- /* must: cn, macAddress, ipHostNumber */
if ($this->cn == "" && chkacl ($this->acl, "cn") == ""){
$message[]= _("The required field 'Phone name' is not set.");
}
if ($this->cn == "0" && chkacl ($this->acl, "cn") == ""){
$message[]= _("The 'Phone name' '0' is reserved and cannot be used.");
}
- if ($this->macAddress == "" && chkacl ($this->acl, "macAddress") == ""){
- $message[]= _("The required field 'MAC-address' is not set.");
- }
- if ($this->ipHostNumber == "" && chkacl ($this->acl, "ipHostNumber") == ""){
- $message[]= _("The required field 'IP-address' is not set.");
- }
- if (!preg_match("/^$num\\.$num\\.$num\\.$num$/", $this->ipHostNumber)){
- $message[]= _("Wrong IP format in field IP-address.");
- }
-
- $tr = count(split(":",$this->macAddress));
- if($tr!=6){
- $message[]=(_("The given macaddress is invalid. There must be 6 2byte segments seperated by ':'."));
- }
$ui= get_userinfo();
$acl= get_permissions ($this->dn, $ui->subtreeACL);
}
if($this->goFonDefaultIP!="dynamic"){
- $this->attrs['goFonDefaultIP'] = $this->ipHostNumber;
+ $this->attrs['goFonDefaultIP'] = $this->netConfigDNS->ipHostNumber;
}
/* Write back to ldap */
}
$this->handle_post_events("modify");
}
+
+ $this->netConfigDNS->save($this->dn);
+
show_ldap_error($ldap->get_error());
/* Optionally execute a command after we're done */
$this->postcreate();
diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc
index 24fe12cf057acbee5ddc243475a043dc437aba20..95d2a983c63cc854a0604697e84f23c1ea29612e 100644 (file)
/* Needed values and lists */
var $base = "";
var $cn = "";
- var $macAddress = "";
- var $ipHostNumber = "";
var $l = "";
var $description = "";
var $labeledURI = "";
var $type = "";
var $dialog =NULL;
+ var $netConfigDNS;
+
/* attribute list for save action */
- var $attributes = array("cn", "description", "l", "labeledURI", "macAddress", "ipHostNumber","gotoPrinterPPD");
+ var $attributes = array("cn", "description", "l", "labeledURI", "gotoPrinterPPD");
var $objectclasses = array("top", "gotoPrinter");
function printgeneric ($config, $dn= NULL)
{
plugin::plugin ($config, $dn);
$ldap= $this->config->get_ldap_link();
+
+ $this->netConfigDNS = new termDNS($this->config, $this->dn,$this->objectclasses);
+
/* Set base */
if ($this->dn == "new"){
return $display;
}
- /* Don't show Asterisk for non-required attribute ipHostNumber and macAddress */
- $smarty->assign("staticAddress", "");
-
-
require_once ("class_ppdManager.inc");
if((isset($_SESSION['config']->data['MAIN']['PPD_PATH']))&&(is_dir($_SESSION['config']->data['MAIN']['PPD_PATH']))){
$smarty->assign("AdminMember" ,$this->AdminMember);
$smarty->assign("AdminMembers" ,$adminlist);
$smarty->assign("AdminMemberKeys",array_flip($adminlist));
- $smarty->assign("netconfig", dirname(__FILE__)."/network.tpl");
+ $smarty->assign("netconfig", $this->netConfigDNS->execute());
return($display.$smarty->fetch (get_template_path('printer.tpl', TRUE)));
}
unset($og->member[$this->dn]);
$og->save ();
}
+
+ $this->netConfigDNS->remove_from_parent();
}
}
}
- /* Save data to object */
- function save_object()
+ /* Save data to object */
+ function save_object()
{
plugin::save_object();
-
+ $this->netConfigDNS->save_object();
/* Save base, since this is no LDAP attribute */
if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
$this->base= $_POST['base'];
/* Check supplied data */
function check()
{
- $message= array();
+ $message= $this->netConfigDNS->check();
if(isset($this->parent->by_name['workgeneric'])){
if($this->parent->by_object['workgeneric']->cn == "wdefault"){
}
show_ldap_error($ldap->get_error());
+ $this->netConfigDNS->save($this->dn);
+
/* Optionally execute a command after we're done */
$this->postcreate();
}
index 2ee9f873de7001fedb1e3852cd3d82533e282cd2..de62146352b771630dc1d21bb810415ef51eea58 100644 (file)
$smarty->assign("$attr"."ACL", chkacl($this->acl, $attr));
}
- /* Don't show Asterisk for non-required attribute ipHostNumber and macAddress */
- $smarty->assign("staticAddress", "");
-
/* Classes... */
foreach ($this->additionaloc as $oc => $dummy){
if (isset($this->objectclasses[$oc])){
index ab9342ead7de8de3f4fd932561ec56947616d6b1..fa48534c49945a75f4d6f3b004538c37d51fae9c 100644 (file)
/* attribute list for save action */
var $ignore_account= TRUE;
- var $attributes= array();
+ var $attributes= array("zoneName","relativeDomainName","dNSTTL","dNSClass","sOARecord");
var $objectclasses= array("whatever");
+ var $RecordTypes = array();
+ var $usedRecords = array();
+
+ var $Zones = array();
+ var $editMode = false;
+
function servdns ($config, $dn= NULL)
{
plugin::plugin ($config, $dn);
+
+ $RecordTypes['ARecord'] ['name'] ="A Record";
+ $RecordTypes['ARecord'] ['type'] ="string";
+ $RecordTypes['MDRecord'] ['name'] ="MD Record";
+ $RecordTypes['MDRecord'] ['type'] ="string";
+ $RecordTypes['MXRecord'] ['name'] ="MX Record";
+ $RecordTypes['MXRecord'] ['type'] ="string";
+ $RecordTypes['NSRecord'] ['name'] ="NS Record";
+ $RecordTypes['NSRecord'] ['type'] ="string";
+ $RecordTypes['CNAMERecord'] ['name'] ="CNAME Record";
+ $RecordTypes['CNAMERecord'] ['type'] ="string";
+ $RecordTypes['PTRRecord'] ['name'] ="PTR Record";
+ $RecordTypes['PTRRecord'] ['type'] ="string";
+ $RecordTypes['HINFORecord'] ['name'] ="HINFO Record";
+ $RecordTypes['HINFORecord'] ['type'] ="string";
+ $RecordTypes['MINFORecord'] ['name'] ="MINFO Record";
+ $RecordTypes['MINFORecord'] ['type'] ="string";
+ $RecordTypes['TXTRecord'] ['name'] ="TXT Record";
+ $RecordTypes['TXTRecord'] ['type'] ="string";
+ $RecordTypes['AFSDBRecord'] ['name'] ="AFSDB Record";
+ $RecordTypes['AFSDBRecord'] ['type'] ="string";
+ $RecordTypes['SIGRecord'] ['name'] ="SIG Record";
+ $RecordTypes['SIGRecord'] ['type'] ="string";
+ $RecordTypes['KEYRecord'] ['name'] ="KEY Record";
+ $RecordTypes['KEYRecord'] ['type'] ="string";
+ $RecordTypes['AAAARecord'] ['name'] ="AAAA Record";
+ $RecordTypes['AAAARecord'] ['type'] ="string";
+ $RecordTypes['LOCRecord'] ['name'] ="LOC Record";
+ $RecordTypes['LOCRecord'] ['type'] ="string";
+ $RecordTypes['NXTRecord'] ['name'] ="NXT Record";
+ $RecordTypes['NXTRecord'] ['type'] ="string";
+ $RecordTypes['SRVRecord'] ['name'] ="SRV Record";
+ $RecordTypes['SRVRecord'] ['type'] ="string";
+ $RecordTypes['NAPTRRecord'] ['name'] ="NAPTR Record";
+ $RecordTypes['NAPTRRecord'] ['type'] ="string";
+ $RecordTypes['KXRecord'] ['name'] ="KX Record";
+ $RecordTypes['KXRecord'] ['type'] ="string";
+ $RecordTypes['CERTRecord'] ['name'] ="CERT Record";
+ $RecordTypes['CERTRecord'] ['type'] ="string";
+ $RecordTypes['A6Record'] ['name'] ="A6 Record";
+ $RecordTypes['A6Record'] ['type'] ="string";
+ $RecordTypes['DNAMERecord'] ['name'] ="DBNAME Record";
+ $RecordTypes['DNAMERecord'] ['type'] ="string";
+ $RecordTypes['DSRecord'] ['name'] ="DS Record";
+ $RecordTypes['DSRecord'] ['type'] ="string";
+ $RecordTypes['SSHFPRecord'] ['name'] ="SSHFP Record";
+ $RecordTypes['SSHFPRecord'] ['type'] ="string";
+ $RecordTypes['RRSIGRecord'] ['name'] ="RRSIG Record";
+ $RecordTypes['RRSIGRecord'] ['type'] ="string";
+ $RecordTypes['NSECRecord'] ['name'] ="NSEC Record";
+ $RecordTypes['NSECRecord'] ['type'] ="string";
+ $RecordTypes['mXRecord'] ['name'] ="MX Record";
+ $RecordTypes['mXRecord'] ['type'] ="string";
+ $RecordTypes['nSRecord'] ['name'] ="nS Record";
+ $RecordTypes['nSRecord'] ['type'] ="string";
+
+ $this->RecordTypes = $RecordTypes;
+
+ $attrs = $this->attributes;
+ foreach($RecordTypes as $name => $att){
+ $attrs2[] = $name;
+ }
+ $attrs3 = array_merge($attrs,$attrs2);
+
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->search("(&(objectClass=dNSZone)(sOARecord=*))",$attrs3);
+ while($zone = $ldap->fetch()){
+ $tmp = array();
+ foreach($attrs as $att){
+ if(isset($zone[$att]['count'])&&(is_array($zone[$att])))
+ unset($zone[$att]['count']);
+
+ if(isset($zone[$att])){
+ $tmp[$att] = $zone[$att][0];
+ }else{
+ $tmp[$att] = "";
+ }
+ }
+
+ if(isset($tmp['sOARecord'])){
+ $tmp2 = split("\ ",$tmp['sOARecord']);
+ unset($tmp['sOARecord']);
+ $tmp['sOARecord'] = array();
+ $tmp['sOARecord']['sOAprimary'] = $tmp2[0];
+ $tmp['sOARecord']['sOAmail'] = $tmp2[1];
+ $tmp['sOARecord']['sOAserial'] = $tmp2[2];
+ $tmp['sOARecord']['sOArefresh'] = $tmp2[3];
+ $tmp['sOARecord']['sOAretry'] = $tmp2[4];
+ $tmp['sOARecord']['sOAexpire'] = $tmp2[5];
+ $tmp['sOARecord']['sOAttl'] = $tmp2[6];
+ }
+
+ $tmp['usedRecords'] = array();
+ foreach($attrs2 as $name){
+ if(isset($zone[$name])){
+ for($i = 0 ; $i < $zone[$name]['count'] ; $i++ ){
+ $tmp['usedRecords'][] = array("type"=> $name,"value"=>$zone[$name][$i]);
+ }
+ }
+ }
+ $this->Zones[$zone['zoneName'][0]] = $tmp;
+ }
+ if(count($this->Zones > 0)){
+ $this->is_account = true;
+ }
}
function execute()
return ($display);
}
+ $once = false;
+ foreach( $_POST as $name => $value){
+ if(preg_match("/^editZone_/",$name)&&!$once){
+ $once =true;
+ $tmp = preg_replace("/^editZone_/","",$name);
+ $tmp = base64_decode(preg_replace("/_.*$/","...",$tmp));
+ $this->editMode = $this->Zones[$tmp];
+ }
+ }
+
+
+ $smarty->assign("editMode",$this->editMode);
+ if($this->editMode){
+
+ foreach($this->attributes as $attrs){
+ $smarty->assign($attrs,$this->editMode[$attrs]);
+ }
+
+ foreach($this->editMode['sOARecord'] as $name => $value){
+ $smarty->assign($name,$value);
+ }
+ $smarty->assign("records","");
+
+ }else{
+ $ZoneList = new divSelectBox("dNSZones");
+ $ZoneList -> SetHeight(254);
+
+ $editImg = "<input type='image' src='images/edit.png' name='editZone_%s'>";
+
+ foreach($this->Zones as $zone => $values ){
+ $ZoneList->AddEntry(array(array("string" => $zone.str_replace("%s",base64_encode($zone),$editImg))));
+ }
+
+
+ $smarty->assign("ZoneList",$ZoneList->DrawList());
+ }
+
$display.= $smarty->fetch(get_template_path('servdns.tpl', TRUE));
return($display);
}
/* Save data to object */
function save_object()
{
- plugin::save_object();
+ //plugin::save_object();
+
+ if(!$this->editMode){return;}
+
+ foreach($this->attributes as $attr){
+ if(isset($_POST[$attr])){
+ $this->editMode[$attr] = $_POST[$attr];
+ }
+ }
+
+ foreach($this->editMode['sOARecord'] as $name => $value){
+ if(isset($_POST[$name])){
+ $this->editMode['sOARecord'][$name] = $_POST[$name];
+ }
+ }
+
}
diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc
index b85d9c834acfad10647d435721ebd3500e23d48e..0c7c0d99e1ab6dc1619639032ec911d159a57ac6 100644 (file)
var $base= "";
var $cn= "";
var $l= "";
- var $macAddress= "";
- var $ipHostNumber= "";
var $description= "";
var $orig_dn= "";
/* attribute list for save action */
- var $attributes= array("cn", "description", "macAddress", "ipHostNumber");
+ var $attributes= array("cn", "description");
var $objectclasses= array("top", "goServer");
+ var $netConfigDNS;
+
function servgeneric ($config, $dn= NULL)
{
plugin::plugin ($config, $dn);
} else {
$this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn);
}
-
+ $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
/* Save dn for later references */
$this->orig_dn= $this->dn;
}
if ($cmd == ""){
print_red(_("No WAKECMD definition found in your gosa.conf"));
} else {
- exec ($cmd." ".$this->macAddress, $dummy, $retval);
+ exec ($cmd." ".$this->netConfigDNS->macAddress, $dummy, $retval);
if ($retval != 0){
print_red(sprintf(_("Execution of '%s' failed!"), $cmd));
}
/* Show main page */
- $smarty->assign("netconfig", dirname(__FILE__)."/network.tpl");
+ $smarty->assign("netconfig", $this->netConfigDNS->execute());
return($smarty->fetch (get_template_path('server.tpl', TRUE)));
}
unset($og->member[$this->dn]);
$og->save ();
}
-
+ $this->netConfigDNS->remove_from_parent();
$this->handle_post_events("remove");
}
function save_object()
{
plugin::save_object();
-
+ $this->netConfigDNS->save_object();
/* Save base, since this is no LDAP attribute */
if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
$this->base= $_POST['base'];
/* Check supplied data */
function check()
{
- $message= array();
+ $message= $this->netConfigDNS->check();
$this->dn= "cn=".$this->cn.",ou=servers,ou=systems,".$this->base;
/* must: cn */
$ldap->modify($this->attrs);
$mode= "modify";
}
+ $this->netConfigDNS->save($this->dn);
show_ldap_error($ldap->get_error());
/* Optionally execute a command after we're done */
diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+
+class termDNS extends plugin
+{
+ /* CLI vars */
+ var $cli_summary= "Manage server basic objects";
+ var $cli_description= "Some longer text\nfor help";
+ var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
+
+ /* attribute list for save action */
+ var $ignore_account= TRUE;
+ var $attributes= array("ipHostNumber","macAddress");
+ var $objectclasses= array("whatever");
+
+ var $ipHostNumber ="";
+ var $macAddress ="";
+
+ function termDNS ($config, $dn,$objectClasses)
+ {
+ $this->objectclasses= $objectClasses;
+ plugin::plugin ($config, $dn);
+ }
+
+ function execute()
+ {
+ /* Call parent execute */
+ $smarty= get_smarty();
+ $display= "";
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ }
+ $smarty->assign("staticAddress","<font class=\"must\">*</font>");
+ $display.= $smarty->fetch(get_template_path('network.tpl', TRUE));
+ return($display);
+ }
+
+ function remove_from_parent()
+ {
+ /* This cannot be removed... */
+ }
+
+
+ /* Save data to object */
+ function save_object()
+ {
+ plugin::save_object();
+ foreach($this->attributes as $attr){
+ if(isset($_POST[$attr])){
+ $this->$attr = $_POST[$attr];
+ }
+ }
+ }
+
+
+ /* Check supplied data */
+ function check()
+ {
+ $message= array();
+
+ return ($message);
+ }
+
+
+ /* Save to LDAP */
+ function save($dn)
+ {
+ $org_dn = $dn;
+ $this->dn = $dn;
+ plugin::save();
+
+ /* Write back to ldap */
+ $ldap= $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc
index 5c825dcaead8423c96fba623721c7baf0c7f3af0..e6a949ab3e8b677588bb39666b7cc24f348e99e4 100644 (file)
var $gotoCdromEnable= "";
var $ghCpuType= "-";
var $ghMemSize= "-";
- var $macAddress= "";
- var $ipHostNumber= "";
var $ghUsbSupport= "-";
var $ghNetNic= array();
var $ghIdeDev= array();
var $ghGfxAdapter= "-";
var $ghSoundAdapter= "-";
var $gotoLastUser= "-";
-
+ var $netConfigDNS;
/* Needed values and lists */
var $base= "";
var $cn= "";
/* attribute list for save action */
var $ignore_account= TRUE;
- var $attributes= array("gotoMode", "gotoTerminalPath", "macAddress",
+ var $attributes= array("gotoMode", "gotoTerminalPath",
"gotoSwapServer", "gotoSyslogServer", "gotoNtpServer",
"gotoFloppyEnable", "gotoCdromEnable", "cn", "gotoSndModule",
- "ghCpuType", "ghMemSize", "ipHostNumber", "ghUsbSupport",
+ "ghCpuType", "ghMemSize","ghUsbSupport",
"ghGfxAdapter", "ghSoundAdapter", "gotoLastUser");
var $objectclasses= array("top", "gotoTerminal", "GOhard");
function termgeneric ($config, $dn= NULL)
{
plugin::plugin ($config, $dn);
-
+ $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
/* Read arrays */
foreach (array("ghNetNic", "ghIdeDev", "ghScsiDev") as $val){
if (!isset($this->attrs[$val])){
if ($cmd == ""){
print_red(_("No WAKECMD definition found in your gosa.conf"));
} else {
- exec ($cmd." ".$this->macAddress, $dummy, $retval);
+ exec ($cmd." ".$this->netConfigDNS->macAddress, $dummy, $retval);
if ($retval != 0){
print_red(sprintf(_("Execution of '%s' failed!"), $cmd));
}
$smarty->assign($val."_select", $this->$val);
$smarty->assign($val."ACL", chkacl($this->acl, $val));
}
- $smarty->assign("ipHostNumber", $this->ipHostNumber);
- $smarty->assign("macAddress", $this->macAddress);
/* Show main page */
- $smarty->assign("netconfig", dirname(__FILE__)."/network.tpl");
+ $smarty->assign("netconfig", $this->netConfigDNS->execute());
$smarty->assign("actionACL", chkacl($this->acl, 'action'));
return($smarty->fetch (get_template_path('terminal.tpl', TRUE)));
}
unset($og->member[$this->dn]);
$og->save ();
}
+ $this->netConfigDNS->remove_from_parent();
}
}
function save_object()
{
plugin::save_object();
-
+ $this->netConfigDNS->save_object();
/* Save base, since this is no LDAP attribute */
if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
$this->base= $_POST['base'];
/* Check supplied data */
function check()
{
- $message= array();
+ $message= $this->netConfigDNS->check();
/* Permissions for that base? */
$this->dn= "cn=".$this->cn."ou=terminals,ou=systems,".$this->base;
$ldap->modify($this->attrs);
$this->handle_post_events("modify");
}
+ $this->netConfigDNS->save($this->dn);
show_ldap_error($ldap->get_error());
/* Optionally execute a command after we're done */
diff --git a/plugins/admin/systems/class_winGeneric.inc b/plugins/admin/systems/class_winGeneric.inc
index 82b847a796a17f1617bb9746cd58972f05f543f4..4fc4ab92e44123b194729f50189e631c33096344 100644 (file)
var $sambaNTPassword="";
var $sambaPwdLastSet="";
var $sambaAcctFlags="";
-
+ var $netConfigDNS;
/* attribute list for save action */
var $ignore_account= TRUE;
var $attributes = array("cn", "description","shadowLastChange",
function wingeneric ($config, $dn= NULL)
{
plugin::plugin ($config, $dn);
-
+ $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
/* Set base */
if ($this->dn == "new"){
$ui= get_userinfo();
$smarty= get_smarty();
// Undefined index in wingeneric.tpl ...
- $smarty->assign("macAddress","");
- $smarty->assign("ipHostNumber","");
-
$smarty->assign("bases", $this->config->idepartments);
/* Assign attributes */
$smarty->assign("$attr", $this->$attr);
}
- /* Show Asterisk for required attribute ipHostNumber and macAddress */
- $smarty->assign("staticAddress", "<font class=\"must\">*</font>");
-
$smarty->assign("base_select", $this->base);
/* Show main page */
- $smarty->assign("netconfig", dirname(__FILE__)."/network.tpl");
+ $smarty->assign("netconfig", $this->netConfigDNS->execute());
return($smarty->fetch (get_template_path('wingeneric.tpl', TRUE)));
}
unset($og->member[$this->dn]);
$og->save ();
}
-
+ $this->netConfigDNS->remove_from_parent();
}
function save_object()
{
plugin::save_object();
-
+ $this->netConfigDNS->save_object();
/* Save base, since this is no LDAP attribute */
if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
$this->base= $_POST['base'];
/* Check supplied data */
function check()
{
- $message= array();
+ $message=$this->netConfigDNS->check();
$this->dn= "cn=".$this->cn.",ou=netdevices,ou=systems,".$this->base;
-
- /* must: cn, macAddress */
- if ($this->cn == "" && chkacl ($this->acl, "cn") == ""){
- $message[]= _("The required field 'Component name' is not set.");
- }
-
-/* if ($this->macAddress == "" && chkacl ($this->acl, "macAddress") == ""){
- $message[]= _("The required field 'MAC-address' is not set.");
- }
- if ($this->ipHostNumber == "" && chkacl ($this->acl, "ipHostNumber") == ""){
- $message[]= _("The required field 'IP-address' is not set.");
- }
-*/
$ui= get_userinfo();
$acl= get_permissions ($this->dn, $ui->subtreeACL);
$acl= get_module_permission($acl, "component", $this->dn);
$ldap->modify($this->attrs);
$this->handle_post_events("modify");
}
+ $this->netConfigDNS->save($this->dn);
show_ldap_error($ldap->get_error());
/* Optionally execute a command after we're done */
diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc
index 33a49bcb040347a9de0ab30398f0989b91ac99b5..88abf046654cc65fea107de49e8fdad174eaba4b 100644 (file)
var $gotoCdromEnable= "";
var $ghCpuType= "-";
var $ghMemSize= "-";
- var $macAddress= "";
- var $ipHostNumber= "";
var $ghUsbSupport= "-";
var $ghNetNic= array();
var $ghIdeDev= array();
/* Plugin side filled */
var $modes= array();
+ var $netConfigDNS;
+
/* attribute list for save action */
var $ignore_account= TRUE;
- var $attributes= array("gotoMode", "macAddress", "gotoSyslogServer", "gotoNtpServer",
+ var $attributes= array("gotoMode", "gotoSyslogServer", "gotoNtpServer",
"gotoFloppyEnable", "gotoCdromEnable", "cn", "gotoSndModule",
- "ghCpuType", "ghMemSize", "ghUsbSupport", "ipHostNumber",
+ "ghCpuType", "ghMemSize", "ghUsbSupport",
"ghGfxAdapter", "ghSoundAdapter", "gotoLastUser", "l","FAIscript");
var $objectclasses= array("top", "gotoWorkstation", "GOhard","FAIobject");
function workgeneric ($config, $dn= NULL)
{
plugin::plugin ($config, $dn);
-
+ $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
/* Load available modes */
$ldap= $this->config->get_ldap_link();
$ldap->cd ($this->config->current['BASE']);
if ($cmd == ""){
print_red(_("No ACTIONCMD definition found in your gosa.conf"));
} else {
- exec ($cmd." ".$this->macAddress." ".escapeshellarg($_POST['saction']), $dummy, $retval);
+ exec ($cmd." ".$this->netConfigDNS->macAddress." ".escapeshellarg($_POST['saction']), $dummy, $retval);
if ($retval != 0){
print_red(sprintf(_("Execution of '%s' failed!"), $cmd));
} else {
$smarty->assign($val."_select", $this->$val);
$smarty->assign($val."ACL", chkacl($this->acl, $val));
}
- $smarty->assign("ipHostNumber", $this->ipHostNumber);
- $smarty->assign("macAddress", $this->macAddress);
$smarty->assign("actionACL", chkacl($this->acl, 'action'));
/* Show main page */
- $smarty->assign("netconfig", dirname(__FILE__)."/network.tpl");
+ $smarty->assign("netconfig", $this->netConfigDNS->execute());
return($smarty->fetch (get_template_path('workstation.tpl', TRUE)));
}
unset($og->member[$this->dn]);
$og->save ();
}
-
+ $this->netConfigDNS->remove_from_parent();
}
if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
$this->base= $_POST['base'];
}
+ $this->netConfigDNS->save_object();
}
/* Check supplied data */
function check()
{
- $message= array();
+ $message=$this->netConfigDNS->check();
$ui= get_userinfo();
$this->dn= "cn=".$this->cn.",ou=workstations,ou=systems,".$this->base;
$this->handle_post_events("modify");
}
}
+ $this->netConfigDNS->save($this->dn);
show_ldap_error($ldap->get_error());
}
index ce04d6ffec7a9e853ec8f126384d099c65b51a74..a1581c2d5850f6877e63920675d5b8ef2a685530 100644 (file)
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
-{include file="$netconfig"}
+{$netconfig}
<!-- Place cursor -->
<script language="JavaScript" type="text/javascript">
index a431d4c852ad2bf26bb281f7d56230d8b092fd96..f08591542a084afce61f9dc343bb5204248c5daf 100644 (file)
{include file="$phonesettings"}
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
-{include file="$netconfig"}
+{$netconfig}
<!-- Place cursor -->
<script language="JavaScript" type="text/javascript">
index db4c23e388dc77e1f915b5d3a7a5f8f017fb4805..37b42402fd5384de569e385c6c35502e57521091 100644 (file)
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
-{include file="$netconfig"}
+{$netconfig}
<!-- Place cursor -->
<script language="JavaScript" type="text/javascript">
index 449ac7ba2f406bba81a7cb3fce958735fc5aa2e7..74251e2a46b851b521b88e66b48432f063ba80d5 100644 (file)
-DNS functionality here..
+{if $editMode == false}
+<h2>{t}Zones{/t}</h2>
+<table summary="" width="100%">
+<tr>
+ <td style="width:100%;vertical-align:top;">
+ {$ZoneList}
+ <input type="submit" name="AddZone" value="{t}Add{/t}">
+ <input type="submit" name="EditZone" value="{t}Edit{/t}">
+ <input type="submit" name="RemoveZone" value="{t}Remove{/t}">
+ </td>
+</tr>
+</table>
+{else}
+<h2>{t}Zone settings{/t}</h2>
+<table summary="" width="100%">
+ <tr>
+ <td style="width:50%;vertical-align:top;">
+ <table summary="">
+ <tr>
+ <td>{t}Zone name{/t}
+ </td>
+ <td><input type="text" name="zoneName" value="{$zoneName}">
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td style="vertical-align:top;">
+ <table summary="">
+ <tr>
+ <td>{t}Subnet{/t}
+ </td>
+ <td><input type="text" name="subNet" value="">
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+<p class="seperator"> </p>
+<h2>{t}SOA record for this zone{/t}</h2>
+<table summary="" width="100%">
+ <tr>
+ <td style="vertical-align:top;width:50%">
+ <table summary="">
+ <tr>
+ <td>{t}Primary dns server for this zone{/t}
+ </td>
+ <td><input type="text" name="sOAprimary" value="{$sOAprimary}">
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Mail address{/t}
+ </td>
+ <td><input type="text" name="sOAmail" value="{$sOAmail}">
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Serialnumber (automatically generated){/t}
+ </td>
+ <td><input type="text" name="sOAserial" value="{$sOAserial}">
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td style="vertical-align:top;">
+ <table summary="">
+ <tr>
+ <td>{t}Refresh{/t}
+ </td>
+ <td><input type="text" name="sOArefresh" value="{$sOArefresh}">
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Retry{/t}
+ </td>
+ <td><input type="text" name="sOAretry" value="{$sOAretry}">
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Expire{/t}
+ </td>
+ <td><input type="text" name="sOAexpire" value="{$sOAexpire}">
+ </td>
+ </tr>
+ <tr>
+ <td>{t}TTL{/t}
+ </td>
+ <td><input type="text" name="sOAttl" value="{$sOAttl}">
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+<p class="seperator"> </p>
+<table summary="" width="100%">
+ <tr>
+ <td style="vertical-align:top;width:50%;">
+ <h2>{t}Parameter{/t}</h2>
+ <table summary="">
+ <tr>
+ <td>{t}DNS TTL{/t}
+ </td>
+ <td>
+ <input type="text" name="dNSTTL" value="{$dNSTTL}">
+ </td>
+ </tr>
+ <tr>
+ <td>{t}DNS Class{/t}
+ </td>
+ <td>
+ <input type="text" name="dNSClass" value="{$dNSClass}">
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td style="vertical-align:top;">
+ <h2>{t}Records{/t}</h2>
+ <table summary="">
+ {$records}
+ </table>
+ </td>
+ </tr>
+</table>
+{/if}
index 4d632c1ff26aabc2055a03f9e0995c0d341f164d..fe84f853c9859706f00b8ef12e9f36f17074adaf 100644 (file)
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
-{include file="$netconfig"}
+{$netconfig}
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
diff --git a/plugins/admin/systems/termdns.tpl b/plugins/admin/systems/termdns.tpl
--- /dev/null
@@ -0,0 +1,3 @@
+
+
+<h2></h2>
index 1d657366878b4eb40a76113acb758d175f1dfac0..2da3738a63e7e68d2a0ddd594ee2938afd43ac56 100644 (file)
</table>
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
-{include file="$netconfig"}
+{$netconfig}
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
<h2><img class="center" alt="" align="middle" src="images/rocket.png"> {t}Action{/t}</h2>
index 3b58f19c6d659d9a67f91df40e80b79fb6272e21..d7f69b66bfe8028f0b6ba37420b7813a08551ac6 100644 (file)
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
-{include file="$netconfig"}
+{$netconfig}
<!-- Place cursor -->
<script language="JavaScript" type="text/javascript">
index ddb7cabb81f830d9e59c4cdbc5b387f7b5fafb12..d278f53140edc6febda01107a8805532fddc1aff 100644 (file)
</table>
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
-{include file="$netconfig"}
+{$netconfig}
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
<h2><img class="center" alt="" align="middle" src="images/rocket.png"> {t}Action{/t}</h2>