summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 643d086)
raw | patch | inline | side by side (parent: 643d086)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 22 Jul 2008 10:58:56 +0000 (10:58 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 22 Jul 2008 10:58:56 +0000 (10:58 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11745 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc
index 93d5db4d0c2361cc6c72362239962635505b91f3..a96de276d0298a37c0ca4d6b0c4bfd1aea6d5dcb 100644 (file)
"zoneName" =>_("Zone name"),
"ReverseZone" =>_("Reverse zone"),
"NetworkClass" =>_("Network class"),
+ "zoneEditor" =>_("Zone entry editor"),
"sOAprimary" =>_("Primary dns server"),
"sOAmail" =>_("Mail address"),
"sOAserial" =>_("Serial"),
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc
index 4eeff271971de65f1d85a5d49986f98b0453bc4b..2a57dd2f50086e205f158e5016e670f2c88259bc 100644 (file)
$smarty->assign("AllowZoneEdit" , false);
}else{
$smarty->assign("AllowZoneEdit" , true);
- if(isset($_POST['EditZoneEntries'])){
+
+ if(isset($_POST['EditZoneEntries']) && $this->parent->acl_is_readable("zoneEditor")){
if($this->zoneEditor == NULL){
- $this->zoneEditor= new servDNSeditZoneEntries($this->config,$this->dn,$this->ZoneObject);
+ $this->zoneEditor= new servDNSeditZoneEntries($this->config,$this->dn,$this->ZoneObject);
+ $this->zoneEditor->acl = $this->parent->getacl("zoneEditor");
$this->zoneEditor->parent = $this;
}
$this->dialog = $this->zoneEditor;
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc
index 27a9aa932b2c2c8aafc6c65a775287e5b6643feb..78b9be741e3819c429ec63295341b81302612168 100644 (file)
var $reverseName = ""; // ReverseZone of the currently edited Zone
var $RecordTypes = array(); // Possible record type.
-
+ var $acl = "";
var $disableDialog = false; // Dialog will be disabled, if this zone is new
$table .= $this->generateRecordConfigurationRow($key);
}
+ $smarty->assign("acl",$this->acl);
$smarty->assign("disableDialog",$this->disableDialog);
$smarty->assign("table",$table);;
$display.= $smarty->fetch(get_template_path('servDNSeditZoneEntries.tpl', TRUE, dirname(__FILE__)));
*/
$once = true;
$ptr_updates = array();
+ if(!preg_match("/w/",$this->acl)) return;
+
foreach($_POST as $name => $value){
/* Add a new Record in given object
{
/* Call common method to give check the hook */
$message= plugin::check();
-
+
+ if(!preg_match("/w/",$this->acl)) return($message);
+
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
function save()
{
- if($this->disableDialog) return;
+ if($this->disableDialog || !preg_match("/w/",$this->acl)) return;
$todo = array();
$obj = $this->Devices[$objKey];
$objectName = $objKey;
+ $dis = "";
+ if(!preg_match("/w/",$this->acl)){
+ $dis = " disabled ";
+ }
+
/* Abort if emtpy
*/
if(count($obj['RECORDS']) == 0) return "";
*/
if($hostNameOnce){
$hostNameOnce = false;
- $str .="<input type='text' name='RenameHost_".$name."' value='".$objectName."'>\n";
+ $str .="<input $dis type='text' name='RenameHost_".$name."' value='".$objectName."'>\n";
}
/* Create rest. Selectbox, icons ...
".$this->createRecordTypeSelection($record['type'],$name)."
</td>
<td>
- <input type='text' value='".$record['value']."' name='ValueSelection_".$name."' style='width:250px;'>
- </td>
- <td style='width:75px;text-align:right;'>
- <input type='image' name='AddRecord_".$name."' src='images/lists/new.png' alt='"._("Add")."' title='"._("Add")."'>
- <input type='image' name='RemoveRecord_".$name."' src='images/lists/trash.png' alt='"._("Remove")."' title='"._("Remove")."'>
- ";
+ <input type='text' $dis value='".$record['value']."' name='ValueSelection_".$name."' style='width:250px;'>
+ </td>";
+
+ if(preg_match("/w/",$this->acl)){
+ $str .= "<td style='width:75px;text-align:right;'>
+ <input type='image' name='AddRecord_".$name."'
+ src='images/lists/new.png' alt='"._("Add")."' title='"._("Add")."'>
+ <input type='image' name='RemoveRecord_".$name."'
+ src='images/lists/trash.png' alt='"._("Remove")."' title='"._("Remove")."'>
+ ";
+ }
$str.=
"</td>
*/
function createRecordTypeSelection($id,$refID){
- $str = "\n<select name='RecordTypeSelection_".$refID."'>";
- foreach($this->RecordTypes as $type => $atr) {
- if($id == $type){
- $str .="\n<option value='".$type."' selected >".strtoupper(preg_replace("/record/i","",$type))."</option>";
- }else{
- $str .="\n<option value='".$type."'>".strtoupper(preg_replace("/record/i","",$type))."</option>";
+ if(preg_match("/w/",$this->acl)){
+ $str = "\n<select name='RecordTypeSelection_".$refID."'>";
+ foreach($this->RecordTypes as $type => $atr) {
+ if($id == $type){
+ $str .="\n<option value='".$type."' selected >".strtoupper(preg_replace("/record/i","",$type))."</option>";
+ }else{
+ $str .="\n<option value='".$type."'>".strtoupper(preg_replace("/record/i","",$type))."</option>";
+ }
}
+ $str.= "\n</select>";
+ }else{
+ $str = " ".strtoupper(preg_replace("/record/i","",$id));
}
- $str.= "\n</select>";
return($str);
}
diff --git a/gosa-plugins/dns/admin/systems/services/dns/servDNSeditZoneEntries.tpl b/gosa-plugins/dns/admin/systems/services/dns/servDNSeditZoneEntries.tpl
index e1b2b53ebfda81146193915bf96b1dfe6b5f739b..3e972844abe2b870d396725f681a60ff0434b7f4 100644 (file)
<br>
{$table}
<br>
+
+ {render acl=$acl}
<input type='submit' name='UserRecord' value='{t}New entry{/t}' title='{t}Create a new DNS zone entry{/t}'>
+ {/render}
{/if}
<p class="seperator"> </p>
<div style="text-algin:right;" align="right">
<p>
+ {render acl=$acl}
<input type="submit" name="SaveZoneEntryChanges" value="{msgPool type=saveButton}">
+ {/render}
<input type="submit" name="CancelZoneEntryChanges" value="{msgPool type=cancelButton}">
</p>
</div>
diff --git a/gosa-plugins/dns/admin/systems/services/dns/servdnseditzone.tpl b/gosa-plugins/dns/admin/systems/services/dns/servdnseditzone.tpl
index fb947b41fc5f0c416bd62d2d0dd60943a5a53ef4..32a2d8fdf9f695314f3cbffc869098a27e1f9e1a 100644 (file)
{/if}
</td>
<td>
+{render acl=$zoneEditorACL mode=read_active}
<input type="submit" name="EditZoneEntries" value="{t}Edit{/t}" {if $AllowZoneEdit == false} disabled {/if}>
+{/render}
</td>
</tr>
</table>